To backtest a trading rule without bias, write the rule down in full before you open a chart, test it on data you did not use to design it, count the full round-trip cost, and report the losses and the worst drawdown in R. If you change the rule after seeing the result, the test is no longer clean.
What does an unbiased backtest actually require?
A backtest replays a rule on past prices to see what it would have done. The danger is not the replay itself but the freedom of the person running it. Every time you adjust a setting, drop a quiet period or add a filter after seeing the result, you move the test toward the answer you hoped for. An unbiased backtest therefore needs a rule that is fixed in advance, data that is separated by purpose, costs that are realistic and a report that includes the bad news.
In this article results are measured in R. R is the risk planned before the trade, from entry to stop. A loss equal to the planned risk is shown as a negative R, a win as a positive R. This lets you compare gold, indices and forex without adding up pips across different instruments, which would be meaningless because a gold pip and an index point are different units.
Which biases damage a backtest most often?
Most bad backtests fail for a small number of well-known reasons:
- Look-ahead bias. The rule uses information that was not available when the decision would have been made, for example a daily high or close that is only known after the day ends, or an indicator value that is redrawn later.
- Data snooping and overfitting. You test many variations of a rule and keep the best one. The best of many variations often fits random noise rather than anything repeatable. The more settings you tune, the less the final result means.
- Period selection. You pick start and end dates that flatter the rule, for example only a strong trending phase of the market.
- Hindsight in the sample. You test only the instruments or conditions that you already know worked.
- Ignoring costs. You test on clean mid prices and forget that each trade pays spread, commission and slippage.
- Vague rules. A rule such as buy near clear support can only be recognised looking back. If different people cannot mark the same setup from the same written rule, it cannot be tested honestly.
Our glossary entries on Backtest and Out-of-sample test explain the basic terms if any of these are new to you.
How do you set up a clean backtest step by step?
The order of the work matters more than the software.
- Write the rule first. Define the entry condition, where the stop goes, how the trade is exited, how position size follows from the planned risk, and which instruments and sessions are included. Date the document and do not edit it afterwards. Fixing a hypothesis before testing it is called pre-registration, and there is a glossary entry on it.
- Split the data by purpose. Use one part of the history to design the rule and keep another part untouched. The untouched part is your out-of-sample test. Look at it once. If the rule fails there, you may not tune it and test again on the same data, because that part has then become design data.
- Decide the sample size before you start. A handful of trades says very little. Our article How Many Trades Do You Need to Judge a Strategy? goes into this in detail.
- Run the rule mechanically. Mark each trade from the written rule only, without looking at how it ended. Code is best because it cannot be tempted. If you work by hand, cover the right-hand side of the chart.
- Keep all trades in the file. Losers, days the rule would have traded but you find awkward, and poor fills all belong in the test file.
- Report in R. Show total R, average R per trade, hit rate (the share of winning trades), the longest losing streak and the maximum drawdown, which is the biggest fall from a previous equity peak. Our article Pips vs R Multiple Explained shows why this is cleaner than counting pips.
How should costs, stops and fills be modelled?
Costs are the most common source of quiet optimism. The cost of a trade is the full round trip: spread plus commission plus slippage, paid when you open and when you close. The quoted spread alone understates it, and spreads usually widen when markets move fast. A rule that only works with zero costs does not work.
A stop-loss is an order, not a price guarantee. In a gap or a fast market the fill can be worse than the stop level, so the loss can be larger than planned. A backtest that always assumes a perfect fill exactly at the stop is therefore optimistic. A sensible habit is to stress the test with worse fills than average and see whether the result survives.
Scheduled events deserve a decision made in advance. Central bank decisions, such as those published on the Federal Reserve monetary policy pages, and major data releases can change spreads and fills sharply. Decide before testing whether the rule trades through them or stays flat, and write that into the rule. Do not discover it afterwards by deleting the ugly days.
Finally, remember what you are testing. Gold, index and forex CFDs are leveraged products, and European regulators have restricted CFDs for retail clients because of the risk of rapid losses. A clean backtest says nothing about whether the leverage you choose is survivable. Our article How Leverage Works in CFD Trading covers that side.
What does a small sample of closed setups look like next to a backtest?
A backtest is a simulation, and actual fills at a broker can differ from simulated ones. It therefore helps to see what an honest, small sample of closed setups looks like, losses included. Our closed setups from our MT5 account at our broker TegasFX are on our public results page, losses included; changes are listed in a public corrections log. See the data block below for the table of closed setups from 7 October 2026 to 22 October 2026, and our results page and methodology page for the details.
As of 22 October 2026, we have 25 closed setups: 11 wins and 14 losses, a hit rate of 44%. The total result is -0.56 R, an average of -0.02 R per setup. The longest losing streak was 6 setups in a row.
Three lessons follow, none of them flattering, which is the point:
- The sample is small. A sample of this size proves nothing yet, and it would be wrong to call the result an edge or to call it a failure. It shows only what the first stretch looked like.
- A losing streak of 6 setups sits inside a total result that is close to flat. A backtest that shows a smooth line with no such stretch should make you suspicious, because sound rules also produce ugly runs.
- Totals depend on the date. The numbers above are as of 22 October 2026 and will change as more setups close.
How do you read the result without fooling yourself?
Before trusting any backtest, your own or someone else's, ask a short list of questions:
- Was the rule fully written before the test, and can someone else reproduce it from the text?
- How many variations were tried before this one was chosen? If the answer is many, the result is weaker than it looks.
- Was there an out-of-sample part, and did the rule behave similarly there?
- Were costs counted as the full round trip, and does the result survive worse fills?
- Does the report show the worst drawdown and the longest losing streak, and could you live through them?
A good backtest result is evidence about the past under stated assumptions. It is not a forecast, and no one can promise future results. If a provider shows you only a rising line, without losses, costs or a date range, treat that as a reason to ask more questions, not as proof. Our guide How to Verify a Forex Signals Provider gives a practical checklist.
Risk note: trading CFDs on gold, indices and forex carries a high risk of loss, you can lose your entire deposit, and past or simulated results do not predict future results.
WICKVIPER data: All instruments
Closed, verified signals between 7 Oct 2026 and 22 Oct 2026. Source: our public ledger.
State described in this article: closed signals up to 22 Oct 2026, 16:50 UTC.
- Total result
- −0.56 R
- Closed & verified
- 25
- Win rate
- 44.0%
- Average per trade
- −0.02 R
- Max drawdown
- −8.37 R
Now (updated automatically): 71 closed signals, −14.35 R in total.
Questions
What is the biggest source of bias in a backtest?
Changing the rule after seeing the result. Testing many variations and keeping the best one fits noise rather than anything repeatable, so write the rule down first and do not edit it after looking at the outcome.
Why do I need out-of-sample data?
Because a rule designed on a stretch of history will usually look good on that same stretch. Keeping a separate, untouched part and looking at it once shows whether the rule behaves similarly on prices it was not built on.
Which costs belong in a backtest?
The full round trip: spread, commission and slippage, paid when opening and closing. The quoted spread alone understates the cost, and a stop-loss is an order, not a price guarantee, so the loss at the stop can be larger than planned.
Is a small sample enough to judge a rule?
No. A small sample proves nothing yet. As of 22 October 2026 our own sample is 25 closed setups with a total of -0.56 R, which is why we do not call it an edge or a failure.
Sources
- Monetary Policy — Board of Governors of the Federal Reserve System
- ESMA agrees to prohibit binary options and restrict CFDs to protect retail investors — European Securities and Markets Authority
Terms used here
- Drawdown — The fall of an equity curve from its previous peak. Maximum drawdown is the largest such fall over a period, measured in our ledger in R.
- Pip — A conventional unit for measuring price moves: 0.0001 for EUR/USD and 0.1 USD for gold (quoted to 0.01). For index CFDs our ledger uses points instead.
- R multiple — The result of a trade divided by its initial risk (entry to stop-loss). A loss at the planned stop is about −1 R; a win twice the risk is +2 R.
- Spread — The difference between the ask (buy) price and the bid (sell) price. Every round trip pays it once, before the market has moved at all.
- Slippage — The difference between the price an order asked for and the price it got. It is largest when the market moves fast or liquidity is thin.
- Leverage — The ratio of a position's value to the margin needed to open it. At 20:1, a margin of 2,000 USD controls a position worth 40,000 USD.
- Stop-loss — An order that closes the position once price reaches a chosen level; slippage or a gap can make the loss larger. The distance from entry to the stop-loss defines 1 R.
- Backtest — A test of fixed trading rules on historical data, as if they had been traded at the time. It is only as honest as its data and costs.
- Out-of-sample test — A test on data that was not used to build or tune a strategy. It is the closest a historical test gets to new trades.
- Pre-registration — Writing down a test's hypothesis, data, costs, test windows and pass threshold before any result is computed, so a failure counts as a failure.
Written and reviewed by AI agents (Claude and Gemini models) under rules set by the owner; no person reviews each text. Last AI review: 25 Oct 2026. Sources are listed at the end of the article.