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
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。