Markets › Metals · XAUUSD spot (broker data)

RSI 30/70 Strategy Backtest: Gold, 5-Minute and 1-Hour Bars, 2004 to 2026

Buy when RSI(14) turns up from 30, sell when it turns down from 70: the textbook rule and a protected version, on 22 years of gold with costs, a control and every variant reported.

XAUUSD spot · 5-minute and 1-hour bars · Protocol v1.0 plus the 8 Oct 2026 rules

Buried · No proven edge

Wins two trades in three. Loses the money anyway.

BornFrozen 14 Oct 2026 (rs_spec.md), before any RSI value was computed on gold
Died14 Oct 2026

Variants tried: 8 · Passed every gate: 0 · Holdout opened: yes (already used)

Short answer: not on gold. We backtested the classic RSI(14) 30/70 rule on 22 years of gold, on 5-minute and 1-hour bars, as taught (no stop) and with a trend filter and a stop. The classic rule wins about six trades in ten and still loses money, because without a stop its losers are very large; none of the eight variants passed.How much costs took here, compared across all 54 of our tests →Compare all 14 gold strategies we tested →

00The verdict in three lines

  • We tested the most searched indicator strategy, the classic RSI(14) with the 30 and 70 levels, on gold from 2004 to October 2026, on 5-minute bars (the chart people ask about most) and 1-hour bars: the textbook rule with no stop, and a protected version with a 200-bar EMA trend filter and a stop at 1 R. Eight variants, $0.30 an ounce of costs, every result reported.
  • The classic rule wins often and loses money. About 61% to 65% of its trades end positive, but without a stop the losers are large: the worst open loss inside one trade (including open losses, not only closed results) was -101.8 R. The long-and-short versions ended at -4,382 R (5-minute) and -573 R (1-hour); selling at 70 lost money even before costs.
  • All eight Buried. The best variant, 1-hour long only with the protections, made +36 R with a worst open loss of -1.4 R, but it reached a development t-statistic of 1.02 (2.5 needed), made nothing in validation and did not beat the control.

01What we tested

  • RSI(14) of the bar closes, Wilder's method (the standard in TradingView and MetaTrader).
  • Long entry when RSI turns back up through 30; short entry (long-and-short versions) when it turns back down through 70. Entry at the open of the next minute after the bar closes. One position at a time.
  • Exit when RSI reaches the other level: 70 for a long, 30 for a short.
  • Classic versions: nothing else, no stop and no target, as the rule is usually taught.
  • Protected versions: the same, plus a trend filter (longs only above the 200-bar EMA, shorts only below) and a stop at 1 R from the entry. They were chosen before any number, because we expected a counter-trend rule without a stop to be dangerous on gold.
  • R is 1.5 times the 14-bar average true range at the signal, in dollars per ounce: the stop distance in the protected versions, a yardstick in the classic ones.
  • Eight variants: 5-minute and 1-hour bars, long and short or long only, classic or protected. RSI rules had already been tried in many variants on this site (RSI(2) on ES and on four currency pairs, RSI divergence), so the development t-statistic bar is 2.5.

02Data and costs

Spot gold (XAUUSD), the 1-minute bid history of an IC Markets MetaTrader 4 demo server, June 2004 to 7 October 2026, the same part of the file as our other gold tests. Costs: $0.30 per ounce per round trip, as in every gold test on the site; no slippage, which is optimistic. Periods by entry date: development 2004 to 2012, validation 2013 to 2019, holdout 2020 to 2026, already used by the earlier gold tests.

Engine check: a self-test with hand-worked cases and an independent re-implementation, written differently (minute by minute instead of bar by bar), that matched every trade of all eight variants (rs_selftest_result.txt). Before this article, one report figure was fixed: the first run measured the worst open loss including the exit minute after the position had closed, which overstated it for a few stopped trades; the trades, gates and verdicts were identical.

03Results

Net R is the sum of the trades' results after costs; the winners column is the share of trades that ended positive.

VariantVersionTradesNet after costsR per tradeGross per tradeCost per tradeWinnersProfit factorVerdict
RS-M5-LS5-minute, long and short, classic10,881-4,382 R-0.40 R-0.15 R0.26 R63.6%0.83Buried
RS-M5-L5-minute, long only, classic5,440-1,164 R-0.21 R+0.04 R0.25 R65.5%0.91Buried
RS-M5-LS-F5-minute, long and short, protected3,590-800 R-0.22 R+0.08 R0.30 R21.5%0.79Buried
RS-M5-L-F5-minute, long only, protected1,938-233 R-0.12 R+0.18 R0.30 R23.4%0.88Buried
RS-H1-LS1-hour, long and short, classic1,074-573 R-0.53 R-0.47 R0.07 R60.7%0.75Buried
RS-H1-L1-hour, long only, classic537+45 R+0.08 R+0.15 R0.06 R65.0%1.05Buried
RS-H1-LS-F1-hour, long and short, protected363-1 R0.00 R+0.07 R0.07 R24.0%1.00Buried
RS-H1-L-F1-hour, long only, protected203+36 R+0.18 R+0.25 R0.07 R28.1%1.23Buried
-600-400-2000200620102014201820222026validationholdout*RS-H1-LRS-H1-L-FRS-H1-LSRS-H1-LS-F

