Learn

How to backtest a trading strategy

Backtesting means running a strategy against historical price data to see how it would have performed. Here's how people actually do it, and where it fits alongside a logic check like StratoBot's.

The three real methods

Manual chart replay

Scroll a chart back to a past date and step forward candle by candle, marking where your rules would have entered and exited. Slow and manual, but it's the fastest way to find out whether a strategy's logic even makes sense before building anything — TradingView's bar replay tool is built for exactly this.

MetaTrader 5's Strategy Tester

The standard way to backtest a compiled EA. It runs your .mq5 file against real historical tick or OHLC data for a chosen symbol and date range, and reports win rate, drawdown, profit factor, and more. This only works once you have compiled code — it's a step after description and logic-checking, not a replacement for either.

Dedicated backtesting engines

Platforms and code libraries (from paid backtesting software to Python frameworks) built specifically for strategy testing, usually with more control over data quality, spread modeling, and walk-forward analysis than a built-in tester. Worth it once you're testing seriously across many symbols or timeframes, overkill for a first pass.

Where a logic check fits in

Before any of the above, you need a strategy specific enough to actually test — clear entry conditions, exits, and position sizing, not a vague idea. StratoBot's free logic check confirms your described rules fire the way you expect, using a synthetic price path rather than real market history. It answers “does the logic work as described”, not “would this have made money” — that second question is what an actual backtest, like MetaTrader's Strategy Tester, is for. See the full distinction.

What backtesting can't tell you

Overfitting to the past

Tuning parameters until a backtest looks perfect almost always means fitting to noise in that specific historical window, not finding a real edge. A strategy tuned this way tends to fall apart on data it hasn't seen.

Ignoring spread and slippage

A backtest using perfect fill prices will overstate performance. Real trades pay the spread and sometimes slip past your intended price, especially during news or low liquidity.

Testing on too short a window

A strategy that looks great over three months of trending price action may fail the moment the market ranges or reverses. Test across different market conditions, not just a convenient recent stretch.

Treating a backtest as a guarantee

Historical performance describes the past, not the future. Even a well-built backtest is one input into a decision, not proof of what a strategy will do going forward.

See the full flow in a demo · Common automation mistakes

Give us your trading strategy

Describe it in plain language and see exactly what your bot will do. Free, no account needed.

Build My EA

Your first EA is free.