OPEN-SOURCE SCRIPT
Pair Correlation Master [Macro]

The Main Idea
Trading represents a constant battle between Systemic Flows (the whole market moving together) and Idiosyncratic Moves (one specific asset moving on its own).
This tool allows you to monitor a "basket" of 4 assets simultaneously (e.g., the major USD pairs). It answers the most important question in forex and multi-asset trading: "Is this move happening because the Dollar is weak, or because the Euro is strong?"
It separates the "Signal" (the unique move) from the "Noise" (the herd movement).
1. The Chart Lines: The "Race" (Macro Trend)
Think of the lines on your chart as a long-distance race. They visualize the performance of all 4 assets over the last 200 candles (adjustable).
- Bunched Together: If all lines are moving in the same direction, the market is highly correlated. (e.g., "The Dollar is selling off everywhere").
- Fanning Out: If the lines are spreading apart, specific currencies are outperforming others.
- The Zero Line: This is the starting line.
--- Above 0: The pair is in a macro uptrend.
--- Below 0: The pair is in a macro downtrend.
2. The Dashboard: The "Health Check" (Micro Data)
The table in the top right gives you the immediate statistics for right now.
- A. The Z-Score (The Rubber Band)
This measures how "stretched" price is compared to its normal behavior.
- White (< 2.0): Normal trading activity.
- Orange (> 2.0): The price is stretching. Warning sign.
- Red (> 3.0): Critical Stretch. The rubber band is pulled to its limit. Statistically, a pullback or pause is highly likely.
B. The Star (★)
The script automatically calculates the average behavior of your group. If one asset is behaving completely differently from the rest, it marks it with a Star (★).
- Example: EURUSD, GBPUSD, and NZDUSD are flat, but AUDUSD is rallying hard. AUDUSD gets the ★. This is where the unique opportunity lies.
🎯 Best Uses: 4H & Daily Timeframes
This indicator is tuned for "Macro" analysis. It works best on the "4-Hour" and "Daily" charts to filter out intraday noise and capture swing trading moves.
- Strategy 1: The "Rubber Band" Snap (Mean Reversion)
- Setup: Look for a Z-Score in the RED (> 3.0) on the Daily timeframe.
- Action: This indicates an unsustainable move. Look for reversals or exhaustion patterns to trade against the trend back toward the mean.
- Strategy 2: The "Lone Wolf" (Trend Following)
- Setup: Look for the asset with the Star (★).
- Action: If the whole basket is flat (Balanced), but the Star asset is breaking out, that creates a high-quality trend trade because that specific currency has its own catalyst (News/Earnings).
- Strategy 3: Systemic Flows (Basket Trading)
- Setup: The dashboard footer says "⚠️ SYSTEMIC MOVE."
- Action: This means everything is moving together (e.g., a massive USD crash). Don't look for unique setups; just join the trend on the strongest pair.
Dashboard Footer Key
The bottom of the table summarizes the current state of the market for you:
- Balanced / Rangebound: The market is quiet. Good for range trading.
- Focus: [Ticker]: Trade this specific pair. It is moving independently.
- Systemic Move: The whole basket is moving violently. Trade the momentum.
p.s. Suggestion - apply and use on the chart rather than an oscillator.
Trading represents a constant battle between Systemic Flows (the whole market moving together) and Idiosyncratic Moves (one specific asset moving on its own).
This tool allows you to monitor a "basket" of 4 assets simultaneously (e.g., the major USD pairs). It answers the most important question in forex and multi-asset trading: "Is this move happening because the Dollar is weak, or because the Euro is strong?"
It separates the "Signal" (the unique move) from the "Noise" (the herd movement).
1. The Chart Lines: The "Race" (Macro Trend)
Think of the lines on your chart as a long-distance race. They visualize the performance of all 4 assets over the last 200 candles (adjustable).
- Bunched Together: If all lines are moving in the same direction, the market is highly correlated. (e.g., "The Dollar is selling off everywhere").
- Fanning Out: If the lines are spreading apart, specific currencies are outperforming others.
- The Zero Line: This is the starting line.
--- Above 0: The pair is in a macro uptrend.
--- Below 0: The pair is in a macro downtrend.
2. The Dashboard: The "Health Check" (Micro Data)
The table in the top right gives you the immediate statistics for right now.
- A. The Z-Score (The Rubber Band)
This measures how "stretched" price is compared to its normal behavior.
- White (< 2.0): Normal trading activity.
- Orange (> 2.0): The price is stretching. Warning sign.
- Red (> 3.0): Critical Stretch. The rubber band is pulled to its limit. Statistically, a pullback or pause is highly likely.
B. The Star (★)
The script automatically calculates the average behavior of your group. If one asset is behaving completely differently from the rest, it marks it with a Star (★).
- Example: EURUSD, GBPUSD, and NZDUSD are flat, but AUDUSD is rallying hard. AUDUSD gets the ★. This is where the unique opportunity lies.
🎯 Best Uses: 4H & Daily Timeframes
This indicator is tuned for "Macro" analysis. It works best on the "4-Hour" and "Daily" charts to filter out intraday noise and capture swing trading moves.
- Strategy 1: The "Rubber Band" Snap (Mean Reversion)
- Setup: Look for a Z-Score in the RED (> 3.0) on the Daily timeframe.
- Action: This indicates an unsustainable move. Look for reversals or exhaustion patterns to trade against the trend back toward the mean.
- Strategy 2: The "Lone Wolf" (Trend Following)
- Setup: Look for the asset with the Star (★).
- Action: If the whole basket is flat (Balanced), but the Star asset is breaking out, that creates a high-quality trend trade because that specific currency has its own catalyst (News/Earnings).
- Strategy 3: Systemic Flows (Basket Trading)
- Setup: The dashboard footer says "⚠️ SYSTEMIC MOVE."
- Action: This means everything is moving together (e.g., a massive USD crash). Don't look for unique setups; just join the trend on the strongest pair.
Dashboard Footer Key
The bottom of the table summarizes the current state of the market for you:
- Balanced / Rangebound: The market is quiet. Good for range trading.
- Focus: [Ticker]: Trade this specific pair. It is moving independently.
- Systemic Move: The whole basket is moving violently. Trade the momentum.
p.s. Suggestion - apply and use on the chart rather than an oscillator.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน