Can a neural network find an edge on gold H1? A walk-forward test with the answer fixed in advance

15 November 2026, 04:06
Hiroaki Yuhara
0
15

I wanted to know whether a neural network can find a tradable edge on gold H1 that simple rules cannot. Before running anything I wrote down the pass criteria, then ran a walk-forward test. The answer was no. Here is how it was done, so that you can check it or repeat it.

Data and trade rules

  • HistData.com XAUUSD M1 (bid), 2010 to 2025, aggregated to H1.
  • Entry at the close of a closed H1 bar. Stop 1.5 x ATR(14), target 3.0 x ATR (1:2), at most 72 hours, a bar that touches both counts as a stop. Cost 0.17 USD per trade.
  • Features (no future information): returns over several horizons divided by ATR, distance to three moving averages, ATR ratios, position in the 24 and 120 bar range, hour and weekday, candle body and wicks.

Walk-forward

For each test year from 2014 to 2025 the models were trained only on the years before it (the last 5 days removed, because trade labels overlap). The test year was never used to tune anything. A model trades a direction only if its predicted expected value is above +0.15R, one position at a time. Models: LightGBM and a small neural network (two hidden layers, three random seeds averaged). Controls: the same models trained on shuffled labels, a rule that buys every bar, and a rule that buys above the 200 bar average.

Pass criteria, fixed in advance

  1. At least 200 trades.
  2. Mean of at least +0.10R per trade.
  3. The 95% block-bootstrap confidence interval (by month) above zero.
  4. At least 8 of 12 years positive.
  5. Better than the shuffled-label control by 0.05R.
  6. Better than the best simple baseline by 0.05R.

Result

MethodTradesMean per trade95% intervalPositive years
LightGBM3,753-0.029R-0.074 to +0.0177 of 12
Neural network2,010+0.047R-0.014 to +0.1107 of 12
Buy every bar5,725+0.020R7 of 12
Buy above the 200 bar average3,413+0.045R7 of 12

Neither model passed. The neural network made +0.047R per trade, the same as the simplest trend rule (+0.045R), and its interval includes zero. It was strong in 2014 to 2017 (+132R in total) and slightly negative from 2018 to 2025 (-39R). That split was not part of the criteria, so I do not read much into it.

What I take from it

  • Recognising a pattern in past prices is easy for a neural network. Finding a pattern that still pays after costs, in data that were not used for training, is the hard part.
  • Fixing the criteria before the run matters: with a free choice of settings afterwards, some combination will look good.
  • This is one setup on one symbol and timeframe. Other targets, features or timeframes may behave differently. It is not a statement that no edge exists.

Past data only; nothing here is a forecast or advice.