Strategy · Pine Script v5 · On the chart

XAUUSD Strategy V4.9 - Professional Entry Model + Backtest

by aeiioaeiio

This Pine Script v5 strategy generates buy and sell signals for XAUUSD on the price chart.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code219
Settings27inputs
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.9 - Professional Entry Model + Backtest combines Stochastic Oscillator, RSI, EMA crossovers and Fibonacci retracements with M15 overbought/oversold triggers and rejection wick filters to identify entries. Confirm mode waits for confirmed signals while Scalp mode executes quicker exits. ATR determines zone tolerances, stop loss buffers and risk-reward ratios for both confirm and scalp trades. The strategy plots entry signals, watch marks and key Fibonacci levels on the chart with an optional dashboard. Main settings control oscillator periods, EMA lengths, M15 levels, risk parameters and backtest modes. It supports closed bar confirmation and draws exclusively on the price chart.

Details

Published by

aeiioaeiio on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Oscillators & momentum, Trend, Volatility & bands, Support & resistance

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 + Scalpmode
Use Closed Bar OnlybooltrueuseConfirmedBar
M15 Sell OB Levelfloat70sellOb
M15 Buy OS Levelfloat30buyOs
Show all 27 settings
SettingTypeDefaultVariable
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
Confirm TP RRfloat1.5rrConfirm
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
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

Box Scalper v4

by wynnforthework
2 stars

Box Scalper v4 is a strategy that plots buy and sell signals on the price chart using ADX trend filters, QQE momentum oscillator, and BOX channels. It signals entries based on crossovers and zone conditions, with trailing stop loss and take profit targets. Par

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Box Scalper v4

Liquidity Sweep Scalper v2

by godlesscherry
2 stars

Liquidity Sweep Scalper v2 is a scalping strategy that detects liquidity sweeps using Supertrend trend filters, Bollinger Bands for volatility, Williams Fractals for pivots, and MACD momentum. It enters on rejection candle breaks after sweeps and exits via sto

Strategy v6 TrendOscillators & momentum
Updated 7 months ago · None stated GitHub repository of Liquidity Sweep Scalper v2

This strategy trades S50 TFEX USDTHB contracts on the price chart. It detects swing highs and swing lows with pivot points to generate long entries on swing highs and short entries on swing lows. The ATR indicator calculates dynamic stop-loss distances while t

Strategy v6 Volatility & bandsOscillators & momentum Repaints
Updated 1 year ago · None stated GitHub repository of S50 TFEX Strategy With ATR and Stoploss
257 stars

This strategy plots VWMA-based Bollinger bands on the 1-minute ES futures price chart for volatility analysis and potential breakout identification. It calculates dynamic long and short stop loss and take profit levels using percentage inputs relative to entry

Strategy v6 Volatility & bandsSupport & resistance
Updated 6 weeks ago · None stated GitHub repository of V1.6 ES - Futures 1M No Repaint

Nasdaq Prop Firm Strategy

by TradersPost
218 stars

This strategy uses multiple VWAP anchors and a custom Lull indicator to generate buy and sell signals on the Nasdaq price chart. It plots the VWAP trend line and three VWAP anchors with customizable colors and mitigation methods. The Lull indicator produces si

Strategy v6 TrendSupport & resistance Repaints
Updated 3 months ago · None stated GitHub repository of Nasdaq Prop Firm 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