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.

XAUUSD (spot gold) · 1-hour bars · Supertrend ATR 10, multiplier 3 (the TradingView defaults) · long only, and long and short · Protocol v1.0 plus the 8 Oct 2026 rules

Buried · No proven edge

It beat chance. Then gold stopped trending for seven years.

BornFrozen 6 Nov 2026 (stau_spec.md), before any Supertrend value on gold was computed
Died6 Nov 2026

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?

VariantRuleTradesWin rateGross per tradeNet per tradeNet totalNet, $ per ozProfit factorVerdict
ST-LLong while green, flat while red1,58240.4%+0.414 R+0.346 R+547 R+$3,1331.35Buried
ST-LSLong while green, short while red (always in the market)3,16437.8%+0.198 R+0.130 R+412 R+$2,5591.12Buried
0 R100 R200 R300 R400 R500 R20052008201120142017202020232026validationholdout*ST-LST-LS

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

VariantMedian time in tradeLongestTime in the marketWorst open loss (open positions included)Trades 3 R or more againstLargest drawdown, closed tradesLargest drawdown, open losses included
ST-L47 h340 h52.8%-16.5 R126-74 R-76 R
ST-LS44 h437 h100.0%-16.5 R262-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?

VariantTradesReal net per tradeShifted, medianShifted, 5th to 95thPercentile (95 needed)
ST-L1,582+0.346 R+0.171 R+0.070 R to +0.270 R99.6
ST-LS3,164+0.130 R-0.060 R-0.162 R to +0.039 R99.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-LSTradesBefore costsAfter costsPer trade
Longs1,582+654 R+547 R+0.346 R
Shorts1,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

VariantBefore costs$0.30 a trade (base)Plus 3% a year financingPlus today's IC Markets swapMean cost per trade
ST-L+654 R+547 R+458 R+7 R0.068 R
ST-LS+626 R+412 R+244 R+208 R0.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

MarketVersionTradesProfit factor, all yearst, all yearsGates passedWeekends
ES futuresST60-L6721.171.432/6flat before the weekend
ES futuresST60-LS1,3390.98-0.281/6flat before the weekend
EURUSDST60-LS4,5481.010.131/6flat before the weekend
EURUSDST60-L2,2451.010.221/6flat before the weekend
GBPUSDST60-LS4,6391.00-0.051/6flat before the weekend
GBPUSDST60-L2,2900.99-0.161/6flat before the weekend
USDJPYST60-LS4,4671.020.502/6flat before the weekend
USDJPYST60-L2,2551.071.093/6flat before the weekend
AUDUSDST60-LS4,4811.00-0.071/6flat before the weekend
AUDUSDST60-L2,2481.020.371/6flat before the weekend
Gold (this test)ST-L1,5821.354.085/6held over weekends
Gold (this test)ST-LS3,1641.122.244/6held 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

Variant2004 to 2012 (trades)2013 to 2019 (trades)Holdout* 2020 to Oct 2026 (trades)t, first periodPF, second periodPF, holdout
ST-L+0.502 R (608)+0.022 R (502)+0.490 R (472)3.781.021.51
ST-LS+0.170 R (1,215)+0.054 R (1,005)+0.160 R (944)1.921.051.15
YearST-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

VariantTrades1. PF ≥ 1.2 in validation2. ≥ 50 trades in each period3. t ≥ 2.5 on development4. Above the 95th percentile of the shifted control5. Positive without the 10 best trades6. Holdout net positive (already used)
ST-L1,582failpasspasspasspasspass
ST-LS3,164failpassfailpasspasspass
VariantCauseGates failedVerdict
ST-LOverfit1Buried
ST-LSNo proven edge1, 3Buried

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

Frozen specificationWhy this test, what was looked at before, the indicator, the rules, costs, periods, gates and control, dated before any Supertrend value on gold was computed.
stau_spec.md
CodeThe engine (its readings of the rules at the top), the independent re-implementation, the self-test with the mutation check, the run (node stau_run.js) and the data-gap check. Needs the MT4 gold history.
stau_lib.js · stau_ref.js · stau_selftest.js · stau_run.js · stau_holes_check.js
Shared code and data checksThe MT4 loaders, the ES Supertrend code it was checked against, statistics and control helpers, the list of data gaps and the data manifest.
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
ResultsThe self-test, the console output of the run, the data-gap check and all numbers.
stau_selftest_result.txt · stau_results.txt · stau_holes.json · stau_summary.json
Trade logs (CSV)Every trade: signal, entry and exit (New York time), direction, prices, R in dollars per ounce, exit reason, gross and net R, net dollars per ounce, worst open loss, the part made across market closures, and both financing scenarios.
ST-L · ST-LS

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.

+More tests and guides