Demo accounts, backtesting, forward testing and market replay

You can check a strategy on a demo account, in a historical test, in real time or through market replay. Each environment answers a different question and has its own limits. We explain what a result establishes, how to account for costs and how to separate parameter selection from independent evaluation. The article also shows how data and simulation errors can improve a performance curve before the rules encounter real order execution.

Illustrative educational scene about strategy testing. The scene illustrates tools and dependencies, not performance or a trade recommendation.

One candle can support two different trade results

A backtest closes a position at its target and reports a profit. The candle also crossed the protective stop. Which level came first? A normal candle records an opening price, a high, a low and a closing price. Those values do not reveal the full path between them. A simulator must obtain more detailed observations or impose a rule.

Consider a hypothetical EUR/USD long position of 10,000 EUR, already open before the candle begins. Entry was filled at Ask 1.2602. The following candle contains Bid observations: open 1.2600, high 1.2630, low 1.2580 and close 1.2610. The exit levels were active before the candle: protective stop at Bid 1.2590 and profit target at Bid 1.2620. Exiting at either level ends the trade; there is no re-entry.

For this calculation only, prices move continuously along each described path, fills occur exactly at the first exit level reached, and there are no gaps, slippage, financing or conversion charges. Round-trip commission is 1 USD. These deliberately simple fill assumptions are not promises about a live stop or limit order.

Separate the observed range from an assumed sequence

Two paths compatible with the same Bid candle
Hypothetical pathFirst exit reachedNet trade result
Open → high → low → closeTarget at 1.2620+17 USD
Open → low → high → closeStop at 1.2590−13 USD

In the first path, the position has already closed before the later low occurs. In the second, the later high cannot rescue a position closed at its stop. Both paths share the given opening, high, low and close. The closing Bid above the opening Bid therefore does not settle the trade outcome.

The official TradingView strategy documentation explains that its broker emulator makes intrabar assumptions from chart data and can use lower-timeframe observations for greater detail. This illustrates why an engine setting belongs in a test report. Our table is an independent hypothetical construction, not a claim that every engine chooses either row by default. More detailed candles can still leave an unresolved order inside their own interval.

Show the result under both allowed paths

Here one pip is 0.0001 USD per EUR, so 10,000 EUR gives 1 USD per pip. The target is 18 pips above the entry Ask: (1.2620 − 1.2602) ÷ 0.0001. That yields 18 USD before commission and 17 USD net. The stop is 12 pips below the entry Ask: (1.2602 − 1.2590) ÷ 0.0001. The corresponding result is −12 USD before commission and −13 USD net.

The difference between the two net results is 30 USD. Do not add another spread deduction: the entry Ask and exit Bid already include that side-of-quote difference. Conversely, do not call the arithmetic midpoint of the possible results an expected result. No probabilities for the two paths have been supplied.

Suppose five other, unambiguous completed trades have net results of +8, +5, −7, +6 and −4 USD. They total +8 USD. Including this unresolved trade gives a six-trade sample total of either +25 USD or −5 USD under the two stipulated paths. The interpretation changes sign before a single strategy parameter changes.

Resolve uncertainty without rewriting the test after seeing it

A test protocol should state how it handles a candle that touches competing exits: obtain adequate timestamped data, apply a predetermined conservative convention, or retain the result as unresolved and report sensitivity. Record the convention before comparing strategy variants. Selecting the favourable sequence after inspecting a trade converts a missing observation into a hidden choice.

If tick observations are available, verify their Bid/Ask meaning, sequence, gaps and coverage, as well as the engine’s rules for fills. Tick detail alone does not reproduce queue priority, liquidity or the broker’s actual execution. A declared worst-case convention is a modelling choice, not evidence that the historical path was the worst case.

Keep the same questions when moving from a backtest to replay or demo trading. What did the environment observe, what did it simulate and what remains unmeasured? This example does not identify a profitable system or establish a complete uncertainty interval for live trading. It isolates one ambiguity in the supplied candle and two explicitly allowed paths. The detailed lesson below adds cost sensitivity, data quality, sample separation and reproducibility.

Three exercises with worked answers

The exercise data are hypothetical. Choose an answer, then check the calculation.

1. Can the candle alone identify the first exit?

Bid open 1.2600, high 1.2630, low 1.2580, close 1.2610. Both exits were active: stop 1.2590 and target 1.2620.

Show the answer and explanation

B. One compatible path reaches the target first and another reaches the stop first. A simulator result must be read together with its data and fill assumptions.

  • A. The closing price does not reconstruct the earlier sequence.
  • B. The four candle values do not determine whether the high or low occurred first.
  • C. That sequence would be an assumption, not information contained in these values.
  • D. Engine rules and available intrabar observations differ and must be recorded.
2. What are the two net results under the stated fills?

Long 10,000 EUR from Ask 1.2602; exits at Bid 1.2620 or 1.2590; pip 0.0001; commission 1 USD per completed trade.

Show the answer and explanation

D. The position is worth 1 USD per pip. Use the actual entry and exit sides, then subtract the stated round-trip commission once.

  • A. Those are results before commission.
  • B. That deducts an additional spread although the Ask-to-Bid fills already account for quote sides.
  • C. Commission reduces the losing result too; it does not offset a loss.
  • D. The price outcomes are +18 USD and −12 USD. Subtract 1 USD commission from each to obtain +17 USD and −13 USD.
3. What can the six-trade sample total be under the two paths?

The other five net results are +8, +5, −7, +6 and −4 USD. The unresolved trade contributes +17 or −13 USD.

Show the answer and explanation

A. Report the sensitivity rather than silently choosing a sequence. The sample’s sign depends on the unresolved exit order in this example.

  • A. The five known results total +8 USD; adding +17 or −13 gives +25 USD or −5 USD.
  • B. That keeps only the favourable allowed sequence.
  • C. That omits the unresolved trade without labelling a different sample.
  • D. The midpoint is not an expectation without probabilities for the paths.

From candle ambiguity to a reproducible test

Keep observations separate from engine conventions while checking costs, sample boundaries, demo execution and test documentation.

1. Demo, paper trading, backtest, forward test, replay, live — six different questions

The largest share of misunderstandings around testing comes from a single mental shortcut: “I checked the strategy”. Checked it where, and in what respect? These environments are not successive steps on one scale of accuracy. They measure different things.

A demo account is an account run on the broker's server and funded with virtual money. Quotes usually come from the same feed as on a live account, but execution is simulated on the demo server side according to simplified rules. It is the broker, not the platform, that decides those rules, and they can differ between account types — which is why every sentence about what “demo does not reproduce” only holds after you check the documentation of that specific account, and not as a universal rule (item 16 in the bibliography shows what such a description looks like at one provider). Execution models and the way a broker treats order flow are covered by the section on choosing a broker.

Paper trading means recording decisions without submitting orders for real execution with a broker. Fills are assigned by a spreadsheet, a script or an emulator built into the charting environment. That distinction is often skipped and it matters: if virtual orders are filled by an emulator, then its rules — not the market — decide the entry price. Paper trading examines decision logic. It is not a test of execution quality, unless you separately describe and justify the emulator's rules.

A backtest replays the rules on historical data. It answers a conditional question: what would have come out if the data, the tick model and the cost model matched reality. The quality of the answer does not exceed the quality of the assumptions.

A forward test checks the rules outside the fitting period. It can be a reserved stretch of history that the optimiser never saw, or observation in real time — bar by bar, with no way to go back.

Market replay replays history with the future hidden and lets you make decisions by hand. It is a training tool for discretionary strategies, not an equivalent of an account with real capital.

A live account is the only environment in which you measure the actual cost of execution: slippage, spread widening, rejections, partial fills.

