Backtesting & risk#
Turn signals into costed equity curves, and measure drawdown and performance.
Risk & performance#
Drawdowns and performance ratios.
Function |
Description |
|---|---|
Running drawdown from the cumulative peak. |
|
Worst drawdown experienced so far (since reset). |
|
Annualised return divided by the worst rolling drawdown. |
|
Historical Conditional Value-at-Risk (Expected Shortfall): the mean loss in the worst alpha tail over a window. |
|
Trailing-window downside semideviation: the RMS of returns falling below a minimum acceptable return. |
|
Fraction of strictly-positive samples in a trailing window. |
|
Annualised information ratio: Sharpe of active returns against a benchmark. |
|
Worst peak-to-trough drawdown inside a trailing window. |
|
Omega ratio over a window: total gains above a threshold divided by total losses below it. |
|
Annualised Sharpe ratio over a trailing window of returns. |
|
Annualised Sortino ratio: Sharpe with downside-only deviation. |
Backtesting#
Simulate a strategy against market data into a costed equity curve: signals, bars, the trade tape, and top-of-book quotes.
Function |
Description |
|---|---|
Running statistics and a summary for a backtest engine's output. |
|
Backtest a two-sided market maker against a top-of-book (L1) quote stream, into a costed equity curve. |
|
Backtest a target-position strategy against the L1 book, taking each quote update as a market fill to reach the target immediately. |
|
Backtest a two-sided market maker against top-of-book quotes with a trade tape driving the fills, into a costed equity curve. |
|
Backtest a two-sided order poster on OHLC bars, posting resting bids and asks that fill when the bar's range reaches them. |
|
Backtest a target-position strategy on OHLC bars, executing market orders at the next bar's open (causal, no manual lag). |
|
Backtest a target position against a value series (price/mark) into a costed mark-to-market equity curve. |
|
Turn a backtest engine's [equity, pnl, position, cost] into running drawdown, cost, turnover, trades, and Sharpe. |
|
Backtest a two-sided order poster against the trade tape, filling resting quotes when prints cross them, into a costed equity curve. |
|
Backtest a target-position strategy against the trade tape, taking each print as a market fill to reach the target immediately. |
|
The 5x2 engine grid by data model and order definition, with fill rules and encoding. |