DXY/XAU Volatility Mismatch & Retracement

1 356
Here is a complete Pine Script (Version 5) custom-built to execute the exact logic you described. It operates as a state machine that mathematically quantifies the "massive push" in the DXY, checks for the "sideways and low volume" anomaly on Gold (XAU/USD), and waits for the DXY retracement to fire the signal.

How the Logic Works:
DXY Impulse Detection (The Massive Push): The script fetches data from the DXY ticker and calculates its Average True Range (ATR). It measures the DXY's momentum over the last few bars and normalizes it against the ATR. If the move is excessively large, it triggers the first condition.

Gold Compression Filter (Low Volume / Sideways): Simultaneously, the script checks the primary chart (Gold). It requires the Average Directional Index (ADX) to be below 20 (indicating no trend) and the Relative Volume (RVol) to be below 0.70 (indicating low volume exhaustion).

The Pullback Trigger: Once the mismatch is locked in (State = Armed), the script stops looking for expansion and waits for the DXY to retrace. This is detected using a MACD cross-under or a price break below a short-term moving average on the DXY. The moment the DXY corrects, the indicator fires a BUY signal on your Gold chart.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。