Our journal app is in pre-release. If you notice a problem, please contact us.

Home › Articles › Why a backtest can show an edge that isn't there

Article

Why a backtest can show an edge that isn't there

You test a set of trading rules on past prices and get a nice rising line. That is a good moment to question how you measured it. Leave out costs, mishandle what happened inside a bar, or lose count of how many versions you tried, and a backtest can show a profit that was never there. This article walks through four common pitfalls with made-up examples and research. It does not tell you which strategy to use.

Published 17 Oct 2026By Kenji Okumura, Representative, Tiltnote (has traded forex)

In short

A backtest that looks profitable can be a product of how it was measured. Did you subtract costs? How did you treat bars where you can't tell which price came first? How many versions did you try? Did you add conditions after seeing the results? Checking these four makes it harder to see an edge that isn't there.

At Tiltnote we also test trading rules on historical prices. Some of them looked positive before costs and left nothing once costs were taken out. Others looked good on one-minute bars and disappeared when we re-measured them with tick data (every individual price change). In each case, it was the measuring, not the rules, that produced the "profit". Here are the pitfalls, one at a time.

1. Leave out costs, and losses can look like wins

If you don't subtract the spread, commission and swap, a rule that makes a tiny amount per trade turns into a smooth rising line as trades add up. But the smaller the edge per trade, the more likely costs are to flip the result from positive to negative.

A made-up rule with a tiny edge, traded 600 times. Before costs it rises to +341 pips; after a cost of 1 pip per trade it falls to −259 pips.
A made-up example (random numbers). A rule that makes a tiny amount on average, traded 600 times. Before costs it ends at +341 pips. Subtract a cost of 1 pip per trade, 600 trades × 1 pip = 600 pips, and it ends at −259 pips.

Research shows the same thing on real data. A paper that re-examined technical trading rules on daily Dow Jones Industrial Average prices from 1897 to 2011 found that even in the period used to pick the rules, low transaction costs completely offset their performance.[1] It is a study of a US stock index, and results in forex or other countries' markets may differ. Still, forex also charges you on every trade, so it is worth subtracting costs from your own rules and checking.

When you subtract costs, watch for these:

For how to add up a month of costs, see counting your trading costs.

2. When you can't tell the order inside a bar, fake wins appear

A candlestick only stores four prices: open, high, low and close. If a single bar reached both your take-profit and your stop, the bar alone can't tell you which one was hit first.

The MetaTrader 5 Strategy Tester, for example, can build price movement from one-minute bars. In its "1 minute OHLC" mode (OHLC stands for open, high, low, close), if a bar has more than four ticks, only four prices (open, high, low and close) are generated. The help page says testing on real ticks from the broker is as close to real conditions as possible.[2]

A made-up example with a close take-profit and stop. Counting bars that touched both as take-profit first gives +0.11R per trade on average, stop first gives −0.11R, and the result measured with ticks is ±0.00R.
A made-up example (random numbers). A rule with no edge, with the take-profit and stop the same distance away, about as far as price moves in one bar. Results are in R (1R = the stop distance, so hitting the stop is −1R and an equally distant take-profit is +1R). About 11% of trades ended on a bar that touched both. Depending on which one you assume came first, the average ranges from +0.11R to −0.11R. Measured tick by tick, it is ±0.

Even a rule with no edge looks profitable if you assume the take-profit came first whenever both were touched. The tighter your take-profit and stop are compared with a typical bar, the bigger this gap gets.

Dropping the unclear bars can make things worse

