Markets › Metals · XAUUSD spot (broker data), 5-minute

Gold 5-Minute Trend Pullback Strategy Backtest: EMA 20/50 With a 200 EMA Filter on XAUUSD

Trade gold only in the direction of the 1-hour 200 EMA, wait on the 5-minute chart for the EMA 20 to sit above the EMA 50, buy the pullback to the EMA 20 once a candle closes back up, stop under the pullback, take 1.5R or 2R, London and New York mornings only. We wrote the rules down, set a minimum stop, and backtested them on XAUUSD from 2007 to 2026 with costs and against random days.

XAUUSD · 5-minute and 1-hour bars from 1-minute data · 200 EMA trend, EMA 20/50 alignment, pullback and confirmation candle, $2 minimum stop, 1.5R or 2R; long and short separately · Protocol v1.0 plus the 8 Oct 2026 rules

Buried · No proven edge

It waited for the pullback. The pullback was random.

BornFrozen 28 Oct 2026 (mtp_spec.md), before any signal was computed
Died28 Oct 2026

Variants tried: 4 · Passed every gate: 0 · Best: 1 of 6 · Holdout opened: yes (already used)

Short answer: not in our test. A 5-minute pullback to the EMA 20 in the direction of the 1-hour 200 EMA, with the EMA 20 above the EMA 50 and a confirmation candle, made -$0.33 an ounce a trade on the long side and -$0.21 on the short side on gold from 2007 to 2026, after $0.30 of costs, with a $2 minimum stop. The entries did no better than random days.Compare all 17 gold strategies we tested →

00The verdict in three lines

  • Does the 5-minute EMA pullback strategy work on gold? Not in our test: the longs made -$0.33 an ounce a trade with a 1.5R target (2,423 trades, 2007 to 2026) and the shorts -$0.21 (1,988 trades), after $0.30 of costs; the 2R versions did no better.
  • Not a cost problem first. With a $2.00 minimum stop the cost was about 0.11 R a trade, yet the longs lost even before costs, in a market that rose about elevenfold.
  • No better than chance: the same trades on random days at the same minute did about as well (the 48th to 63th percentile). All four buried.

01The rules

A common way to trade gold intraday: follow the bigger trend, wait for a pullback on a fast chart, enter when price turns back. We wrote it down as follows, before any result (for a buy; a sell is the mirror image, tested as separate versions):

  • Trend: the last closed 1-hour candle closes above its 200 EMA.
  • Alignment: on the 5-minute chart, the EMA 20 is above the EMA 50.
  • Pullback: the low of one of the last three 5-minute candles reaches its EMA 20.
  • Confirmation: the last candle is green and closes above the EMA 20. Entry at the next minute's open.
  • Stop: $0.30 under the lowest low of those three candles. If that is less than $2.00 from the entry, no trade: we never widen the stop, and we never trade a stop so small that the cost eats a big share of it.
  • Target: 1.5R or 2R. Window: from 08:00 London time to 11:30 New York time, with each city's real clock changes; anything still open at 11:30 closes. At most one trade a day per version.

02How we tested it

