entekhab.netentekhab.nettrilingual encyclopedia

Backtesting

ENGLISHBacktestingreference
فارسیبک‌تستEnglish term retained
کوردیبەکتێست (تاقیکردنەوە لەسەر داتای ڕابردوو)English term retained
Category
Algorithmic Trading
Level
Professional

Simple definition

Running a trading rule over past data to see what it would have done. It records a hypothesis rather than forecasting, and only counts if the rule was followable then.

Professional definition

Simulating a fully specified rule on historical prices, bar by bar, with every decision taken from information available at that bar, and with fees, spread, slippage and funding deducted. The output is an equity curve and a set of statistics describing one path through one sample.

Technical definition

A backtest is an experiment whose validity rests on three things: that signals use only information available before the trade, that fills are achievable against the liquidity that existed, and that the sample was not searched for the result being reported. Breaking the first makes the result void, not optimistic. Breaking the second inflates it by the size of the unmodelled cost. Breaking the third makes the statistics unmeasurable, because the reported path is the best of many unreported ones.

Academic definition

The historical simulation of a fully specified decision rule on past data, with returns computed net of transaction costs, used to estimate the distribution of outcomes the rule would have produced in the sample.

Mechanism

A backtest is a recursion over equity: each bar applies the position chosen before the bar to the return of the bar, then deducts the costs actually incurred. Every assumption in that recursion is an assumption about the past that cannot be verified from the equity curve itself, which is why the curve is evidence about the code as much as about the market.

In practice

Who uses it
Systematic strategy developers, quantitative researchers, risk reviewers, and discretionary traders formalising a rule.
Why it matters
It forces a vague idea into a complete specification: entry, exit, size, data source and cost model must all be written down before anything can run.
Limitations
Costs, funding and slippage are modelled, not observed, and modelling them optimistically is the most common way a profitable backtest becomes an unprofitable system. A single sample also gives one path, not a distribution.

Common mistakes

  • Reporting results gross of fees, spread, slippage and funding.
  • Treating the best of many parameter runs as the expected result.
  • Testing on a universe that excludes instruments that later failed.

Examples

market

Two engineers code the same written rule. One fills at the signal bar's close, the other at the next bar's open with slippage. The rules are identical; the equity curves are not comparable.

numeric

Equity 10,000 and a bar return of 1.2 percent at full size, with 0.15 percent of costs charged in that bar, gives 10,105. The gross figure would have been 10,120: the gap is the cost model.

Given
  • E_{t-1} = 10,000
  • w_{t-1} = 1 (fully invested, decided before the bar)
  • r_t = 1.2 percent
  • k_t = 0.15 percent of equity, covering fee, spread and slippage
Steps
  1. 1 + 0.012 - 0.0015 = 1.0105
  2. 10,000 x 1.0105 = 10,105
  3. gross comparison: 10,000 x 1.012 = 10,120
10,105 net against 10,120 gross on a single bar

Illustrative figures. Repeated over hundreds of bars this 15 basis point difference compounds, which is why the cost model decides whether a backtest means anything.

Mathematical foundation

E_t = E_{t-1} \left( 1 + w_{t-1} r_t - k_t \right), \qquad w_{t-1} \in \mathcal{F}_{t-1}

Variables

E_tEquity at the end of bar tcurrency
w_{t-1}Position weight chosen before bar t, as a fraction of equity; negative for shortfraction of equity
r_tReturn of the instrument over bar tfraction
k_tCosts charged in bar t as a fraction of equity: fees, spread crossed, slippage and any funding accruedfraction
\mathcal{F}_{t-1}The information set available before bar t beginsinformation set

Procedure

Start from initial capital. For each bar in order, read the position decided from information available before that bar, apply the bar's return to it, subtract the period's costs, and carry the result forward. Never revisit an earlier bar once a later one has been read.

Worked example

Given
  • E_0 = 10,000
  • w_0 = 1
  • r_1 = 0.012
  • k_1 = 0.0015
Steps
  1. 1 + 0.012 - 0.0015 = 1.0105
  2. E_1 = 10,000 x 1.0105
E_1 = 10,105

Interpretation

The recursion is the whole backtest. Its honesty lives in two symbols: the subscript on w, which must be earlier than the bar it trades, and k, which must contain every cost actually payable.

Assumptions

  • Costs are charged as a fraction of equity in the bar in which they occur; a per-contract or per-share fee schedule needs converting before it fits this form.
  • Position weight is set on information strictly before the bar it is applied to, which is the condition the lookahead-bias entry formalises.
  • The instrument return is the return actually achievable, including any dividend, funding or roll convention relevant to the contract.
Limits of the formula
  • The recursion describes a single realised path through a single sample. It is not an estimate of expected return and carries no confidence interval.
  • It silently assumes orders of the simulated size were fillable at the modelled price, which for illiquid instruments is often false.

Related terminology

related
Overfitting Walk-Forward Testing Lookahead Bias Drawdown Sharpe Ratio Slippage Win Rate
Commonly confused with

Walk-Forward Testing

A backtest is the simulation itself and can be run on all the data at once. Walk-forward testing is a protocol for arranging backtests so that each evaluation window was never used to choose the rule.

Sources

CMT Program Guide 2026
CMT Association · system design, testing and evaluation topics
https://cmtassociation.org/wp-content/uploads/2026/03/2026-CMT-Program-Guide_v2026.3.5.pdf URL verified
Technical Analysis: Modern Perspectives
CMT Association · chapters on testing rule-based methods and the evidence they produce
https://cmtassociation.org/wp-content/uploads/2019/01/Technical-Analysis-Modern-Perspectives-CMT-Association.pdf URL verified
Portfolio Performance Evaluation (refresher reading)
CFA Institute · principles of performance measurement net of costs
https://www.cfainstitute.org/insights/professional-learning/refresher-readings/2026/portfolio-performance-evaluation URL verified

Editorial status

Draftindustry-conventionv1.02026-11-03

Written, not yet reviewed.

The equity recursion is an accounting identity and is stated as such; the cost term is defined by convention and must be adapted for per-contract fee schedules. No claim is made about the predictive value of any backtest: the entry states only what the simulation computes and the conditions under which it means anything. Figures in the example are illustrative. Both headwords keep the English term because practitioners in Persian and Kurdish use it, following this corpus's lexicon.