OPEN-SOURCE SCRIPT
Updated Cross Exchange Premium Drift Map [AGPro Series]

Cross Exchange Premium Drift Map [AGPro Series]
🧠 Core Idea
Is the active crypto venue drifting away from the exchange basket, or is the market staying aligned across venues?
📌 Overview / What it does
Cross Exchange Premium Drift Map [AGPro Series] is a crypto market structure tool designed to compare the active chart against a configurable basket of exchange reference symbols.
Instead of reading only the local chart, the script builds a venue basket from multiple exchange feeds and measures whether the active venue is trading at a premium, discount, or neutral alignment versus that basket.
It produces a premium drift path, a dispersion path, a right-side venue premium stack, event labels, strongest/weakest venue context, and a compact panel. It does not predict price direction, automate trading, or claim that a premium will close immediately.
🎯 Purpose & Design Philosophy
This script was built to fill a specific gap in crypto analysis: many traders look at one exchange chart and assume that chart represents the whole market.
Crypto is fragmented across venues. Premiums, discounts, and venue dispersion can appear before important shifts in liquidity, risk appetite, or execution quality.
The purpose of this tool is to make that fragmentation visible in a structured, readable, and non-predictive way.
⚡ Why This Script Is Different
Most tools focus on the active chart alone, or compare futures against spot using a basis model.
This script does NOT operate as a funding, carry, open interest, or perp-versus-spot basis indicator.
Instead, it compares the active venue against a configurable cross-exchange reference basket, then maps premium drift, venue dispersion, strongest venue, weakest venue, and alignment quality into a dedicated visual workflow.
⚙️ Methodology
1. Venue Basket Construction
The script requests multiple user-defined exchange symbols and builds an average reference basket from available venue prices.
2. Premium Drift Detection
The active chart is compared against the venue basket to calculate premium or discount.
3. Dispersion Evaluation
The script measures how far individual venues are spread around the basket.
4. State Classification
Premium, discount, spread expansion, spread compression, and exchange alignment are converted into readable states.
5. Visual Output
The chart displays premium paths, event labels, a right-side venue stack, and a panel summary.
🗺️ How to Read the Chart
The premium drift path shows how the active chart behaves relative to the venue basket.
The dispersion path shows whether exchange prices are widening away from each other or compressing toward alignment.
The right-side venue stack shows the current premium/discount context, basket drift, dispersion, strongest venue, and weakest venue.
Labels mark meaningful changes such as Venue Premium, Venue Discount, Spread Expansion, and Exchange Alignment.
The panel summarizes state, score, premium, drift z-score, velocity, dispersion, direction, grade, and venue count.
🚦 Signals & States
• Venue Premium → the active chart trades meaningfully above the exchange basket
• Venue Discount → the active chart trades meaningfully below the exchange basket
• Spread Expansion → venue dispersion is widening
• Spread Compression → venue prices are moving closer together
• Exchange Alignment → venues are compressed and the active chart is near the basket
• Check Venue Set → selected symbols may not represent the same asset or may be mismatched
🔔 Alerts Logic
Alerts trigger when the script detects a fresh state transition into a meaningful venue condition.
Venue Premium alerts mark active-chart premium pressure versus the basket.
Venue Discount alerts mark active-chart discount pressure versus the basket.
Spread Expansion alerts mark widening cross-exchange dispersion.
Exchange Alignment alerts mark compression toward venue agreement.
Alerts are attention markers, not trade instructions.
🧩 Confluence Logic
The strongest readings occur when premium drift, drift z-score, velocity, dispersion, and persistence align.
When these conditions align, the venue message becomes more meaningful, but it still remains context rather than a prediction.
📊 When to Use
• Crypto spot charts with active multi-exchange liquidity
• BTC, ETH, and major liquid altcoin pairs
• Periods where venue premium, discount, or spread quality matters
• Market structure review before interpreting local price action
• Cross-exchange monitoring during volatile sessions
⚠️ When NOT to Use
• Illiquid symbols with unreliable venue references
• Symbols where the basket does not match the active chart asset
• Extremely noisy low-timeframe conditions
• Markets where one or more venue feeds are missing or stale
• Situations where the user expects guaranteed arbitrage signals
🎛️ Key Inputs
• Venue Symbols → define the exchange reference basket
• Venue Labels → control the short exchange names shown in the visual stack
• Premium Threshold → controls when active-chart premium or discount becomes relevant
• Dispersion Threshold → controls when cross-exchange spread widening matters
• Premium Baseline Length → controls the drift baseline
• Premium Z-Score Length → controls normalization
• Visual Settings → control panel, labels, paths, and venue stack display
🖥️ Interface & Visual Design
The interface is built for quick market reading.
The panel provides compact state information.
The premium stack shows the current venue relationship without using pale or white primary visuals, preserving readability on both dark and light chart backgrounds.
Labels are designed to be visible, premium, and not buried inside candles.
🧪 Practical Usage Workflow
1. Confirm that the venue symbols match the active chart asset.
2. Read the panel state and score.
3. Check whether the active chart is premium, discount, aligned, or mismatched.
4. Inspect the strongest and weakest venue labels.
5. Use the premium and dispersion paths to understand whether the relationship is widening or normalizing.
🔍 Interpretation Guidelines
A venue premium does not automatically mean price must fall.
A venue discount does not automatically mean price must rise.
Spread expansion means exchange prices are becoming less aligned.
Exchange alignment means the active venue is closer to the basket.
The script should be read as market context, not as a buy or sell system.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not financial advice.
It is not an arbitrage execution tool.
It is not an auto-trading system.
It does not guarantee that premiums, discounts, or spreads will normalize.
⚠️ Limitations & Transparency
Cross-exchange readings depend on symbol quality, venue availability, quote currency differences, and TradingView data access.
USD and USDT references may behave slightly differently.
Low-liquidity assets can produce unstable readings.
Timeframe differences and exchange data behavior can affect how states appear.
🧠 Market Context Notes
Crypto markets are fragmented.
The same asset can trade differently across exchanges because of liquidity, regional flow, quote currency differences, venue-specific demand, and execution conditions.
This script attempts to make that fragmentation easier to see.
🧾 Use Case Examples
When the active chart trades above the basket while dispersion expands, the market may be showing venue-specific premium pressure.
When the active chart trades below the basket while dispersion expands, the market may be showing local venue weakness.
When premium and dispersion compress together, the market may be returning toward exchange alignment.
🧱 System Philosophy
Cross Exchange Premium Drift Map follows the AGProLabs design principle of building decision-support maps rather than prediction tools.
The goal is to improve context, visual structure, and trader awareness.
🔐 Non-Promise Statement
No signal in this script guarantees a future price move.
No premium or discount reading guarantees convergence.
All outputs require broader market interpretation.
📉 Risk Disclosure
Trading involves risk.
Users are fully responsible for their own decisions.
This script does not provide financial advice, investment advice, or guaranteed trading outcomes.
📚 Educational Note
This tool is designed for educational and analytical use. It helps traders study cross-exchange price behavior, venue alignment, and premium drift as part of a broader market structure workflow.
🧠 Core Idea
Is the active crypto venue drifting away from the exchange basket, or is the market staying aligned across venues?
📌 Overview / What it does
Cross Exchange Premium Drift Map [AGPro Series] is a crypto market structure tool designed to compare the active chart against a configurable basket of exchange reference symbols.
Instead of reading only the local chart, the script builds a venue basket from multiple exchange feeds and measures whether the active venue is trading at a premium, discount, or neutral alignment versus that basket.
It produces a premium drift path, a dispersion path, a right-side venue premium stack, event labels, strongest/weakest venue context, and a compact panel. It does not predict price direction, automate trading, or claim that a premium will close immediately.
🎯 Purpose & Design Philosophy
This script was built to fill a specific gap in crypto analysis: many traders look at one exchange chart and assume that chart represents the whole market.
Crypto is fragmented across venues. Premiums, discounts, and venue dispersion can appear before important shifts in liquidity, risk appetite, or execution quality.
The purpose of this tool is to make that fragmentation visible in a structured, readable, and non-predictive way.
⚡ Why This Script Is Different
Most tools focus on the active chart alone, or compare futures against spot using a basis model.
This script does NOT operate as a funding, carry, open interest, or perp-versus-spot basis indicator.
Instead, it compares the active venue against a configurable cross-exchange reference basket, then maps premium drift, venue dispersion, strongest venue, weakest venue, and alignment quality into a dedicated visual workflow.
⚙️ Methodology
1. Venue Basket Construction
The script requests multiple user-defined exchange symbols and builds an average reference basket from available venue prices.
2. Premium Drift Detection
The active chart is compared against the venue basket to calculate premium or discount.
3. Dispersion Evaluation
The script measures how far individual venues are spread around the basket.
4. State Classification
Premium, discount, spread expansion, spread compression, and exchange alignment are converted into readable states.
5. Visual Output
The chart displays premium paths, event labels, a right-side venue stack, and a panel summary.
🗺️ How to Read the Chart
The premium drift path shows how the active chart behaves relative to the venue basket.
The dispersion path shows whether exchange prices are widening away from each other or compressing toward alignment.
The right-side venue stack shows the current premium/discount context, basket drift, dispersion, strongest venue, and weakest venue.
Labels mark meaningful changes such as Venue Premium, Venue Discount, Spread Expansion, and Exchange Alignment.
The panel summarizes state, score, premium, drift z-score, velocity, dispersion, direction, grade, and venue count.
🚦 Signals & States
• Venue Premium → the active chart trades meaningfully above the exchange basket
• Venue Discount → the active chart trades meaningfully below the exchange basket
• Spread Expansion → venue dispersion is widening
• Spread Compression → venue prices are moving closer together
• Exchange Alignment → venues are compressed and the active chart is near the basket
• Check Venue Set → selected symbols may not represent the same asset or may be mismatched
🔔 Alerts Logic
Alerts trigger when the script detects a fresh state transition into a meaningful venue condition.
Venue Premium alerts mark active-chart premium pressure versus the basket.
Venue Discount alerts mark active-chart discount pressure versus the basket.
Spread Expansion alerts mark widening cross-exchange dispersion.
Exchange Alignment alerts mark compression toward venue agreement.
Alerts are attention markers, not trade instructions.
🧩 Confluence Logic
The strongest readings occur when premium drift, drift z-score, velocity, dispersion, and persistence align.
When these conditions align, the venue message becomes more meaningful, but it still remains context rather than a prediction.
📊 When to Use
• Crypto spot charts with active multi-exchange liquidity
• BTC, ETH, and major liquid altcoin pairs
• Periods where venue premium, discount, or spread quality matters
• Market structure review before interpreting local price action
• Cross-exchange monitoring during volatile sessions
⚠️ When NOT to Use
• Illiquid symbols with unreliable venue references
• Symbols where the basket does not match the active chart asset
• Extremely noisy low-timeframe conditions
• Markets where one or more venue feeds are missing or stale
• Situations where the user expects guaranteed arbitrage signals
🎛️ Key Inputs
• Venue Symbols → define the exchange reference basket
• Venue Labels → control the short exchange names shown in the visual stack
• Premium Threshold → controls when active-chart premium or discount becomes relevant
• Dispersion Threshold → controls when cross-exchange spread widening matters
• Premium Baseline Length → controls the drift baseline
• Premium Z-Score Length → controls normalization
• Visual Settings → control panel, labels, paths, and venue stack display
🖥️ Interface & Visual Design
The interface is built for quick market reading.
The panel provides compact state information.
The premium stack shows the current venue relationship without using pale or white primary visuals, preserving readability on both dark and light chart backgrounds.
Labels are designed to be visible, premium, and not buried inside candles.
🧪 Practical Usage Workflow
1. Confirm that the venue symbols match the active chart asset.
2. Read the panel state and score.
3. Check whether the active chart is premium, discount, aligned, or mismatched.
4. Inspect the strongest and weakest venue labels.
5. Use the premium and dispersion paths to understand whether the relationship is widening or normalizing.
🔍 Interpretation Guidelines
A venue premium does not automatically mean price must fall.
A venue discount does not automatically mean price must rise.
Spread expansion means exchange prices are becoming less aligned.
Exchange alignment means the active venue is closer to the basket.
The script should be read as market context, not as a buy or sell system.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not financial advice.
It is not an arbitrage execution tool.
It is not an auto-trading system.
It does not guarantee that premiums, discounts, or spreads will normalize.
⚠️ Limitations & Transparency
Cross-exchange readings depend on symbol quality, venue availability, quote currency differences, and TradingView data access.
USD and USDT references may behave slightly differently.
Low-liquidity assets can produce unstable readings.
Timeframe differences and exchange data behavior can affect how states appear.
🧠 Market Context Notes
Crypto markets are fragmented.
The same asset can trade differently across exchanges because of liquidity, regional flow, quote currency differences, venue-specific demand, and execution conditions.
This script attempts to make that fragmentation easier to see.
🧾 Use Case Examples
When the active chart trades above the basket while dispersion expands, the market may be showing venue-specific premium pressure.
When the active chart trades below the basket while dispersion expands, the market may be showing local venue weakness.
When premium and dispersion compress together, the market may be returning toward exchange alignment.
🧱 System Philosophy
Cross Exchange Premium Drift Map follows the AGProLabs design principle of building decision-support maps rather than prediction tools.
The goal is to improve context, visual structure, and trader awareness.
🔐 Non-Promise Statement
No signal in this script guarantees a future price move.
No premium or discount reading guarantees convergence.
All outputs require broader market interpretation.
📉 Risk Disclosure
Trading involves risk.
Users are fully responsible for their own decisions.
This script does not provide financial advice, investment advice, or guaranteed trading outcomes.
📚 Educational Note
This tool is designed for educational and analytical use. It helps traders study cross-exchange price behavior, venue alignment, and premium drift as part of a broader market structure workflow.
Release Notes
🔧 UPDATE NOTES - V1.1This update focuses on readability, panel clarity, visual hierarchy, and cleaner venue-stack interpretation.
The core purpose of the script remains unchanged.
This release improves how venue premium, venue discount, dispersion, velocity, and exchange alignment are presented on the chart.
This script continues to function as an analytical and visualization tool.
It does not attempt to predict price direction or provide guaranteed outcomes.
------------------------
What Changed
------------------------
• Reworked the AG Pro panel into a cleaner two-column layout.
The panel now summarizes state, premium, spread, venue count, venue leaders, and action without crowding the dashboard.
• Improved dark-theme panel contrast.
Rows now use stronger alternating backgrounds, clearer borders, brighter labels, and higher-readability value text.
• Added full panel location support.
Top, middle, and bottom placement options are available for left, center, and right chart positions.
• Refined the venue premium stack.
The right-side stack now projects closer by default and uses a cleaner centered badge for faster interpretation.
• Improved event label readability.
Event labels now use two-line Title Case text with score context and contrast-aware text color.
• Added stronger tooltip coverage.
Venue labels, data symbols, visual controls, and alert controls now provide clearer English guidance.
------------------------
Visual Improvements
------------------------
• Improved chart readability by adjusting labels, right-side tags, row contrast, and centered stack text.
• Reduced visual clutter while keeping enough event history for an active publication screenshot.
• Refined visual hierarchy so state, premium drift, dispersion, and venue leaders stand out more clearly.
• Kept text inside contrast-safe badges instead of relying on transparent rail text.
------------------------
Interface & Usability
------------------------
• Optimized panel layout for clearer information flow.
• Improved label readability for better chart interaction.
• Adjusted default stack projection for a more balanced right-side layout.
• Enhanced overall user experience without changing the core analytical logic.
------------------------
Behavior Notes
------------------------
This update does not change the core analytical purpose of the script.
The goal is to improve clarity, usability, and visual structure, not to introduce predictive behavior.
Users should interpret outputs the same way as before, but with improved visual organization.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool.
Cross-exchange symbols may differ by quote currency, market type, venue liquidity, and data availability.
Outputs should always be interpreted within broader market context.
------------------------
Risk Reminder
------------------------
This script is for educational and analytical purposes only.
It does not provide financial advice or guaranteed trading outcomes.
Users remain responsible for their own decisions.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Public-free and invite-only TradingView Pine Script tools for market analysis, risk planning, liquidity and execution review.
Script library & access: aligurtuna.com/agprolabs-pine-scriptleri/
Telegram: t.me/agprolabs
Script library & access: aligurtuna.com/agprolabs-pine-scriptleri/
Telegram: t.me/agprolabs
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Public-free and invite-only TradingView Pine Script tools for market analysis, risk planning, liquidity and execution review.
Script library & access: aligurtuna.com/agprolabs-pine-scriptleri/
Telegram: t.me/agprolabs
Script library & access: aligurtuna.com/agprolabs-pine-scriptleri/
Telegram: t.me/agprolabs
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.