Statistics & Metrics
Complete reference for all 30+ metrics computed by the backtesting engine
How Statistics Are Computed
After each backtest run, the engine reads the strategy's inPosition array — a bar-by-bar record of whether the strategy was in a trade. State transitions (0→1 = entry, 1→0 = exit) identify individual trades.
For each trade, the engine reads the entryPrice, values (prices), position type (long/short), quantity, commission, and slippage. Profit is computed as:
All 30+ metrics are derived from this trade list. The Statistics panel on the right side of the Backtesting component displays results in 8 colour-coded sections.
Colour Coding
P&L-related fields in the Statistics panel are colour-coded for quick scanning:
Capital
Initial Capital
initialCapitalThe starting account balance used for all P&L calculations. Set in your strategy's risk management node.
Final Equity
finalEquityAccount balance at the end of the backtest period after all trades. finalEquity = initialCapital + netPnL.
Total Return
totalReturnRaw dollar profit or loss over the entire backtest. Positive = profit, negative = loss.
Return %
totalReturnPctTotal return as a percentage of the initial capital. (totalReturn / initialCapital) × 100.
Trades
Total Trades
totalTradesTotal number of completed trades (entry + exit pairs). More trades generally means more statistically reliable results.
Wins
winsNumber of trades that closed with a profit (exitPrice > entryPrice for long, reversed for short).
Losses
lossesNumber of trades that closed with a loss.
Win Rate
winRatePercentage of trades that were winners. winRate = (wins / totalTrades) × 100. Note: a high win rate alone doesn't guarantee profitability.
Profit & Loss
Gross Profit
grossProfitSum of all winning trades' profits before subtracting losses. Always positive.
Gross Loss
grossLossSum of all losing trades' losses. Always shown as a positive dollar amount representing the total loss. Displayed in red.
Net P&L
netPnLgrossProfit − grossLoss. The true bottom line after all trades. Commission and slippage are factored in.
Profit Factor
profitFactorgrossProfit ÷ grossLoss. A Profit Factor > 1 means profitable. Values: <1 = losing, 1–1.5 = marginal, 1.5–2 = good, 2+ = excellent. Displays ∞ when grossLoss = 0.
Averages
Avg Win
avgWinAverage profit per winning trade. grossProfit ÷ wins.
Avg Loss
avgLossAverage loss per losing trade. grossLoss ÷ losses. Shows as negative.
Avg P&L
avgPnLAverage profit/loss across all trades. netPnL ÷ totalTrades. If positive, the strategy has positive expectancy on average.
Expectancy
expectancyExpected profit per trade on average: (winRate × avgWin) + ((1 − winRate) × avgLoss). The most important single metric — tells you how much you expect to make per trade.
Extremes
Largest Win
largestWinThe single most profitable trade in dollar terms. Helps identify if results are dominated by one outlier trade.
Largest Loss
largestLossThe single largest losing trade in dollar terms. Helps identify catastrophic loss events.
Best Trade %
bestTradeThe best trade expressed as a percentage return on the position.
Worst Trade %
worstTradeThe worst trade expressed as a percentage loss on the position.
Duration
Average (bars)
avgHoldingBarsMean number of bars a position is held. Computed across all completed trades.
Maximum (bars)
maxHoldingBarsLongest trade duration measured in bars. A very long hold time may indicate a stuck position.
Minimum (bars)
minHoldingBarsShortest trade duration. Very short trades (1 bar) may indicate signal noise.
Streaks
Max Consecutive Wins
maxConsecutiveWinsLongest winning streak — maximum number of consecutive winning trades. High values can indicate trend-following behaviour.
Max Consecutive Losses
maxConsecutiveLossesLongest losing streak. Critical for assessing psychological and capital risk. If this is high, consider adding a stop-loss.
Drawdown
Max Drawdown ($)
maxDrawdownThe largest peak-to-trough drop in account equity in dollar terms. Measures the worst-case loss from any high point to the following low point.
Max Drawdown %
maxDrawdownPctMax drawdown as a percentage of the equity at the peak. Lower is better. Anything above 30% is considered high risk for most traders.
Reading the Numbers: A Quick Guide
| Metric | Poor | Acceptable | Good |
|---|---|---|---|
| Win Rate | < 35% | 35–50% | > 50% |
| Profit Factor | < 1.0 | 1.0–1.5 | > 1.5 |
| Expectancy | < $0 | $0–$10 | > $10 |
| Max Drawdown % | > 40% | 20–40% | < 20% |
| Return % | < 10% | 10–30% | > 30% |
| Total Trades | < 30 | 30–100 | > 100 |
These are general guidelines. Requirements vary by strategy type, timeframe, and risk tolerance.