OPEN-SOURCE SCRIPT
Gold Sniper Pro: Trend & Reversal System

Title: Gold Sniper Pro: Trend & Reversal System [XAUUSD]
Headline: Stop choosing between "Buying the Dip" and "Chasing the Trend." Now you can do both.
Introduction: Most indicators fail because they only work in one market condition. Reversal indicators fail during strong breakouts (selling too early), and Trend indicators fail during ranging markets (buying the top).
Gold Sniper Pro solves this by running two separate algorithms simultaneously to cover every phase of price action on Gold (XAUUSD).
How It Works (The Dual-Core Logic):
1. 🟢 SNIPER MODE (The "Buy Low" Logic)
Goal: Catch the exact bottom of a pullback.
Logic: Detects when price sweeps a liquidity low but is trading at a "discount" (below the EMA 20).
Signal: Displays a Green "SNIPER" label.
Best for: Ranging markets and deep corrections.
2. 🔵 TREND MODE (The "Breakout" Logic)
Goal: Catch the high-momentum runaway moves (like the 16:40 pump).
Logic: Detects when price is holding above the EMA 20 with strong momentum. It buys the strength, not the weakness.
Signal: Displays a Blue "TREND" label.
Best for: News events and strong directional rallies.
Key Features:
⚡ Dynamic EMA Filter: Replaces laggy RSI with real-time price action relative to the EMA 20.
🛡️ Multi-Timeframe Safety: Built-in 30m Trend Filter to prevent trading against the major trend (can be toggled OFF for aggressive scalping).
🎯 Auto TP/SL Lines: Automatically plots your Risk:Reward (2:1) targets on the chart.
🚀 "Force Trade" Switch: A new feature that allows you to bypass safety filters during high-volatility news events to catch fast breakouts.
How to Use:
Timeframe: Best on 1m or 5m (Designed for XAUUSD/Gold).
Aggressive: Check "Ignore 30m Filter" in settings to catch every scalping opportunity.
Conservative: Uncheck "Ignore Filter" to only trade when the 30m trend is aligned.
Exit: Close trade when price hits the Green TP line or Red SL line.
Settings:
EMA Length: 20 (Standard Institutional Trend).
Reward Ratio: 2.0 (Default).
Headline: Stop choosing between "Buying the Dip" and "Chasing the Trend." Now you can do both.
Introduction: Most indicators fail because they only work in one market condition. Reversal indicators fail during strong breakouts (selling too early), and Trend indicators fail during ranging markets (buying the top).
Gold Sniper Pro solves this by running two separate algorithms simultaneously to cover every phase of price action on Gold (XAUUSD).
How It Works (The Dual-Core Logic):
1. 🟢 SNIPER MODE (The "Buy Low" Logic)
Goal: Catch the exact bottom of a pullback.
Logic: Detects when price sweeps a liquidity low but is trading at a "discount" (below the EMA 20).
Signal: Displays a Green "SNIPER" label.
Best for: Ranging markets and deep corrections.
2. 🔵 TREND MODE (The "Breakout" Logic)
Goal: Catch the high-momentum runaway moves (like the 16:40 pump).
Logic: Detects when price is holding above the EMA 20 with strong momentum. It buys the strength, not the weakness.
Signal: Displays a Blue "TREND" label.
Best for: News events and strong directional rallies.
Key Features:
⚡ Dynamic EMA Filter: Replaces laggy RSI with real-time price action relative to the EMA 20.
🛡️ Multi-Timeframe Safety: Built-in 30m Trend Filter to prevent trading against the major trend (can be toggled OFF for aggressive scalping).
🎯 Auto TP/SL Lines: Automatically plots your Risk:Reward (2:1) targets on the chart.
🚀 "Force Trade" Switch: A new feature that allows you to bypass safety filters during high-volatility news events to catch fast breakouts.
How to Use:
Timeframe: Best on 1m or 5m (Designed for XAUUSD/Gold).
Aggressive: Check "Ignore 30m Filter" in settings to catch every scalping opportunity.
Conservative: Uncheck "Ignore Filter" to only trade when the 30m trend is aligned.
Exit: Close trade when price hits the Green TP line or Red SL line.
Settings:
EMA Length: 20 (Standard Institutional Trend).
Reward Ratio: 2.0 (Default).
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.
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.
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.