Backtesting

    Category

    Quantitative & Statistische Methoden

    Sub-category

    Backtesting-Metriken

    Curated by

    GlanWick Team

    Last reviewed

    · Methodology

    Backtesting is the testing of a trading strategy on historical price data to estimate its metrics before live use: hit rate, profit factor, expectancy, maximum drawdown. A clean backtest also simulates fees, spread and slippage. The biggest traps are overfitting, look-ahead bias and samples that are too small – historical results are no guarantee for the future.

    Context & Mechanics

    Definition and process

    Backtesting answers the question: “What would this strategy have earned in the past – and what would it have cost?” The process has four steps: first, define the strategy fully rule-based (entry, exit, position size – no discretion). Second, obtain clean historical data covering the target market and period. Third, simulate the rules trade by trade – including fees, bid-ask spread and realistic slippage. Fourth, condense the results: expectancy, profit factor, win rate, max drawdown and the shape of the equity curve.

    The three big distortions

    Overfitting: optimising parameters until history looks perfect models noise instead of signal – the strategy collapses live. Antidotes: few parameters, in-sample/out-of-sample separation, walk-forward analysis. Look-ahead bias: the simulation uses information not yet available at decision time (e.g. the closing price for an entry within the same candle). Survivorship bias: datasets without failed, delisted assets systematically overstate historical returns.

    Putting validity into perspective

    A backtest is an estimate under the assumption that market behaviour repeats structurally – regime changes (rate turns, volatility shocks) regularly break this assumption. Therefore: the sample must be large enough (rule of thumb: several hundred trades across different market phases), costs must be set conservatively, and between backtest and live use belongs a forward test on unseen data or in a simulator.

    Why it matters for traders

    Backtesting replaces opinion with measurement: it shows whether a setup had any historical edge at all and delivers the metrics for position-sizing and drawdown planning. In the GlanWick simulator strategies can be played through on historical data by way of example and the metrics evaluated automatically – GlanWick is a training and simulation tool and not a prop firm itself.

    Execution Example

    A trader backtests a moving-average crossover over 5 years of price data on a simulated $100,000 account: 240 trades, 42% win rate, average winner +$1,900, average loser −$900, fees and slippage set at $30 per trade.

    1. Expectancy before costs: 0.42 × 1,900 − 0.58 × 900 = 798 − 522 = +$276 per trade.
    2. Costs: −$30 per trade → net expectancy +$246; over 240 trades ≈$59,000 simulated profit.
    3. Profit factor: (101 winners × 1,900) ÷ (139 losers × 900 + 7,200 costs) = 191,900 ÷ 132,300 ≈ 1.45.
    4. Robustness check: compare in-sample (years 1–3) vs. out-of-sample (years 4–5) – if expectancy collapses to near zero out-of-sample, the parameter choice was over-optimised and the test is repeated with simpler rules.

    Execution Risk & Errors

    1

    Optimising parameters until history looks perfect (overfitting)

    2

    Omitting fees, spread and slippage and flattering the expectancy

    3

    Building in look-ahead bias, e.g. entries based on candles not yet closed

    4

    Drawing statistical conclusions from 20–30 trades

    5

    Treating backtest results as a forecast instead of a historical estimate

    Frequently Asked

    How many trades does a meaningful backtest need?

    As a rule of thumb several hundred trades across different market phases. Small samples make luck look like edge – the dispersion of results is then larger than the measured advantage.

    What is the difference between backtest and forward test?

    The backtest simulates on known past data, the forward test runs on new, unseen data – e.g. in a simulator or live at minimum size. Only both together give a reliable picture.

    What does out-of-sample testing mean?

    The data is split: the strategy is developed on one part (in-sample) and validated on the held-back part (out-of-sample). If performance collapses there, the strategy is over-optimised.

    Why do backtested strategies fail live?

    Most common reasons: overfitting, underestimated costs, market regime changes and execution differences between simulation and reality – such as slippage in fast phases.

    This Website Uses Cookies

    We use technically required cookies so the platform works. Optional cookies are only set with your explicit consent.

    Legal basis: Art. 6(1)(a) GDPR. You can withdraw your consent at any time via the "Cookie Settings" link in the footer.

    More information in our Privacy Policy · Imprint