Six testing environments and the questions they answer
EnvironmentQuestion it answersWhat it does not settleWho sets the conditions
Demo accountWhether you can operate the platform and whether the automated system does not hang during normal workThe cost of execution and behaviour in low liquidityBroker (demo server)
Paper tradingWhether you can apply your own rules consistentlyThe fill price — it is assigned by an emulator or by your own conventionYou or the tool's emulator
BacktestWhat would have come out on a given history under explicitly stated assumptionsThe future, the cost of execution and whether the assumptions were accurateThe author of the test (data, tick model, costs)
Forward testWhether the rules survived a stretch of data the optimiser had not seenThe next market regime; it does not fix a small sampleThe data split or the passage of time
Market replayWhether you recognise situations in sequence, without looking to the rightThe cost of execution and the pressure of a real lossThe author of the replay session
Live account (minimal exposure)How much execution actually costs at that position sizeThe cost of execution at a substantially larger sizeThe broker and the state of the market
Model EUR/USD demo order with a 0.10-lot volume and protective levels.
A virtual trade can test operation; it does not verify actual live execution and costs.
One sentence of scope. This article describes a validation procedure: data, costs, the sample split, reproducibility. Whether a given logic makes economic sense at all and how to measure an edge statistically is a topic for the section on strategies. Position size and risk limits are settled by the section on risk management. Here we take them as inputs to the test.

2. What demo and paper trading do not measure

A demo account is sometimes described as “live without the money”. That is untrue on several concrete, checkable points. The table below lists the elements that on a demo server may be absent or modelled in a simplified way — and every one of them enters the result directly once you move to real capital. The “on demo” column describes typical simplifications, not a rule binding on every broker: the scope of the simulation is set by the account provider and can differ even between account types at the same broker.

Elements of execution: a demo account versus an account with real capital
ElementOn demoOn a live account
SlippageAt many brokers zero or modelled with a fixed value; the scope of the simulation is set by the account providerVariable, dependent on the moment and on liquidity; largest around data releases and at session opens
Widening of the spreadOften a fixed or barely variable spreadThe spread widens in low liquidity and around events; on demo that profile tends to be smoothed out
Rejections and requotesRare or absentThey occur depending on the execution model and the account type — a property of the broker, not of the platform
Partial fillsUsually a full fillPossible at larger size and worse liquidity; with micro positions usually irrelevant
Available liquidityA demo server usually does not refuse; whether it refuses at all follows from the rules of that specific providerLimited; in exotics and outside sessions it can disappear at your level
Price gaps (gap)Sometimes reproduced differently from a live accountA stop loss inside a gap works like a market order: execution at the first available price, not at the stop level
Psychological stakeZero — a loss has no consequencesReal; it affects whether you execute the plan at all
How to check this for your own account instead of assuming. Demo server rules are sometimes described in the broker's documentation, and then there is nothing to guess. An example from one specific provider, not an industry rule: in a help article dated 29 May 2026 IG writes about its own demo account that “Trades made through the demo account will not be subject to slippage, interest and dividend adjustments, or out-of-hours price movements”, and that orders “will never be rejected on the grounds of size or price”, although on a live account such a rejection is possible (item 16 in the bibliography, retrieved 22.08.2026). That sentence describes IG's demo and nothing beyond it. At another broker the scope of the simulation may be narrower or wider — in the documentation of your own account look for the words slippage, requote, rejection and partial fill. If the documentation is silent, the correct entry in the description of the test is “unknown”, not “zero”.

The last row is the one that can turn a sensible plan into improvisation, but it is not the subject of this article. The mechanism of behaviour under pressure is described by the article on process and outcome. Here we are interested in the measurable part: the cost of execution.

Hypothetical EUR/USD buy order: reference price 1.1000 and live fill 1.1003 imply 3 pips of adverse slippage.
The model shows one possible execution difference. Demo rules depend on the provider; live orders do not always experience slippage.

How to measure slippage instead of estimating it. For every trade record: the price at the signal, the requested price, the execution price, the spread at the moment of the click, the spread at the moment of the fill, the latency, the session, information about any macro event, and the broker's server time. Once you have collected a sample, calculate the median and the tail of the distribution, not the mean alone — an average taken over a few extreme fills can be misleading in either direction. Only such a number is fit to be put into the cost model of a backtest.

Minimal exposure measures slippage for minimal exposure. Slippage measured on 0.01 lots is a measurement for 0.01 lots. Transferring it to a position a hundred times larger is an assumption, not a measurement — and it has to be named explicitly in the description of the test. It is a silent extension of the conclusion beyond the data on which it was measured.

An anchoring case: 3 January 2019, the sharp move in the yen. During the thin liquidity of the Asian session, yen pairs went through a jump move in a matter of minutes; the episode is described in a separate box in a report by Australia's central bank (item 12 in the bibliography, content retrieved 22.08.2026). The report states that “At 9:36 am AEDT, over the span of about 30 seconds, and in the absence of any material news, the yen appreciated by 3 per cent against the US dollar”, and that the difference between the bid and the ask widened “from around 2 pips to 100–300 pips”. Two sentences from the same box matter for this article: that “market liquidity was seasonably low at this time of the day and year”, and that retail brokers automatically close positions with stop loss orders once the loss exceeds a set level — that is, that in this window exactly the mechanism was triggered whose cost a tester reproduces only to the extent that the chosen modelling mode allows — and in the simplified modes it does not reproduce it at all, because it fills at the price written into the order (see the subsection on filling pending orders). The extent of the move and the fill prices differed between data providers and brokers, which is why one “true” number of pips does not exist here and will not be given. For strategy testing the conclusion is limited and concrete: a cost model that assumes a fixed spread and zero slippage does not reproduce such windows at all, and a strategy with a tight stop is the most sensitive to them. The course of the event itself and its market background belong to the section on sessions and trading hours.

Model of empty size fields in market depth with example quotes.
The displayed book does not represent the entire decentralized FX market.

3. What a backtest result is made of: data, tick model, cost model

A tester's result is a function of three things that a user can decide on without realising it: which data was loaded, how the movement inside the candle was reproduced, and what was added to every trade.

The tick generation model

The MetaTrader 5 documentation lists five modes for the tester: Every tick, Every tick based on real ticks, 1 minute OHLC, Open prices only and Math calculations. The difference between the first and the second is the most important one here. In Every tick mode the ticks are generated algorithmically from minute data. In Every tick based on real ticks mode the test uses ticks collected by the broker — that is, a record of one particular stream, not a full reconstruction of the market. 1 minute OHLC emulates four prices per minute, Open prices only runs the logic at the bar open, and Math calculations does not load history at all and serves to optimise mathematical functions. The names of the modes and their order are confirmed by the tester settings page (item 2 in the bibliography, retrieved 22.08.2026). Tester modes are sometimes changed along with the terminal version, so before relying on them check the help page for your own version.

Choosing the mode with real ticks is not, however, a declaration that not a single computed tick will appear in the test. The documentation describes the fallback behaviour explicitly: “If a symbol history has a minute bar with no tick data for it, the tester generates ticks in the »Every tick« mode”, and in the opposite situation “If a symbol history has no minute bar but the appropriate tick data for the minute is present, these ticks are ignored” (item 1 in the bibliography, retrieved 22.08.2026). In other words: where the broker's archive has gaps or inconsistencies, a stretch of the run is reproduced with modelled ticks, and the report does not mark those stretches separately. The same page also points out that with real ticks “a spread may change within a minute bar”, whereas with generated ticks the spread fixed in the given bar is used — so the data mode changes not only the price path but the spread model as well.

The practical consequence is simple and inconvenient. If a rule depends on the order in which the price touched the high and the low inside a candle — and every strategy that has an active stop and a target at the same time depends on it — then a test on ticks generated from minute data guesses that order. This is not a bug in the program, it is a property of the model. In MetaTrader 4 the tester reports a separate measure of historical data coverage, but even there the movement inside the candle is computed rather than read from a record of a real stream. The documentation describes three modelling modes — Open prices only, Control points and Every tick — where the last one “uses for generation not only data of the nearest less timeframe, but also those of all available nearest timeframes”, and where lower-timeframe data is missing the tester uses ready-made wave templates (item 14 in the bibliography, retrieved 22.08.2026). The modelling quality bar shows which timeframe was actually used — the lower it is, the less guesswork there is in the price path. The availability of real ticks and the depth of their history depend on the broker and on how long it archives them.

Diagram of historical data, generated ticks and simulated operations.
Check the data and assumptions independently of the tester’s percentage score.

How the tester fills pending orders

The tick model decides which prices the tester will see at all. A separate layer of assumptions is what the tester does with those prices when a pending order is sitting in the market — and that assumption tends to be invisible in the settings and has to be looked up in the tool's documentation. It hides two separate questions, and only when they are separated does the calculation come out right: when the order is executed, and at what price. The answer to the second one depends, in the MetaTrader 5 tester, on two separate axes: the kind of instrument and the data modelling mode. Confusing those axes is the easiest way to take a true sentence out of the documentation and apply it where it does not hold.

