Pine Library · 341 open-source scripts

Free Gold Pine Scripts for TradingView (page 2)

Open-source Pine scripts written for gold (XAU/USD): session and range tools, breakout and scalping strategies, and indicators tuned to gold's volatility.

Pine scripts341
Code shown here93open licence
Updated in a year312
No repaint flag296

Gold: Indicators, Strategies and Libraries

EMA Gold Trader 2026

by alexhb-maker
1 stars

An overlay for the price chart that plots a 60-period EMA, a 60-period double EMA and a 200-period EMA. It marks a buy triangle when the previous close sits above both the EMA and the double EMA, and a second triangle when the EMA crosses above the double EMA.

Indicator v6 TrendMoving averages
Updated 3 months ago · MIT GitHub repository of EMA Gold Trader 2026
1 stars

This indicator draws two ATR trailing stop lines on the price chart: a fast Sniper line and a slow Anchor line. A buy or sell trigger comes from the fast line flipping, and the README says it should agree with the slow line's direction. A session filter shades

Indicator v6 TrendVolatility & bands
Updated 3 months ago · MIT GitHub repository of Phoelix 15min Sniper Bot - Raw Ride Edition

GEKO Gold

by grzegorzkowalskigk-jpg
1 stars

GEKO Gold is a trend-following indicator for gold (XAUUSD/MGC). It computes a GEKO-TIMID composite trend strength score by blending weekly and daily EMAs and ADX values, then classifies the trend into Emerging, Dominant or Extended states. The indicator plots

Indicator v6 TrendMoving averages
Updated 3 months ago · Custom licence GitHub repository of GEKO Gold
1 stars

Marks order block zones on the price chart for gold. A displacement candle is one whose range is at least 1.2 times ATR on above-average volume; the last opposite-colour candle before it becomes the zone. Each zone is scored on five checks such as clean body,

Indicator v5 SMC / ICT / price actionScalping
Updated 4 months ago · None stated GitHub repository of Krishna Simple OB Scalper - XAUUSD
1 stars

Identifies 3-candle price patterns that combine structural liquidity sweeps with candle breaks. In a bullish pattern, a second candle sweeps the low of an initial bearish candle before closing above its open, followed by a third candle closing above the previo

Indicator v6 Candlestick patternsSMC / ICT / price action
Updated 4 months ago · None stated GitHub repository of 3-Candle Pattern Clean

DST HMM v9 Mobile

by Javas128282
1 stars

DST HMM v9 Mobile is a variant of a gold-focused hidden Markov model regime indicator, adjusted for mobile screens. It classifies the market into Sideways, Bull and Bear states using Baum-Welch retraining on a rolling window, draws a Kalman filter line with co

Indicator v6 AI / machine learningTrend
Updated 5 months ago · None stated GitHub repository of DST HMM v9 Mobile

Gold indicator

by H4RsH-25
1 stars

The Gold indicator plots the 20 SMA and 200 EMA on the price chart together with $2 proximity zones around the SMA. It generates strong long signals when price enters the zone from below, stays above the SMA and MACD histogram is positive. Strong short signals

Indicator v6 TrendOscillators & momentum Repaints
Updated 5 months ago · None stated GitHub repository of Gold indicator
1 stars

This indicator is tuned for 30-minute micro gold futures. It computes a Keltner-style band around a Hull-type moving average and draws a coloured cloud on the price chart. A separate pane shows a smoothed mountain-style oscillator and candles, while a four-lin

Indicator v6 Volatility & bandsMoving averages
Updated 5 months ago · None stated GitHub repository of MMP v.17 Futures 30Min MGC

Bakome Buy Sell

by BAKOME-Hub
1 stars

This indicator plots a fast and a slow EMA, 5 and 13 by default, on the price chart and gives a buy or sell signal when they cross, optionally requiring the signal candle to close in the same direction. For each signal it draws an entry, an ATR-based stop loss

Indicator v5 Moving averagesTrend
Updated 5 months ago · MIT GitHub repository of Bakome Buy Sell

XAUUSD Renko Scalping

by thealgo899-creator
1 stars

A strategy intended for gold on a Renko chart with a box size of 1. It goes long when close is above its five-bar average and RSI sits between 45 and the overbought level, and short on the mirror conditions. An optional volume filter is available. Stop loss an

Strategy v5 ScalpingOscillators & momentum
Updated 5 months ago · None stated GitHub repository of XAUUSD Renko Scalping

Hybrid Strategy Trend ORB MTF

by eliasvictor-trading
1 stars

An indicator for intraday futures that builds an opening range for each session and marks breakout signals once price clears it by a tick buffer, with gap filtering and one signal per direction per range. A trend filter uses two moving averages and a higher ti

