citrusinvest engine
The open-source Rust backtest + strategy engine behind citrusinvest — the
yuzu backtest core plus the lemon strategy DSL. Pure, I/O-free math:
(strategy spec JSON, data panels) -> Report. It compiles to both native
(batch backtests via Rayon) and WASM (browser/Worker).
Top-level entry (in the yuzu-core crate):
run_backtest // ctx: &EvalContext (numeric panels keyed by series name + a symbol→industry map)
Architecture, DSL vocabulary, NAV model, metric conventions, and the Report JSON
contract live in docs/backtest-engine.md.
Build
WASM
The two wasm crates build to a repo-local dist/ by default:
Override the output directory with OUT:
OUT=/path/to/pkg
(Requires wasm-pack.)
Test
Coverage
# one-time: rustup component add llvm-tools-preview && cargo install cargo-llvm-cov
The cargo llvm-cov run also executes the test suite, so it doubles as the test step.
Contributing
See CONTRIBUTING.md.
License
MIT — see LICENSE.