The rules tested

The strategy buys USD/JPY when the price closes above the highest high of the previous 20 bars, and sells when it closes below their lowest low. Stop loss at 2 ATR, take profit at 4 ATR, 1% of the account at risk per trade, on 4-hour bars.

Instrument
USD/JPY
Timeframe
4 hours (H4)
Entry
close above the highest high or below the lowest low of the previous 20 bars
Filters
none
Stop loss
2 times the 14-bar ATR
Take profit
4 times the 14-bar ATR
Other exits
none
Risk per trade
1% of the virtual account, position size set from the stop distance
Costs
spread actually recorded hour by hour, slippage of half a spread on every stop, no commission; swaps not included
Period tested
from August 1, 2022 to September 25, 2026

Edit this strategy in the lab

The button opens the lab with exactly these settings: change one, run it again and compare.

Two periods, two verdicts

The lab splits every test in two: the first 70% of the period is used to design the strategy, the final 30% to check it. Here the design period, from August 1, 2022 to June 27, 2025, gives +15.3% over 169 trades. The out-of-sample period, from June 27, 2025 to September 25, 2026, gives -13.1% over 77 trades. The lab then shows its most serious warning: the result does not hold out of sample.

Cumulative result in % of the virtual account, trade after trade, with 1% risk per trade. Hypothetical. Shaded area: out-of-sample period.

The year-by-year split tells the same story, in multiples of the risk taken per trade: +10.9 R over the last months of 2022, +0.6 R in 2023, +12.6 R in 2024, then -8.5 R in 2025 and -12.8 R in 2026.

What a single figure would have hidden

Over the whole period the rule ends at +0.2%. On its own, that figure describes a neutral strategy, neither good nor bad. In fact it adds up a period in which the rule worked and a period in which it stopped working. Anyone designing it on June 27, 2025, looking back over the previous three years, would have seen a winning rule; what came next would have proved them wrong.

As on gold, longs carry the whole result: +25.5% for the 139 longs, -20.1% for the 107 shorts. Costs also weigh more than on gold: without spread or slippage, the rule would have made +10.5% instead of +0.2%.

The sensitivity test hinted at it

The sensitivity test already pointed to a fragile result. With a 10-bar range, +34.6%; with 15, +4.0%; with 20, +0.2%; from 25 to 40 bars, losses. A sound rule gives similar results for similar settings. This one slides from a clear gain to a loss as the setting changes, which often means the result depends on the period more than on the rule.

Compare with the same breakout on gold (XAUUSD), which makes money in both the design and the out-of-sample periods. And in the lab, you can narrow the test period year by year to see how much the verdict depends on the years you keep. Our article on how to verify a forex EA track record explains why a live history, over a period nobody could pick after the fact, remains the only proof that counts.

Design period against out-of-sample

Design period: Aug 1, 2022 to Jun 27, 2025

Result
+15.3%
Trades
169
Maximum drawdown
10.0%
In R
+16.1 R

Out-of-sample: Jun 27, 2025 to Sep 25, 2026

Result
-13.1%
Trades
77
Maximum drawdown
19.5%
In R
-13.3 R

Tune the strategy while looking at the design period, then judge it on the out-of-sample period, which played no part in the tuning. A wide gap between the two often means the settings were fitted to the past.

Sensitivity of the main setting

Result over the period (in %) as the number of bars in the range changes, every other setting unchanged. Outlined bar: your setting. A result that only holds for one exact value is fragile.

Year by year

YearTradesResult (R)
202222+10.9 R
202353+0.6 R
202468+12.6 R
202554-8.5 R
202649-12.8 R

In R, the multiple of the risk taken on each trade: a yearly total cannot be read as a % of the account, since gains and losses compound from one year to the next.