OPEN-SOURCE SCRIPT
XAUUSD: Ultimate Sniper v6.0 [Order Flow & Macro]

This indicator is a comprehensive trading system designed specifically for XAUUSD (Gold). It moves away from lagging indicators by combining real-time Macro-Economic sentiment, Regression Analysis, and Institutional Order Flow logic into a single professional interface.
### Core Strategy & Features: 1. Macro Correlation Filter: Gold has a strong inverse correlation with the USD (DXY) and Treasury Yields (US10Y). This script monitors them in the background. If DXY/US10Y are Bullish, Gold Buy signals are filtered out to prevent trading against the trend. 2. Linear Regression Channel: Defines the "Fair Value" of price. We only look for reversal trades when price hits the extreme Upper or Lower bands. 3. Order Flow Pressure (New): Analyzes the internal structure of each candle (Wick vs Body). A signal is only confirmed if the "Buying Pressure" or "Selling Pressure" within the candle supports the move (e.g. >50%). 4. RSI Divergence: Automatically spots Bullish and Bearish divergences to identify momentum exhaustion.
### ⚙️ Recommended Settings / Best Practices To get the best results, adjust the settings based on your trading style:
🏎️ SCALPING (1min - 5min Charts) * Goal: Quick entries, smaller targets, higher frequency. * DXY/US10Y Timeframe: Set to "15" or "30" (Reacts faster to macro changes). * Regression Length: 50 or 80 (Adapts to short-term trends). * RSI Length: 9 or 14.
🛡️ INTRADAY (15min - 1h Charts) - [Default] * Goal: Balanced trading, capturing the daily range. * DXY/US10Y Timeframe: Set to "60" (1 Hour). * Regression Length: 100 (Standard setting). * RSI Length: 14.
🦅 SWING TRADING (4h - Daily Charts) * Goal: Catching major trend reversals. * DXY/US10Y Timeframe: Set to "240" (4 Hours) or "D" (Daily). * Regression Length: 200 (Long-term trend baseline). * Channel Width: Increase to 2.5 or 3.0.
### How to Trade: - BUY Signal: Valid when the Dashboard shows "BEARISH" DXY/US10Y and the Live Pressure is "BUYERS". - SELL Signal: Valid when the Dashboard shows "BULLISH" DXY/US10Y and the Live Pressure is "SELLERS". - Risk Management: The script automatically calculates ATR-based Stop Loss (SL) and Take Profit (TP) levels.


### Core Strategy & Features: 1. Macro Correlation Filter: Gold has a strong inverse correlation with the USD (DXY) and Treasury Yields (US10Y). This script monitors them in the background. If DXY/US10Y are Bullish, Gold Buy signals are filtered out to prevent trading against the trend. 2. Linear Regression Channel: Defines the "Fair Value" of price. We only look for reversal trades when price hits the extreme Upper or Lower bands. 3. Order Flow Pressure (New): Analyzes the internal structure of each candle (Wick vs Body). A signal is only confirmed if the "Buying Pressure" or "Selling Pressure" within the candle supports the move (e.g. >50%). 4. RSI Divergence: Automatically spots Bullish and Bearish divergences to identify momentum exhaustion.
### ⚙️ Recommended Settings / Best Practices To get the best results, adjust the settings based on your trading style:
🏎️ SCALPING (1min - 5min Charts) * Goal: Quick entries, smaller targets, higher frequency. * DXY/US10Y Timeframe: Set to "15" or "30" (Reacts faster to macro changes). * Regression Length: 50 or 80 (Adapts to short-term trends). * RSI Length: 9 or 14.
🛡️ INTRADAY (15min - 1h Charts) - [Default] * Goal: Balanced trading, capturing the daily range. * DXY/US10Y Timeframe: Set to "60" (1 Hour). * Regression Length: 100 (Standard setting). * RSI Length: 14.
🦅 SWING TRADING (4h - Daily Charts) * Goal: Catching major trend reversals. * DXY/US10Y Timeframe: Set to "240" (4 Hours) or "D" (Daily). * Regression Length: 200 (Long-term trend baseline). * Channel Width: Increase to 2.5 or 3.0.
### How to Trade: - BUY Signal: Valid when the Dashboard shows "BEARISH" DXY/US10Y and the Live Pressure is "BUYERS". - SELL Signal: Valid when the Dashboard shows "BULLISH" DXY/US10Y and the Live Pressure is "SELLERS". - Risk Management: The script automatically calculates ATR-based Stop Loss (SL) and Take Profit (TP) levels.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน