Before you read: what do you think?
In the backtest, your strategy only works with EMA 17, but hardly with EMA 15 or 20. What does this suggest?
Guessing first helps you remember the answer, even if the guess was wrong.
Before an airplane takes off, it has been tested in a simulator. Backtesting is the simulator for trading strategies: you apply your rules to past prices and see what would have come out. It costs no money, only time, and it quickly shows you whether an idea stands a chance at all.
Prefer to watch first? The video sums up the lesson in a few minutes. Subtitles are always on.
Read the video text
- Before you risk real money, you can test your rules on past prices and see how they would have done. This is called backtesting, and it costs you only time.
- A backtest checks how your rules would have worked in the past. You see the win rate, expectancy and drawdown. But it is no proof of what will happen in the future.
- For beginners, a manual backtest is ideal. You use the replay function, go through the chart candle by candle and record every trade as if you were trading it live.
- You need at least fifty to a hundred trades across different market phases, meaning uptrends, downtrends and sideways phases. And always calculate with fees included.
- Watch out for the five big traps: tweaking rules until the past looks perfect. Deciding with knowledge from later. Testing only stocks that still exist. Forgetting costs. And picking only the nice examples.
- After the backtest comes the forward test: the same rules, in real time, in a demo account. Only when that also convinces you do you move on to real money.
What a backtest can and can’t do
It can:
- show whether a strategy had a positive expectancy in the past
- give you a feel for win rate, drawdowns and losing streaks
- force you to word your rules clearly
- give you the confidence to stick to the rules on hard days
It can’t:
- predict the future
- show how you act under real pressure
- fully capture slippage, partial fills and nerves
Manual or automated?
| Manual backtest | Automated backtest | |
|---|---|---|
| How it works | Step through the chart candle by candle, note trades by your rules | Rules as a program, software tests over years |
| Pros | No programming needed, you train your eye at the same time | Fast, thousands of trades, objective |
| Cons | Slow, risk of unconsciously “knowing” what comes next | Only for rules that can be programmed exactly, risk of overfitting |
| For whom | Beginners and setups that involve judgment | Advanced traders with clear rules |
To start, a manual backtest is ideal. Many charting platforms have a replay function: the chart stops at a date in the past, and you play it forward candle by candle without seeing the future.
How to run a manual backtest
- Write down the rules: entry, stop, target, management, filters. Precise enough that someone else could apply them.
- Set the period and instruments: for example 12 months and 20 stocks from your usual watchlist. Set this in advance and don’t change it along the way.
- Start the replay: reset the chart to the start date and go forward candle by candle.
- Record every trade: entry, stop, exit, result in R, ideally in the same spreadsheet as your journal.
- Include costs: subtract fees and a realistic slippage per trade, for example 0.05 to 0.1 R.
- Analyze: as in Review and Statistics.
How many trades?
- Under 30 trades: hardly meaningful
- 50 to 100 trades: a first, rough picture
- Over 100 trades: usable, especially if they cover different market phases (up, down, sideways)
A backtest that only runs in a strong bull market says little about what happens in a bear market.
At least how many trades should a backtest include for you to get a usable picture?
The five big traps
1. Overfitting
You keep adjusting the rules until the past looks perfect: EMA 17 instead of 20, stop at 1.3 ATR instead of 1.5, only on Tuesdays. The result looks great and doesn’t work in the future, because the rules are tailored to random quirks of the past.
Remedy: Few, simple rules with round values. And ask: does the strategy work about as well with EMA 18 and 22? If only one exact value works, it is probably chance.
2. Look-ahead bias
You use information you didn’t have at the time of the trade. For example, you buy “at the low of the day”, even though you only know in the evening where the low of the day was.
Remedy: Use the replay function and only react to candles that have already closed.
3. Survivorship bias
You only test stocks that still exist today and are well known today. The bankruptcies and decliners of the past are missing. This makes strategies look better than they were.
Remedy: A random selection, or data that also includes stocks that no longer trade.
4. Forgetting costs
An expectancy of +0.1 R per trade can disappear completely through fees and slippage, especially in day trading with many small trades.
5. Cherry-picking
In a manual backtest, it’s tempting to “overlook” trades you would have taken in real time that turned out badly. Or you tell yourself: “I wouldn’t have taken that one, the setup wasn’t pretty.”
Remedy: Every signal by the rules counts. If you allow judgment calls, you have to write them down as a rule in advance.
You test a strategy and keep adjusting parameters until the past looks perfect: EMA 17, stop at 1.3 ATR, only on Tuesdays. What is this trap called?
After the backtest: the forward test
A backtest looks back. The next step is the forward test: you trade the strategy in real time in a demo account or with very small money, for at least 30 to 50 trades. If the results are roughly in the range of the backtest, that’s a good sign. If they are clearly worse, check: is the strategy the problem, or your execution?
Key takeaways
- Backtesting tests rules on past prices without risking money.
- Beginners start with a manual backtest using the replay function.
- At least 50 to 100 trades, across different market phases, including costs.
- The five traps: overfitting, look-ahead bias, survivorship bias, forgetting costs, cherry-picking.
- Then comes the forward test in a demo account.
01In the backtest, your strategy only works with EMA 17, but hardly with EMA 15 or 20. What does this suggest?
Robust strategies work about as well with slightly changed values.
02You test a stock strategy over 20 years using only the current members of an index like the DAX or S&P 500. Which error is likely?
Stocks that dropped out of the index or went bankrupt during those 20 years are missing from the test.
03What is the next step after a successful backtest?
Only the forward test shows whether the strategy works in real time and with your execution.
Chart exercise
Your turn: click right on the chart. The page checks instantly and shows you the solution.
Click on the candle that is the first to close clearly above the resistance of the base.
Click on the false breakout: the candle that pokes above resistance but closes back below it.
Your homework
Reading alone is not enough. It only sticks once you do it yourself. Take 10 to 15 minutes, now or later. Your answers go into your notebook.
Test a setup by hand: go back one year on a chart and note every time it occurred, with the result in R. At least 20 cases.
All clear?
Mark the lesson as done so it counts toward your progress and streak.
Your progress is only saved in this browser. Sign up for free to keep it for good and on all your devices.
War diese Lektion verständlich?
Danke für deine Rückmeldung! 🙏 Damit wird level2lab besser.