Performance Metrics Glossary
Profit Metrics
| Metric | Description |
|---|---|
| Net Profit | Total profit after all costs (slippage, commission) |
| Gross Profit | Sum of all winning trades |
| Gross Loss | Sum of all losing trades |
| Profit Factor | Gross Profit / Gross Loss (>1.0 is profitable) |
| Average Trade | Net Profit / Total Trades |
Win/Loss Metrics
| Metric | Description |
|---|---|
| Win % | Percentage of trades that were profitable |
| Average Winner | Mean profit of winning trades |
| Average Loser | Mean loss of losing trades |
| Largest Winner | Best single trade |
| Largest Loser | Worst single trade |
| Avg Win / Avg Loss | Payoff ratio |
Risk-Adjusted Returns
| Metric | Description |
|---|---|
| Sharpe Ratio | (Annualised Return - Risk Free Rate) / Annualised Volatility |
| Sortino Ratio | Like Sharpe, but uses only downside volatility |
| Calmar Ratio | Annualised Return / Maximum Drawdown |
| RINA Index | Risk-adjusted metric that rewards consistency |
| Ulcer Index | Measures the depth and duration of drawdowns |
Drawdown Metrics
| Metric | Description |
|---|---|
| Maximum Drawdown | Largest peak-to-trough equity decline |
| NP/DD | Net Profit / Maximum Drawdown |
| Recovery Factor | Net Profit / Maximum Drawdown (same as NP/DD) |
Equity Curve Quality
| Metric | Description |
|---|---|
| R-Squared | Linearity of the equity curve (1.0 = perfectly linear growth) |
| Pearson Correlation | Correlation 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”.