OPEN-SOURCE SCRIPT
Macro Structural Run [XP Tactical HUD]

[Publication Description] Macro Structural Run [XP Tactical HUD]
Overview
The Macro Structural Run (MSR) is a high-precision trend-following system designed to identify the exact onset of long-term market trends while protecting the user from late entries and sudden "blow-off" exhaustion phases. Unlike standard moving averages that suffer from fixed lag, the MSR uses a Structural Decay Filter that dynamically weights price data based on its "Efficiency Score."
1. The Core Logic: Structural Decay
Standard indicators treat every bar with equal importance or use a fixed exponential decay. The MSR is different. It calculates a Weighted Moving Average where the weight of each historical bar is determined by two factors:
Efficiency Ratio (ER): This measures how "clean" the price movement was. If price moved from point A to point B in a straight line, it is 100% efficient. If it zig-zagged wildly to get there, efficiency is low. The MSR prioritizes "efficient" historical structure.
Temporal Decay: Influence decreases as bars move further into the past, allowing the filter to hold onto strong structural foundations while remaining reactive to new data.
2. High-Precision On-Set Detection
To solve the problem of entering a move too late, the XP Execution engine requires three points of confirmation before an INITIATE_RUN signal is triggered:
Structural Surge: The Efficiency Ratio must be high (default > 60%) and actively rising.
Tactical Proximity: The price must be close to the structural filter (measured in ATR). If the price has already exploded away from its base, the signal is suppressed.
Momentum Flip: The filter must confirm a foundational change in the macro trend direction.
3. Reactive Exhaustion Analysis
A major feature of this system is its ability to detect when a run is about to fail. It monitors for three types of "danger zones":
Volatility Spikes: Identifies sudden, violent bars that are significantly larger than the recent average (True Range vs. ATR).
Parabolic Acceleration: Tracks the rate at which the price is warping away from its structural base.
Efficiency Decay: Flags when the "cleanliness" of the move drops below the Exhaustion Floor.
4. How to Use the Diagnostic HUD
The Diagnostic HUD provides real-time telemetry on the state of the market:
RUN_PRECISION: Shows the current efficiency of the trend. Above 60% is ideal for runs.
BASE_ANCHOR: Tells you how far price is from the structural base. "OPTIMAL" means a safe entry zone.
VOL_RATIO: Monitors for spikes. A ratio above 2.0x indicates high-risk volatility.
LATEST_SIGNAL: A centralized readout of the current trade lifecycle (BULL_INITIATE, EXHAUST_EXIT, or SYNC_LOST).
Instructions for Use
Entry: Look for the INITIATE_RUN labels on the chart or the BULL/BEAR_INITIATE status on the HUD. Ensure the SYNC_STATUS is "OPTIMAL."
Holding: Maintain the position as long as the HUD shows "MACRO_STABLE" and the line color remains Cyan or Pink.
Exit: When the line turns Neon Gold or the HUD displays EXHAUST_EXIT, the structural health of the move has collapsed. This is the tactical signal to take profits or tighten stops.
Settings Breakdown
Macro Lookback: Controls the sensitivity of the long-term path. (50+ for macro runs).
Structural Power: Higher values prioritize "clean" price action and ignore noise.
Spike Sensitivity: Adjusts how reactive the system is to sudden volatility. Lower values are more sensitive.
Disclaimer
This indicator is for educational and informational purposes only. It is not financial advice. Trading involves significant risk, and past performance is not indicative of future results. Always use proper risk management.
Overview
The Macro Structural Run (MSR) is a high-precision trend-following system designed to identify the exact onset of long-term market trends while protecting the user from late entries and sudden "blow-off" exhaustion phases. Unlike standard moving averages that suffer from fixed lag, the MSR uses a Structural Decay Filter that dynamically weights price data based on its "Efficiency Score."
1. The Core Logic: Structural Decay
Standard indicators treat every bar with equal importance or use a fixed exponential decay. The MSR is different. It calculates a Weighted Moving Average where the weight of each historical bar is determined by two factors:
Efficiency Ratio (ER): This measures how "clean" the price movement was. If price moved from point A to point B in a straight line, it is 100% efficient. If it zig-zagged wildly to get there, efficiency is low. The MSR prioritizes "efficient" historical structure.
Temporal Decay: Influence decreases as bars move further into the past, allowing the filter to hold onto strong structural foundations while remaining reactive to new data.
2. High-Precision On-Set Detection
To solve the problem of entering a move too late, the XP Execution engine requires three points of confirmation before an INITIATE_RUN signal is triggered:
Structural Surge: The Efficiency Ratio must be high (default > 60%) and actively rising.
Tactical Proximity: The price must be close to the structural filter (measured in ATR). If the price has already exploded away from its base, the signal is suppressed.
Momentum Flip: The filter must confirm a foundational change in the macro trend direction.
3. Reactive Exhaustion Analysis
A major feature of this system is its ability to detect when a run is about to fail. It monitors for three types of "danger zones":
Volatility Spikes: Identifies sudden, violent bars that are significantly larger than the recent average (True Range vs. ATR).
Parabolic Acceleration: Tracks the rate at which the price is warping away from its structural base.
Efficiency Decay: Flags when the "cleanliness" of the move drops below the Exhaustion Floor.
4. How to Use the Diagnostic HUD
The Diagnostic HUD provides real-time telemetry on the state of the market:
RUN_PRECISION: Shows the current efficiency of the trend. Above 60% is ideal for runs.
BASE_ANCHOR: Tells you how far price is from the structural base. "OPTIMAL" means a safe entry zone.
VOL_RATIO: Monitors for spikes. A ratio above 2.0x indicates high-risk volatility.
LATEST_SIGNAL: A centralized readout of the current trade lifecycle (BULL_INITIATE, EXHAUST_EXIT, or SYNC_LOST).
Instructions for Use
Entry: Look for the INITIATE_RUN labels on the chart or the BULL/BEAR_INITIATE status on the HUD. Ensure the SYNC_STATUS is "OPTIMAL."
Holding: Maintain the position as long as the HUD shows "MACRO_STABLE" and the line color remains Cyan or Pink.
Exit: When the line turns Neon Gold or the HUD displays EXHAUST_EXIT, the structural health of the move has collapsed. This is the tactical signal to take profits or tighten stops.
Settings Breakdown
Macro Lookback: Controls the sensitivity of the long-term path. (50+ for macro runs).
Structural Power: Higher values prioritize "clean" price action and ignore noise.
Spike Sensitivity: Adjusts how reactive the system is to sudden volatility. Lower values are more sensitive.
Disclaimer
This indicator is for educational and informational purposes only. It is not financial advice. Trading involves significant risk, and past performance is not indicative of future results. Always use proper risk management.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。