Latency. Latency emulation in the MetaTrader 5 tester covers the placing of the order by the automated system, not its later execution on the server: “if an EA uses pending orders, delays are only applied to order placing but not to order execution (in real conditions, execution occurs on the server without a network delay)” (item 2 in the bibliography, retrieved 22.08.2026). The fill of an order already sitting in the market therefore gets no network delay in the test — and rightly so, because in reality it does not get one either.

Axis one: the kind of instrument. The absence of latency does not imply that the order will be filled at the level written into it. The documentation settles this question first by the kind of instrument, and the OTC FX/CFD symbols discussed here are non-exchange instruments; exchange-traded currency contracts belong to a different category. The rule for non-exchange instruments reads: “For non-exchange instruments, triggering of all kinds of pending orders and SL/TP is performed by Bid and Ask prices. Execution is performed by the current Bid and Ask market prices at the moment of triggering” (item 13 in the bibliography, section Order Triggering and Execution, first paragraph, retrieved 22.08.2026). All kinds of pending orders — including a limit order — as well as stop loss and take profit are therefore executed at the current bid or ask at the moment of triggering, and not at the level written into the order. For a limit order, a favorable difference from its stated price is price improvement; this is not permission to fill beyond the limit in the adverse direction.

The sentence about a limit order filled without slippage concerns exchange instruments. The next paragraph of the same section describes stocks and exchange contracts separately, and there the rule is different: “For exchange instruments, charts are plotted and stop orders are triggered by last performed deal prices (Last). Limit orders are triggered by Bid and Ask prices. Limit orders are executed at the price specified in the order (without a slippage), while orders of other types are executed at the current Bid and Ask market prices (slippage is possible)” (item 13, second paragraph of the same section, same retrieval). That sentence is sometimes quoted as a universal rule of the tester, and that is an error of scope, not an error of quotation: “a limit without slippage” holds for an exchange instrument. For a non-exchange FX symbol, the preceding paragraph applies; an exchange-traded currency contract falls under the exchange-instrument rules.

Axis two: the modelling mode. The kind of instrument settles what happens in the accurate modes — Every tick and Every tick based on real ticks. The modelling mode is a separate axis and in the simplified modes it switches that rule off entirely: “In the »Open prices only« and »1 minute OHLC« testing modes, pending orders, as well as SL and TP are executed at the prices specified in the orders. The algorithm of execution at market prices used in accurate modes (every tick and real ticks), is not suitable for less accurate modes” (item 13, same retrieval). The vendor also gives the reason and the conclusion: “In some modes intermediate ticks are not generated, therefore the difference between the requested order price and the current price (Open or OHLC) can be significant. Execution of orders at the requested price in the »Open prices only« and »1 minute OHLC« provides more accurate testing results”. The logic here is the opposite of the intuitive one: in a simplified mode the tester has nothing to take a market price from after triggering, so it fills at the price written into the order, because a fill at the open of the next bar would be a bigger error than a fill at the level.

Putting both axes together. For a non-exchange FX symbol in the MetaTrader 5 tester this produces two different execution environments that are easy to confuse, because the report looks the same in both:

  • Accurate modes (Every tick, Every tick based on real ticks) — every pending order as well as SL and TP are filled at the current bid or ask at the moment of triggering. Slippage is modelled, but only within the price path the tester reproduced — either generated from minute data or taken from the broker's tick archive
  • Simplified modes (1 minute OHLC, Open prices only) — every pending order as well as SL and TP are filled exactly at the price written into the order. Slippage disappears from the calculation entirely, for all order types at once

The mechanism of this simplification differs between the two order types, even though the effect goes the same way. After triggering, a stop order behaves like a market order: in reality its execution price is the first price available after the level is crossed, not the level itself. A fill at the level — which is what the simplified modes give — therefore removes the whole cost of the jump from the calculation and inflates the result. A limit order is a purchase below the market or a sale above it: a fill at the level written into it assumes liquidity sufficient for the whole position at exactly that level, whereas touching a price does not guarantee sufficient liquidity for a fill. On an exchange, queue position also matters; for OTC FX/CFDs, the provider’s execution rules apply. The tester models neither the queue nor the volume available at the level: it knows only the price path. Both simplifications therefore work in favour of the result, but they enter the calculation only when the chosen mode lets them in.

A separate condition is the side of the market: a level is touched by the price series that corresponds to the side of the order, so a purchase reacts to the ask and a sale to the bid. A test run on one series, usually the bid, reproduces the other side by adding the spread, and the MQL5 documentation notes that “During testing, the spread is not modeled but is taken from historical data” (item 3 in the bibliography, retrieved 22.08.2026) — the moment of triggering therefore depends on the spread recorded in the data, and not on the spread that would have occurred on your account. The density of the price path itself matters too: the page about ticks warns that “Stop Levels and pending orders may trigger at a price different from the specified one (especially when testing at higher timeframes)” (item 1 in the bibliography).

What this means for reading a report. A tester report does not say which of these two environments produced it — you have to read that from the settings of the run. The same set of rules run in an accurate mode and in a simplified mode will give a different calculation, and that is not a matter of computational precision but of a different fill rule. The most sensitive are strategies with a small average trade and strategies with a tight stop, because for them the removed cost of the jump makes up a substantial part of the result. That is why the fill rule adopted for pending orders belongs to the description of the test environment on a par with the tick model and the cost model, and a report that does not disclose it needs to be checked against the tool's documentation. The control test is cheap: repeat the run in an accurate mode, and then once more with fills worsened by an amount of the order of average slippage, and see how much of the result is left.

The cost model

Four items with different units are added to every trade, and they must not be mixed:

  • Spread — in pips or points. The key question: does the test use a fixed spread, the spread recorded in the data, or the current spread from the moment the test was launched. Three different answers, three different results — in the MetaTrader 5 tester the answer is closed by the documentation quoted above; in other tools it has to be looked for in the description of that particular tester
  • Commission — in the account currency, usually per lot and per side. To compare it with the spread you have to convert it into pips using the pip value for the given instrument and position size
  • Swap points — charged for holding a position across the change of the settlement day, with a triple charge on a chosen day of the week. For an intraday strategy an irrelevant item, for a position strategy sometimes larger than the spread
  • Slippage — in pips or points, as the difference between the requested price and the execution price. In a tester it enters only where the fill rule allows it to: in the MetaTrader 5 tester on a currency pair in the accurate modes it applies to all types of pending orders together with SL and TP, while in the 1 minute OHLC and Open prices only modes it does not enter at all, because fills go at the prices written into the orders (item 13 in the bibliography)

Latency is deliberately not on this list, although it is sometimes tacked on as a fifth item. Latency is measured in milliseconds, not in pips, and it is not added to a trade — it is a parameter of the execution model, that is, it affects which price will be used, not how much will be subtracted. The MetaTrader 5 tester lets you emulate it in No delay and Random delay modes as well as with a fixed delay, where — as the section on filling pending orders shows — the emulation covers the placing of the order by the automated system, not the execution of an order already sitting in the market (item 2 in the bibliography). Mixing these two quantities in one row of a cost calculation is an error of unit, not a rounding.

It is worth separating two mistakes that look similar. Network latency measured with a ping command to the server address is not the time it takes to execute an order — between the two lie validation on the broker's side, queuing and the moment of execution itself. The question of infrastructure, virtual servers and keeping an automated system running is developed by the article on automation, EAs and VPS; here all that matters is that latency has to be assumed explicitly in a test rather than silently taken as zero.

The quality of the data itself

Before a result starts to mean anything at all, the data has to pass a check: gaps and discontinuities in the series, duplicates, outliers, chronology, the time zone and the daylight-saving shift, the convention for the candle timestamp (open or close), and also whether the series is built from the bid, the ask or the mid price. That last point tends to be dismissed, and it decides whether a level was touched at all: a short position is closed at the ask, so a candle built from the bid may never show the price that triggered the stop.

4. The perfect but unrealistic backtest — anatomy of a pretty curve

A pretty tester result usually comes not from one great deception but from four small concessions, each of which looks innocent on its own. Below is each of them together with the way to detect it.

Concession one: an entry at a price that could not have been known

