# How to Backtest a Trading Strategy Properly

> Backtesting done wrong gives you false confidence. Here is how to backtest in a way that produces reliable conclusions about your strategy's edge.

**Tags:** backtesting, strategy-testing, methodology, analysis
**URL:** https://traderjournal.app/trading-strategies/how-to-backtest-trading-strategy-properly

---


# How to Backtest a Trading Strategy Properly

Backtesting means testing your trading strategy against historical price data to see how it would have performed. Done correctly, it is one of the most valuable tools in a trader's development. Done incorrectly, it produces optimistic results that do not survive contact with live markets.

---

## The Fundamental Problem With Most Backtests

The biggest risk in backtesting is look-ahead bias - using information that was not available at the time of the theoretical trade to make the entry or exit decision.

Example of look-ahead bias: You look at a daily chart and mark trades where a candle broke a level and then continued in that direction. You are selecting trades that worked in retrospect. In real trading, you did not know which breakouts would continue and which would fail.

A valid backtest applies your rules mechanically to each price bar as it appeared at that point in time, using only information that would have been available to you then.

---

## The Right Way to Backtest Manually

Manual backtesting is the most thorough approach for discretionary strategies. Here is the process:

**Step 1 - Define your rules precisely.** Before touching historical data, write down every rule: entry conditions, stop loss placement method, take profit method, lot size calculation, and any filters (no trading before news, no trading in choppy conditions, etc.). If any rule is ambiguous, resolve it before testing.

**Step 2 - Use the chart scroll-back method.** In MT4, go to a chart from a starting date. Scroll right bar by bar through the history using your keyboard's right arrow. Apply your rules to each bar as it appears. Do not look at what happens after the current bar.

**Step 3 - Log every qualified trade.** Every time your entry conditions are met, record the trade regardless of whether it worked. Do not cherry-pick. A backtest that skips losing trades is worthless.

**Step 4 - Record all required data.** For each trade: date, symbol, direction, entry price, stop price, target price, actual exit price, P&L. Use a spreadsheet or journal template.

**Step 5 - Analyze the results.** After 100+ trades, calculate win rate, profit factor, average win, average loss, and maximum drawdown.

---

## Out-of-Sample Testing

Test your strategy on data from one period, then validate it on data from a different period that was not used during development. If performance degrades significantly on the out-of-sample data, the strategy may be overfit to specific historical conditions.

This step is skipped by most retail traders and is one of the main reasons live performance falls short of backtest results.

---

## Automated Backtesting in MT4/MT5

MT4 and MT5 have built-in strategy testers that automate the process for rule-based EAs. The MT5 strategy tester is more capable, supporting tick-by-tick testing with more accurate historical data.

Automated backtesting is faster but requires your rules to be coded precisely in MQL4/MQL5. It is not practical for discretionary strategies that involve subjective pattern recognition.

---

## What Backtesting Cannot Tell You

Backtesting cannot replicate the psychological experience of live trading. In backtesting, you never feel fear, never hesitate, never move a stop loss, never take a different size. The execution in backtest is always perfect.

This is why forward testing (see next article) is a necessary complement. The backtest tells you whether the strategy has mechanical edge. The forward test tells you whether you can execute it.

---

Use Trader Journal to log your live forward test trades alongside your backtest data.

Download at android.traderjournal.app or ios.traderjournal.app.