Spot gold (XAUUSD), the 1-minute bid history of an IC Markets MetaTrader 4 demo server, on the New York clock (corrected for the weeks in which the server's clock was an hour off; the uncorrected clock gave the same verdicts). A day counts only if its window has at least 80% of its minutes: the broker's early history skips so many quiet minutes that only 18 days of 2004 to 2006 qualify, so the test effectively starts in 2007 (section 11). Costs: $0.30 an ounce a round trip, as in every gold test on the site, and $0.45 and $0.75 too; the data has no historical spread, so we do not pretend to model one. Periods: development to 2012, validation 2013 to 2019, holdout 2020 to 2026, already used by many gold tests, so these results are exploratory; first-period bar t ≥ 2.5. Control: every trade moved to another day at the same minute, same stop and target distances, 500 times. Engine check: 30 checks, among them hand-made days for each rule, the window in each kind of clock-change week, and an independent re-implementation that matched every trade on both clocks and computed the window from written-out clock rules; all 16 deliberate bugs put into the engine were caught (mtp_selftest_result.txt).

03Results: does the gold 5-minute pullback strategy work?

VersionSide and targetTradesWin rateGross per tradeNet per tradeNet totalProfit factorVerdict
MTP-L-1.5RLong, target 1.5R2,42340.4%-$0.03-$0.33-$8070.83Buried
MTP-L-2RLong, target 2R2,42335.2%-$0.06-$0.36-$8730.83Buried
MTP-S-1.5RShort, target 1.5R1,98841.9%+$0.09-$0.21-$4160.90Buried
MTP-S-2RShort, target 2R1,98836.9%+$0.10-$0.20-$4060.91Buried
-$800-$600-$400-$200$020052008201120142017202020232026validationholdout*MTP-L-1.5RMTP-L-2RMTP-S-1.5RMTP-S-2R

Cumulative net dollars per ounce by month (one ounce per trade; a standard lot is 100 ounces). * Holdout already used before this test.

VersionTarget hitStop11:30 closeMedian stop an ounceCost in RMedian time in trade
MTP-L-1.5R34.6%54.1%11.3%$2.620.107 R49 min
MTP-L-2R26.7%59.1%14.1%$2.620.107 R61 min
MTP-S-1.5R36.6%52.8%10.6%$2.600.107 R45 min
MTP-S-2R28.7%57.1%14.2%$2.600.107 R56 min

A 1.5R target breaks even before costs at a win rate of 40%; the longs won 40.4%, about that, and lost the cost. The 2R versions won less often and did no better.

04Long or short: the trend filter did not help the longs

Gold rose about elevenfold from 2004 to 2026, and a long-only rule usually rides that drift. Here the longs lost before costs over the whole test (-$0.03 and -$0.06 an ounce a trade) and after costs in every period, most clearly in 2007 to 2012 (t -2.73). The 1-hour 200 EMA filter kept them on the side of the trend; short pullback trades closed by 11:30 the same day did not capture it. The shorts made +$0.09 and +$0.10 an ounce before costs and lost them to the $0.30.

05The minimum stop: what changes without it

On the same signals, with other minimum stops (reported for information only, with no gates and no verdict, as fixed in the specification; the first trade of the day can change with the minimum):

VersionNo minimum (trades; cost in R)$1$2 (the test)$3$5
MTP-L-1.5R-$0.29 (2,878; 0.21 R)-$0.28 (2,843; 0.17 R)-$0.33 (2,423; 0.11 R)-$0.44 (1,820; 0.07 R)-$0.21 (931; 0.05 R)
MTP-L-2R-$0.29 (2,878; 0.21 R)-$0.29 (2,843; 0.17 R)-$0.36 (2,423; 0.11 R)-$0.46 (1,820; 0.07 R)-$0.23 (931; 0.05 R)
MTP-S-1.5R-$0.20 (2,374; 0.21 R)-$0.17 (2,343; 0.17 R)-$0.21 (1,988; 0.11 R)-$0.51 (1,508; 0.08 R)+$0.17 (783; 0.05 R)
MTP-S-2R-$0.16 (2,374; 0.21 R)-$0.14 (2,343; 0.17 R)-$0.20 (1,988; 0.11 R)-$0.54 (1,508; 0.08 R)+$0.17 (783; 0.05 R)

Without a minimum the cost doubles to about 0.21 R a trade and the result stays negative. With a $5 minimum, fewer than half the trades remain and the shorts come out slightly positive, but with t-statistics under 1: noise, not an edge, and not a version we could pick after the fact.

06London morning or New York overlap?

VersionLondon only, to 08:00 New York (trades)Overlap with New York (trades)
MTP-L-1.5R-$0.39 (1,563)-$0.23 (860)
MTP-L-2R-$0.42 (1,563)-$0.26 (860)
MTP-S-1.5R-$0.16 (1,286)-$0.30 (702)
MTP-S-2R-$0.13 (1,286)-$0.34 (702)

Neither part of the window was positive for any version: the longs did worse in the London morning, the shorts in the overlap.

07Pullback or random day?

VersionTradesReal net per tradeMoved trades, medianMoved, 5th to 95thPercentile (95 needed)
MTP-L-1.5R2,423-$0.33-$0.36-$0.49 to -$0.2262.8
MTP-L-2R2,423-$0.36-$0.35-$0.49 to -$0.2247.6
MTP-S-1.5R1,988-$0.21-$0.23-$0.36 to -$0.1058.8
MTP-S-2R1,988-$0.20-$0.22-$0.36 to -$0.0758.4

The same entries moved to other days, at the same minute and with the same stop and target distances, did about as well as the real ones. The trend, the alignment, the pullback and the confirmation candle did not pick better moments than the clock alone.

08By period and by year

VersionDevelopment to 2012 (trades)2013 to 2019 (trades)Holdout* 2020 to Oct 2026 (trades)t, first periodPF, second period
MTP-L-1.5R-$0.37 (730)-$0.29 (669)-$0.34 (1,024)-2.730.82
MTP-L-2R-$0.40 (730)-$0.31 (669)-$0.36 (1,024)-2.740.82
MTP-S-1.5R-$0.30 (556)-$0.26 (701)-$0.09 (731)-1.830.84
MTP-S-2R-$0.28 (556)-$0.19 (701)-$0.16 (731)-1.530.89
YearUsable days / weekdaysMTP-L-1.5R net per ounce (trades)MTP-L-2R net per ounce (trades)MTP-S-1.5R net per ounce (trades)MTP-S-2R net per ounce (trades)
2007187/259-$5 (66)+$6 (66)-$6 (43)-$24 (43)
2008254/258-$121 (129)-$118 (129)-$40 (119)-$5 (119)
2009256/259-$85 (146)-$91 (146)-$40 (99)-$36 (99)
2010244/258-$1 (133)+$16 (133)-$72 (90)-$65 (90)
2011240/259-$26 (130)-$31 (130)-$57 (96)-$80 (96)
2012243/259-$27 (123)-$72 (123)+$48 (104)+$54 (104)
2013258/259-$27 (82)-$41 (82)-$14 (148)+$6 (148)
2014258/258-$49 (94)-$52 (94)-$36 (105)-$35 (105)
2015257/258-$27 (83)-$11 (83)+$46 (128)+$69 (128)
2016258/259-$20 (118)-$23 (118)-$53 (106)-$27 (106)
2017257/258+$11 (99)+$7 (99)-$25 (70)-$32 (70)
2018258/259-$3 (72)-$20 (72)-$46 (72)-$47 (72)
2019258/260-$80 (121)-$69 (121)-$53 (72)-$68 (72)
2020259/260-$34 (173)-$5 (173)-$54 (91)-$49 (91)
2021257/258-$55 (133)-$57 (133)-$24 (126)-$51 (126)
2022258/259+$0 (122)-$24 (122)-$46 (128)-$29 (128)
2023257/259-$105 (139)-$139 (139)-$4 (108)-$45 (108)
2024259/261-$112 (169)-$64 (169)-$65 (97)-$61 (97)
2025257/260-$7 (190)-$52 (190)+$91 (74)+$4 (74)
2026 (to 7 Oct)198/199-$33 (98)-$31 (98)+$36 (107)+$114 (107)

* The holdout was already used by many gold tests. 2004 to 2006 are left out of the year table: 18 usable days in all, 3 long trades.

The long with a 1.5R target lost in 18 of the 20 years from 2007.

09Costs

VersionBefore costs$0.30 (base)$0.45$0.75
MTP-L-1.5R-$0.03-$0.33-$0.48-$0.78
MTP-L-2R-$0.06-$0.36-$0.51-$0.81
MTP-S-1.5R+$0.09-$0.21-$0.36-$0.66
MTP-S-2R+$0.10-$0.20-$0.35-$0.65

10The gates

VersionTrades1. PF ≥ 1.2 in validation2. ≥ 50 trades in each period3. t ≥ 2.5 on development4. Above the 95th percentile of the moved-trade control5. Positive without the 10 best trades6. Holdout net positive (already used)
MTP-L-1.5R2,423failpassfailfailfailfail
MTP-L-2R2,423failpassfailfailfailfail
MTP-S-1.5R1,988failpassfailfailfailfail
MTP-S-2R1,988failpassfailfailfailfail
VersionCauseGates failedVerdict
MTP-L-1.5RNo proven edge1, 3, 4, 5, 6Buried
MTP-L-2RNo proven edge1, 3, 4, 5, 6Buried
MTP-S-1.5RCosts1, 3, 4, 5, 6Buried
MTP-S-2RCosts1, 3, 4, 5, 6Buried

The data-gap check removed 12, 12, 4, 4 trades; no verdict changed. No proven edge for the longs (negative before costs) and costs for the shorts in the protocol's sense (a few cents positive before costs). Other fast rules on gold went the same way: the EMA 9/20 crossover on 15-minute bars, the RSI 30/70 on 5-minute bars and the H1 Open Trap; all of them are compared in our gold strategies guide.

TWhat this shows, and what to take into your own tests

What the results show

  • A 5-minute pullback to the EMA 20, in the direction of the 1-hour 200 EMA and the 20/50 alignment, with a confirmation candle, lost money on gold in every period from 2007 to 2026: from -$0.20 to -$0.36 an ounce a trade after costs.
  • The longs lost even before costs, although gold rose about elevenfold; the shorts made a few cents before costs and lost them to the $0.30 spread and commission.
  • The entries were no better than the same trades placed on random days at the same minute (the 48th to 63th percentile of the control).

What remains unknown

  • Other averages, other pullback rules (a touch of the EMA 50, a deeper retracement), trailing exits, or a filter for news and volatility.
  • Gold futures with exchange data, or a broker with real historical spreads; our data is a broker's bid prices with a fixed cost.
  • The years 2004 to 2006, which our data covers too thinly to test this intraday rule.

Why it was buried

None of the four versions made money in any period; the longs lost before costs, the shorts after them, and none beat random days. With the $2.00 minimum stop the cost was about a tenth of the risk, so this is not mainly a cost story: the pullback and the confirmation candle did not pick better moments than chance.

What you can apply to your own tests

  • Set a minimum stop before you test a fast strategy, and test with and without it on the same signals: here removing it doubled the cost in R and changed nothing else.
  • Compare a trend filter with the market's own drift: a long-only rule on gold can look clever only because gold rose.
  • Look at the other fast rules on the same market before trusting a new one: the EMA 9/20 crossover on 15-minute gold, the RSI 30/70 on 5-minute gold and the H1 Open Trap all lost after costs too.

A note on the numbers: drawdown figures are measured on closed trades unless a table says it includes open losses. Open losses inside a trade are not counted in a closed-trade drawdown, so real account risk is higher, especially for systems with no stop. Backtests are not live trading.

FAQCommon questions

Does the 5-minute EMA pullback strategy work on gold?

Not in our backtest of XAUUSD from 2007 to 2026: 2,423 long trades at -$0.33 an ounce and 1,988 short trades at -$0.21, with a 1.5R target. The longs lost even before costs; the shorts made a few cents and lost them to costs.

What is the win rate of a gold EMA pullback strategy?

About 40% for the longs and 42% for the shorts with a 1.5R target, near the 40% such a target needs to break even before costs.

Does a minimum stop help a gold scalping strategy?

It keeps costs in check: with a $2 minimum the cost was about 0.11 R a trade, against about 0.21 R with no minimum. It did not create an edge: every minimum we looked at, from none to $3, lost money.

How was the gold 5-minute pullback strategy tested?

On XAUUSD 1-minute data built into 5-minute and 1-hour bars, in a window from 08:00 London to 11:30 New York with the real clock changes, with the rules and the minimum stop written down before any result, and rules written and dated before the data was run, costs included on every trade, results split into development, validation and holdout periods, a random-entry control as the benchmark, and every variant reported. Read the protocol.

11Check our arithmetic

Frozen specificationThe rules, the minimum stop, the window, costs, periods, gates and control, dated before any signal was computed, with one documented clarification of the window's description.
mtp_spec.md
CodeThe engine (its readings of the rules at the top), the independent re-implementation, the self-test and the run (node mtp_run.js). Needs the MT4 gold history.
mtp_lib.js · mtp_ref.js · mtp_selftest.js · mtp_run.js
Shared code and data checksThe MT4 loader and gold clock, statistics and control helpers, the gold gap list and the data manifest.
control_audit_lib.js · fx_data.js · gh_lib.js · gx_lib.js · hourly_lib.js · ma_lib.js · rsi2_protocol.js · data_holes_xau.json · data_manifest.md
ResultsSelf-test result, the console output of the run (with the usable days by year, the signal counts, the hours, the uncorrected clock and the minimum-stop table) and all numbers.
mtp_selftest_result.txt · mtp_results.txt · mtp_summary.json
Trade logs (CSV)Every trade: date, signal bar, entry and exit (New York time), direction, entry, stop, target, exit, risk in dollars an ounce, exit reason, part of the window, net dollars an ounce and net R.
MTP-L-1.5R · MTP-L-2R · MTP-S-1.5R · MTP-S-2R

Code provenance: our own code, written from the rules above.

12Data notes

Source. A broker's demo history of spot gold (bid prices only) on the New York clock; gaps in the data are listed in data_holes_xau.json and never filled. Usable days (at least 80% of the window's minutes): 2004 4 of 140, 2005 2 of 253, 2006 12 of 251, 2007 187 of 259, 2008 254 of 258; from 2009 nearly every weekday. Fills: entries at a minute's open, stops and targets at their level or at a minute's open if it opened beyond it; a flat $0.30 an ounce a round trip, which understates the wider spreads around news.

13Corrections

28 Oct 2026, navigation: added links to the gold strategies guide, which now includes this test. No result changed.

+More tests and guides