OPEN-SOURCE SCRIPT
GC Trend-Pullback Volume Gate Signal Indicator

A trend-following pullback signal tool for COMEX gold, ported from a strategy validated on GC 1H data. It marks re-entries in the direction of the higher-timeframe trend, confirmed by a volume gate, and plots the intended stop/target frame for each signal.
What it does
Trades only with the trend: long signals when the 4H EMA-50 is above EMA-200, shorts when below. The trend filter reads the previous completed HTF bar with lookahead_off, so it does not repaint.
Signals on RSI(14) re-entry after a pullback — cross up through 40 in uptrends, cross down through 60 in downtrends.
Fires only when volume is at or above its 20-bar average. This volume gate is the validated edge.
Plots an entry/stop/target frame (1.5×ATR stop, 2.0 R:R by default) so you can see the geometry of each signal. The frame is illustrative — this is an indicator, not a backtest, so it shows intent, not fills.
Built-in alerts: named conditions for long/short in the Create Alert dialog, plus a dynamic-price alert() option. Set alerts to Once Per Bar Close to match the tested bar-close logic.
Data requirement — read before using
The volume gate depends on real volume, so a real-time data feed for the instrument is needed for live signals. On GC and other CME/COMEX futures, TradingView volume is true contract volume — exactly what this was built on. On spot/CFD gold (XAUUSD), volume is only tick volume, a different quantity, and the edge does not carry over. Run it on the futures.
Suggested use
GC1! (or the live front month) on the 1H timeframe, with the higher-timeframe trend filter at 240 (4H) — the configuration it was validated on. Note that GC1! is an auto-rolled continuous contract, so expect minor discontinuities at each roll; trade the actual front month live. Real-time COMEX volume on TradingView requires the CME/COMEX real-time data add-on — without it the feed is delayed and live signals will lag.
Scope
The underlying logic was validated on a single ~10.5-month gold uptrend, so treat signals as a starting point, not a finished system, and confirm behavior across other regimes before relying on it.
Research and educational tool, not financial advice. Markets carry risk; past behavior does not guarantee future results.
What it does
Trades only with the trend: long signals when the 4H EMA-50 is above EMA-200, shorts when below. The trend filter reads the previous completed HTF bar with lookahead_off, so it does not repaint.
Signals on RSI(14) re-entry after a pullback — cross up through 40 in uptrends, cross down through 60 in downtrends.
Fires only when volume is at or above its 20-bar average. This volume gate is the validated edge.
Plots an entry/stop/target frame (1.5×ATR stop, 2.0 R:R by default) so you can see the geometry of each signal. The frame is illustrative — this is an indicator, not a backtest, so it shows intent, not fills.
Built-in alerts: named conditions for long/short in the Create Alert dialog, plus a dynamic-price alert() option. Set alerts to Once Per Bar Close to match the tested bar-close logic.
Data requirement — read before using
The volume gate depends on real volume, so a real-time data feed for the instrument is needed for live signals. On GC and other CME/COMEX futures, TradingView volume is true contract volume — exactly what this was built on. On spot/CFD gold (XAUUSD), volume is only tick volume, a different quantity, and the edge does not carry over. Run it on the futures.
Suggested use
GC1! (or the live front month) on the 1H timeframe, with the higher-timeframe trend filter at 240 (4H) — the configuration it was validated on. Note that GC1! is an auto-rolled continuous contract, so expect minor discontinuities at each roll; trade the actual front month live. Real-time COMEX volume on TradingView requires the CME/COMEX real-time data add-on — without it the feed is delayed and live signals will lag.
Scope
The underlying logic was validated on a single ~10.5-month gold uptrend, so treat signals as a starting point, not a finished system, and confirm behavior across other regimes before relying on it.
Research and educational tool, not financial advice. Markets carry risk; past behavior does not guarantee future results.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Sharing clean, logical market analysis focused on liquidity, structure and volume. No signals, no pressure — just education. If you want more insights, you’re welcome to join: t.me/CE3vdc5m72w4MjRk
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Sharing clean, logical market analysis focused on liquidity, structure and volume. No signals, no pressure — just education. If you want more insights, you’re welcome to join: t.me/CE3vdc5m72w4MjRk
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.