OPEN-SOURCE SCRIPT
XAUUSD Macro Anomaly Pulses (Chart XAU) - sudo

XAUUSD Macro Anomaly Pulses
A simple pulse indicator that highlights when XAUUSD moves in a way that macro conditions cannot fully explain
Overview
This indicator marks candles on XAUUSD that behave differently than what the broader market suggests should happen.
Instead of looking at XAUUSD alone, this tool compares gold’s actual movement to an expected movement based on:
Other gold cross pairs (XAUJPY, XAUAUD, XAUCHF)
The U.S. Dollar Index (DXY), inverted
The US30 index (Dow Jones)
When XAUUSD moves much stronger or weaker than this macro-based expectation, the indicator plots a small pulse (a circle) directly on the candle.
Purpose
This indicator helps you quickly see when a candle on XAUUSD is acting “out of character” compared to normal macro flow. In other words:
These unusual moves often signal:
Liquidity grabs
Stop hunts
News-driven spikes
False breakouts
Front-running of macro shifts
How It Works
It reads the XAUUSD candles directly from the chart.
This ensures pulses stick to your candles correctly.
It pulls data from basket legs (XAUJPY, XAUAUD, XAUCHF) and macro symbols (DXY, US30) using security calls.
It converts each symbol into a simple % return per candle.
It builds an “expected” gold move using weighted inputs:
Average return of gold crosses
Inverse return of DXY
Return of US30
It calculates the “residual,” which means:
Pine Script®
It turns that into a Z-score to measure how extreme the deviation is.
If the Z-score is too high or too low, the script marks the candle:
Aqua pulse below bar = unusually strong move
Fuchsia pulse above bar = unusually weak move
How to Interpret the Pulses
Aqua Pulse (below candle) – Bullish anomaly
XAUUSD moved stronger than the macro environment suggests.
Meaning:
-Possible liquidity grab upward
-Possible early trend move
-Possible false breakout
-Price may be overreacting
Fuchsia Pulse (above candle) – Bearish anomaly
XAUUSD moved weaker than expected.
Meaning:
-Possible liquidity sweep downward
-Possible aggressive sell-side event
-Possible exhaustion
-Price may be taking liquidity before reversing
Typical Use Cases
-Spot moments when gold acts independently of macro
-Identify candles that might signal a reversal or a trap
-Confirm whether a breakout is real or suspicious
-Filter trades by macro alignment
-Help understand when XAUUSD is reacting to news or liquidity instead of fundamentals
Inputs Explained
-Z-score Lookback – How many candles are considered normal behavior
-Z-threshold – How extreme a move must be before it is marked
-Basket / DXY / US30 weights – How much influence each macro component has
A simple pulse indicator that highlights when XAUUSD moves in a way that macro conditions cannot fully explain
Overview
This indicator marks candles on XAUUSD that behave differently than what the broader market suggests should happen.
Instead of looking at XAUUSD alone, this tool compares gold’s actual movement to an expected movement based on:
Other gold cross pairs (XAUJPY, XAUAUD, XAUCHF)
The U.S. Dollar Index (DXY), inverted
The US30 index (Dow Jones)
When XAUUSD moves much stronger or weaker than this macro-based expectation, the indicator plots a small pulse (a circle) directly on the candle.
Purpose
This indicator helps you quickly see when a candle on XAUUSD is acting “out of character” compared to normal macro flow. In other words:
“Did XAUUSD move in a way that makes sense with the rest of the market, or did something weird happen?”
These unusual moves often signal:
Liquidity grabs
Stop hunts
News-driven spikes
False breakouts
Front-running of macro shifts
How It Works
It reads the XAUUSD candles directly from the chart.
This ensures pulses stick to your candles correctly.
It pulls data from basket legs (XAUJPY, XAUAUD, XAUCHF) and macro symbols (DXY, US30) using security calls.
It converts each symbol into a simple % return per candle.
It builds an “expected” gold move using weighted inputs:
Average return of gold crosses
Inverse return of DXY
Return of US30
It calculates the “residual,” which means:
actual XAU return - expected macro return
It turns that into a Z-score to measure how extreme the deviation is.
If the Z-score is too high or too low, the script marks the candle:
Aqua pulse below bar = unusually strong move
Fuchsia pulse above bar = unusually weak move
How to Interpret the Pulses
Aqua Pulse (below candle) – Bullish anomaly
XAUUSD moved stronger than the macro environment suggests.
Meaning:
-Possible liquidity grab upward
-Possible early trend move
-Possible false breakout
-Price may be overreacting
Fuchsia Pulse (above candle) – Bearish anomaly
XAUUSD moved weaker than expected.
Meaning:
-Possible liquidity sweep downward
-Possible aggressive sell-side event
-Possible exhaustion
-Price may be taking liquidity before reversing
Typical Use Cases
-Spot moments when gold acts independently of macro
-Identify candles that might signal a reversal or a trap
-Confirm whether a breakout is real or suspicious
-Filter trades by macro alignment
-Help understand when XAUUSD is reacting to news or liquidity instead of fundamentals
Inputs Explained
-Z-score Lookback – How many candles are considered normal behavior
-Z-threshold – How extreme a move must be before it is marked
-Basket / DXY / US30 weights – How much influence each macro component has
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.