Indicator v6 BreakoutSessions & time
Updated 5 months ago · MPL-2.0 GitHub repository of Hybrid Strategy Trend ORB MTF
1 stars

This strategy overlays a seven-step smart-money process on the price chart. It compares a higher-timeframe close with an EMA to shade bullish or bearish trend, then marks equal highs and lows, order blocks, fair value gaps, and changes of character. Inputs set

Strategy v6 SMC / ICT / price actionTrend
Updated 5 months ago · None stated GitHub repository of Kasper — 7 Étapes de Trading
1 stars

ICT v4-weinkya All-in-One overlays smart money concept structural elements directly on the price chart. It detects Market Structure Shifts (MSS), Breaks of Structure (BOS), Order Blocks, Fair Value Gaps (FVGs), and Buyside or Sellside Liquidity levels. Additio

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 6 months ago · None stated GitHub repository of ICT v4-weinkya All-in-One
1 stars

The aggressive preset of a strategy that routes orders to MetaTrader through connector alert messages. Inputs cover symbol prefix, suffix and mapping, lot size, a magic number, a pip multiplier and a base risk percentage, with higher risk tiers for selected in

Strategy v6 Breakout
Updated 7 months ago · None stated GitHub repository of Energy Block V11 Aggressive
1 stars

This strategy identifies the Initial Balance (IB) high and low during a user-defined opening session and trades breakout pullbacks. Once the IB window concludes and range filters are satisfied, it enters long or short when price breaks out and retraces back to

Strategy v6 BreakoutSessions & time
Updated 7 months ago · MIT GitHub repository of Gold IB Breakout Retracement

ICT 2022 Pure Mentorship

by cKm-IceCold
1 stars

A strategy that models an ICT-style sequence: it detects a liquidity sweep of a one-hour swing level, then waits for a market structure shift on the chart timeframe confirmed by a large displacement candle. Signals are limited to configurable London, New York

Strategy v6 SMC / ICT / price actionSessions & time Repaints
Updated 8 months ago · None stated GitHub repository of ICT 2022 Pure Mentorship

Dynamic DCA Equities/Gold

by LucasRibeiroCaetano
1 stars

A Pine v5 indicator that works on any chart by reading the S&P 500 to gold ratio on the weekly timeframe. It compares the ratio to its 200-week simple moving average and sets a regime only after 30 consecutive weekly closes on one side. Above the average it ti

Indicator v5 Screeners & dashboardsMean reversion
Updated 9 months ago · None stated GitHub repository of Dynamic DCA Equities/Gold

Momentum FX Order Block Zones

by mikedconcepcion
1 stars

An indicator that finds supply and demand zones after a short consolidation followed by a fast ATR-scaled breakout, and draws them as boxes on the price chart. Zones can be limited to windows around the hour and half hour in UTC, and to the direction of a high

Indicator v5 Support & resistanceSMC / ICT / price action
Updated 9 months ago · MIT GitHub repository of Momentum FX Order Block Zones

Forex Sessions

by klimasevskiy
1 stars

This indicator highlights key trading sessions directly on the price chart to help identify periods of high volatility. It visualizes Asian, Frankfurt, London, and New York killzones using configurable background boxes, high and low boundary lines, and pip-ran

Indicator v5 Sessions & timeSupport & resistance
Updated 1 year ago · None stated GitHub repository of Forex Sessions

Hammers & Stars Strategy

by namdar-nejad
1 stars

This Pine v4 strategy trades hammer and shooting star candles on the price chart. Entry candles can be filtered by size relative to ATR and by an optional EMA, and a Fibonacci level defines how far into the candle the close must be. Stop loss is an ATR multipl

Strategy v4 Candlestick patterns
Updated 4 years ago · None stated GitHub repository of Hammers & Stars Strategy
6 stars

This indicator detects and visualizes Candle Range Theory (CRT) setups directly on the price chart across defined session windows. It tracks 1-hour and 4-hour key ranges for Asian, London, and New York sessions using higher-timeframe data. The script draws hor

Indicator v6 SMC / ICT / price actionSessions & time
Updated 7 months ago · None stated GitHub repository of CRT All-Models Visual Suite v6
5 stars

This strategy executes long trades when price retests the prior week's low level within a specified tolerance and closes above it. Entries are restricted to configurable UTC trading hours, excluding Mondays and late Friday sessions. Stop loss and take profit t

Strategy v5 Support & resistanceSessions & time Repaints
Updated 5 months ago · MIT GitHub repository of WKL v2 — Prior Week Low Retest (Fixed)
2 stars

