New Indicator: Cross-Asset FX Macro Divergence Engine

The Cross-Asset FX Macro Divergence Engine for TradingView bridges sovereign bond yield spreads and spot foreign exchange pricing to identify macro mean-reversion setups confirmed by local micro-structure shifts. Rather than trading isolated momentum or lagging price indicators, this engine measures statistical disparity between spot exchange rates and their underlying sovereign 10-year yield differentials before executing on verified price action.

Purpose

Forex currency pairs are fundamentally driven by interest rate expectations and sovereign yield differentials. However, short-term intraday order flow and momentum runs frequently drive spot FX prices away from their sovereign bond yield fundamentals, creating pricing imbalances.

The Cross-Asset FX Macro Divergence Engine solves two primary challenges for active FX traders:

  • The Macro Gap: Quantifies the rolling statistical deviation (Delta Z) between spot FX price and the sovereign 10-year yield spread to detect when an asset is trading at an unsustainable premium or discount.
  • Premature Counter-Trend Entries: Avoids “knife-catching” during strong macro trends by arming an execution state on statistical disparity, but requiring micro-structure confirmation via a Change of Character (ChoCH) before generating a valid trade trigger.

Usage

The engine operates on a two-stage execution architecture designed to filter out false breakouts and chop:

1. Macro Arming

The script tracks daily sovereign yield spreads (such as US10Y vs. DE10Y, GB10Y, JP10Y, or AU10Y) using closed-bar daily data to prevent repainting. When the disparity between spot price Z-score and the yield spread Z-score crosses your target standard deviation threshold, the system enters an armed state:

  • Extreme Discount: Spot price is significantly undervalued relative to sovereign bond yield support, arming for a bullish mean-reversion setup.
  • Extreme Premium: Spot price is significantly overvalued relative to sovereign bond yield spreads, arming for a bearish mean-reversion setup.

2. Micro-Structure Confirmation (ChoCH)

Once armed, the indicator waits for a local Change of Character (ChoCH) to confirm structural market reversal. If price breaks and closes beyond the recent swing high (for longs) or swing low (for shorts) within the configured arming expiry window, an entry signal fires.

3. Integrated Risk & Trade Visualization

Upon signal generation, the script projects visual trade levels directly on the chart:

  • Entry Marker: Yellow horizontal level dash (-) plotted on the execution bar.
  • Profit Target: Green level dash (-) calibrated from your Reward-to-Risk (R:R) setting.
  • Stop Loss: Red level dash (-) calculated from Average True Range (ATR) or structural swing pivots.

Details

Sovereign Yield-Implied Fair Value & Parity Bands

The engine calculates a rolling benchmark fair value by projecting the yield spread’s Z-score onto the spot price mean and standard deviation. This produces an on-chart Macro Fair Value centerline along with dynamic sigma Parity Bands and an Equilibrium Cloud, allowing you to instantly assess price position relative to macro parity.

On-Chart Telemetry Dashboard (HUD)

A customizable Heads-Up Display provides real-time auditability across multiple market metrics:

  • Macro State: Displays whether the current market is in an EXTREME DISCOUNT 🟢, EXTREME PREMIUM 🔴, or EQUILIBRIUM ⚪ state.
  • Macro Disparity (Delta Z): Real-time numerical standard deviation disparity between spot price and yield spread.
  • Yield Spread: The calculated net percentage spread between base and quote sovereign benchmark yields.
  • Implied Fair Value: Exact synthetic price target where spot price achieves yield parity.
  • Active Z-Threshold: Current operating standard deviation trigger level.

Built-In Alert Conditions

The script comes equipped with ready-to-use TradingView alert conditions:

  • Bullish Macro Reversion Alert: Fires on confirmed long signals.
  • Bearish Macro Reversion Alert: Fires on confirmed short signals.
  • Macro Parity Outlier Alert: Fires immediately when spot price reaches the extreme disparity threshold (sigma), alerting you before structure breaks.

Settings

Cross-Asset & Sovereign Yield Ingestion

  • FX Pair Preset: Select between EUR/USD, GBP/USD, USD/JPY, AUD/USD, or Custom. Selecting a major pair automatically assigns the corresponding sovereign 10Y bond tickers (e.g., US10Y and DE10Y for EUR/USD, US10Y and JP10Y for USD/JPY).
  • Base Currency 10Y Yield Ticker: Custom benchmark symbol for base currency yield (Default: TVC:US10Y).
  • Quote Currency 10Y Yield Ticker: Custom benchmark symbol for counter currency yield (Default: TVC:DE10Y).
  • Dollar Index (DXY) Ticker: Reference benchmark ticker for global USD strength (Default: CAPITALCOM:DXY).

Rolling Z-Score Macro Divergence Engine

  • Macro Rolling Lookback Window (Bars): Lookback window (10–200 bars, default: 50) used to compute the rolling mean and standard deviation for spot price and the yield spread.
  • Parity Divergence Z-Score Threshold ($\sigma$): Standard deviation threshold required to arm the system for mean-reversion.

Micro-Structure Shift (ChoCH) Confirmation

  • ChoCH Swing Detection Lookback: Lookback period (2–20 bars, default: 5) used to identify local swing highs and lows for structural breakouts.
  • Macro Arming Expiry Window (Bars): Valid bar duration (1–50 bars, default: 15) after reaching extreme macro disparity for a ChoCH trigger to execute.
  • ChoCH Requires Candle Body Close: When enabled (true), candle close must break the swing level; when disabled (false), wick breaks are accepted.

Risk Management & Simulation Targets

  • Allow Concurrent Trades: Toggles whether new positions can be opened while a simulated trade is active.
  • Stop Loss Calculation Mode: Choose between ATR (volatility-based) or Structure (swing high/low pivot-based).
  • ATR Multiplier for Stop Loss: Multiplier applied to Average True Range for stop distance (Default: 2.0).
  • Reward-to-Risk Ratio (R:R): Profit target multiplier relative to initial stop distance (Default: 2.0).
  • ATR Length: Smoothing period for ATR calculations (Default: 14).

Visual & Display Settings

  • Show Macro Parity Bands & Fair Value: Toggles the on-chart fair value centerline and $\pm 2.0\sigma$ parity envelope.
  • Highlight Extreme Disparity Zones: Toggles subtle green/red background shading during extreme macro discount or premium phases.
  • Show ChoCH Structure Trigger Levels: Toggles visual circle plots of active swing high and low trigger levels.
  • Show On-Chart HUD Dashboard: Toggles the real-time telemetry info box.
  • HUD Position: Pins dashboard to any screen corner.

Premium AI AutoTuning and Order Tracking

If you purchase a premium subscription, you will get the added functionality of our ai enabled auto tuning, which allows you to set an upper and lower boundary for key inputs, and then the indicator will track the failure and success of each trade and automatically adjust those key values, within that range, to optimize performance. You will also get a new HUD with the additional insights and analytics.

Summary

The Cross-Asset FX Macro Divergence Engine converts intermarket sovereign yield analysis into a systematic, rule-based execution model. By pairing statistical Z-score disparity with local price structure shifts, it eliminates blind counter-trend entries and provides active FX traders with an objective framework for macro mean-reversion.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top