A backtest runs on one version of price history. Change the data feed and the prices differ by a fraction of a pip here and there. Change the server time zone and every hourly or daily bar starts at a different moment, so its open, high, low and close change too.
None of those differences is a change in the market. A strategy that has found something real about how price behaves should barely notice them. A strategy whose result depends on the exact prices in one data file has probably learned that file rather than the market.
A noise test checks which of the two you have. You keep the strategy exactly as it is, run it on many slightly altered copies of the same history, and look at how far the results move. This guide covers what to alter, how to generate the copies, how to read the spread of results, and how to choose a noise level that means something.
One point up front: a noise test can show that a result is fragile. It cannot show that an edge is real. A strategy can hold up well on perturbed data and still fail on new data, for reasons this test does not look at.
What a noise test changes, compared with other robustness tests
Three common robustness tests each change a different thing and keep the rest fixed.
| Test | What changes | What stays fixed | Question it answers |
|---|---|---|---|
| Parameter sensitivity | The strategy's inputs | Price data, rules | Do nearby settings give similar results? |
| Monte Carlo | The order or selection of trades | The trade list | How bad could the path of these trades have been? |
| Noise test | The price data the rules read | Rules and settings | Does the result depend on exact prices or bar timing? |
They are complementary. A strategy can sit on a broad plateau of settings, as described in parameter sensitivity for EAs, and still depend on exact price levels in one data set. A Monte Carlo test reshuffles trades that already exist, so it can't tell you whether those trades would have happened at all on slightly different data. The noise test is the one that asks that question.
Step 1: Decide which kinds of noise are realistic
The aim is to simulate differences you would genuinely expect between two reasonable versions of the same history, not to see how much damage it takes to break the strategy. Any strategy breaks under enough noise. Three kinds of perturbation are worth running, each as its own batch so you know which one the strategy is sensitive to.
- Price noise. Add small random amounts to each bar's open, high, low and close, scaled to recent volatility, so the noise is the same relative size in quiet and busy periods.
- Bar-boundary shift. Rebuild hourly or daily bars so they start at a different minute or hour. Two data sources in different time zones produce exactly this difference, as covered in sourcing and aligning tick history for MT5 custom symbols.
- Cost noise. Vary the spread and slippage applied to each trade. This one is covered in why an EA trades worse live than in its backtest, so this guide focuses on the first two.
Decide in advance whether the bar-boundary test is fair for your strategy. If the logic is tied to a real clock time, such as an entry at a session open, shifting the bars changes the strategy itself rather than the data. In that case, shift the bars in ways that keep the session boundary in place, or skip that test and write down why.
Step 2: Freeze the strategy
Every copy of the data is run with the same rules and the same settings. No re-optimising on the noisy copies: that answers a different question, and it lets the optimiser fit each copy's noise.
Freeze the evaluation as well. Use the same date range, the same cost assumptions and the same position sizing for every run. If anything else changes between runs, you can't tell how much of the spread in results came from the noise.
Step 3: Generate the perturbed copies
Start from the finest bars you have, such as M1 bars, perturb those, then rebuild the timeframe the strategy trades. That way the noise shows up in the trading bars the way a different feed would: slightly different highs and lows, slightly different closes.
import numpy as np
import pandas as pd
def perturb_m1(m1, noise_frac, window, rng):
"""Add volatility-scaled random noise to M1 OHLC bars (DatetimeIndex,
columns open/high/low/close), then repair each bar so high and low
still contain open and close. noise_frac is the noise size as a
fraction of the recent average M1 bar range."""
scale = noise_frac * (m1["high"] - m1["low"]).rolling(window, min_periods=1).mean()
out = m1.copy()
for col in ["open", "high", "low", "close"]:
out[col] = m1[col] + rng.normal(0.0, 1.0, len(m1)) * scale
prices = out[["open", "high", "low", "close"]]
out["high"] = prices.max(axis=1)
out["low"] = prices.min(axis=1)
return out
def to_bars(m1, rule, offset_minutes=0):
"""Rebuild a higher timeframe from M1 bars, with bars starting
offset_minutes later than usual. Bars are labelled by their start
time, so a strategy must only act once a bar is complete."""
agg = {"open": "first", "high": "max", "low": "min", "close": "last"}
bars = m1.resample(rule, offset=pd.Timedelta(minutes=offset_minutes),
label="left", closed="left").agg(agg)
return bars.dropna()
def price_noise_batch(m1, run_backtest, rule="1h", noise_frac=0.1,
n_copies=200, seed=11):
"""Run the frozen strategy on many noisy copies of the same history.
run_backtest(bars) is your own backtest, returning a summary dict."""
rng = np.random.default_rng(seed)
return [run_backtest(to_bars(perturb_m1(m1, noise_frac, 60, rng), rule))
for _ in range(n_copies)]
def offset_batch(m1, run_backtest, rule="1h", offsets=range(0, 60, 5)):
"""Run the frozen strategy on bars that start at different minutes."""
return {off: run_backtest(to_bars(m1, rule, off)) for off in offsets}
Two cautions about the code. First, the bars are labelled by their start time, which makes it easy to act on a bar before it has closed. If your backtest uses the bar's close, make sure it only does so at the bar's end; see look-ahead bias in EA backtests. Second, the rebuilt bars have no tick or spread detail. If the strategy depends on intrabar paths or spreads, run the noisy copies through a test that models them, or treat the result as a check on the bar logic only.
If you test in MT5 rather than Python, each noisy copy can be imported as a custom symbol and run in the Strategy Tester with the same settings. Bars-only custom symbols limit which modelling modes are meaningful, as explained in MT5 backtest data quality.
Step 4: Choose what to record for each run
Record the same summary for the original data and for every copy:
- Trade count. If it moves a lot, entry conditions sit on knife edges, where a fraction of a pip decides whether a trade happens.
- Trade overlap. The share of the original trades that still occur, with roughly the same entry time and direction, on the noisy copy. Low overlap means the copies are, in effect, different strategies.
- Average R per trade. R is a trade's result divided by the risk taken at entry. Working in R keeps the comparison independent of position size.
- Maximum drawdown in R, and the worst losing streak.
- Profit factor, if you use it elsewhere, so the noise test speaks the same language as your other reports.
Look at the whole distribution across copies, not just the average. The percentiles (10th, 50th and 90th, for example) and the position of the original result within them say more than any single number.
Step 5: Read the spread of results
The original data usually produces one of the best results among all the copies. That is expected for an optimised strategy: its settings were chosen on that exact data. What matters is how far the copies fall from it, and how widely they spread.
A hypothetical example: on the original data a strategy averages 0.20R per trade. Across 200 copies with price noise, the median is 0.06R, and 90% of the copies fall between −0.04R and 0.14R. (Hypothetical arithmetic for teaching purposes, not from any strategy or account.)
Every copy is worse than the original, and the typical copy keeps less than a third of the original's average. That pattern suggests much of the original result came from the exact prices in that file. The strategy might still have some edge, but the backtest figure overstates it, and anything sized from that figure is sized on the flattering version.
| Pattern across copies | What it usually suggests |
|---|---|
| Results cluster close to the original, trade overlap high | The result does not depend much on exact prices at this noise level |
| Results drop sharply even at small noise levels | Rules triggered by exact levels, single-tick conditions or very tight thresholds |
| Trade count swings widely between copies | Entry conditions on a knife edge; small price changes decide whether trades exist |
| Price noise is fine, bar shifts are not | Dependence on bar timing; acceptable only if the logic is genuinely time-based |
| A few copies collapse, most are fine | A small number of trades carry the result; check which ones and why |
Illustrative teaching example: typical readings, not results from any strategy or account.
If a small number of trades carry the result, the problem is partly one of sample size. See how many trades a backtest needs.
Step 6: Calibrate the noise level
A single noise level gives one snapshot. Running several levels shows the shape of the decline, which is more informative.
- Start at zero and step up. For example 0.05, 0.1, 0.2 and 0.4 times the average M1 bar range. Record the median and the 10th percentile of average R at each level.
- Look for a gentle slope or a cliff. A gradual fall as the noise grows suggests the rules respond to price in a smooth way. A sharp drop between two small noise levels points to thresholds that sit on exact prices.
- Anchor the realistic level on real data. If you have two sources for the same symbol, compare them bar by bar. The typical difference between their highs, lows and closes is a reasonable guide to how much noise is realistic. Noise far beyond that tests something that would not happen.
Write the chosen level, and the reason for it, into the test record before looking at results. A noise level picked after seeing which one the strategy survives is one more way of fitting the test to the strategy.
Step 7: Don't turn the noise test into another optimiser
Two habits quietly undo the value of the test.
- Tuning the strategy until it survives the noise. Each change is chosen with knowledge of the noisy results, so the noisy copies stop being independent evidence. Fix the problem the test found, then confirm the fix on data the process has not used, as described in out-of-sample testing for EAs.
- Using it as a filter across thousands of candidates. If a builder generates many strategies and the noise test keeps the ones that survive, some will survive by luck. That is a selection step, and its effect has to be measured like any other; see data-mining bias in strategy builders.
What a noise test doesn't tell you
- Whether the market will change. Noise around one history says nothing about a regime the history doesn't contain.
- Whether costs are realistic. That needs its own cost tests.
- Whether the sample is large enough. A few dozen trades will look fragile under any test, and a fragile result on a few dozen trades may just be a small sample.
- Whether the edge is real. Surviving perturbation is necessary, not sufficient. For the wider set of warning signs, see how to spot an overfit backtest.
Common noise-testing mistakes
- Adding far more noise than any real feed difference. Every strategy fails eventually, so an extreme level tells you nothing useful.
- Mixing perturbation types in one batch. If price noise, bar shifts and cost changes run together, you can't tell which one hurt.
- Re-optimising on the noisy copies. That fits each copy's noise instead of testing the frozen strategy.
- Reading only the average. The spread of results and the position of the original result matter more.
- Ignoring trade overlap. Similar averages from very different trade lists are not the same strategy holding up.
- Shifting bars for a clock-based strategy. It changes the rules, not just the data.
- Choosing the noise level after seeing the results.
Noise-testing checklist
- Strategy, settings, date range, costs and sizing frozen before the test
- Perturbation types chosen in advance, each run as its own batch
- Bar-boundary test judged fair, or skipped with a written reason
- Noise scaled to recent volatility, starting from the finest bars available
- Bars rebuilt so the strategy only acts on completed bars
- Noise level anchored on a real comparison between data sources where possible
- Trade count, trade overlap, average R and drawdown recorded for every copy
- Results read as a distribution, with the original's position noted
- Several noise levels run to see the shape of the decline
- Any fix confirmed on data the process has not used
Frequently asked questions
What is a noise test for a trading strategy?
It runs the same strategy, with the same settings, on many slightly altered copies of the same price history, and measures how much the results change. A result that depends on the exact prices in one data file tends to fall apart. A result that reflects broader price behaviour tends to hold up better.
How much noise should I add to the price data?
Enough to match the differences you would expect between two reasonable data sources, and no more. A practical starting point is a small fraction of the recent average bar range, stepped up in stages. Where you have two feeds for the same symbol, use the typical difference between them as your anchor.
Is a noise test the same as a Monte Carlo test?
No. A Monte Carlo test reshuffles or resamples trades that already exist. A noise test changes the price data the strategy reads, so the trades themselves can change, appear or disappear. The two answer different questions and are worth running together.
My EA fails when I shift the bar start times. Is it broken?
Not necessarily. If its logic is tied to a real clock time, such as a session open, shifting the bars changes the strategy rather than the data, and the test isn't fair. If the logic has no reason to depend on when bars start, a large change is a warning that the result depends on one particular bar alignment.
If my EA passes a noise test, will it work live?
A noise test can't tell you that. It checks one kind of fragility. A strategy can survive perturbed data and still fail because of changing markets, costs, execution or a sample that was too small. Treat it as one piece of evidence alongside the others.
Want a second pair of eyes?
Start with our free Sample Stress-Test Report. It walks one anonymized, illustrative strategy through a full stress test, start to finish, so you can see what rigorous validation looks like before you test your own.
Read the Sample Stress-Test ReportWant your own backtest checked? The Strategy Audit + 60-minute call is a paid service at a launch price of £100, credited in full against our build and portfolio offers. You send an MT4/MT5 Strategy Tester report or trade-list CSV; what we can check depends on the files you supply, and walk-forward and parameter sweeps are not included because they need the strategy itself. It is analysis of strategy testing, not investment advice, and does not promise any trading or evaluation outcome. See the Strategy Audit
Disclaimers
CollosoTrading provides educational content and analytical services for retail and professional algorithmic traders. We do not provide regulated investment advice, financial advice, or personal recommendations. Trading derivatives, leveraged products, and CFDs carries a high level of risk and may result in losses exceeding deposits. Past performance, including any verified or unverified historical results referenced on this site, is not indicative of future results. Consult an independent regulated financial adviser before making investment decisions.
All figures are backtests or simulations unless marked LIVE. Hypothetical or backtested performance results have inherent limitations and may not reflect actual trading. No representation is made that any account will or is likely to achieve profits or losses similar to those shown. Individual results vary. Any figures in this article are hypothetical arithmetic for teaching purposes, not results from any strategy or account. We do not guarantee the outcome of any prop firm challenge.