BacktestStatisticsModel

Statistical data calculated from backtest results.

All numeric values are null if calculation is unsafe (NaN, Infinity, etc). Provides comprehensive metrics for strategy performance analysis.

signalList: IStrategyTickResultClosed[]

Array of all closed signals with full details (price, PNL, timestamps, etc.)

totalSignals: number

Total number of closed signals

winCount: number

Number of winning signals (PNL > 0)

lossCount: number

Number of losing signals (PNL < 0)

winRate: number

Win rate as percentage (0-100), null if unsafe. Higher is better.

avgPnl: number

Average PNL per signal as percentage, null if unsafe. Higher is better.

totalPnl: number

Cumulative PNL across all signals as percentage, null if unsafe. Higher is better.

stdDev: number

Standard deviation of returns (volatility metric), null if unsafe. Lower is better.

sharpeRatio: number

Sharpe Ratio (risk-adjusted return = avgPnl / stdDev), null if unsafe. Higher is better.

annualizedSharpeRatio: number

Annualized Sharpe Ratio (sharpeRatio × √tradesPerYear), null if unsafe. Higher is better.

certaintyRatio: number

Certainty Ratio (avgWin / |avgLoss|), null if unsafe. Higher is better.

expectedYearlyReturns: number

Expected yearly returns based on average trade duration and PNL, null if unsafe. Higher is better.

avgPeakPnl: number

Average peak PNL percentage across all signals (_peak.pnlPercentage), null if unsafe. Higher is better.

avgFallPnl: number

Average fall PNL percentage across all signals (_fall.pnlPercentage), null if unsafe. Lower (more negative) means deeper drawdowns.

sortinoRatio: number

Sortino Ratio (avgPnl / downside deviation — RMS of losing trades only), null if unsafe. Higher is better.

calmarRatio: number

Calmar Ratio (annualized expected return / max drawdown), null if unsafe. Higher is better.

recoveryFactor: number

Recovery Factor (totalPnl / max drawdown), null if unsafe. Higher is better.

expectancy: number

Per-trade Expectancy (winProbavgWin + lossProbavgLoss), null if unsafe. Higher is better.

avgDuration: number

Average trade duration in minutes ((closeTimestamp - pendingAt) / 60_000), null if unsafe.

medianPnl: number

Median pnlPercentage — robust to outliers; reveals distribution skew when paired with avgPnl.

avgConsecutiveWinPnl: number

Average sum of pnlPercentage across consecutive winning streaks. Null if no win streak.

avgConsecutiveLossPnl: number

Average sum of pnlPercentage across consecutive losing streaks. Null if no loss streak. Closer to 0 is better.

avgWinDuration: number

Average duration in minutes of winning trades.

avgLossDuration: number

Average duration in minutes of losing trades.

medianStepSize: number

Median |close[i] - close[i-1]| / close[i-1] across trade closes, in %. Robust to outliers.

buyerPressure: number

Fraction of up-moves among decisive close-to-close moves. 0..1. Higher = buyers more frequent.

sellerPressure: number

Fraction of down-moves among decisive moves. 0..1. Equals 1 - buyerPressure.

buyerStrength: number

Share of upward absolute movement in total close-to-close movement. 0..1.

sellerStrength: number

Share of downward absolute movement in total close-to-close movement. 0..1.

pressureImbalance: number

buyerStrength - sellerStrength ∈ [-1, 1]. Positive = bullish bias on magnitude.

trend: "bullish" | "bearish" | "sideways" | "neutral"

Bivariate trend classification (slope × R²).

trendStrength: number

Log-price regression slope, in %/day.

trendConfidence: number

R² of the log-price regression, in [0, 1].