The rule says “enter when the candle closes above the average”, and the test enters at that same candle’s closing price. A signal requiring the final close can produce an order only once the close is confirmed, at a price available then. In a typical model that calculates once at the close, this means the first tick of the next bar. The fill price may happen to equal the preceding close, but its availability cannot be assumed without specifying the model. Correcting that assumption can materially change the result.

A sensitivity test, not a verdict: shift the entry by one candle and run it again. If the result stops existing, all you know is that the system cannot stand a shift of the entry by one period. A leak from the future is one possible explanation, but not the only one: the signal may equally well be simply short-lived or sensitive to the execution price. What settles the matter is an audit of the availability of every variable at the moment of the decision — the full procedure for that test, together with what it does not prove, is given in the box at the end of the section on look-ahead.

Concession two: no costs

A test without spread, commission and slippage is not a simplified version of the system. It is a different system — with a different expected value and a different profitability threshold. The scale of that shift can be calculated, and the next section shows it.

Concession three: one set out of a thousand attempts

An optimiser returns a ranking. Taking the top row from it and presenting it as the strategy's result omits the information about how many variants were checked. With a sufficiently large number of attempts, the best result is high from the statistics of searching alone, including for rules that make no sense — the formal treatment of this phenomenon is given by item 8 in the bibliography. The number of variants tested belongs to the description of the result just as much as the period and the costs do.

Concession four: evaluation on the data used for tuning

If the parameters were chosen on the same period on which the result is then reported, there is no validation there at all — there is a description of a fit. It is at the same time the easiest mistake to detect: it is enough to ask which stretch of data was used for tuning and which one exclusively for evaluation.

Four concessions in one calculation — how much of the pretty curve is left

Listing four concessions does not yet show their scale. The calculation below does, and it is built so that every step can be checked with a single operation.

Assumptions of the calculation (illustrative values, not the result of a test that was run).
The environment is the same as in the calculation in the section Cost sensitivity test: EUR/USD, a position of 1.00 standard lot, pip value 10.00 USD, account currency USD.
Data: 36 months of one broker's minute quotes; of that, 24 months as the in-sample set and 12 months as the out-of-sample set, with the boundary fixed before tuning.
Number of trades in the in-sample set: 1,000; in the out-of-sample set about 500, because at the same trading frequency the validation period is half as long. The dollar column normalises every row to 1,000 trades so that the rows are comparable — for the fourth row it is therefore a normalised value, not the amount that would have fallen on the out-of-sample set itself. Number of parameter variants checked: 1,200.
Cost of a full round turn in the variant adopted in the example: spread 0.30 + commission 0.70 + slippage 0.20 = 1.20 pips. This is not a measured set, nor one typical for the market — it is a set chosen so that the calculation can be checked in your head.
Swap points: zero, because the example explicitly assumes an intraday strategy in which every position is closed before the change of the settlement day. For a strategy that goes through the rollover this row stops being zero and has to be added separately.
None of these numbers comes from a tester that was run. It is a construction showing the direction and order of magnitude of each of the four concessions — checkable with a calculator, but not a substitute for your own test.
The same set of rules after successive concessions are removed (illustrative values)
StepWhat is removedResult
(pips/trade)
1,000 trades
(USD, 1 lot)
0. Report from the optimisernothing — entry at the close of the signal candle, zero costs, top of the ranking, evaluation on the tuning period+2.60+26,000
1. An entry that can actually be executedlook-ahead: the entry shifted to the open of the next candle+1.20+12,000
2. Costs addedthe assumption of zero spread, commission and slippage0.000
3. Without the privilege of the top of the rankingthe median of 1,200 variants instead of the best of them, the same period and the same costs−0.45−4,500
4. Evaluation outside the tuning periodthe same frozen parameter set on the out-of-sample data−0.30−3,000

How to check every row. The dollar column is the result in pips multiplied by 10.00 USD and by 1,000 trades. Steps 0, 1 and 2 are one and the same parameter variant, from which one assumption is removed at a time, so the subtraction runs vertically: 2.60 − 1.40 = 1.20 and 1.20 − 1.20 = 0.00. Steps 3 and 4 are not further subtraction but answers to two different questions put to the same result — and that is why they are calculated separately, rather than tacked onto step 2.

Step 1 takes away 1.40 pips, that is, the part of the signal candle's move that the rule was claiming for itself by entering at a price known only at the moment of its close. It is no accident that after this correction exactly 1.20 pips gross are left: it is the same system whose sensitivity to costs is broken down by the next section. Step 2 shows where that sensitivity leads — after 1.20 pips of full round-turn cost are added, the result zeroes out to the cent.

Step 3 shows the gap between the selected result and the median of the tested variants. The top of a ranking of 1,200 variants is the highest of 1,200 values; its advantage over the median — here 0.45 pips per trade — illustrates selection, but does not by itself measure overfitting. A negative median across the whole ranking also does not prove that the selected point is a spike: assess its neighborhood and independent data. Step 4 evaluates the same frozen set on 12 months unseen by the optimizer, producing −0.30 pips per trade.

In this hypothetical calculation, removing three of the four concessions turned +26,000 USD into −3,000 USD converted to the same 1,000 trades, and that without changing a single rule of the strategy. The fourth — the privilege of showing the top of the ranking — remains untouched in the fourth row, because the same frozen parameter set works on the out-of-sample data; its gap from the median is shown separately in the third row, which answers a different question. All that changed were the assumptions about when you may enter, how much a trade costs, which variant you may show, and on which data you may evaluate it.

Model of an IS result and a variable OOS result after freezing the rules.
A decline is not inevitable; independent testing, stability and realistic costs matter.
Why “I tested it on twenty-eight pairs and it works on four” is not an argument. With a sufficiently large number of parallel attempts, some of them come out well by chance alone. Picking after the fact the ones that came out well and presenting them as the strategy's area of operation is selection on the basis of the result, not a conclusion from a test — this mechanism is described under the name data mining bias by item 9 in the bibliography. The honest record reads: 28 instruments were checked, all of them are reported, four came out positive. On top of that, pairs with the same quote currency are not independent samples — how to account for that dependence is explained by the article on correlation and portfolio risk.
Hypothetical correlation matrix of EUR/USD, GBP/USD and AUD/USD.
Each long contains a short USD leg; changing correlations do not guarantee a hedge.

5. Cost sensitivity test — the calculation step by step

This is the place where most strategies stop existing. The calculation below is not the result of a test that was run — it is a construction on explicitly stated assumptions that can be checked with a calculator. That is precisely why it is fit for showing the mechanism: there is no number here whose origin cannot be traced.

Assumptions of the calculation (illustrative values, not the result of a test).
Instrument: EUR/USD, 1 pip = 0.0001 of the price. Account currency: USD.
Position size: 1.00 standard lot, that is 100,000 EUR of notional. Pip value = 100,000 × 0.0001 = 10.00 USD (for EUR/USD the quote currency is USD, so the pip value is fixed in the account currency).
Distribution of gross results, before costs: 1,000 trades, of which 600 profitable at +8.00 pips and 400 losing at −9.00 pips.
Total gross profit: 600 × 8.00 − 400 × 9.00 = 4,800 − 3,600 = 1,200 pips, that is 1.20 pips per trade.
Gross profit factor = 4,800 / 3,600 = 1.33 (the sum of gross profits divided by the absolute value of the sum of gross losses).
Cost calculated for a full round turn — entry and exit together — and added to every trade.
Commission converted into pips: 3.50 USD per lot per side gives 7.00 USD per full round turn, that is 7.00 / 10.00 = 0.70 pips. The commission rate depends on the broker and the account type — here it is an assumed value, not a measured one.
Swap points: zero, and that is an assumption, not a measurement — the example concerns an intraday strategy in which the position does not go through the change of the settlement day. If it did, a separate row would have to be added to the cost column, and with the triple charge on a chosen day of the week it can exceed the spread.
None of the numbers in this table comes from a tester that was run or from a measurement on an account. All of them are illustrative and serve only to show how quickly costs eat a small per-trade edge.
The effect of the cost model on the same set of 1,000 trades (illustrative values)
Cost modelSpread
(pips)
Commission
(pips)
Slippage
(pips)
Total cost
(pips)
Net result
(pips/trade)
Net profit
factor
1,000 trades
(USD, 1 lot)
No costs0.000.000.000.00+1.201.33+12,000
Spread only0.300.000.000.30+0.901.24+9,000
Spread and commission0.300.700.001.00+0.201.05+2,000
Spread, commission, slippage0.300.700.201.200.001.000
Conditions worse than assumed0.600.700.501.80−0.600.86−6,000

