Skip to content

citrusquant

An open-source Rust backtest engine (yuzu) and a small strategy DSL (lemon). Write a strategy, run a backtest — right here in your browser.

What this is

citrusquant turns a one-line strategy into an equity curve, a trade list, and a full metrics report. Two pieces:

  • lemon — a small, readable DSL. is_largest(sma(close, 2), 3) means “hold the three names with the highest 2-day average close.”
  • yuzu — a pure, I/O-free engine that evaluates the strategy against your price/fundamental panels and produces a Report.

It compiles to native (batch backtests via Rayon) and WebAssembly — which is exactly why the playground can run a real backtest with no server.

Readable strategies

Author in lemon; the engine lowers it to a JSON Expr tree. No boilerplate.

Runs in the browser

The same engine that runs native batch backtests is compiled to WASM.

Bring your own data

The engine ships no market data — you feed panels. See the data guide.

Rust-native API

Published crates document themselves on docs.rs.

Start here