OPEN-SOURCE SCRIPT
GoldAlgo DXY

GoldAlgo DXY puts the US Dollar Index in a panel under your Gold (XAUUSD) chart and translates it into one simple question: is the dollar a headwind or a tailwind for gold right now?
WHY THE DOLLAR
Gold is priced in dollars, so most of the time it trades inverse to the Dollar Index: a rising DXY pressures gold down, a falling DXY supports it. Watching the two side by side is one of the oldest edges in gold trading — this tool does it for you and reads the relationship out loud.
HOW IT WORKS
1. The dollar in a panel. DXY is plotted as candles (or a line) on your chart's own timeframe, with a trend EMA (default 50) over it.
2. The bias tint. The panel background shades softly red while the dollar trends above its EMA (headwind for gold) and softly green while it trends below (tailwind), so the bias is readable at a glance without studying the candles.
3. The correlation check. A rolling correlation between gold and DXY is tracked over a configurable lookback. On gold it normally sits deep negative; when it drifts toward zero the panel flags the relationship as broken — on those days, trust the dollar less.
ON-CHART DASHBOARD
A live panel shows the DXY price, today's percentage change, the dollar trend, the current gold/DXY correlation with a broken-relationship flag, and the resulting gold bias in plain words: headwind or tailwind.
ALERTS
Alert conditions for the dollar turning up (crossing above its EMA) and turning down (crossing below), so you catch the shifts in the gold backdrop from your phone.
SETTINGS
Dollar Index symbol, candles or line, trend EMA length, correlation lookback, bias tint on/off, and full color customization.
IMPORTANT
GoldAlgo DXY works only on Gold (XAUUSD). On any other symbol it displays a notice instead of drawings. This is an educational analysis tool: correlation is a tendency, not a rule — it does not predict the market and it is not financial advice. Always use proper risk management and never risk capital you cannot afford to lose.
WHY THE DOLLAR
Gold is priced in dollars, so most of the time it trades inverse to the Dollar Index: a rising DXY pressures gold down, a falling DXY supports it. Watching the two side by side is one of the oldest edges in gold trading — this tool does it for you and reads the relationship out loud.
HOW IT WORKS
1. The dollar in a panel. DXY is plotted as candles (or a line) on your chart's own timeframe, with a trend EMA (default 50) over it.
2. The bias tint. The panel background shades softly red while the dollar trends above its EMA (headwind for gold) and softly green while it trends below (tailwind), so the bias is readable at a glance without studying the candles.
3. The correlation check. A rolling correlation between gold and DXY is tracked over a configurable lookback. On gold it normally sits deep negative; when it drifts toward zero the panel flags the relationship as broken — on those days, trust the dollar less.
ON-CHART DASHBOARD
A live panel shows the DXY price, today's percentage change, the dollar trend, the current gold/DXY correlation with a broken-relationship flag, and the resulting gold bias in plain words: headwind or tailwind.
ALERTS
Alert conditions for the dollar turning up (crossing above its EMA) and turning down (crossing below), so you catch the shifts in the gold backdrop from your phone.
SETTINGS
Dollar Index symbol, candles or line, trend EMA length, correlation lookback, bias tint on/off, and full color customization.
IMPORTANT
GoldAlgo DXY works only on Gold (XAUUSD). On any other symbol it displays a notice instead of drawings. This is an educational analysis tool: correlation is a tendency, not a rule — it does not predict the market and it is not financial advice. Always use proper risk management and never risk capital you cannot afford to lose.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。