Skip to content

API Reference


API Reference / BacktestMetrics

Interface: BacktestMetrics ​

Defined in: src/backtest/types.ts:70

Properties ​

totalTrades ​

totalTrades: number

Defined in: src/backtest/types.ts:71


winRate ​

winRate: number

Defined in: src/backtest/types.ts:72


totalPnl ​

totalPnl: number

Defined in: src/backtest/types.ts:73


maxDrawdown ​

maxDrawdown: number

Defined in: src/backtest/types.ts:75

Largest peak-to-trough drawdown on the equity curve, as a fraction (0.1 = 10%).


profitFactor ​

profitFactor: number

Defined in: src/backtest/types.ts:77

grossProfit / grossLoss. Infinity when there were wins and no losses, 0 when there were no trades at all.


sharpe ​

sharpe: number | null

Defined in: src/backtest/types.ts:84

Per-bar Sharpe ratio scaled by sqrt(n), not annualized to any specific trading-days convention — the harness doesn't know your bar interval's business meaning. null when there isn't enough equity-curve variance to compute one.

Community project — not affiliated with Dhan. MIT License.