Performance Metrics Glossary

Performance Metrics Glossary

Profit Metrics

MetricDescription
Net ProfitTotal profit after all costs (slippage, commission)
Gross ProfitSum of all winning trades
Gross LossSum of all losing trades
Profit FactorGross Profit / Gross Loss (>1.0 is profitable)
Average TradeNet Profit / Total Trades

Win/Loss Metrics

MetricDescription
Win %Percentage of trades that were profitable
Average WinnerMean profit of winning trades
Average LoserMean loss of losing trades
Largest WinnerBest single trade
Largest LoserWorst single trade
Avg Win / Avg LossPayoff ratio

Risk-Adjusted Returns

MetricDescription
Sharpe Ratio(Annualised Return - Risk Free Rate) / Annualised Volatility
Sortino RatioLike Sharpe, but uses only downside volatility
Calmar RatioAnnualised Return / Maximum Drawdown
RINA IndexRisk-adjusted metric that rewards consistency
Ulcer IndexMeasures the depth and duration of drawdowns

Drawdown Metrics

MetricDescription
Maximum DrawdownLargest peak-to-trough equity decline
NP/DDNet Profit / Maximum Drawdown
Recovery FactorNet Profit / Maximum Drawdown (same as NP/DD)

Equity Curve Quality

MetricDescription
R-SquaredLinearity of the equity curve (1.0 = perfectly linear growth)
Pearson CorrelationCorrelation between trade sequence and cumulative profit

Equity Curve Graph (Time-Based X Axis)

The graph output mode displays an ASCII equity curve where the X axis represents equal time periods rather than equal numbers of trades. This means each unit of horizontal space corresponds to the same amount of calendar time, making it easy to see when trades occurred and how performance varied over different market periods.

Trades entered during the indicator warmup period (before max-bars-back bars have been processed) are excluded from both the equity curve and the monthly returns table. The graph itself is trimmed to start from the first tradable bar (after warmup), so no flat zero-line appears during the warmup period. The time-based period splitting also starts from the first tradable bar, not from the backtest start date.

The post-warmup backtest period is divided into equal calendar periods:

  • Monthly periods when the backtest spans 5 years or fewer
  • Yearly periods when the backtest spans more than 5 years

Each period is allocated an equal share of the graph width. Within each period, the daily equity values are downsampled (when there are more days than allocated graph points) or interpolated via step function (when there are fewer days). For margin curves, downsampling preserves peak values within each bucket to avoid underrepresenting margin requirements.

For futures contracts, the margin requirement curve is overlaid on the equity curve graph in green (Lime), drawn behind the equity curve (BlueViolet) so both are visible.

Custom Metrics

Algolang supports custom fitness expressions using the ExprTK mathematical expression library. The following 24 variables are available in fitness expressions:

avgtrade, calmar, car, carbh, mar, mar12roll, nbrtrades, netprofit, npdd, npmargin, pearson, pctindd, pctpm, pctpq, pctpy, profitfactor, profsegs10, r2, rina, sharpe, sortino, tsindex, ulcer

Expressions support arithmetic (+, -, *, /, ^), comparison (<, >, ==), logical operators (and, or, not), and functions (abs, sqrt, min, max, if, clamp).

Example: --fitness-metric "sharpe * r2" (Sharpe ratio weighted by equity curve linearity).

For the full variable reference, expression syntax guide, and additional examples, see the “Custom fitness expressions” section under “Optimisation with seek”.