How to check every row. The “total cost” column is the sum of the three columns to its left. The “net result” column is 1.20 pips minus the total cost. The dollar column is the net result multiplied by 10.00 USD and by 1,000 trades. The net profit factor is calculated from the same distribution after the cost is added to every trade — for instance at a cost of 1.20 pips the unit profit falls from 8.00 to 6.80 pips and the loss grows from 9.00 to 10.20 pips, which gives 600 × 6.80 = 4,080 pips of profits and 400 × 10.20 = 4,080 pips of losses, that is a profit factor of exactly 1.00. The sum of all costs in that row is 1,000 × 1.20 = 1,200 pips and equals the entire gross profit — which is why the result zeroes out to the cent.

Cumulative result over 1,000 trades by cost model (illustrative values) +12,000 +8,000 +4,000 0 −4,000 −8,000 0 250 500 750 1,000 number of trades cumulative result in USD, position 1.00 lot EUR/USD, pip value 10.00 USD cost 0.00 → +12,000 cost 0.30 → +9,000 cost 1.00 → +2,000 cost 1.20 → 0 cost 1.80 → −6,000
Five times the same set of 1,000 trades, five models of full round-turn cost given in pips. At a cost of 1.20 pips the line coincides with the zero axis — the whole gross profit goes on costs. Illustrative values, computed from the assumptions given above the table.

Two numbers from this calculation are worth remembering. First: the difference between the third and the fourth row is just 0.20 pips of slippage, and 2,000 USD in the final result. Second: between a test without costs and a test with costs at the level adopted in this example there is no small correction — there is the difference between a system that makes a profit and one that does not. Whether 1.20 pips is a realistic value for your strategy is settled solely by measurement on your own account; here it is a number chosen to fit the calculation, not read from the market. The smaller the average gross result per trade and the higher the trading frequency, the more abrupt that transition is. For a position strategy with an average result of a few dozen pips the same change in cost is marginal — which is why cost sensitivity has to be calculated for your own strategy rather than taken from someone else's example.

6. Look-ahead and data leakage — leaks from the future

Look-ahead bias is the use in a decision of information that was not available at that moment. Data leakage is a broader notion: it is every way in which knowledge of the future leaks into the process of building or evaluating rules. Both are dangerous because they do not look like an error — they look like a good result.

The places where a leak appears:

  1. Entry at the closing price of the signal candle. Described in section four. The fix: an entry no earlier than at the open of the next candle, or a signal computed exclusively from already closed data
  2. An indicator recalculated backwards. The Pine Script documentation defines repainting as a situation in which the behaviour of a script causes “historical vs realtime calculations or plots” to behave differently (item 4 in the bibliography, retrieved 22.08.2026). Not every such behaviour is a deception, but every one of them must be described before the result is treated as credible. The alert mechanism and the difference between history and real time are developed by the article on TradingView
  3. A centred indicator. Any construction that uses observations from t+k for the value at point t is useless for trading, even though it looks excellent on a historical chart
  4. Macro data after revision. A reading of an indicator in a version revised years later is not what was known at the moment of publication. If a rule uses macro data, it must use the data vintage available at the decision time, including revisions already released by then, and the actual publication time. The interpretation of the releases themselves is developed by the article on trading around data
  5. Selecting instruments with knowledge of the future. Testing exclusively on instruments that survived to this day, or that are known to have risen, introduces selection on the basis of the future. In currencies this concerns exotic pairs in particular, and periods when the exchange rate regime changed
  6. Preparing the data before splitting the sample. Normalisation, scaling or feature selection computed on the whole set carries information from the out-of-sample part into the in-sample part. The split into an in-sample and an out-of-sample set has to be the first operation, not the last
The signal delay test — a sensitivity test, not a decisive one.
Assumptions. The same set of rules and parameters, the same instrument, period, tick generation mode and cost model as in the baseline run. Exactly one thing changes: the moment of entry. Record the version of the code, the version of the platform and the identifiers of both reports, otherwise the comparison is not reproducible.
Procedure. Delay the whole signal by one full decision period and run the test again, changing nothing else. Repeat for a delay of two periods — a single point does not show the shape of the relationship.
Observed result. What you interpret is a comparison of three numbers: the result per trade with no delay, after one period and after two. No specific values are given here, because no run was carried out for the purposes of this article — you fill those three fields with your own numbers from your own reports.
Limitation. The disappearance of the result after a delay does not prove a leak from the future. The same picture is produced by a short-lived signal whose edge is exhausted within minutes, and by a signal sensitive to the execution price, for which one candle of difference is the whole expected entry. The test separates systems that are robust to the moment of entry from those that are not, and that is all that may be said about it.
What really settles it. A leak is ruled out by an availability audit: for every variable that enters the decision you write down at which point in time its value was known, and compare that with the moment the decision was made. A variable whose timestamp is later than the decision is a leak regardless of what the delay test showed — and conversely: an audit with no reservations closes the matter even if the result fell after the delay.

7. In-sample, out-of-sample and walk-forward

The principle is one sentence long and merciless: data used for tuning cannot at the same time serve as independent validation. Everything else follows from it.

The in-sample set (IS) is the stretch of history on which you may select parameters, test variants and change rules. The out-of-sample set (OOS) is the stretch you do not look at while doing that work. Both have to be separated in time — a random shuffling of observations from the whole period is not a split into IS and OOS, because a time series has memory and shuffling carries information in both directions.

The most important consequence of this split: the out-of-sample set loses independence when its result influences subsequent changes. If you look at the OOS result, judge it weak and change the strategy, then that stretch of data has stopped being OOS for everything you do afterwards. You can still use it — but as part of the in-sample set, not as independent evidence. There is no data on how often this mechanism ruins validations in practice, and there is no point pretending otherwise — it is enough that its effect is unambiguous: an OOS period used to change parameters is no longer independent evidence for the revised model.

The MetaTrader 5 tester has this split built in. The Forward setting takes the values No, 1/2, 1/3, 1/4 and Custom, and what is reserved is always the second, later part of the period (item 2 in the bibliography). That is convenient, because it makes it harder to peek into the out-of-sample set by accident, but it does not shift the window automatically — a walk-forward with many rounds has to be assembled by hand or in an external tool. State of the documentation checked on 22 August 2026.

Walk-forward: a window that moves

Walk-forward is the repetition of the same procedure on successive, shifted stretches of history. The point is that instead of one verdict you get a series of verdicts, and the stitched-together validation stretches form a run that the optimiser never saw as a whole.

  1. Fix the window lengths before the first run — for example 12 months of in-sample and 3 months of out-of-sample. Choosing those lengths after looking at the results is another form of tuning
  2. Optimise exclusively on the in-sample window and record the number of variants checked
  3. Apply the chosen parameters on the out-of-sample window without any change
  4. Shift both windows by the length of the out-of-sample window and repeat
  5. Evaluate the stitched-together validation stretches, not the optimisation results. How many of them came out positive, what the worst of them looked like, whether the parameters chosen in successive rounds resemble each other
Walk-forward: 12-month in-sample window, 3-month out-of-sample window In-sample: M1–M12 OOS M13–M15 In-sample: M4–M15 OOS M16–M18 In-sample: M7–M18 OOS M19–M21 Round 1 Round 2 Round 3 in-sample set (tuning) out-of-sample set (unchanged) You evaluate the stitched stretches M13–M21, not the optimisation results from the in-sample windows.
Horizontal scale: 25 pixels per month. The in-sample window takes 300 pixels (12 months), the out-of-sample one 75 pixels (3 months), and each round shifts both windows by 75 pixels, that is by the full length of the out-of-sample window. Thanks to that the validation stretches meet exactly and do not overlap.

Walk-Forward Efficiency, a measure introduced by Pardo (item 7 in the bibliography), is sometimes used as a shorthand indicator of how well a result holds up outside the in-sample set:

WFE = annualised OOS rate of returnannualised IS rate of return × 100%