Gold Multi-TF NYSE Scalper v2 is an intraday trading strategy for XAUUSD that seeks momentum entries by aligning RSI and EMA bias across multiple timeframes. It filters trades using an optional NYSE session clock and an ATR volatility spike check. Entries exit

Strategy v6 Oscillators & momentumVolatility & bands
Updated 8 days ago · None stated GitHub repository of Gold Multi-TF NYSE Scalper v2

Qtus SMC-Sniper AutoTrader v2 is an automated trading strategy plotted on the price chart that combines Smart Money Concepts (SMC), ICT frameworks, price action patterns, and technical indicators into a multi-factor scoring engine. It enters long or short posi

Strategy v6 SMC / ICT / price actionTrend
Updated 2 months ago · Custom licence GitHub repository of Qtus SMC-Sniper AutoTrader v2
2 stars

This strategy plots on the gold price chart and combines stochastic, RSI, and three EMAs with ATR. Confirm buys and sells can require an M15 overbought or oversold rejection wick, a Fibonacci or EMA zone, and a no-chase distance from the fast EMA. Optional LSB

Strategy v5 Oscillators & momentumMoving averages
Updated 4 months ago · None stated GitHub repository of XAUUSD Strategy - Hook Trap Guard

SMC Major Pairs Strategy

by middlechild0
2 stars

This strategy identifies trend alignments and Smart Money Concept (SMC) setups across major currency pairs and gold. It calculates a customized Q-Trend filter combined with higher-timeframe trend confirmation, liquidity sweep detection, swing points, and fair

Strategy v6 SMC / ICT / price actionTrend
Updated 5 months ago · None stated GitHub repository of SMC Major Pairs Strategy
1 stars

Draws confluence zones and options open interest levels on the price chart from a text block pasted into a settings box. Zones are coloured by how many layers of levels overlap (two, three, or four and more), and can be limited to volume-anchored zones. Open i

Indicator v6 Support & resistance
Updated yesterday · None stated GitHub repository of C.og - Confluence Zones + OI v2
1 stars

A Pine v5 indicator, written as the second layer of a gold-focused framework, that reads market direction from moving averages across weekly, daily, 4-hour and 1-hour data. A timeframe is bullish when price sits above 9, 21 and 50 averages in order, bearish wh

Indicator v5 TrendSupport & resistance
Updated 6 weeks ago · None stated GitHub repository of Market Direction and HTF Bias

Gold Dominator Pro

by thanvish21
1 stars

Gold Dominator Pro is an overlay strategy aimed at gold. It reads a higher-timeframe trend from three exponential moving averages and includes RSI, MACD, Stochastic RSI, ADX, ATR, and volume settings. Optional session, equity-curve, and maximum-drawdown guards

Strategy v5 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of Gold Dominator Pro

MTF Confluence Trend

by aretephi
1 stars

MTF Confluence Trend plots trend signals when conditions align across timeframes. It detects Supertrend direction flips on the chart timeframe and confirms them against a higher timeframe Supertrend. Optional filters require an ADX strength threshold and a vol

Indicator v6 TrendVolatility & bands
Updated 3 months ago · None stated GitHub repository of MTF Confluence Trend

DST HMM v9 XAUUSD

by Javas128282
1 stars

DST HMM v9 XAUUSD classifies the market into hidden regimes such as Sideways, Bull and Bear using a hidden Markov model retrained on a rolling window with Baum-Welch iterations. It adds a Kalman filter line with confidence bands and an optional multi-bar Kalma

Indicator v6 AI / machine learningTrend
Updated 5 months ago · None stated GitHub repository of DST HMM v9 XAUUSD

Fresh Supply & Demand Zones

by kvmafthab-pixel
1 stars

Fresh Supply & Demand Zones is a Pine Script v6 indicator that detects and plots fresh supply and demand zones on the price chart. It identifies momentum candles based on ATR period and body size threshold, then scans back for base candles to form zones. Zones

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 5 months ago · Custom licence GitHub repository of Fresh Supply & Demand Zones
1 stars

This indicator plots the Parabolic Stop and Reverse (SAR) on the price chart with customizable acceleration start, increment, and maximum values. It highlights trend reversals where the price crosses the SAR line, marking flip points with directional triangula

Indicator v6 TrendScreeners & dashboards
Updated 5 months ago · None stated GitHub repository of SAR with tweakable aparameter

Kill Zone Liquidity Sweeps tracks the Asian trading session high and low prices and monitors for liquidity sweeps during the London session. When price temporarily breaches the prior Asian high or low during the London kill zone but closes back within the rang

Indicator v5 SMC / ICT / price actionSessions & time
Updated 6 months ago · MIT GitHub repository of Kill Zone Liquidity Sweeps - Castle Trade

