This Pine Script strategy for XAUUSD combines Exponential Moving Averages (20, 50, and 200), Stochastic, RSI, and ATR indicators to generate trading signals.
1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.
Source Code
The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.
Overview
XAUUSD Strategy V4.9.7 - Adaptive Sell + Reclaim Buy identifies potential buy and sell opportunities using trend alignment, M15 overbought or oversold conditions, rejection wicks, and Fibonacci tolerance zones. Entries are categorized into main confirmation trades and optional scalp trades. Risk management features include swing-based and ATR-buffered stop losses, fixed risk-to-reward take profit targets, and trade blocking filters for wide stop loss distances or ATR volatility spikes. Indicators, signals, and an info dashboard plot directly on the price chart.
EMA trend and M15 stochastic RSI trigger signals
Fibonacci and EMA tolerance zone filters
ATR-buffered swing stop losses and risk-reward targets
Trade blocking filters for wide stops and ATR volatility spikes
On-chart execution signals and informational dashboard
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Stoch Period
int
5
stochLen
Stoch K
int
3
stochKLen
Stoch D
int
3
stochDLen
RSI Period
int
14
rsiLen
EMA Fast
int
20
emaFastLen
EMA Slow
int
50
emaSlowLen
EMA Trend
int
200
emaTrendLen
ATR Period
int
14
atrLen
Backtest Mode
string
Confirm Only
mode
Use Closed Bar Only
bool
true
useConfirmedBar
Enable BUY CONFIRM
bool
true
enableBuyConfirm
Enable SELL CONFIRM
bool
true
enableSellConfirm
Show all 40 settings
Setting
Type
Default
Variable
Enable LSB SCALP
bool
false
enableLsbScalp
Enable LSS SCALP
bool
false
enableLssScalp
Show Disabled Scalp Marks for Review
bool
false
showDisabledLegs
M15 Sell OB Level
float
70
sellOb
M15 Buy OS Level
float
30
buyOs
M15 Rejection Wick %
float
0.35
wickPct
Require M15 Trigger for Confirm
bool
true
requireM15
Fib Lookback
int
50
fibLookback
Fib/EMA Zone Tolerance x ATR
float
0.45
fibTolAtr
No Chase Distance from EMA20 x ATR
float
1.35
noChaseAtr
Confirm TP RR
float
1.5
rrConfirm
Scalp TP RR
float
0.8
rrScalp
Confirm SL Buffer x ATR
float
0.35
slAtrBuf
Scalp SL Buffer x ATR
float
0.12
scalpSlAtr
Confirm SL Swing Lookback
int
8
swingLb
Scalp SL Swing Lookback
int
3
scalpLb
Show Dashboard
bool
true
showDash
Show Signals
bool
true
showSignals
Show Watch Marks
bool
true
showWatch
Show Key Fib
bool
true
showFib
Block Trade if SL too wide
bool
false
useRiskBlock
Max SL Distance (price points)
float
60.0
maxSlPoints
Block Trade during ATR Spike
bool
true
useAtrSpikeBlock
ATR Spike MA Length
int
50
atrSpikeLen
Max ATR x Average ATR
float
1.65
atrSpikeMult
Use Strict BUY Quality
bool
true
useStrictBuyV495
BUY Min H1 RSI
float
45.0
buyRsiMinV495
BUY Require Close > EMA20
bool
true
requireBuyEma20
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This strategy overlays the price chart and looks for VWAP pullbacks. It goes long when a short SMA crosses above VWAP after RSI has been oversold within ten bars, and short on the opposite cross after RSI has been overbought. Optional Minervini-style moving-av
This strategy trades 1-minute futures contracts on Binance. It plots pivot high and low resistance and support levels on the price chart, along with an EMA and a custom Cto indicator. Long and short entries trigger on EMA and Cto crossovers combined with price
This strategy generates long signals on the price chart using multiple technical indicators. It computes EMA 70 and 100, SMA 70, ADX with DMI, CCI, and MACD values. A long entry occurs when EMA crossover condition, SMA condition, ADX above 15, CCI above 30, an
This strategy combines MACD momentum signals with support and resistance levels from pivot points and an EMA100 trend filter for long positions. It plots the 100-period EMA on the price chart and signals when price breaks above the EMA or forms bullish pivot p
This overlay strategy combines swing price structure with MACD structure and two higher-timeframe exponential moving averages. It finds pivot highs and lows over ten bars, labels higher highs, lower highs, higher lows and lower lows, and builds matching states
This strategy identifies long entry setups by combining WaveTrend momentum, an exponential moving average trend filter, and automated Fibonacci retracements. It triggers an entry when the price trades above the baseline EMA, pulls back into the 0.5 to 0.618 Fi