Strategy · Pine Script v5 · On the chart

XAUUSD Strategy V4.18 Structure Sell Double Confirm

by aeiioaeiio

This strategy executes gold trades by combining multiple exponential moving averages with RSI, Stochastic oscillator, and ATR indicators alongside Fibonacci zones.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code566
Settings40inputs
LicenceNone stated
Last update4 months ago6 Jun 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 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.18 Structure Sell Double Confirm triggers confirmed buy or sell positions and optional scalp legs based on trend direction and M15 overbought or oversold wick rejections. Stop loss levels are placed at recent swing highs or lows padded with an ATR buffer, while take profits are calculated via configurable risk-reward ratios. The strategy plots trade signals, Fibonacci levels, and a dashboard directly on the price chart.

Details

Published by

aeiioaeiio on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Trend, Oscillators & momentum, Moving averages, Screeners & dashboards

Markets

Gold

Timeframes

M15-H1

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Stoch Periodint5stochLen
Stoch Kint3stochKLen
Stoch Dint3stochDLen
RSI Periodint14rsiLen
EMA Fastint20emaFastLen
EMA Slowint50emaSlowLen
EMA Trendint200emaTrendLen
ATR Periodint14atrLen
Backtest ModestringConfirm Onlymode
Use Closed Bar OnlybooltrueuseConfirmedBar
Enable BUY CONFIRMbooltrueenableBuyConfirm
Enable SELL CONFIRMbooltrueenableSellConfirm
Show all 40 settings
SettingTypeDefaultVariable
Enable LSB SCALPboolfalseenableLsbScalp
Enable LSS SCALPboolfalseenableLssScalp
Show Disabled Scalp Marks for ReviewboolfalseshowDisabledLegs
M15 Sell OB Levelfloat70sellOb
M15 Buy OS Levelfloat30buyOs
M15 Rejection Wick %float0.35wickPct
Require M15 Trigger for ConfirmbooltruerequireM15
Fib Lookbackint50fibLookback
Fib/EMA Zone Tolerance x ATRfloat0.45fibTolAtr
No Chase Distance from EMA20 x ATRfloat1.35noChaseAtr
BUY Confirm TP RRfloat1.5rrBuyConfirm
SELL Confirm TP RRfloat1.6rrSellConfirm
Scalp TP RRfloat0.8rrScalp
Confirm SL Buffer x ATRfloat0.35slAtrBuf
Scalp SL Buffer x ATRfloat0.12scalpSlAtr
Confirm SL Swing Lookbackint8swingLb
Scalp SL Swing Lookbackint3scalpLb
Show DashboardbooltrueshowDash
Show SignalsbooltrueshowSignals
Show Watch MarksbooltrueshowWatch
Show Key FibbooltrueshowFib
Block Trade if SL too wideboolfalseuseRiskBlock
Max SL Distance (price points)float60.0maxSlPoints
Block Trade during ATR SpikebooltrueuseAtrSpikeBlock
ATR Spike MA Lengthint50atrSpikeLen
Max ATR x Average ATRfloat1.65atrSpikeMult
Use Strict BUY QualitybooltrueuseStrictBuyV495
BUY Min H1 RSIfloat42.0buyRsiMinV495
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.

Similar Pine Scripts

This long-only trend-following strategy combines Ichimoku Kinko Hyo components with higher timeframe moving average filters. It triggers long entries when price trades above a higher timeframe EMA and a bullish Tenkan-Sen cross above Kijun-Sen occurs under fav

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · MPL-2.0 GitHub repository of Ichimoku Kinko Hyo Momentum Strategy

This strategy calculates trend direction across three user-defined higher timeframes using dual Simple Moving Averages, filtered by On-Balance Volume and Commodity Channel Index conditions alongside fractal pivot swings. Entries trigger when multi-timeframe tr

Strategy v5 TrendMoving averages Repaints
Updated 5 months ago · None stated GitHub repository of Fractals with Pivot Trendlines Strategy

This strategy automatically adapts its moving average lengths and types based on the chart's timeframe, covering scalping, intraday, and swing styles. It generates entry signals when a fast moving average crosses a slow moving average, provided price is on the

Strategy v6 TrendMoving averages
Updated 10 months ago · MIT GitHub repository of EMA / SMA Crossover + ADX + EMA100 Trend Filter
1 stars

This strategy executes trades based on MACD line crossovers filtered by trend direction and histogram slope. Long positions open on bullish MACD crossovers when price is above the trend EMA and histogram momentum is rising. Short positions open on bearish cros

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Tn Sovereign MACD v6
330 stars

2 EMA/SMA + RSI Strategy [Alorse] combines three configurable moving averages with a short-period Relative Strength Index filter. It plots fast, slow, and trend moving averages on the price chart. Long entries trigger when the fast moving average is above the

Strategy v4 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of 2 EMA/SMA + RSI Strategy [Alorse]

Acrypto - Weighted Strategy

by AlbertoCuadra
318 stars

This strategy plots on the price chart and opens long or short positions when a weighted score from MACD, Stochastic RSI, RSI, Supertrend and a moving-average crossover exceeds a user-set trigger. Each component has its own weight and candle delay. Entries can

Strategy v5 TrendOscillators & momentum
Updated 3 years ago · Custom licence GitHub repository of Acrypto - Weighted Strategy

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers