1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Pure, I/O-free backtest engine core for US equity strategies.
//!
//! # Pipeline
//!
//! 1. Build [`panel::Panel`]s of market / factor data (`dates × symbols`, `f64`).
//! 2. Put them in an [`EvalContext`] (optionally with a sector map).
//! 3. Evaluate a lemon JSON [`spec::Expr`] with [`run_strategy`] → position panel.
//! 4. Or run end-to-end with [`run_backtest`] → [`report::Report`] (equity, trades, metrics).
//!
//! No network and no platform deps: matrices in, report out. Compiles to native
//! and WASM. Conceptual overview: `docs/backtest-engine.md`. Strategy language:
//! `docs/lemon.md`.
//!
//! # Example
//!
//! See the crate example `basic_backtest`:
//!
//! ```text
//! cargo run -p yuzu-core --example basic_backtest
//! ```
// Numeric kernels index matrices directly; index loops read clearer than
// iterator chains here.
pub use spec;
pub use EngineError;
pub use run_backtest;
pub use run_strategy;
pub use EvalContext;