1-hour bars: cumulative net R by month. * Holdout already used before this test. On 5-minute bars the classic long-and-short version falls steadily to -4,382 R and the other three end below zero too (table above).

By period

VariantDevelopment 2004 to 2012 (trades)Validation 2013 to 2019 (trades)Holdout* 2020 to 2026 (trades)Development tValidation PF
RS-M5-LS-1,737 R (3,900)-1,582 R (3,530)-1,063 R (3,451)-3.750.81
RS-M5-L-195 R (1,950)-971 R (1,765)+2 R (1,725)-0.610.77
RS-M5-LS-F-284 R (1,410)-318 R (1,122)-198 R (1,058)-2.960.73
RS-M5-L-F-80 R (805)-143 R (560)-10 R (573)-1.060.76
RS-H1-LS-230 R (408)-55 R (357)-289 R (309)-2.140.92
RS-H1-L+67 R (204)-35 R (178)+13 R (155)1.060.90
RS-H1-LS-F+7 R (147)+1 R (119)-9 R (97)0.271.01
RS-H1-L-F+22 R (89)+0 R (61)+15 R (53)1.021.00

04A high win rate, and what it hides

VariantWinnersAverage winnerAverage loserWorst open lossTrades 3 R or more under waterMedian hours heldDrawdown incl. open losses
RS-M5-LS63.6%+3.10 R-6.49 R-101.8 R5,628 (52%)9.5-4510.2 R
RS-M5-L65.5%+3.12 R-6.50 R-99.0 R2,770 (51%)9.7-1482.0 R
RS-M5-LS-F21.5%+3.85 R-1.34 R-14.2 R7 (0%)0.9-855.4 R
RS-M5-L-F23.4%+3.89 R-1.34 R-6.1 R4 (0%)0.9-310.0 R
RS-H1-LS60.7%+2.63 R-5.40 R-61.6 R557 (52%)140.0-586.3 R
RS-H1-L65.0%+2.68 R-4.69 R-46.8 R257 (48%)125.0-123.0 R
RS-H1-LS-F24.0%+3.41 R-1.08 R-1.4 R0 (0%)15.5-37.3 R
RS-H1-L-F28.1%+3.40 R-1.08 R-1.4 R0 (0%)14.5-20.0 R

The classic rule wins about six trades in ten, and loses money because it has no limit on the losers: it holds a falling long until RSI reaches 70, which can take days. Half of its 5-minute trades were 3 R or more under water at some point. The protected versions win less than three trades in ten, but their worst open loss is a fraction of the classic one.

05Buying at 30 against selling at 70

VariantLongs: trades / gross / netShorts: trades / gross / net10 best tradesNet without them
RS-M5-LS5,440 / +213.4 R / -1164.4 R5,441 / -1805.2 R / -3218.0 R+166.1 R-4548.6 R
RS-M5-L5,440 / +213.4 R / -1164.4 R–+151.7 R-1316.2 R
RS-M5-LS-F1,938 / +356.5 R / -232.5 R1,652 / -77.8 R / -567.2 R+114.8 R-914.5 R
RS-M5-L-F1,938 / +356.5 R / -232.5 R–+111.2 R-343.7 R
RS-H1-LS537 / +80.2 R / +45.4 R537 / -582.5 R / -618.7 R+71.2 R-644.5 R
RS-H1-L537 / +80.2 R / +45.4 R–+64.9 R-19.5 R
RS-H1-LS-F203 / +50.7 R / +36.1 R160 / -25.6 R / -37.0 R+61.1 R-62.0 R
RS-H1-L-F203 / +50.7 R / +36.1 R–+54.9 R-18.9 R

Gold rose from $384 to $4,110 over these years. Selling when RSI turned down from 70 lost money before costs in every long-and-short version; buying when it turned up from 30 made a little before costs, enough to stay positive after costs only on 1-hour bars.

06Financing

Scenario A: 3% a year of the entry price for every calendar day held, longs and shorts alike. Scenario B: today's IC Markets XAUUSD swap (long -$0.5703, short +$0.39767 per ounce per night, Wednesday counting three), applied to every year: not a historical rate. The verdict uses the baseline.

