OPEN-SOURCE SCRIPT
Asset Premium/Discount Monitor

📊 Overview
The Asset Premium/Discount Monitor is a tool for analyzing the relative value between two correlated assets. It measures when one asset is trading at a premium or discount compared to its historical relationship with another asset, helping traders identify potential mean reversion opportunities, or pairs trading opportunities.
🎯 Use Cases
Perfect for analyzing:
Any two correlated assets where relative value matters
Example of a trade: MSTR vs BTC - When indicator shows MSTR at 95% percentile (extreme premium): Short MSTR, Buy BTC. Then exit when the spread reverts to the mean, say 40-60% percentile.
🔧 How It Works
Core Calculation
The Math
Premium % = (Current Ratio / Historical Average Ratio - 1) × 100
🎨 Customization Options
Correlated Asset: Choose any symbol for comparison
Lookback Period: Adjust historical baseline (50-1000 days)
Smoothing: Reduce noise with moving average (1-50 days)
Visual Toggles: Show/hide bands and percentile lines
Color Themes: Customize premium/discount colors
📊 Interpretation Guide
Premium/Discount Reading
Percentile Ranking
Signal Classifications
🚨 Built-in Alerts
⚠️ Important Notes
🔄 Updates & Future Features
This indicator will be continuously improved based on user feedback. So... please give me your feedback!
The Asset Premium/Discount Monitor is a tool for analyzing the relative value between two correlated assets. It measures when one asset is trading at a premium or discount compared to its historical relationship with another asset, helping traders identify potential mean reversion opportunities, or pairs trading opportunities.
🎯 Use Cases
Perfect for analyzing:
MSTR vs
BTCUSD - MicroStrategy's premium/discount to Bitcoin
COIN vs
BTCUSD - Coinbase's relative value to Bitcoin
TSLA vs
QQQ - Tesla's premium to tech sector
- Regional banks
KRE vs
XLF - Individual bank stocks vs financial sector
Any two correlated assets where relative value matters
Example of a trade: MSTR vs BTC - When indicator shows MSTR at 95% percentile (extreme premium): Short MSTR, Buy BTC. Then exit when the spread reverts to the mean, say 40-60% percentile.
🔧 How It Works
Core Calculation
- Ratio Analysis: Calculates the price ratio between your asset and the correlated asset
- Historical Baseline: Establishes the "normal" relationship using a 252-day moving average. You can change this.
- Premium Measurement: Measures current deviation from historical average as a percentage
- Statistical Context: Provides percentile rankings and standard deviation bands
The Math
Premium % = (Current Ratio / Historical Average Ratio - 1) × 100
🎨 Customization Options
Correlated Asset: Choose any symbol for comparison
Lookback Period: Adjust historical baseline (50-1000 days)
Smoothing: Reduce noise with moving average (1-50 days)
Visual Toggles: Show/hide bands and percentile lines
Color Themes: Customize premium/discount colors
📊 Interpretation Guide
Premium/Discount Reading
- Positive %: Asset trading above historical relationship (premium)
- Negative %: Asset trading below historical relationship (discount)
- Near 0%: Asset at fair value relative to correlation
Percentile Ranking
- 90%+: Near recent highs - potential selling opportunity
- 10% and below: Near recent lows - potential buying opportunity
- 25-75%: Normal trading range
Signal Classifications
- 🔴 SELL PREMIUM: Asset expensive relative to recent range
- 🟡 Premium Rich: Moderately expensive, monitor for reversal
- ⚪ NEUTRAL: Fair value territory
- 🟡 Discount Opportunity: Moderately cheap, potential accumulation zone
- 🟢 BUY DISCOUNT: Asset cheap relative to recent range
🚨 Built-in Alerts
- Extreme Premium Alert: Triggers when percentile > 95%
- Extreme Discount Alert: Triggers when percentile < 5%
⚠️ Important Notes
- Works best with highly correlated assets
- Historical relationships can change - monitor correlation strength
- Not investment advice - use as one factor in your analysis
- Backtest thoroughly before implementing any strategy
🔄 Updates & Future Features
This indicator will be continuously improved based on user feedback. So... please give me your feedback!
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.