For that number to mean anything, both rates have to be calculated after the same costs, in the same currency and under the same position sizing rule. With a zero IS return the ratio is undefined; with a negative one it does not usefully describe retention of a positive edge. Comparing WFE between systems with different definitions of return makes no sense. And a more important caveat: WFE is not a binary gate. A high WFE on twelve out-of-sample trades says less than a moderate WFE on four hundred. Look at it together with the number of trades, the distribution of results across the individual rounds, the drawdown and the behaviour once costs are raised.

8. Optimisation, parameter stability and Monte Carlo

Optimisation answers the question of which parameter set gave the best result on this data. It does not answer the question of which set will be good later. This is not a linguistic nuance — it is the difference between a description of the past and a forecast. Without a deployment record, this article cannot state how many systems fail for this reason. An optimizer ranks results on the supplied data; those results do not establish future performance.

Spike and plateau

Instead of looking at the best row of the ranking, look at its neighbourhood. If neighbouring values of the parameter give similar results, you have a plateau — an area in which the rule behaves similarly despite small changes in the settings. If the result collapses when the parameter is moved by one step, you have a spike, that is, most probably an accidental hit on a configuration of the historical data. Choosing a point from the middle of the plateau is usually more sensible than choosing the peak; this distinction and the whole walk-forward methodology come from Pardo's work (item 7 in the bibliography).

The same test is worth doing for the parameters that nobody usually optimises: trading hours, the minimum stop distance, a day-of-the-week filter. If the result depends on whether you trade until 22:00 or until 23:00 server time, check the filter’s economic rationale and stability outside the tuning period; the difference between hours alone does not prove overfitting.

The number of variants belongs to the result

When reporting a backtest, give the number of combinations checked alongside the result itself. This one habit distinguishes a description of a test from an advertisement. A methodical treatment of the multiple testing problem and of the probability that the best result is an artefact of searching is given by the work of Bailey, Borwein, López de Prado and Zhu (item 8 in the bibliography); a systematic description of selection on the basis of the result is given by Aronson (item 9).

Monte Carlo as a robustness test, not as a forecast

A simple and useful variant, described among others by Tomasini and Jaekle (item 10 in the bibliography): take the set of trade results from the validation stretches, draw new orderings many times over and compute the distribution of the maximum drawdown. What interests you is the right tail of that distribution — for instance the 95th percentile of the maximum drawdown, that is the value that 95 per cent of the simulated runs do not exceed. If that value exceeds the drawdown limit written into your risk plan, the assumed model and position size fail that risk criterion, even if the average looks favorable.

Two limitations have to be named explicitly. Reshuffling the order assumes that the trades are independent, and that is untrue if the strategy opens correlated positions or scales size according to recent results. And a second thing, usually formulated too broadly: reshuffling draws from results that have already occurred, so it will not generate a single trade from outside the observed distribution. That does not limit the maximum drawdown — on the contrary, the point of this simulation is precisely that a different ordering can concentrate existing losses into one sequence and produce a drawdown larger than the observed one. Monte Carlo therefore examines sensitivity to the order of events, not the range of possible individual events. The drawdown limit itself and the mechanics of halting trading are described by the article on drawdown and the kill switch.

Definitions without which metrics are not comparable. Profit factor: the sum of gross profits divided by the absolute value of the sum of gross losses — a quantity without a unit. Maximum drawdown: state whether it is calculated on the balance or on running equity, and whether in currency or in per cent — these variants can differ by a multiple for the same series. Expected value: in currency per trade or in units of risk R, never without stating which. Comparing these numbers between two tools without checking the definitions, the range of history and the treatment of deposits and withdrawals is comparing different quantities. How to read reports and where these definitions diverge is shown by the article on the trading journal and performance analysis.

9. Forward test, demo and market replay — what exactly they confirm

A forward test is sometimes described as the ultimate proof. It is not. It is a stage of validation that confirms something narrow and very specific.

A forward test on a reserved stretch of history confirms that the rules with fixed parameters gave a particular result on data the optimiser had not seen. It does not confirm the cost of execution or the behaviour in a different market regime.

A real-time forward test on a demo account adds two things: it checks whether the implementation works correctly during normal terminal operation and whether you are able to apply the rules without improvising. It does not measure the cost of execution to the extent that the demo server does not reproduce it — and what exactly it does reproduce is settled by the documentation of that broker and that account type, not by a general principle. Until you check that, a demo result describes a simulation whose execution assumptions have not yet been verified.

A forward test on an account with real capital, at minimal size adds a measurement of the cost of execution. With the caveat from section two: it measures it for the size you are trading. The decision to increase exposure does not belong to the testing procedure — it belongs to the risk management plan, and only if that plan allows it at all.

Hypothetical model of cumulative gross and net results after costs.
Use consistent cost units and avoid counting the spread twice.

Market replay

Replay reproduces history with the future hidden: you scroll bar by bar, make a decision, and only then see what happened. For discretionary strategies this allows you to collect a large number of repetitions without waiting in real time and without having to code the rules. Replay environments split into dedicated simulators with an order panel and statistics, and modes built into charting platforms — with the latter no longer being simple chart scrolling. TradingView today describes a separate Replay Trading mode in which “You can open positions and place limit, stop, and stop-limit orders, just like you would with a real broker”, and the results of a session are collected by the Overview, Performance, Trades analysis, Risk/performance ratios and List of trades tabs, of which “The Performance and List of trades can also be exported for further analysis or record-keeping” (item 5 in the bibliography, retrieved 22.08.2026).

Non-standard charts compute a result at prices that never existed in the market. If you test a rule on Heikin Ashi, Renko, Kagi, Line Break or Point & Figure, the prices at which the emulator fills orders are not market prices. The TradingView documentation says so explicitly: “Because of the inherently synthetic nature of price levels on non-standard charts, backtesting results calculated on them will typically not produce results representing real market conditions” (item 15 in the bibliography, retrieved 22.08.2026). For Heikin Ashi there is a workaround — the Using standard OHLC setting in the strategy properties computes the signal on synthetic data but fills orders at real prices. For the remaining chart types there is no workaround. The vendor formulates the consequence cautiously — it writes “typically not”, not “never” — and that caution should not be taken away from it. It does not, however, change the practical decision: until you demonstrate that in your case the synthetic prices coincided with market ones, the result cannot be converted into money.

What replay does not give. It does not give the cost of execution, because fills are assigned by the simulator according to its own rules — and those rules have to be known before the result of a session is treated as anything more than an exercise. Nor does it give the pressure of a real loss. It does have one drawback specific to itself: it is easy to cheat in it without noticing. Undoing the last decision, repeating a stretch, “once more, because this time I saw it differently” — every such operation turns a test into a story. If a replay session is to be data, it has to have rules written down before the start and a record of all decisions, including the bad ones.

Chart-replay model with the future hidden and decisions recorded.
Replay tests rule application; it does not reproduce all live execution conditions.
Tick volume is not market volume. In the spot currency market there is no centralised turnover, so the volume shown in a terminal is the number of quote changes in a given feed. It is a measure of one provider's activity, not of market turnover. A rule based on volume understood that way will behave differently at another broker, and in a historical test it uses a record that cannot be compared between sources.

10. Testing tools — a comparison by criteria

There is no tool that closes all the stages. The table below compares them by the criteria that actually decide the choice, rather than by the number of features.