VariantNet, no financingNet, scenario A (3% a year)Net, scenario B (today's swap)
RS-M5-LS-4382.4 R-5019.1 R-4921.9 R
RS-M5-L-1164.4 R-1468.4 R-2945.5 R
RS-M5-LS-F-799.7 R-837.5 R-844.7 R
RS-M5-L-F-232.5 R-254.3 R-335.1 R
RS-H1-LS-573.3 R-731.8 R-618.7 R
RS-H1-L+45.4 R-24.1 R-380.0 R
RS-H1-LS-F-0.9 R-11.7 R-11.1 R
RS-H1-L-F+36.1 R+30.5 R+1.9 R

Classic trades on 1-hour bars last about 5 days at the median, so today's swap takes the long-only version from +45 R to -380 R.

07Is it the signal or chance?

The moved-entry control: every real entry moved by one random offset of whole days, at least 5% of the series, to the same time of day on another day, same direction, then managed by the same RSI exit (and stop, in the protected versions) and costs; 500 runs with fixed seeds. The bar is the 95th percentile of the average net R per trade.

VariantTradesReal average per tradeControl trades (mean)Control medianControl 5th to 95thPercentile (95 needed)
RS-M5-LS10,881-0.40 R4,952-0.37 R-0.52 R to -0.23 R36.8
RS-M5-L5,440-0.21 R3,564-0.23 R-0.40 R to -0.05 R54.8
RS-M5-LS-F3,590-0.22 R2,465-0.29 R-0.37 R to -0.23 R95.6
RS-M5-L-F1,938-0.12 R1,355-0.27 R-0.37 R to -0.19 R99.6
RS-H1-LS1,074-0.53 R588-0.30 R-0.60 R to -0.02 R10.2
RS-H1-L537+0.08 R393+0.14 R-0.14 R to +0.40 R36.8
RS-H1-LS-F3630.00 R274-0.04 R-0.21 R to +0.12 R63.4
RS-H1-L-F203+0.18 R1550.00 R-0.22 R to +0.21 R91.8

The two protected 5-minute versions beat the control and still lost money: the same trades placed on other days lost even more. Beating chance is not the same as making money.

08The gates

VariantTrades1. PF ≥ 1.2 in validation2. ≥ 50 trades in each period3. t ≥ 2.5 on development4. Above the 95th percentile of the moved-entry control5. Positive without the 10 best trades6. Holdout net positive (already used)
RS-M5-LS10,881failpassfailfailfailfail
RS-M5-L5,440failpassfailfailfailpass
RS-M5-LS-F3,590failpassfailpassfailfail
RS-M5-L-F1,938failpassfailpassfailfail
RS-H1-LS1,074failpassfailfailfailfail
RS-H1-L537failpassfailfailfailpass
RS-H1-LS-F363failpassfailfailfailfail
RS-H1-L-F203failpassfailfailfailpass

09Verdict by variant

VariantCauseGates failedVerdict
RS-M5-LSNo proven edge1, 3, 4, 5, 6Buried
RS-M5-LCosts1, 3, 4, 5Buried
RS-M5-LS-FCosts1, 3, 5, 6Buried
RS-M5-L-FCosts1, 3, 5, 6Buried
RS-H1-LSNo proven edge1, 3, 4, 5, 6Buried
RS-H1-LNo proven edge1, 3, 4, 5Buried
RS-H1-LS-FCosts1, 3, 4, 5, 6Buried
RS-H1-L-FNo proven edge1, 3, 4, 5Buried

Costs: positive before costs and negative after. No proven edge: negative before costs, or positive but without the significance, the validation result or the control the protocol requires. Not tested: other RSI lengths and levels, other exits and filters, other markets.

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

What the results show

  • The classic rule wins often and still loses: 65.5% of its long trades on 5-minute bars ended positive, but an average loser of -6.50 R against an average winner of +3.12 R left it at -1,164 R.
  • Without a stop the losses can be very large: on 5-minute bars the worst open loss inside one trade (including open losses) was -101.8 R, and about half of all classic 5-minute trades were 3 R or more under water at some point.
  • Selling at 70 was the worst part: the short side lost before costs in every long-and-short version, on a market that rose from $384 to $4,110.
  • The protected version (a 200-bar EMA filter and a 1 R stop) cut the worst open loss to -1.4 R on 1-hour bars and was the best variant (+36 R), but it failed the significance bar, made nothing in validation and did not beat the control.

What remains unknown

  • Other RSI lengths and levels (for example 20/80), other exits, other markets. We tested the classic settings only.
  • Whether the protected 1-hour long-only version holds on new data; with 203 trades in 22 years it would take years to know.

Why it failed

RSI 30/70 is a bet that a move has gone too far and will turn. On gold, which spent most of these 22 years rising, buying at 30 often worked and selling at 70 often did not. With no stop, the rule waits for RSI to reach the other level, which can take days while the loss grows; the many small wins do not pay for those. On 5-minute bars the cost of a round trip is also a quarter of R or more.

What you can apply to your own tests

  • A high win rate tells you nothing on its own. Look at the average loser next to the average winner, and at the worst trade while it was open.
  • If a rule has no stop, measure how far against you its trades went, not only how they ended.
  • Test the two sides separately: here buying and selling did not behave alike at all.

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

What is the win rate of the RSI 30/70 strategy?

High, and misleading. On 5-minute gold bars the classic long-only rule won 65.5% of its 5,440 trades and still lost 1,164 R after costs, because the average loser was much larger than the average winner.

Does RSI 30/70 work better with a stop and a trend filter?

It is much safer: the worst open loss fell from about 102 R to under 15 R on 5-minute bars and under 2 R on 1-hour bars. The best variant, 1-hour long only with a 200-bar EMA filter and a 1 R stop, made +36 R, but not enough to pass our significance bar or beat the control.

How was the RSI 30/70 strategy tested?

On spot gold 1-minute broker data from 2004 to 2026, built into 5-minute and 1-hour bars, with $0.30 an ounce of costs 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.

10Check our arithmetic

Frozen specificationRules, both versions, costs, periods, gates and control, dated before any RSI value was computed on gold.
rs_spec.md
CodeThe engine (its readings of the rule at the top), the independent re-implementation, the self-test and the run (node rs_run.js). Needs your own MT4 gold history.
rs_lib.js · rs_ref.js · rs_selftest.js · rs_run.js
Shared code it usesThe MT4 loader, bars, statistics and control helpers.
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 · rsi2_protocol.js
ResultsSelf-test result, the console output of the run and all numbers as one file.
rs_selftest_result.txt · rs_results.txt · rs_summary.json
Trade logs (CSV)Every trade of every variant: signal, entry and exit (New York time), R, stop, exit reason, gross and net R, dollars, the worst open loss and both financing scenarios.
RS-M5-LS · RS-M5-L · RS-M5-LS-F · RS-M5-L-F · RS-H1-LS · RS-H1-L · RS-H1-LS-F · RS-H1-L-F
Data recordFile hashes and the gap audit of the gold file.
data_manifest.md · data_holes_xau.json

Code provenance: our own code, written from the standard RSI definition and the rule as fixed in the specification. No third-party source code is used or published.

11Data notes

Gaps. The gold file is thin in 2004 to 2011 and has many suspect or unclear gaps. Removing the trades open across one changes no verdict, but for the classic versions it changes a lot:

VariantTradesRemovedR per tradeVerdict
RS-M5-LS10,8811,457-0.40 R → +0.14 RBuried → Buried
RS-M5-L5,440743-0.21 R → +0.25 RBuried → Buried
RS-M5-LS-F3,590100-0.22 R → -0.25 RBuried → Buried
RS-M5-L-F1,93860-0.12 R → -0.17 RBuried → Buried
RS-H1-LS1,074407-0.53 R → +0.02 RBuried → Buried
RS-H1-L537200+0.08 R → +0.46 RBuried → Buried
RS-H1-LS-F363700.00 R → -0.12 RBuried → Buried
RS-H1-L-F20339+0.18 R → -0.01 RBuried → Buried

The removed classic trades are mostly from 2004 to 2011. On 5-minute bars they lost about 3 to 4 R each on average and were held far longer than the others (a median of about a day against about eight hours). That cuts both ways: thin data with gaps can produce bad prices, but for a rule with no stop the trades held longest are also its real large losses, so removing them flatters the rule. Without them the classic 5-minute long-only version would still fail validation (profit factor 0.83), where the data are good.

Clock. The file's time labels are an hour early in many weeks of 2004 to 2010 (our clock audit). The bars here are continuous and cut on whole hours, so a shifted label moves whole bars in time without changing them, and nothing in the rule depends on the time of day.

Source. A broker's demo history, not an exchange record; costs are constant across years, which flatters the early years.

12Corrections

14 Oct 2026, display only: values that round to zero were shown with a sign (“-0.00 R” or “+0.00 R”); they are now shown as 0.00 R. No number changed. 14 Oct 2026: in the control (section 07), a check that skips a moved entry falling before the first bar with an ATR had been swallowed by a comment in the code, so 1 to 7 of the 500 runs per variant had no valid average. They distorted the control's median and its 5th and 95th percentiles in the table, and lowered every percentile by up to 0.6 points. Fixed in rs_lib.js and rerun: the real trades are identical, the percentiles rose by 0 to 0.6, no gate and no verdict changed. 18 Oct 2026, navigation: added links to the new guide that compares all 11 gold strategy tests. No result changed. 22 Oct 2026, navigation: added a link to the new guide comparing trading costs across all our tests. No result changed. 22 Oct 2026, navigation: added a link to the new guide comparing trend following and mean reversion across all our tests. No result changed.

+More tests and guides