OPEN-SOURCE SCRIPT
DXY/XAU Volatility Mismatch & Retracement

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.
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.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.