Markets › Metals · XAUUSD spot (broker data), 1-hour
Supertrend Strategy on Gold: XAUUSD 1-Hour Backtest (ATR 10, 3)
Buy when the Supertrend turns green, sell when it turns red: we backtested the most popular trend indicator on 22 years of gold 1-hour bars, with costs, with the overnight swap, and against the same holdings at random times.
Buried · No proven edgeIt beat chance. Then gold stopped trending for seven years.
Variants tried: 2 · Passed every gate: 0 · Best: 5 of 6 · Holdout opened: yes (already used)
Short answer: partly. On gold 1-hour bars, buying when the Supertrend turned green and selling when it turned red made +0.35 R a trade after costs from 2004 to 2026, twice the same long holdings at random times, and passed five of our six gates. It failed the 2013 to 2019 validation years, and today's overnight swap nearly erases it.Compare all 20 gold strategies we tested →
00The verdict in three lines
- Does the Supertrend strategy work on gold? Partly. Long only made +0.346 R a trade after costs on 1,582 trades, about twice the same long holdings at random times, and passed five of our six gates.
- It failed the validation years. From 2013 to 2019, when gold went sideways, it made almost nothing (profit factor 1.02). Long and short did worse, because the shorts lost.
- The swap nearly erases it. With today's overnight swap on a gold CFD, the long-only result falls from +547 R to +7 R over 22 years.
01The Supertrend strategy
Supertrend is a trend-following indicator widely credited to Olivier Seban (sources differ on its origin). It draws a line from the average true range (ATR): under the price in an uptrend, over it in a downtrend. When the price closes through the line, the line flips side and colour. The usual way to trade it is to be long while it is green and short while it is red. On TradingView, its built-in strategy uses ATR period 10 and multiplier 3; we test exactly those and nothing else.
- ST-L: buy when the line turns green; sell when it turns red; stay out until it turns green again.
- ST-LS: the same, but when it turns red, also go short; always in the market.
Not new on this site, and we say so: the same settings on ES futures and on four forex pairs were all buried. The owner of the site chose gold knowing that, because a result on one market says little about another; it is one reason for the strict bar below.
02How we made the rules mechanical
- Indicator: ATR = Wilder's average of the true range over 10 one-hour bars; bands = (high + low) / 2 ± 3 × ATR; the bands only move toward the price unless the previous close crossed them; the direction flips when a bar closes beyond the band on the other side. It is the same code as in our ES test, and we checked that it gives the same direction on every gold bar.
- Signal: read at the close of each 1-hour bar, New York time. Fill: at the open of the next minute. A flip in ST-LS closes the trade and opens the opposite one at the same price.
- No stop and no target other than the flip, as the indicator is normally used. We report the worst open loss of every trade.
- Held over weekends and the daily break, as in every gold test on the site. Our ES and forex tests went flat before each weekend; on this gold file a Friday-hour rule would depend on clock labels that are an hour off in some years.
03How we tested it
XAUUSD, the 1-minute bid history of an IC Markets MetaTrader 4 demo server, from June 2004 to 7 October 2026, built into 1-hour bars; positions start after the first 500 bars, in mid-July 2004. Costs: $0.30 an ounce per round trip, as in every gold test on the site; the overnight financing is shown as two scenarios (3% a year, and today's IC Markets swap). Unit: R, 1.5 times the 1-hour ATR(14) at the signal, so that 2005 and 2025 weigh the same although gold rose about elevenfold; dollar results are shown alongside. Periods: 2004 to 2012, 2013 to 2019, and a holdout from 2020 already used by our earlier gold tests. First-period bar t ≥ 2.5, because Supertrend has been tested before on the site and many strategies have been tried on this file. Control: the real sequence of green and red periods, shifted as a whole by a random amount of time (at least 5% of the data), 500 times; it keeps the number of flips, their lengths and the long and short mix, so gold's rise is in the control too. Engine check: 28 checks, among them hand-worked bars, an independent re-implementation that matched every trade, the same direction as our ES code on all 129,857 bars, and 4 deliberate rule changes that the test had to catch (stau_selftest_result.txt).
04Results: does Supertrend work on gold?
| Variant | Rule | Trades | Win rate | Gross per trade | Net per trade | Net total | Net, $ per oz | Profit factor | Verdict |
|---|---|---|---|---|---|---|---|---|---|
| ST-L | Long while green, flat while red | 1,582 | 40.4% | +0.414 R | +0.346 R | +547 R | +$3,133 | 1.35 | Buried |
| ST-LS | Long while green, short while red (always in the market) | 3,164 | 37.8% | +0.198 R | +0.130 R | +412 R | +$2,559 | 1.12 | Buried |
Cumulative net R by month, at the $0.30 cost, before financing. * Holdout already used before this test.
Supertrend win rate and how long trades last
| Variant | Median time in trade | Longest | Time in the market | Worst open loss (open positions included) | Trades 3 R or more against | Largest drawdown, closed trades | Largest drawdown, open losses included |
|---|---|---|---|---|---|---|---|
| ST-L | 47 h | 340 h | 52.8% | -16.5 R | 126 | -74 R | -76 R |
| ST-LS | 44 h | 437 h | 100.0% | -16.5 R | 262 | -75 R | -76 R |
A typical Supertrend: about 40% of trades win, the winners are larger than the losers, and half the trades last about two days. With no stop, the worst open loss (open positions included) was 16.5 R against the position before the line flipped.
05Supertrend or chance?
| Variant | Trades | Real net per trade | Shifted, median | Shifted, 5th to 95th | Percentile (95 needed) |
|---|---|---|---|---|---|
| ST-L | 1,582 | +0.346 R | +0.171 R | +0.070 R to +0.270 R | 99.6 |
| ST-LS | 3,164 | +0.130 R | -0.060 R | -0.162 R to +0.039 R | 99.8 |
On gold, random long holdings make money: the shifted long-only runs made +0.171 R a trade in the median, because gold rose. The real Supertrend made twice that, better than 99.6% of the shifted runs. For long and short, the shifted runs lost (-0.060 R) and the real one made +0.130 R. On this test, the flips picked better moments than chance.
06Long or short
| Trades of ST-LS | Trades | Before costs | After costs | Per trade |
|---|---|---|---|---|
| Longs | 1,582 | +654 R | +547 R | +0.346 R |
| Shorts | 1,582 | -28 R | -135 R | -0.086 R |
The longs of ST-LS are exactly the trades of ST-L. The shorts lost even before costs: on a market that rose about elevenfold, going short every time the line turned red cost more than it saved.
07Costs and the overnight swap
| Variant | Before costs | $0.30 a trade (base) | Plus 3% a year financing | Plus today's IC Markets swap | Mean cost per trade |
|---|---|---|---|---|---|
| ST-L | +654 R | +547 R | +458 R | +7 R | 0.068 R |
| ST-LS | +626 R | +412 R | +244 R | +208 R | 0.068 R |
The trading cost is small here, 0.068 R a trade, because trades last days and the ATR is wide; this is unlike our short-term gold tests, where costs took most of the profit. The overnight swap is the real cost: at today's rate (about $0.57 an ounce a night on a long, Wednesday counting three) the long-only result falls to +7 R. The scenario applies today's rate to all 22 years, so it overstates the cost of the low-rate years, but it is what a CFD trader pays now. Gold futures carry the financing in the price instead.
08The same Supertrend on six markets
| Market | Version | Trades | Profit factor, all years | t, all years | Gates passed | Weekends |
|---|---|---|---|---|---|---|
| ES futures | ST60-L | 672 | 1.17 | 1.43 | 2/6 | flat before the weekend |
| ES futures | ST60-LS | 1,339 | 0.98 | -0.28 | 1/6 | flat before the weekend |
| EURUSD | ST60-LS | 4,548 | 1.01 | 0.13 | 1/6 | flat before the weekend |
| EURUSD | ST60-L | 2,245 | 1.01 | 0.22 | 1/6 | flat before the weekend |
| GBPUSD | ST60-LS | 4,639 | 1.00 | -0.05 | 1/6 | flat before the weekend |
| GBPUSD | ST60-L | 2,290 | 0.99 | -0.16 | 1/6 | flat before the weekend |
| USDJPY | ST60-LS | 4,467 | 1.02 | 0.50 | 2/6 | flat before the weekend |
| USDJPY | ST60-L | 2,255 | 1.07 | 1.09 | 3/6 | flat before the weekend |
| AUDUSD | ST60-LS | 4,481 | 1.00 | -0.07 | 1/6 | flat before the weekend |
| AUDUSD | ST60-L | 2,248 | 1.02 | 0.37 | 1/6 | flat before the weekend |
| Gold (this test) | ST-L | 1,582 | 1.35 | 4.08 | 5/6 | held over weekends |
| Gold (this test) | ST-LS | 3,164 | 1.12 | 2.24 | 4/6 | held over weekends |
Same indicator, same settings, 60-minute bars. Gold is where it did best over the whole sample. On ES the long-only version reached a profit factor of 1.17; on the four forex pairs it stayed near 1. None of the versions passed every gate. The ES and forex versions went flat before each weekend; this one held through, which also kept its trend trades open longer.
09By period and by year
| Variant | 2004 to 2012 (trades) | 2013 to 2019 (trades) | Holdout* 2020 to Oct 2026 (trades) | t, first period | PF, second period | PF, holdout |
|---|---|---|---|---|---|---|
| ST-L | +0.502 R (608) | +0.022 R (502) | +0.490 R (472) | 3.78 | 1.02 | 1.51 |
| ST-LS | +0.170 R (1,215) | +0.054 R (1,005) | +0.160 R (944) | 1.92 | 1.05 | 1.15 |
| Year | ST-L net R (trades) | ST-LS net R (trades) |
|---|---|---|
| 2004 (from mid-July) | +0.5 R (34) | -14.6 R (67) |
| 2005 | +66.7 R (68) | +56.2 R (137) |
| 2006 | +49.6 R (79) | +34.1 R (157) |
| 2007 | +57.3 R (72) | +34.5 R (145) |
| 2008 | +35.9 R (72) | +66.9 R (144) |
| 2009 | +37.3 R (73) | +17.9 R (146) |
| 2010 | +19.9 R (73) | -32.5 R (146) |
| 2011 | +44.5 R (64) | +52.7 R (127) |
| 2012 | -6.8 R (73) | -8.4 R (146) |
| 2013 | -35.3 R (76) | +36.9 R (152) |
| 2014 | -7.7 R (65) | +14.9 R (131) |
| 2015 | -18.9 R (72) | -11.7 R (144) |
| 2016 | +5.7 R (74) | -24.4 R (148) |
| 2017 | +25.7 R (71) | +6.2 R (141) |
| 2018 | -9.4 R (74) | -7.1 R (148) |
| 2019 | +50.9 R (70) | +39.5 R (141) |
| 2020 | +91.7 R (55) | +108.6 R (109) |
| 2021 | -10.4 R (73) | -1.6 R (146) |
| 2022 | +6.6 R (74) | +3.5 R (148) |
| 2023 | +11.3 R (74) | -14.5 R (149) |
| 2024 | +50.9 R (72) | +16.2 R (143) |
| 2025 | +75.5 R (72) | +17.9 R (145) |
| 2026 (to 7 Oct) | +5.6 R (52) | +20.8 R (104) |
* The holdout years were already used by our earlier gold tests.
Long only lost in 6 years: 2012, 2013, 2014, 2015, 2018 and 2021. Four of them fall inside the 2013 to 2019 stretch, after gold's 2011 peak, and 2012 just before it. Its best years were trending ones: 2020 (+91.7 R) and 2025 (+75.5 R).
10The gates
| Variant | Trades | 1. PF ≥ 1.2 in validation | 2. ≥ 50 trades in each period | 3. t ≥ 2.5 on development | 4. Above the 95th percentile of the shifted control | 5. Positive without the 10 best trades | 6. Holdout net positive (already used) |
|---|---|---|---|---|---|---|---|
| ST-L | 1,582 | fail | pass | pass | pass | pass | pass |
| ST-LS | 3,164 | fail | pass | fail | pass | pass | pass |
| Variant | Cause | Gates failed | Verdict |
|---|---|---|---|
| ST-L | Overfit | 1 | Buried |
| ST-LS | No proven edge | 1, 3 | Buried |
Overfit is our rule's label for a strong first period that a later period does not confirm; nothing was fitted here, the settings are the defaults. No proven edge: positive, but not convincing by our bars.
The data-gap check: 461 trades of ST-L and 917 of ST-LS were open across a suspect or unclear gap in the data, mostly from 2004 to 2010, when the file is thin. Without them both versions stay buried, and their average falls to -0.023 R and -0.190 R. The gaps did not make the money: the price moves across them add +53.0 R and -11.3 R. The removed trades are simply the long ones (83 hours on average against 58 for the rest of ST-L), and long trades are where a trend follower makes its money.
TWhat this shows, and what to take into your own tests
What the results show
- Long only (buy when the line turns green, sell when it turns red) made +0.346 R a trade after costs on 1,582 trades from 2004 to 2026, about twice what the same long holdings made at random times (+0.171 R). It passed five of our six gates.
- It failed validation: from 2013 to 2019, when gold mostly went sideways or down, it made almost nothing (profit factor 1.02). Strategies that follow trends need trends.
- Long and short was worse: the shorts lost 135 R even with gold trending, because gold rose about elevenfold. And with today's overnight swap on a CFD account, the long-only profit nearly disappears (+7 R left of +547 R).
What remains unknown
- Other settings. We tested only ATR 10 and 3, the TradingView defaults, and did not search for “best Supertrend settings”: searching would make any result look better than it is.
- Gold futures, other brokers or other timeframes; we tested spot gold on 1-hour bars from one broker's history.
- What the swap will cost in future years. The swap scenario uses today's rate; in the low-rate years of 2009 to 2021 it was smaller.
Why it was buried
Long only passed five gates and failed one: the profit factor in the validation years was 1.02, far below 1.2. By our rule the cause is “Overfit”, our label for a strong first period that a later period does not confirm; no setting was fitted here, they are the defaults. Long and short also failed the first-period bar (t 1.92, below 2.5).
What you can apply to your own tests
- Test a trend rule through a period without a trend. Gold's 2013 to 2019 is the period where this one stopped working.
- On a market that rose for twenty years, compare a long rule with random long trades, not with zero: random long holdings made money too.
- Before holding positions for days on a CFD, work out the overnight swap. Here it took almost the whole long-only profit.
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 Supertrend strategy work on gold?
Partly, in our backtest of XAUUSD 1-hour bars with the default settings (ATR 10, multiplier 3): long only made +0.35 R a trade after costs on 1,582 trades from 2004 to 2026 and passed five of our six gates, but it made almost nothing from 2013 to 2019, so it was buried.
What is the Supertrend win rate on gold?
About 40% for long only and 38% for long and short in our test. Supertrend wins less than half of its trades and relies on a few long trends to pay for many small losses.
What are the best Supertrend settings?
We did not search for them: we tested only ATR 10 and multiplier 3, the TradingView defaults. Settings picked after looking at the results always look better than they trade.
Is Supertrend a good indicator for gold?
In our test it timed gold's trends better than chance: the long-only trades made about twice as much as the same holdings at random times. But it needs trends, and with today's overnight swap on a CFD the long-only profit nearly disappears.
How was the Supertrend strategy tested on gold?
On 22 years of XAUUSD 1-minute data built into 1-hour bars, with 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
stau_spec.md
stau_lib.js · stau_ref.js · stau_selftest.js · stau_run.js · stau_holes_check.js
control_audit_lib.js · em_lib.js · fx_data.js · gh_lib.js · gx_lib.js · hourly_lib.js · ma_lib.js · rb_lib.js · rs_lib.js · rsi2_protocol.js · st_protocol.js · data_holes_xau.json · data_manifest.md
stau_selftest_result.txt · stau_results.txt · stau_holes.json · stau_summary.json
Code provenance: our own code, written from the specification; the Supertrend function is the one of our ES test.
12Data notes
Source. A broker's demo history of spot gold (bid prices), not COMEX futures. Coverage. The early years are thin, with many short gaps; missing minutes are never filled. Clock. The file labels some weeks of 2004 to 2010 an hour early; nothing in this rule depends on the time of day, so it does not matter here. Fills at a minute's open; the cost is a fixed $0.30 for 22 years, because the file has no historical spread. Exploratory: one market, one timeframe, one broker, the default settings only, a holdout already used.
13Corrections
6 Nov 2026, wording: the sentence on the worst trade in section 04 now says that the figure includes open losses. No result changed. 6 Nov 2026, navigation: added links to the gold strategies guide, which now includes this test. No result changed.