OPEN-SOURCE SCRIPT
מעודכן XAU/DXY Macro Engine

Here is the English version of the professional description, structured and formatted specifically for your TradingView script publication:
📌 Suggested Title for TradingView
XAU/DXY Advanced Macro Engine [MTX Hybrid Upgrade]
📝 Script Description (To paste into the description box)
Overview
This indicator is an institutional-grade macro correlation engine designed specifically for scalping and day trading Gold (XAUUSD). Inspired by the advanced intermarket strategies popularized by trading academies like MATRIX Academy, this script dynamically merges the data of the US Dollar Index (DXY) and the 10-Year US Treasury Yields (US10Y) directly onto your Gold chart. It eliminates traditional market noise using advanced algorithmic filtering to provide crystal-clear execution zones.
🚀 Key Features & Algorithmic Advantages
Smart Hybrid Alignment (Anti-Drift): Unlike standard overlay tools that distort, warp, or flatten when you zoom out or scroll back through history, this engine uses an adaptive normalization algorithm. The macro trendline remains perfectly anchored to the true heart of Gold’s price structure.
Strict Inversion Polarity Logic: The script respects foundational intermarket mechanics. During a bearish Gold phase (Dollar dominance), the macro curve automatically flips above the Gold candles to act as a solid ceiling of resistance. In a bullish phase, it glides below them to act as support.
Algorithme Dynamic Retest Lock (The "MTX Trap"): When a major structural shift occurs, the indicator temporarily freezes the macro curve horizontally, turning it into a fixed, rigid price line. The line only unlocks and resumes its smoothed path once Gold has officially executed a technical retest (candle wick tagging the line).
Pearson Correlation Filter (Anti-Whipsaw): If Gold and the Dollar temporarily move in the same direction due to geopolitical safe-haven spikes or systemic crises, the engine immediately flags a CONFLICT state and neutralizes entry signals to protect your capital.
Supercharged HUD Dashboard: A sleek on-screen display showing real-time market metrics:
Current macro trend state and market volume regime.
High-precision DXY momentum measured in pure ATR ratio.
An automated lot size calculator that computes your exact MT4/MT5 position sizing in real-time based on your capital, risk percentage, and current market volatility (ATR).
📈 Trading Strategy & Execution Rules
For a BUY Trade: Gold must be trading above the macro curve (candles turn turquoise/blue). Wait for the price to correct downward and test the locked horizontal support line. The BUY signal prints at the exact point of contact. Place your Stop-Loss safely below the lower ATR band.
For a SELL Trade: Gold must be trading below the macro curve (candles turn orange/red). Wait for a relief rally to push Gold back up to test the locked horizontal resistance ceiling. The SELL signal triggers on contact. Place your Stop-Loss safely above the upper ATR band.
Recommendation: Highly optimized for M1, M5, and M15 scalping setups during the London and New York sessions.
⚙️ Customizable Settings
Macro Asset: Swap the primary macro driver (defaults to TVC:DXY).
Lookback Period: Adjusts how quickly the curve normalizes and adapts to historical data.
Risk Management: Input your account balance and desired risk percentage per trade so the HUD can instantly output your recommended lot sizing.
📌 Suggested Title for TradingView
XAU/DXY Advanced Macro Engine [MTX Hybrid Upgrade]
📝 Script Description (To paste into the description box)
Overview
This indicator is an institutional-grade macro correlation engine designed specifically for scalping and day trading Gold (XAUUSD). Inspired by the advanced intermarket strategies popularized by trading academies like MATRIX Academy, this script dynamically merges the data of the US Dollar Index (DXY) and the 10-Year US Treasury Yields (US10Y) directly onto your Gold chart. It eliminates traditional market noise using advanced algorithmic filtering to provide crystal-clear execution zones.
🚀 Key Features & Algorithmic Advantages
Smart Hybrid Alignment (Anti-Drift): Unlike standard overlay tools that distort, warp, or flatten when you zoom out or scroll back through history, this engine uses an adaptive normalization algorithm. The macro trendline remains perfectly anchored to the true heart of Gold’s price structure.
Strict Inversion Polarity Logic: The script respects foundational intermarket mechanics. During a bearish Gold phase (Dollar dominance), the macro curve automatically flips above the Gold candles to act as a solid ceiling of resistance. In a bullish phase, it glides below them to act as support.
Algorithme Dynamic Retest Lock (The "MTX Trap"): When a major structural shift occurs, the indicator temporarily freezes the macro curve horizontally, turning it into a fixed, rigid price line. The line only unlocks and resumes its smoothed path once Gold has officially executed a technical retest (candle wick tagging the line).
Pearson Correlation Filter (Anti-Whipsaw): If Gold and the Dollar temporarily move in the same direction due to geopolitical safe-haven spikes or systemic crises, the engine immediately flags a CONFLICT state and neutralizes entry signals to protect your capital.
Supercharged HUD Dashboard: A sleek on-screen display showing real-time market metrics:
Current macro trend state and market volume regime.
High-precision DXY momentum measured in pure ATR ratio.
An automated lot size calculator that computes your exact MT4/MT5 position sizing in real-time based on your capital, risk percentage, and current market volatility (ATR).
📈 Trading Strategy & Execution Rules
For a BUY Trade: Gold must be trading above the macro curve (candles turn turquoise/blue). Wait for the price to correct downward and test the locked horizontal support line. The BUY signal prints at the exact point of contact. Place your Stop-Loss safely below the lower ATR band.
For a SELL Trade: Gold must be trading below the macro curve (candles turn orange/red). Wait for a relief rally to push Gold back up to test the locked horizontal resistance ceiling. The SELL signal triggers on contact. Place your Stop-Loss safely above the upper ATR band.
Recommendation: Highly optimized for M1, M5, and M15 scalping setups during the London and New York sessions.
⚙️ Customizable Settings
Macro Asset: Swap the primary macro driver (defaults to TVC:DXY).
Lookback Period: Adjusts how quickly the curve normalizes and adapts to historical data.
Risk Management: Input your account balance and desired risk percentage per trade so the HUD can instantly output your recommended lot sizing.
הערות שחרור
more stable and robustסקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.