What the lab does
The lab tests a simple trading rule on a broker's real price history, without a line of code. You choose an entry signal (moving average crossover, RSI, range breakout), filters (trend, session, direction), exits (stop loss and take profit in ATR or pips, opposite signal, maximum holding time) and the risk per trade. The engine then replays the rule hour by hour, charging the costs a live account would have paid. To get started, four textbook strategies fill in the form in one click.
It contains no QuantStone strategy and does not suggest one. Its purpose is educational: seeing, on real data, what a trading idea turns into once costs, gaps and the order of trades are accounted for. Plenty of simple rules lose money here once the spread is paid, which is worth knowing in itself; our article on whether forex trading robots actually work looks at why.
Six strategies through the lab
To show what the lab reveals, six textbook rules were tested in detail, losers and winners alike, with their full figures and what each one teaches:
- EUR/USD moving average crossover: +20.6% before costs, -19.1% after: costs wipe out a small raw edge.
- 20-bar breakout on gold (XAUUSD): +33.9%, but longs made +56.8% and shorts -14.6%: gold's rally did the paying.
- 20-bar breakout on USD/JPY: +15.3% in the design period, -13.1% afterwards: the rule does not hold out of sample.
- Asian range breakout on GBP/USD: -76.5% over 974 trades, and already -34.4% before costs: no edge to capture.
- 10/30 EMA crossover on gold (XAUUSD): +7.0% with a 30-bar slow average, -22.6% with 26 and -11.7% with 38: a fragile result.
- The rollover minute, on a 14-period RSI (EUR/USD): -7.0% with tradable minutes only, +1.9% when midnight is treated as an ordinary minute.
Reading the results
The result over the period
The headline figure is the total result over the tested period, as a percentage of a virtual account. Each trade risks the share of the balance you chose, 1% by default, and gains and losses compound from one trade to the next, as they would on a real account. The figure covers the tested period and nothing else: it is never converted into a monthly or yearly average. It depends directly on the risk per trade, since a higher risk magnifies gains and losses alike, drawdowns included. The virtual account used to size positions does not stand for any real account. Like everything the lab shows, this result is hypothetical: it describes what the rule would have done on past data, not what it will do.
Results in R
The detailed results also give R, the result expressed as a multiple of the risk taken on each trade. A trade that hits its stop costs about -1 R, and a trade that reaches a target set twice as far away earns about +2 R. R does not depend on the risk you chose or on the account size, which makes it the unit for comparing two rules with each other.
Design period and out-of-sample
The tested period is split in two: the first 70% for design, the final 30% as a check. If you keep adjusting the settings until the curve looks good, you will always find one; randomness in past data is enough. The out-of-sample part, which played no role in the tuning, tells you whether the rule holds beyond the data it was built on.
Sensitivity
The lab reruns the strategy while moving its main setting from half to twice your value. A sound rule gives similar results for similar settings. If only your exact value works, it is almost always a coincidence.
Monte Carlo
A backtest only ever saw one order of trades. The Monte Carlo simulation, the same one used by the EA backtest analyzer, replays those trades thousands of times in a different order and reports the median drawdown, the drawdown in the worst 5% of scenarios and the chance of reaching your own loss limit.
Method
The data
The price history comes from a broker's MetaTrader 5 server, for a commission-free account where the cost is the spread: bid prices in one-hour bars for EUR/USD, GBP/USD, USD/JPY and gold, from August 2022 to September 2026. Four-hour bars are built from the hourly ones and aligned on server time, as in MetaTrader. Before July 2022 this server keeps only one bar per day, so we chose four years of reliable hourly data over a longer, reconstructed period. The bars stay on our server, which only sends back results.
Execution
- Signals are read when a bar closes; the order goes out at the first tradable price of the next bar. Buys fill at the ask, which is the bid plus the spread.
- One position at a time, no scaling in.
- Stop loss and take profit are checked hour by hour, including for four-hour strategies. If both are hit within the same hour, the lab counts the stop: the sequence of prices inside an hour is unknown, so we take the unfavorable case.
- When the price jumps a level between two quotes (Monday open, economic release), a stop fills at the opening price, which is worse, and a target fills at its level, never better.
- Position size is set by the risk per trade (1% by default). The stop loss and take profit must be at least five times the instrument's typical spread, so the lab never simulates unrealistic scalping.
- The London and New York sessions run from 8 a.m. to 5 p.m. local time in each city, each with its own daylight saving time. The session filter only applies to entries: an open position stays subject to its exits around the clock.
- The Asian range is the high and low from midnight to 7 a.m. London time. The first hourly close outside it between 7 a.m. and 4 p.m. triggers the entry, at most once a day.
- Indicators are computed as in MetaTrader: exponential average seeded with the first price, Wilder's RSI, and ATR as the simple average of the true range.
Costs
The spread charged is the one the server actually recorded, hour by hour, rather than a flat average. We recalibrated it on real ticks, because the spread stored in one-minute bars slightly understates what an order meets at a random moment, by 3 to 9% depending on the instrument. Every stop also takes slippage equal to half of that hour's spread. Swaps, the financing charged on positions held overnight, are not included, but the lab tells you how many trades and nights they would have applied to.
One exception: the spreads recorded from August to December 2022 are unusable. In August, with no minute data, the server shows a placeholder spread of 5 pips; from September to December it recorded 0 to 0.1 pips on the currency pairs, far less than a commission-free account pays. For those hours, and for any hour whose recorded spread falls below half the usual spread for that time of day, the lab applies that usual spread, measured across the whole history. The correction mostly affects late 2022, between 2,200 and 2,400 hours per currency pair, then a few dozen hours a year, slightly more on gold in early 2023. The comparison with the MetaTrader 5 strategy tester below uses the spreads as recorded, since those are what the tester uses.
The rollover minute
Every day at midnight server time (5 p.m. in New York), the currency market rolls from one value date to the next. During the first minute of the new day the server keeps publishing quotes but refuses orders, and that is exactly when spreads are at their widest. On EUR/USD on May 13, 2024, the spread reached 8.3 pips at midnight and 11.5 pips at the first price where an order was accepted, averaging 6.3 pips over the hour against roughly 1.2 pips for the rest of the day. For gold, the trading session only reopens an hour later.
A backtest that only looks at one-hour bars treats those quotes as tradable: it triggers stops on spikes where no order could have been filled, and it misses what an order sent at midnight really costs. The lab therefore isolates, within each hour, the minutes when the broker accepts orders. Fills, stops and targets are read on those minutes only, and a strategy that enters at midnight pays the spread actually available at that moment.
Checked trade by trade against the MetaTrader 5 strategy tester
We ran the lab's engine side by side with the MetaTrader 5 strategy tester on the same price history, with six strategies covering every building block of the lab: moving averages, RSI, breakouts, the Asian range, trend and session filters, ATR and pip stops, opposite-signal and time exits, fixed and risk-based position sizing. The tester ran in "1 minute OHLC" mode from January 2023 to August 2026.
Every one of the 2,746 trades MetaTrader produced was found in the engine, one for one, with the same entry hour and direction, and the engine produced no extra trade. 2,250 match to the point: entry and exit prices, size, times and result. Each remaining difference has a known cause: a stop jumped by a gap, which the engine fills at the opening price while the tester fills it at the stop level; a stop loss and take profit hit within the same hour, where the engine counts the stop; a one-point rounding difference on a level; or a different position size because the balance had drifted after one of those differences, with the sizing rule itself unchanged. Rounding aside, no price difference favors the engine. The ATR computed by the engine matches MetaTrader's to the point.
Limitations
- Four years of data cover several market regimes, not all of them.
- One-hour bars do not show the order in which prices moved inside the hour, so the lab assumes the unfavorable case, which penalizes strategies with tight stops and targets.
- The data comes from a single broker; another broker's spreads and prices differ slightly.
- In live trading, latency, liquidity and slippage vary from one order to the next, especially around economic releases. No result is guaranteed, and a backtest is no substitute for a verifiable live track record.
To go further on how automated strategies work, from signal to execution, see our guide on how automated forex trading robots work.