Testing environments by selection criteria
ToolWhat it testsData sourceIn-sample / out-of-sample splitRequires codeMain limitation
MetaTrader 4 — Strategy TesterAn automated system in MQL4 on a single instrumentThree modelling modes: Open prices only, Control points, Every tick (item 14)Manual, through the date rangeYes (MQL4)Movement inside the candle is computed from lower-timeframe data, not read from a tick stream; the modelling quality bar shows which timeframe was used
MetaTrader 5 — Strategy TesterAn automated system in MQL5, also multi-instrumentFive tick generation modes, including ticks collected by the broker (item 2)Built in (Forward: 1/2, 1/3, 1/4, Custom) (item 2)Yes (MQL5)The availability and depth of real ticks depend on the broker, and where the archive has gaps the tester fills the run in with modelled ticks (item 1); the walk-forward window does not move by itself
cTrader — cBot backtestAn automated system in the cTrader Algo environmentFour modes: Tick data from server, M1 bars from the server, M1 bars in CSV file, H1 bars from the server (item 6)Manual, through the date rangeYesCommission set per million units traded, spread as a fixed value or drawn at random from a given range — the cost model is therefore simplified and has to be set deliberately
TradingView — Pine strategies and Replay TradingRules in Pine Script and the practice of making decisions on a chart, with a record of positions and export of session results (item 5)Data of the provider selected on the chartManualPartly (Pine for strategies, replay without code)Fills are assigned by an emulator; behaviour on history and in real time can differ (item 4); on non-standard charts the fill prices are synthetic and the result usually does not describe the market (item 15)
Dedicated replay simulatorsDiscretionary strategies, decision by decisionData packages supplied with the tool; at one of the providers checked, the documentation states tick data with a variable spread — at others the scope can differ and has to be read separately (item 11)ManualNoFills are assigned by an emulator, so it does not measure the real cost of execution — even where the provider lets you set a variable spread and a commission; the fill rules themselves are not described by the checked provider's documentation (item 11); it is also easy to repeat a stretch and spoil the sample
Result analysers (report import)Finished reports from a tester or from an accountThe input fileDepends on the toolNoIt does not run a test — it inherits all the errors of the source
Python (backtesting libraries)Any logic, full control over the sample splitAny, along with responsibility for the qualityFull, any schemeYesThe whole methodological correctness rests on you — see the article on Python in trading
On prices and plan limits. Licence prices, the scope of free plans and the availability of replay modes belong to the variable layer of a product rather than to its architecture, and they differ between regions — which is why they are not in the table and why there is no figure here about how often they change, because it has not been counted. Before buying, check the current price list at the tool's vendor and verify whether the feature you need — for example replay on lower timeframes or export of the trade list — is included in the plan you choose. A comparison of the trading platforms themselves, without the testing part, can be found in the article on MT4, MT5 and cTrader.

The choice comes down to three questions. Can your rules be written in code? If not, you need a replay environment, not a tester. Do you need real ticks? If the rule depends on the order of events inside a candle — yes, and that settles the choice. Do you want to control the sample split scheme? If so, sooner or later you will end up with your own code, because the built-in splits are deliberately simple.

11. Reproducibility protocol and a credibility checklist

A test that cannot be repeated is an opinion written down in numbers. The set of fields below is the minimum from which you in six months' time, or somebody else, will reproduce exactly the same run. If any field cannot be recovered, that has to be named as a limitation rather than skipped.

Test reproducibility protocol — mandatory fields.
1. The version of the rules or the code and the date it was frozen. 2. The full set of parameters. 3. The instrument and the exact symbol at the broker, including the suffix. 4. The data source and how it was obtained. 5. The date range. 6. The time zone of the data and the server time. 7. The candle timestamp convention. 8. The tick generation mode. 9. The spread model. 10. The commission rate and how it is charged. 11. Swap points, if positions go through the change of day. 12. The assumed slippage and execution latency. 13. The rule for filling pending orders adopted by the tool — the moment at which a limit is deemed filled, the price of that fill and the way a jump is handled with a stop order. 14. The starting capital and the account currency. 15. The position sizing rule. 16. The version of the platform or of the testing library. 17. The split into an in-sample and an out-of-sample set together with the boundary dates. 18. The number of parameter variants checked. 19. The identifier of the report or of the output file.
Validation sequence: the data split comes before tuning 1. RULES FROZEN rules and parameters written down before the test 2. DATA AND SPLIT IS/OOS boundary fixed before tuning 3. TEST AND TUNING tuning on IS only costs and data disclosed 4. OUT-OF-SAMPLE SET OOS, frozen parameters looked at once 5. STABILITY parameter grid plateau, not spike 6. FORWARD / DEMO outside the fitting period rules kept? 7. EXPOSURE minimal and optional if the risk plan allows REPLAY discretionary branch not a stage of the sequence a deviation sends you back to the data split The data split and the freezing of the rules precede tuning — not the other way round. Replay is a separate training branch for discretionary strategies, not part of the forward test.
Seven stages in the order that follows from the data split rule: rules frozen before the test, the boundary between the in-sample and the out-of-sample set fixed before tuning begins, tuning exclusively on the in-sample set, only then evaluation on the out-of-sample set, then parameter stability, a forward test on a demo account and finally optional minimal exposure on a live account. Replay hangs on a separate, dashed branch at the data stage — it is a training tool for discretionary strategies, not a stage of this sequence nor an equivalent of a forward test. The return path leads to the data split stage, not to a change of position size.

Backtest credibility checklist

Eleven questions that you put to somebody else's result and to your own in exactly the same way. The answer “I don't know” is a negative answer.

  1. Is the instrument, the exact symbol, the period and the data source stated?
  2. Is the tick generation mode stated, and does it match the strategy's horizon?
  3. Is it known at what price the tester fills limit and stop orders — and was that checked in the tool's documentation rather than assumed?
  4. Does the result account for spread, commission, swap points and assumed slippage — and does each of them have its unit stated?
  5. Does the result survive raising the cost by an amount of the order of the average slippage measured on the account?
  6. For every variable that enters the decision, is the moment at which its value was known written down, and is none of those moments later than the decision itself? A test of delayed entry complements this audit; it does not replace it
  7. Is the split into an in-sample and an out-of-sample set stated together with the boundary dates?
  8. Was the out-of-sample set looked at only once, after the parameters were frozen?
  9. Is the number of parameter variants checked stated?
  10. Does the result hold in the neighbourhood of the chosen parameters, and not only at a single point?
  11. Do the number of trades and the length of the period cover more than one market regime, given that the conclusion is meant to be general?

The worst way in which this procedure breaks down is not the omission of one of the points but carrying them out in the wrong order: first the result, then the justification. The order here is a condition of sense, not a preference — points seven and eight settled after looking at the result can no longer be settled honestly. Rules written down before the test, sample boundary dates fixed before optimisation and the number of variants noted as you go cost a quarter of an hour, and they are what separates validation from the search for a pretty chart.

Once the procedure is written down, the next step is often to move it out of clicking in a tester and into code that carries it out repeatably and keeps track of the sample split by itself. From that point begins the subject of a separate article — Python in trading, where reproducibility of the environment matters as much as reproducibility of the test itself.

FAQ — testing a strategy before going to market

Is a demo account enough to establish that a strategy makes a profit?
No, and not because of psychology but because of mechanics. A demo server simulates execution according to rules set by the broker, and those rules usually omit or simplify part of the real costs — at one provider it will be slippage, at another additionally rejections or partial fills. The extent of that simplification has to be read from the documentation of the specific account rather than assumed: IG, for example, writes explicitly about its own demo that trades “will not be subject to slippage” and will never be rejected “on the grounds of size or price” (item 16 in the bibliography, article dated 29.05.2026), but that is a description of one provider, not a rule of the market. Demo answers a different question: whether the implementation works and whether you are able to apply the rules. Execution costs omitted by the demo model can be observed only when an order is actually executed on a live account.
How many trades are needed for a result to mean anything?
There is no single number, and it cannot be given without a calculation. The required sample is derived from the relationship between the average result per trade (m) and the standard deviation of a single result (s): the standard error of the mean is s divided by the square root of n, so for that error to be k times smaller than the mean itself, you need n greater than (k times s/m) squared. Take the illustrative distribution from section five: 600 profits of +8.00 and 400 losses of −9.00 pips give m = 1.20 pips and s = 8.33 pips, and at k = 2 this gives n greater than (2 × 8.33 / 1.20) squared, that is about 193 trades. Change the distribution and the number changes with it — for a strategy with rare large profits and frequent small losses, s grows and the required sample grows quadratically. This calculation assumes independence and a stable distribution of trades, and in practice both assumptions can be false, so treat the result as a lower bound, not as a threshold. A complementary criterion that no number replaces: whether the sample covers more than one market regime.
Does walk-forward eliminate overfitting?
It does not eliminate it, it limits it. Walk-forward forces evaluation on data the optimiser did not see in a given round, but you can still overfit the scheme itself: by choosing the window lengths after looking at the results, by repeating the whole procedure with different logic until it works, or by changing the strategy after seeing the validation stretches. After every such change the validation stretches so far stop being independent.
What exactly does it mean that a backtest does not account for costs?
That it describes a different system from the one you intend to trade. In the illustrative calculation from section five — of which no number comes from a test that was run — the same series of 1,000 trades gives +12,000 USD without costs and 0 USD once a spread of 0.30 pips, a commission of 0.70 pips and slippage of 0.20 pips are added, assuming the position is closed before the change of the settlement day, that is at zero swap. The difference does not come from the market but from the assumptions of the test. The smaller the average gross result per trade, the more abruptly this mechanism works.
Can market replay replace a test on an account with real capital?
No. Replay lets you collect many repetitions without waiting in real time and test discretionary strategies without coding the rules. It does not, however, measure the cost of execution — fills are assigned by an emulator according to its own rules — and it lets you undo a decision, which without discipline turns a sample into a collection of selected fragments.
Do real ticks solve the problem of backtest quality?
They improve it in one dimension: where real ticks actually exist, the order of events inside a candle stops being guessed. That does not mean nothing is generated — the MetaTrader 5 documentation describes the fallback behaviour explicitly: “If a symbol history has a minute bar with no tick data for it, the tester generates ticks in the »Every tick« mode” (item 1 in the bibliography, retrieved 22.08.2026). Where the broker's archive has holes, part of the run is therefore reproduced with modelled ticks, without any separate marking in the report. The remaining limitations are not solved by this mode. Real ticks in a tester are a record of one provider's stream, of a given depth of history and of a quality that depends on how they were collected. They contain no information about the liquidity available at your level, about rejections or about the latency of your connection. A test on real ticks without an execution cost model is still a test of perfect execution.

