Skip to content

Backtesting

Backtesting is the process of applying a trading strategy's rules to historical price data to measure how that strategy would have performed had it been traded in the past. A backtest replays deterministic entry and exit logic bar by bar over a historical dataset, producing a track record of hypothetical trades. The output is a set of performance statistics — total return, maximum drawdown, Sharpe ratio, and profit factor — that quantify the strategy's historical edge before any real capital is risked.

HOW IT WORKS

A valid backtest requires four components: a complete rule set (entry conditions, exit conditions, and position sizing), survivorship-bias-free historical data adjusted for splits and dividends, a cost model that applies commissions and slippage to every simulated fill, and an evaluation layer of performance metrics. Core formulas used to assess results:

  • CAGR = (Ending Equity / Starting Equity)^(1/years) − 1
  • Profit Factor = Gross Profits / Gross Losses
  • Sharpe Ratio = (Mean Return − Risk-Free Rate) / Standard Deviation of Returns

The most rigorous form is a walk-forward test: optimize parameters on an in-sample window, validate on the subsequent out-of-sample window, then roll both windows forward. The primary failure modes are overfitting (too many parameters, too little data), look-ahead bias (using data unavailable at the decision point), and survivorship bias (testing only on instruments that still exist today). A backtest measures the past; regime change can break any historical edge.

IN TAPEBOARD

In the Tapeboard terminal, backtesting runs directly against the instrument or watchlist you are analyzing. Select a date range, define your entry and exit conditions using Tapeboard's rule builder, and set your cost model — the terminal applies slippage and commission estimates automatically. Results surface in the Performance panel as CAGR, maximum drawdown, Sharpe ratio, profit factor, and a full trade log. Walk-forward windows can be configured in Strategy Settings to guard against overfitting before you promote a strategy to live tracking.

SEE ALSO