Gold trading strategies, backtested
We backtested the gold strategies across 14 strategies in Strategy Lab. Every one below is profitable after costs and stayed profitable on a final 12 months it was never tuned on. The best, XAUUSD 1h Bollinger band breakout, made +489% from Jan 2020 to Nov 2026; the median profit factor is 1.69.
- 14Backtested strategies
- +489%Best return after costs
- 1.69Median profit factor
- +16.1%Best last 12 months
Results compared
| Strategy | Timeframe | Direction | Return | Profit factor | Win rate | Max drawdown | Last 12 months |
|---|---|---|---|---|---|---|---|
| XAUUSD 1h Bollinger band breakout | 1 hour | Long only | +489% | 1.24 | 31.6% | −57.8% | +16.1% |
| XAUUSD 1h Bollinger band breakout (New York) | 1 hour | Long and short | +191% | 1.37 | 24.1% | −17.1% | +15.1% |
| XAUUSD 4h Bollinger band breakout | 4 hours | Long only | +94.9% | 1.97 | 58.3% | −4.7% | +13.8% |
| XAUUSD daily Donchian breakout | Daily | Long only | +70.3% | 2.04 | 69.9% | −5.1% | +5.8% |
| XAUUSD daily Donchian breakout (length 20) | Daily | Long only | +67.5% | 1.67 | 66.1% | −6.9% | +6.6% |
| XAGUSD 4h three soldiers or crows (Longs only) | 4 hours | Long only | +65.1% | 1.71 | 35.2% | −7.7% | +2.4% |
| XAGUSD 4h three soldiers or crows | 4 hours | Long and short | +64.5% | 1.96 | 35.9% | −5.7% | +13.8% |
| XAGUSD 4h liquidity run | 4 hours | Long and short | +59.4% | 1.74 | 40.0% | −10.4% | +8.4% |
| XAGUSD 4h pennant | 4 hours | Long and short | +59.1% | 1.82 | 57.9% | −8.8% | +12.9% |
| XAGUSD 15m order block | 15 minutes | Long and short | +50.0% | 1.63 | 34.2% | −7.6% | +4.8% |
| XAUUSD 4h inside bar | 4 hours | Long only | +48.7% | 1.55 | 63.8% | −5.6% | +5.6% |
| XAGUSD 4h marubozu | 4 hours | Long and short | +47.2% | 2.10 | 54.0% | −3.8% | +11.9% |
| XAUUSD daily pullback to moving average | Daily | Long and short | +43.4% | 1.36 | 51.6% | −4.9% | +1.8% |
| XAGUSD 1h Bollinger band breakout | 1 hour | Long only | +41.8% | 1.35 | 50.8% | −11.1% | +5.1% |
Backtests in Strategy Lab at 1% risk per trade, after each market's typical spread. Last 12 months were locked away during the search and tested once.
What worked
Timeframes
4 hours (7), 1 hour (3), Daily (3), 15 minutes (1).Setups
Bollinger band breakout (3), Bollinger band breakout (New York) (1), Donchian breakout (1), Donchian breakout (length 20) (1), three soldiers or crows (Longs only) (1), three soldiers or crows (1), liquidity run (1), pennant (1), order block (1), inside bar (1), marubozu (1), pullback to moving average (1).Targets
1.5R (4), 1R (3), 4R (3), 3R (2), 5R (1), 2R (1). Wider targets win less often but pay more per winner.Filters and direction
7 with the 200 EMA trend filter, 6 with no filter, 1 with a high-volatility filter; 7 long only, 7 long and short.
Trading gold with an algo
Read the guide: Trend following strategyXAUUSD is spot gold priced in US dollars, traded around the clock from Sunday evening to Friday evening, with the most volume in the London and New York sessions. Gold tends to trend for long stretches, which suits breakout systems, but it also makes sharp reversals around US data.
The strategies below were tested on spot gold with its typical spread and up to 20× leverage. Overnight financing isn't included, so check your broker's swap before holding trades for days.
Looking for an algo trading strategy for gold? Each card links to a full XAUUSD strategy backtest: the rules, every trade, the drawdown and how the last 12 months went, with a free prompt to rebuild it in Strategy Lab.
Every strategy
- XAUUSD
+489.3%
Jan 2020 to Nov 2026
Profit factor
1.24
Win rate
31.6%
Max DD
−57.8%
Breakout · 1 hour
XAUUSD 1h Bollinger band breakout
Buy when the candle closes above the upper Bollinger band(20, 2), with the 200 EMA trend. XAUUSD 1-hour candles, long only, 3R target.
See the rules and results - XAUUSD
+190.9%
Jan 2020 to Nov 2026
Profit factor
1.37
Win rate
24.1%
Max DD
−17.1%
Breakout · 1 hour
XAUUSD 1h Bollinger band breakout (New York)
Enter when the candle closes above the upper Bollinger band(20, 2) for longs, below the lower band for shorts, with the 200 EMA trend. XAUUSD 1-hour candles, long and short, 5R target.
See the rules and results - XAUUSD
+94.9%
Jan 2020 to Nov 2026
Profit factor
1.97
Win rate
58.3%
Max DD
−4.7%
Breakout · 4 hours
XAUUSD 4h Bollinger band breakout
Buy when the candle closes above the upper Bollinger band(20, 2), only when volatility is higher than usual. XAUUSD 4-hour candles, long only, 1.5R target.
See the rules and results - XAUUSD
+70.3%
Nov 2006 to Nov 2026
Profit factor
2.04
Win rate
69.9%
Max DD
−5.1%
Breakout · Daily
XAUUSD daily Donchian breakout
Buy when the close breaks above the highest high of the last 55 bars. XAUUSD daily candles, long only, 1R target.
See the rules and results - XAUUSD
+67.5%
Nov 2006 to Nov 2026
Profit factor
1.67
Win rate
66.1%
Max DD
−6.9%
Breakout · Daily
XAUUSD daily Donchian breakout (length 20)
Buy when the close breaks above the highest high of the last 20 bars, with the 200 EMA trend. XAUUSD daily candles, long only, 1R target.
See the rules and results - XAGUSD
+65.1%
Jan 2020 to Nov 2026
Profit factor
1.71
Win rate
35.2%
Max DD
−7.7%
Price action · 4 hours
XAGUSD 4h three soldiers or crows (Longs only)
Three-bar momentum thrusts. XAGUSD 4-hour candles, long only, 4R target.
See the rules and results - XAGUSD
+64.5%
Jan 2020 to Nov 2026
Profit factor
1.96
Win rate
35.9%
Max DD
−5.7%
Price action · 4 hours
XAGUSD 4h three soldiers or crows
Three-bar momentum thrusts. XAGUSD 4-hour candles, long and short, 4R target.
See the rules and results - XAGUSD
+59.4%
Jan 2020 to Nov 2026
Profit factor
1.74
Win rate
40.0%
Max DD
−10.4%
ICT and SMC · 4 hours
XAGUSD 4h liquidity run
Liquidity run (ICT): price takes a meaningful swing pool (longer structural high/low) then keeps going. XAGUSD 4-hour candles, long and short, 3R target.
See the rules and results - XAGUSD
+59.1%
Jan 2020 to Nov 2026
Profit factor
1.82
Win rate
57.9%
Max DD
−8.8%
Price action · 4 hours
XAGUSD 4h pennant
Pennant: a sharp pole move, then a small symmetrical consolidation (converging trendlines), then a breakout in the pole’s direction, with the 200 EMA trend. XAGUSD 4-hour candles, long and short, 1.5R target.
See the rules and results - XAGUSD
+50.0%
Nov 2023 to Nov 2026
Profit factor
1.63
Win rate
34.2%
Max DD
−7.6%
ICT and SMC · 15 minutes
XAGUSD 15m order block
Order block: the last opposing candle before a strong impulsive move that fully engulfs it, with same-timeframe market-structure confirmation. XAGUSD 15-minute candles, long and short, 4R target.
See the rules and results - XAUUSD
+48.7%
Jan 2020 to Nov 2026
Profit factor
1.55
Win rate
63.8%
Max DD
−5.6%
Breakout · 4 hours
XAUUSD 4h inside bar
The current candle’s high is below the prior high and its low is above the prior low. XAUUSD 4-hour candles, long only, 1R target.
See the rules and results - XAGUSD
+47.2%
Jan 2020 to Nov 2026
Profit factor
2.10
Win rate
54.0%
Max DD
−3.8%
Price action · 4 hours
XAGUSD 4h marubozu
A marubozu is a strong conviction candle: a large real body with almost no wicks, so open and close sit near opposite extremes of the bar, with the 200 EMA trend. XAGUSD 4-hour candles, long and short, 2R target.
See the rules and results - XAUUSD
+43.4%
Nov 2006 to Nov 2026
Profit factor
1.36
Win rate
51.6%
Max DD
−4.9%
Pullback · Daily
XAUUSD daily pullback to moving average
After price has moved clearly away from the 10 EMA, it pulls back to touch it and closes back in the trend's direction, with the 200 EMA trend. XAUUSD daily candles, long and short, 1.5R target.
See the rules and results - XAGUSD
+41.8%
Jan 2020 to Nov 2026
Profit factor
1.35
Win rate
50.8%
Max DD
−11.1%
Breakout · 1 hour
XAGUSD 1h Bollinger band breakout
Buy when the candle closes above the upper Bollinger band(20, 2), with the 200 EMA trend. XAGUSD 1-hour candles, long only, 1.5R target.
See the rules and results
Backtests are hypothetical: they apply fixed rules to historical data with assumed costs and fills. Past results don't predict future results, and leveraged trading carries a high risk of loss. This is an educational description, not a recommendation.