Sources and bibliography

  1. MetaQuotes — MetaTrader 5 Help: Real and Generated Ticks, metatrader5.com/en/terminal/help/algotrading/tick_generation (retrieved 22.08.2026) — tick generation modes and the principle of replacing missing real ticks with modelled ones: “If a symbol history has a minute bar with no tick data for it, the tester generates ticks in the »Every tick« mode”
  2. MetaQuotes — MetaTrader 5 Help: Strategy Testing — tester settings, forward testing and delay emulation, metatrader5.com/en/terminal/help/algotrading/testing (retrieved 22.08.2026) — the Forward setting in the variants No, 1/2, 1/3, 1/4, Custom and the principle: “if an EA uses pending orders, delays are only applied to order placing but not to order execution”
  3. MetaQuotes — MQL5 Reference: Testing Trading Strategies, mql5.com/en/docs/runtime/testing (retrieved 22.08.2026) — “During testing, the spread is not modeled but is taken from historical data”
  4. TradingView — Pine Script User Manual: Repainting, tradingview.com/pine-script-docs/concepts/repainting (retrieved 22.08.2026)
  5. TradingView — Help Center: Learn to trade on historical data (Replay Trading), tradingview.com/support/solutions/43000691889 (retrieved 22.08.2026) — “You can open positions and place limit, stop, and stop-limit orders, just like you would with a real broker”; the Overview, Performance, Trades analysis, Risk/performance ratios and List of trades tabs, where “The Performance and List of trades can also be exported for further analysis or record-keeping”
  6. Spotware — cTrader Algo: Backtest a cBot, help.ctrader.com/ctrader-algo/documentation/cbots/backtest-a-cbot (retrieved 22.08.2026) — four data modes: “Tick data from server”, “M1 bars from the server”, “M1 bars in CSV file”, “H1 bars from the server”; commission as a “commission rate per million traded units”; spread in the “Fixed Value” and “Random” variants
  7. Pardo, R. — The Evaluation and Optimization of Trading Strategies, Wiley, 2nd ed., 2008 — walk-forward, Walk-Forward Efficiency, the parameter plateau, methodology of testing systems
  8. Bailey, D.H., Borwein, J.M., López de Prado, M., Zhu, Q.J. — The Probability of Backtest Overfitting, Journal of Computational Finance, 2017 — multiple testing and the probability that the best result is an artefact of searching
  9. Aronson, D.R. — Evidence-Based Technical Analysis, Wiley, 2007 — data mining bias, selection on the basis of the result, statistical validation
  10. Tomasini, E., Jaekle, U. — Trading Systems: A New Approach to System Development and Portfolio Optimisation, Harriman House, 2009 — walk-forward, Monte Carlo, portfolio-level testing
  11. Forex Tester Software — Forex Tester Online: Support Center, help.forextester.com (retrieved 22.08.2026) — the scope of the data supplied with the tool: “Yes, we provide tick data and form candle sticks based on it”, “Data on price changes per minute, including: Open, High, Low, Close prices, and Volume (trading activity). Tick data provides detailed data on every price change of a financial symbol, as well as floating spread”; cost parameters: “Forex Tester Online supports testing strategies with variable spreads and commissions”. The rules by which the emulator assigns a fill price are not described by this documentation. The address previously cited, forextester.com/documentation, returns a 404 page (checked 22.08.2026) and has been replaced
  12. Reserve Bank of Australia — Statement on Monetary Policy, February 2019, Box B: The Recent Japanese Yen Flash Event, rba.gov.au/publications/smp/2019/feb/box-b-the-recent-japanese-yen-flash-event.html (content retrieved 22.08.2026) — “At 9:36 am AEDT, over the span of about 30 seconds, and in the absence of any material news, the yen appreciated by 3 per cent against the US dollar”; “Bid-ask spreads also widened substantially from around 2 pips to 100–300 pips”; “market liquidity was seasonably low at this time of the day and year”
  13. MetaQuotes — MetaTrader 5 Help: Testing Features, metatrader5.com/en/terminal/help/algotrading/testing_features (retrieved 22.08.2026) — the Order Triggering and Execution section, two consecutive paragraphs with disjoint scope. The first paragraph, which applies to the currency market: “For non-exchange instruments, triggering of all kinds of pending orders and SL/TP is performed by Bid and Ask prices. Execution is performed by the current Bid and Ask market prices at the moment of triggering”. The second paragraph, exclusively about exchange instruments: “Limit orders are executed at the price specified in the order (without a slippage), while orders of other types are executed at the current Bid and Ask market prices (slippage is possible)”. The same page, on the simplified modes: “In the »Open prices only« and »1 minute OHLC« testing modes, pending orders, as well as SL and TP are executed at the prices specified in the orders”
  14. MetaQuotes — MetaTrader 4 Help: Strategy Tester — Tester Settings, metatrader4.com/en/trading-platform/help/autotrading/tester/tester_parameters (retrieved 22.08.2026) — the Open prices only, Control points and Every tick modes; the last of these “uses for generation not only data of the nearest less timeframe, but also those of all available nearest timeframes”, and the modelling quality bar shows which timeframe was used
  15. TradingView — Help Center: Strategy produces unrealistic results on non-standard chart types, tradingview.com/support/solutions/43000481029 (retrieved 22.08.2026) — “Because of the inherently synthetic nature of price levels on non-standard charts, backtesting results calculated on them will typically not produce results representing real market conditions”
  16. IG — How does a demo account differ from a live account?, ig.com/uk/help-and-support/articles/687034 (article dated 29.05.2026, retrieved 22.08.2026) — the description concerns exclusively this provider's demo account: “Trades made through the demo account will not be subject to slippage, interest and dividend adjustments, or out-of-hours price movements” and “Trades may be rejected if you have insufficient funds to open them, but, unlike on a live account, will never be rejected on the grounds of size or price”

Your learning progress

Finished this lesson? Mark it yourself. Opening or scrolling a page never marks it complete.

Progress requires JavaScript and browser storage.

Saved only in this browser. No account or cross-device sync. Clearing site data can erase your progress.

Jarosław Wasiński

Editor-in-chief, ForexMechanics.com • Macro & FX analyst

Independent analyst and practitioner with over 20 years of experience in financial markets. Actively involved in Forex since 2007, with a focus on fundamental analysis, OTC market structure, and disciplined capital risk management.

  • Creator and editor-in-chief of MyBank.pl, providing reliable financial education since 2004.
  • Author of hundreds of in-depth market commentaries, structural analyses, and educational materials for traders and investors.
  • Advocate for market transparency, promoting education grounded in hard data and institutional reports (BIS, ESMA, CFTC).

Full author profile, credentials & published research →

All content is educational and informational only – it does not constitute investment advice or a recommendation. Remember: leveraged trading (Forex/CFD) carries a high risk of rapid capital loss.