Precious Metals Dashboard

by TehbynDFRNT
1 stars

Overlays fast, slow and trend EMAs with an optional cloud, cross triangles and volume spike markers on the price chart, and pulls spot gold, silver and a list of ASX gold and silver miners through security requests. A table summarises daily change, RSI, volume

Indicator v6 Screeners & dashboardsMoving averages
Updated 7 months ago · None stated GitHub repository of Precious Metals Dashboard
1 stars

A strategy for automated order routing that formats alert messages for a MetaTrader connector service. Inputs cover a license identifier field, symbol prefix, suffix and mapping, lot size, a magic number, a pip multiplier and a base risk percentage. Selected i

Strategy v6 Breakout
Updated 7 months ago · None stated GitHub repository of Energy Block V11 Auto Strategy

StackOverFlow MFI and DMI

by namdar-nejad
1 stars

This Pine v4 indicator shows a Money Flow Index line and the directional movement indicators DI plus and DI minus in a separate pane, each with a label on the last bar. A green square at the top marks bars where DI plus is above DI minus and MFI is above 50, a

Indicator v4 Oscillators & momentumVolume
Updated 4 years ago · None stated GitHub repository of StackOverFlow MFI and DMI
105 stars

This overlay strategy looks for gold scalps from break of structure and change of character. It enters long when a bullish break, a bullish character change, and an optional volume filter align, and short on the opposite set. Optional RSI levels can block trad

Strategy v6 SMC / ICT / price actionOscillators & momentum Repaints

Trading Sessions

by iamc1oud
56 stars

Trading Sessions is an overlay indicator that highlights major market trading sessions such as Tokyo, London, and New York directly on the price chart. It draws customizable session boxes along with optional open and close price lines, average session prices,

Indicator v6 Sessions & time
Updated 2 months ago · None stated GitHub repository of Trading Sessions

COT Net Positions

by ChartsLector
41 stars

This indicator fetches and plots weekly Commitment of Traders (COT) net position data in a separate pane using TradingView's official COT library. It displays positioning breakdowns for selected futures markets under either Legacy or Financial (TFF) reporting

Indicator v6 Volume
Updated 3 days ago · None stated GitHub repository of COT Net Positions

Estrategia EMA and BARS

by JoelPasapera
11 stars

This strategy generates long trade entries based on an exponential moving average crossover on the main price chart. It calculates two customizable EMAs and executes a buy order when the shorter moving average crosses above the longer moving average. Rather th

Strategy v6 TrendMoving averages
Updated 5 months ago · Apache-2.0 GitHub repository of Estrategia EMA and BARS
5 stars

This strategy trades long when an M15 bar's low comes within a tolerance of the prior week's low and the bar closes above that level. It places a fixed point stop below entry and a take-profit at a chosen R-multiple of that stop. Entries are limited to a UTC s

Strategy v5 Support & resistanceSessions & time
Updated 5 months ago · MIT GitHub repository of WKL v2 — Prior Week Low Retest (Locked Spec)

More Pine Script Categories

Browse the whole Pine Library

Third-party code. ForexR lists open-source Pine scripts from GitHub; it did not write, test or endorse them, and their summaries are generated automatically from each script's code and README. Indicators describe the past, and a strategy's backtest can look better than live trading. Check a script on a demo account before you rely on it. CFDs and leveraged forex are complex instruments with a high risk of losing money rapidly.

Learn to Use Pine Scripts

Free, plain-English guides: add a script to TradingView, read what it does, test it and avoid the common traps.

  1. 1Using this librarySearch, filters, licences and what the badges mean.
  2. 2Add a script to TradingViewCopy, paste into the Pine Editor, save and add to chart.
  3. 3Indicators, strategies and librariesWhat each type does and how to tell them apart.
  4. 4Spot a script that repaintsWhy some signals change after the bar closes.
  5. 5Backtest a strategyStrategy Tester settings that keep results honest.
  6. 6Send alerts to MT4 or MT5From a TradingView alert to an order in MetaTrader.
  7. 7What Pine Script isThe language, what it can and cannot do, and where to start.
  8. 8Write your first indicatorA complete script, line by line, in the Pine Editor.
  9. 9Read a script before you trust itA routine for checking inputs, logic and red flags.
  10. 10Edit a script safelyChange colours and lengths, add a filter or an alert.
  11. 11Pine Script alertsalertcondition(), alert(), placeholders and webhooks.
  12. 12Build a crossover strategyAn EMA cross strategy with an ATR stop, ready to test.

Trade Your Charts With a Regulated Broker

Compare regulated brokers on platforms, spreads, minimum deposit and leverage.

Compare brokers