Docs / Test and optimise

Backtesting

Replay a strategy over history and read the result honestly — which numbers matter, which mislead, and how to avoid fooling yourself.

A backtest replays your strategy over historical candles and reports how it would have performed. It is the fastest way to reject a bad idea, and the easiest way to fool yourself into keeping one. This page is mostly about the second problem.

Running one#

Once a strategy has indicators, signals and a stop, press Run Backtest at the top of the strategy page. It replays every candle in the window, opening and closing positions exactly as your rules and risk settings dictate, and takes 30–60 seconds. The results land on the Reports tab.

Re-run it after any edit. A backtest describes the strategy as it was when the test ran, not as it is now.

The numbers that matter#

The Reports tab shows a wall of statistics. Four of them carry most of the signal; read these first.

MetricWhat it tells youRough read
Cumulative ReturnDid it make money over the window?The headline, and the most misleading on its own
Max DrawdownThe worst peak-to-trough fallThe pain you'd have had to sit through — small is good
SharpeReturn per unit of volatilityAbove ~1 is decent, above ~2 is strong (and suspicious)
Profit FactorGross wins ÷ gross lossesAbove 1 is profitable; higher is better

Then one number decides how much to trust all the others:

IMPORTANT

Look at the number of trades before you believe anything else. A strategy with nine trades and a Sharpe of 3 has told you almost nothing — that is a small-sample fluke. A hundred trades at a Sharpe of 1.2 is a real result. The fewer the trades, the more the metrics are noise.

The rest of the grid — Sortino, Calmar, Omega, Value at Risk, Skew, Kurtosis, Tail Ratio and more — refines the picture once the basics look good. Sortino is the one worth graduating to early: it is Sharpe but only penalises downside volatility, which is the volatility you actually mind.

Read them together#

No single metric is a verdict. The combinations are what mean something:

  • High return with a huge drawdown → profitable but unholdable. You would have quit before the payoff.
  • Great Sharpe with three trades → noise wearing a suit.
  • Low win rate with a profit factor above 1 → completely fine. A strategy can win 35% of the time and print money if the winners dwarf the losers. Read win rate and profit factor as a pair, never alone.

Open View Chart to see the entries and exits drawn on the candles. This is usually where you catch a rule doing something you never intended — entering twice in a row, or exiting a bar too late.

The trap: overfitting#

The danger of backtesting is that you can always make the number go up. Keep nudging a threshold until the return peaks and you have not found an edge — you have memorised the noise in this particular slice of history, and it will evaporate the moment the market does something new.

WARNING

If you find yourself tuning a parameter to the third decimal place because the backtest "likes" it, stop. You are fitting the past, not the market.

Three habits keep you honest:

  • Prefer plateaus to peaks. A setting that works only at exactly RSI-length 14, and falls apart at 13 or 15, is fragile. One that works across 12–16 is robust. A grid search shows you which you have.
  • Check more than one regime. A strategy that only shines in a single trending stretch has not been tested, it has been flattered. Look at how it behaves in ranging periods too.
  • Stress the sequence. Monte Carlo reshuffles your trades thousands of times to show how much of the result was the order the trades happened to fall in.

After a good backtest#

A backtest you believe is a hypothesis, not a conclusion. The next honest test is paper trading: the same execution path as live, against real-time prices it has never seen, with no money at risk. That is the step that tells you whether the edge survives contact with the present.

Was this page helpful?