Gold (XAUUSD) RSI Pine Strategy Without Coding

RSI 14 on TradingView gold with ATR stops and a session filter — export Pine v6, attach on your XAUUSD/GOLD chart, and test honestly.

📖 4 min read

📝 786 words

🏷️ Pine Script and TradingView

Share this article:

Gold is not just another pair

An RSI strategy on gold is an RSI strategy — what the oscillator does is covered in the RSI playbook. What is specific to gold is the instrument, and that is what breaks strategies moved onto it from FX.

Three things to settle before you build

The symbol is not one thing. Gold appears under different tickers on different data feeds, and a strategy backtested on one may behave differently on another because the underlying price series is not identical — different sessions, different quoting, sometimes a different instrument entirely (spot versus a future versus a CFD). Fix the exact symbol you will trade, and record it beside your results.

The tick size is not an FX tick size. This is the setting that silently changes meaning. slippage in Pine is counted in ticks, so a slippage = 3 you calibrated on EURUSD is not three of the same thing here. Moving an FX strategy to gold without re-deriving slippage understates or overstates costs, usually badly.

It gaps. Gold has session breaks, and price crosses levels during them. The broker emulator assumes intrabar data does not exist inside a gap, so a stop sitting inside one is not filled at your stop price — it is dealt with when trading resumes, and the difference is the gap. Any strategy holding a position through a break should expect its real losses on those trades to be worse than the backtest's. The mechanism is in risk management.

Which is why the stop should be in ATR

An ATR-based stop adjusts itself to the instrument, so it survives being moved in a way a fixed-pip stop does not:

Stop typeMoving a strategy from EURUSD to XAUUSD
fixed pipsmeans a completely different distance — needs re-tuning
ATR multiplescales automatically to gold's larger typical range

That does not make the strategy portable — nothing does, on its own — but it removes one of the two settings that break first. The construction, and why a ratio rather than a level is the portable form, is in the ATR regime filter.

Building it

FieldValueNote
Symbolthe exact gold ticker you will traderecord it with your results
Timeframe1 hour or highergold's intraday noise is large
RSI14, oversold 30re-derive the levels on this symbol
Trend filterprice above a 200-period MAtake longs with the trend only
Stop / target2 × ATR / 3 × ATRnot fixed pips
Slippagere-derived in gold's ticksnot carried over from FX
Session filteryesspreads widen outside liquid hours

The verification that matters most here

Run the strategy, open the List of Trades, and check three fills against the chart: does each fill price fall inside that bar's high–low range? Then check whether any exits sit next to a session gap.

Those two checks catch the gold-specific failures directly, and they take about a minute — part of the trade-list audit in reading the Strategy Tester.



Tactix AI — Studio vs Guide

Tactix AI is AlfaTactix’s product assistant brand (open Tactix AI).

  • Tactix Studio turns a one-sentence strategy description into a draft across Timeframe, Signals, Filters, and Risk in the visual Strategy Builder. You review and edit every field before Code Generator writes MQL5 or Pine Script.
  • Tactix Guide explains the step you are on — what to fill, what a control means, or how to phrase a rule — without dumping untested source code.

That is form-first automation: the LLM never replaces Code Generator, and you keep plan limits and real-time validation.

Frequently Asked Questions

Yes. Same RSI playbook as FX, but pick the TradingView gold symbol your data feed uses (often XAUUSD or GOLD), prefer ATR stops, and add a session filter. DemoCode GeneratorEditorTester.

RSI Length 14, Buy cross↑30, Sell cross↓70, H1, one TF. Risk: % equity + ATR SL/TP — see Pine risk. Theory: RSI. Twin MT5: Gold RSI EA.

Use the continuous gold / XAUUSD symbol available on your TradingView plan and broker data. Names differ by feed — open the chart first, then export with that chart in mind. The builder does not invent a broker-specific ticker.

Gold’s point value and volatility make fixed-pip FX defaults a poor fit. ATR-based exits adapt to range. Map Step 5 fields in risk guide.

No. Session / time / liquidity (volume path) only — market filters. No SuperTrend / Ichimoku / ADX / MTF in Basic.

Prefer Cross at 30/70 for entries. Compare stays true while RSI remains beyond a level. No NOT operator. Full RSI guide: RSI playbook.