Every trading idea sounds convincing until it meets real data. A breakout rule that "always works" on the three charts you remember may fail on the next thirty. Testing is the process of finding out — before risking money — whether a strategy has any edge at all, what its realistic results look like, and whether you can actually follow it.
This guide covers the three stages of testing a strategy: backtesting on historical data, forward testing in real time on a demo account, and stepping carefully to small live positions. It also covers the traps that make bad strategies look good, because a misleading test is worse than no test.
Step 0: write rules that can be tested
You cannot test a feeling. Before testing, every part of the strategy must be written precisely enough that two people would make the same decision on the same chart:
- Market and timeframe.
- Conditions: when the strategy is active (for example, "daily chart in an uptrend").
- Entry trigger: the exact event that opens a trade.
- Stop-loss: exactly where.
- Exit: target, trailing method or time-based exit.
- Position size: the risk per trade.
If you have not yet written these down, start with our guide on how to write a trading plan.
Stage 1: backtesting
Backtesting applies the rules to historical data and records what would have happened.
Manual backtesting
Scroll back on a chart, hide future candles (move forward one candle at a time), and record every signal the rules produce — winners and losers alike.
Pros: no programming required; you learn the strategy's behaviour intimately; you see the context of each trade. Cons: slow; prone to subjective decisions if rules are vague; easy to unconsciously skip trades that "look bad".
Automated backtesting
Code the rules and run them over historical data automatically. This is covered in our introduction to algorithmic trading.
Pros: fast; perfectly consistent; can test many years and markets. Cons: requires programming and good data; easy to produce impressive-looking but meaningless results through overfitting.
What to record for every trade
| Field | Example |
|---|---|
| Date and time | 2026-03-14 09:00 |
| Market and direction | EUR/USD long |
| Entry, stop, target | 1.0860 / 1.0835 / 1.0910 |
| Result in R | +2.0R or −1.0R |
| Market condition | Trending / ranging / news-driven |
| Notes | Anything ambiguous about the signal |
Recording results in R — multiples of the initial risk — rather than money makes trades comparable regardless of position size.
Reading the results
Total profit is the least informative number in a backtest. Look at the full profile.
Sample size
With only a handful of trades, results are dominated by luck. As a rough guide, fewer than 30 trades tells you almost nothing; 100 or more spread across different market conditions starts to be informative.
Win rate, average win and average loss
These three numbers determine expectancy:
Expectancy (in R) = win rate × average win − loss rate × average loss
A strategy winning 45% of trades with an average win of 1.8R and an average loss of 1R has expectancy of (0.45 × 1.8) − (0.55 × 1) = +0.26R per trade before costs.
Costs
Subtract realistic spreads, commissions and slippage. A strategy with +0.05R expectancy before costs may be negative after them, especially if it trades frequently on short timeframes. Research on individual investors — including Barber and Odean's widely cited 2000 study in The Journal of Finance — found that the households that traded most actively earned noticeably lower net returns, with trading costs a major reason. Costs are not a footnote.
Drawdown and losing streaks
Record the maximum drawdown (largest fall from an equity peak) and the longest losing streak. These tell you what the strategy will feel like. A strategy with a 20-trade losing streak in its history will produce one again, and you need to be able to keep following it when it does.
How long a losing streak should you expect?
Losing streaks are not a sign that something is broken — they are a mathematical certainty. If a strategy loses 60% of the time, the chance that any particular run of eight trades are all losers is 0.6⁸, about 1.7%. That sounds rare, but across hundreds of trades there are hundreds of overlapping runs of eight.
A useful approximation for the longest losing streak you should expect over N trades, with a loss rate q, is ln(N) ÷ ln(1 ÷ q):
| Win rate | Trades | Expected longest losing streak |
|---|---|---|
| 40% | 100 | about 9 |
| 40% | 200 | about 10 |
| 45% | 100 | about 8 |
| 55% | 100 | about 6 |
These are typical values, not worst cases — longer streaks happen. Compare them with your backtest. If the backtest's longest streak is much shorter than this, the sample is probably too small or too lucky. And decide in advance how you will respond when a streak of that length arrives, because it will.
Consistency
Split results into periods (for example, by year or quarter) and market conditions. A strategy whose entire profit comes from one exceptional month is fragile. A strategy that is modestly positive in most periods is more trustworthy.
The traps that make bad strategies look good
Overfitting
If you test a moving-average crossover with every combination of lengths from 5 to 200, some combination will look superb on past data — by chance. That combination has captured noise, not a real pattern. Warning signs: very specific parameter values (a 37-period average outperforming 35 and 40 dramatically), many rules and filters, and results that collapse when settings change slightly.
Defences:
- Keep rules and parameters few and simple.
- Prefer settings that work reasonably across a range of values rather than one perfect value.
- Use out-of-sample testing: develop the strategy on one portion of data (for example, the first 70%), then test it once on the rest without further changes.
Hindsight bias
On a historical chart, the outcome is visible. It is very easy to see a breakout as "obviously" genuine because you can see where price went. Hide future candles when backtesting manually, and decide each trade before revealing the next candle.
Cherry-picking
Testing on the markets or periods where the strategy is known to have done well guarantees good results. Test on a broad set of markets and periods chosen before seeing the results.
Survivorship and data issues
Data with gaps, errors, or prices that differ from what you could actually have traded produce misleading results. Use consistent, reliable data from the source you will actually trade.
Ignoring execution reality
Backtests usually assume you are filled at exactly your intended price. In real markets, orders can fill at a worse price, particularly around news and with stop orders. Our article on latency and slippage explains why. Add a realistic allowance.
Stage 2: forward testing on a demo account
A strategy that survives backtesting should then be traded in real time, without real money. This step tests things a backtest cannot:
- Real-time ambiguity. In live markets you don't know if a candle will close the way it looks mid-way through.
- Execution. Can you actually place orders at the planned prices, and how much slippage occurs?
- Your behaviour. Do you take every signal, or skip some after a few losses? Do you exit early?
A demo account is ideal for this. On RumiEX, every account includes a funded demo wallet with live prices and the same order tools as a live account — see our demo account guide.
How long to forward test
Long enough to collect a meaningful number of trades — often several weeks to a few months, depending on how often the strategy trades. Compare the forward-test statistics with the backtest. Large differences are a warning: either the backtest was flawed, market conditions differ, or you are not following the rules.
Stage 3: small live positions
Demo trading cannot reproduce the emotional weight of real money. Before trading at full size:
- Start with the smallest position your platform allows, or a fraction of your normal risk.
- Keep following the plan exactly and journalling every trade.
- Increase size gradually only after a sustained period of rule-following.
- Compare live statistics with the demo and backtest results after every block of 20 trades. Live results will differ somewhat, but a sharp drop usually points to execution costs or behaviour, not to the market.
If your live behaviour diverges from your demo behaviour — skipped trades, moved stops, early exits — that is the most important finding of the whole process. Our psychology articles cover why this happens.
A worked example
A trader tests a trend-pullback strategy on four currency pairs and gold over three years of 4-hour data, developing the rules on the first two years and keeping the third year as out-of-sample data.
- In-sample (development) period: 142 trades, 41% win rate, average win 2.3R, average loss 1R, expectancy +0.35R before costs.
- Out-of-sample year: 61 trades, 38% win rate, average win 2.1R, expectancy +0.18R before costs; longest losing streak 9 trades; maximum drawdown 11R.
- After costs (estimated at 0.08R per trade): out-of-sample expectancy about +0.10R.
The out-of-sample result is weaker than the development result — as it almost always is — but still positive. The trader then forward-tests for two months on demo. Results are similar, but the journal shows two skipped trades after losing streaks, both of which would have been winners. That behavioural finding becomes the main focus before going live.
The numbers here are illustrative, not a claim about any real strategy's performance.
Common testing mistakes
- Too few trades to separate skill from luck.
- Testing until something looks good, then trading the best-looking version.
- No out-of-sample period.
- Ignoring costs and slippage.
- Skipping forward testing and going straight from backtest to full-size live trading.
Key takeaways
- Write rules precise enough to test before testing anything.
- Backtest with a large sample, record results in R, and examine expectancy, drawdown, losing streaks and consistency — not just profit.
- Guard against overfitting, hindsight bias and cherry-picking; keep an out-of-sample period.
- Forward test on a demo account to check real-time execution and your own discipline.
- Move to small live positions gradually, and treat behavioural differences as a key result.
Ready to forward test? Open a free RumiEX account — it includes a funded demo wallet — or read the Technology series to learn how automated testing and execution work.
Frequently asked questions
What is backtesting?
Backtesting is applying a trading strategy's rules to historical price data to see how it would have performed. It can be done manually, by scrolling through charts and recording each signal, or automatically with code. It shows how a strategy behaved in the past, not how it will behave in the future.
How many trades do I need to test a strategy?
More than most people expect. With fewer than about 30 trades, results are dominated by luck. Many traders aim for 100 or more trades across different market conditions before drawing conclusions about win rate and expectancy.
What is overfitting?
Overfitting is tuning a strategy's rules or settings so precisely to past data that it captures random noise rather than a real pattern. An overfitted strategy looks excellent in the backtest and performs poorly on new data. Fewer rules and parameters reduce the risk.
Is a demo account enough to test a strategy?
A demo account is ideal for forward testing: it shows how a strategy works in real time and how well you follow it. It cannot fully reproduce the emotions of trading real money, so many traders move to small live positions afterwards before trading at full size.
What results should I look for in a backtest?
Look beyond total profit. Check the number of trades, win rate, average win and loss, expectancy per trade, maximum drawdown, longest losing streak, and whether results are consistent across different periods and markets rather than coming from a few lucky trades.
Sources and further reading
- Trading Is Hazardous to Your Wealth: The Common Stock Investment Performance of Individual Investors — Brad Barber and Terrance Odean, The Journal of Finance (2000)
- Trading in the Zone — Mark Douglas, Prentice Hall (2000)
Written and reviewed by the RumiEX Editorial Team. This article is for education only and is not financial, investment or tax advice. Read our editorial standards.