Leaving out every trade that hit an unclear bar (a bar that touched both the take-profit and the stop, so you can't tell which came first) sounds fair. But if winning and losing trades are not equally likely to hit one, the trades you keep are skewed. Take a rule that moves its exit along as price moves in its favor (a trailing stop): winning trades stay open longer and pass through more bars, so they are more likely to hit an unclear bar and be dropped. Depending on how the rule is built, losers can be the ones dropped more often instead. In our own testing, dropping trades this way once produced results that made no sense. (In the simple example above, with the take-profit and stop the same distance away, dropping them caused almost no skew. Whether it does depends on how the rule is built.)

Safer alternatives:

3. Pick the best of many tries, and you are likely picking luck

Trying many settings or rules and keeping the best one is common practice. But the more you try, the better the best result looks, even with no real edge.

Rules with a 50% win rate and no edge, tried from 1 to 1,000 at a time, keeping the best over 200 trades. The best win rate in that period rises from 49.8% to 61.4%, but over the next 200 trades every pick stays near 50%.
A made-up example (random numbers). Every rule is a coin flip with a 50% win rate. As the number of tries goes from 1 to 1,000 and you keep the best over 200 trades, the best win rate rises from 49.8% to 61.4%. Over the next 200 trades, which were not used to pick it, the same rules stay near 50%.

Three findings from research:

What helps:

4. Every condition added afterward fits the past a little more

You look back at your losing trades and add rules: skip this hour, take this weekday off, only enter when an indicator is above some level. The past results keep improving. But each condition was chosen after seeing the losses, so of course the past looks better.

When you add a condition, put the trade counts before and after side by side, and count the condition as one more try. Write the reason before you look at the results. If the reason is "spreads are wide at this hour", for example, you can actually measure the spread at that hour and check.

5. A short checklist for your own tests

None of this means your strategy is bad. Measure it consistently, and you get to see what it really does. Which strategy to use is up to you. Here is what to check when you look at a backtest.

Before and after you measure
  • Costs: did you subtract spread, commission and swap on both entry and exit, using the spread at the time you trade?
  • Order inside a bar: how did you count bars that touched both the take-profit and the stop? Did you run both the favorable and unfavorable case?
  • Number of tries: have you written down how many versions you tried, including the ones you dropped?
  • Pass mark: did you write it before seeing the results?
  • Unused data: do you show results for the period not used to pick, and how many times have you looked at it?
  • Added conditions: for each one, do you have the trade counts before and after, and a reason written in advance?
  • Number of trades: is it too small? Does most of the profit come from a handful of trades?
  • Too-good results: if profit comes easily at many times the cost, did you check your own calculation first?

Once you trade live, measure live results the same way (profit and loss after costs). The trading stats calculator turns a profit and loss list into win rate, average P&L and longest losing streak. If the backtest and live numbers drift apart, the list above is a place to start looking for why.

Sources

  1. Bajgrowicz, P., & Scaillet, O. (2012). Technical trading revisited: False discoveries, persistence tests, and transaction costs. Journal of Financial Economics, 106(3), 473–491. https://doi.org/10.1016/j.jfineco.2012.06.001
  2. MetaQuotes. Real and Generated Ticks (MetaTrader 5 Help). https://www.metatrader5.com/en/terminal/help/algotrading/tick_generation
  3. Bailey, D. H., Borwein, J. M., López de Prado, M., & Zhu, Q. J. (2014). Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance. Notices of the American Mathematical Society, 61(5), 458. https://doi.org/10.1090/noti1105 (authors' copy: https://www.davidhbailey.com/dhbpapers/backtest-pseudo.pdf)
  4. Sullivan, R., Timmermann, A., & White, H. (1999). Data-Snooping, Technical Trading Rule Performance, and the Bootstrap. The Journal of Finance, 54(5), 1647–1691. https://doi.org/10.1111/0022-1082.00163 (earlier version: https://www.fmg.ac.uk/sites/default/files/2020-11/dp303.pdf)
  5. Harvey, C. R., & Liu, Y. (2015). Backtesting. The Journal of Portfolio Management, 42(1), 13–28. https://doi.org/10.3905/jpm.2015.42.1.013 (authors' copy: https://people.duke.edu/~charvey/Research/Published_Papers/P120_Backtesting.PDF)
  6. MetaQuotes. Strategy Testing (MetaTrader 5 Help). https://www.metatrader5.com/en/terminal/help/algotrading/testing

Tools for this article

Measure backtests and live trades the same way.

Tiltnote is a trading journal you can use free with manual entries. On every trade you can log the strategy name, how you felt, whether you kept your rules, and a note, so you have a record of your live results, after costs, to compare with your backtest.

Try Tiltnote free →Opens the Tiltnote web app. On the free plan, analysis and history show your most recent 14 days (older records are kept and unlock on the paid plan).

More articles

Why a great backtest can fail liveCount your trading costs for a monthLosing streaks, in numbersHow far can you trust your win rate?Confirmation bias in tradingIchimoku explained: the five lines, and why the cloud is drawn aheadArticles →

Feedback on this page

Anything missing, unclear, or a tool you would like? Tell us in any language.

Numbers you entered in a tool are not sent. Please do not include account numbers or passwords. Privacy details

This article is general information. It is not investment advice or a recommendation to make any trade.

Updated 20 Oct 2026 · Run by Kenji Okumura, Representative, Tiltnote · About this site