OPEN-SOURCE SCRIPT
Binance Spot vs Perpetual Price index by BIGTAKER

📌 Overview
This indicator calculates the premium (%) between Binance Perpetual Futures and Spot prices in real time and visualizes it as a column-style chart.
It automatically detects numeric prefixes in futures symbols—such as `1000PEPE`, `1MFLUX`, etc.—and applies the appropriate scaling factor to ensure accurate 1:1 price comparisons with corresponding spot pairs, without requiring manual configuration.
Rather than simply showing raw price differences, this tool highlights potential imbalances in supply and demand, helping to identify phases of market overheating or panic selling.
🔧 Component Breakdown
1. ✅ Auto Symbol Mapping & Prefix Scaling
Automatically identifies and processes common numeric prefixes (`1000`, `1M`, etc.) used in Binance perpetual futures symbols.
Example:
`1000PEPEUSDT.P` → Spot symbol: `PEPEUSDT`, Scaling factor: `1000`
This ensures precise alignment between futures and spot prices by adjusting the scale appropriately.
2. 📈 Premium Calculation Logic
Formula:
(Scaled Futures Price − Spot Price) / Spot Price × 100
Interpretation:
* Positive (+) → Futures are priced higher than spot: indicates possible long-side euphoria
* Negative (−) → Futures are priced lower than spot: indicates possible panic selling or oversold conditions
* Zero → Equilibrium between futures and spot pricing
3. 🎨 Visualization Style
* Rendered as column plots (bar chart) on each candle
* Color-coded based on premium polarity:
* 🟩 Positive premium: Light green (`#52ff7d`)
* 🟥 Negative premium: Light red (`#f56464`)
* ⬜ Neutral / NA: Gray
* A dashed horizontal line at 0% is included to indicate the neutral zone for quick visual reference
💡 Strategic Use Cases
| Market Behavior | Strategy / Interpretation |
| ----------------------------------------- | ------------------------------------------------------------------------ |
| 📈 Premium surging | Strong futures demand → Overheated longs (short setup) |
| 📉 Premium dropping | Aggressive selling in futures → Oversold signal (long setup) |
| 🔄 Near-zero premium | Balanced market → Wait and observe or reassess |
| 🧩 Combined with funding rate or OI delta | Enables multi-factor confirmation for short-term or mid-term signals |
🧠 Technical Advantages
* Fully automated scaling for prefixes like `1000`, `1M`, etc.
* Built-in error handling for inactive or missing symbols (`ignore_invalid_symbol=true`)
* Broad compatibility with Binance USDT Spot & Perpetual Futures markets
🔍 Target Use Cases & Examples
Compatible symbols:
`1000PEPEUSDT.P`, `DOGEUSDT.P`, `1MFLUXUSDT.P`, `ETHUSDT.P`, and most other Binance USDT-margined perpetual futures
Works seamlessly with:
* Binance Spot Market
* Binance Perpetual Futures Market
This indicator calculates the premium (%) between Binance Perpetual Futures and Spot prices in real time and visualizes it as a column-style chart.
It automatically detects numeric prefixes in futures symbols—such as `1000PEPE`, `1MFLUX`, etc.—and applies the appropriate scaling factor to ensure accurate 1:1 price comparisons with corresponding spot pairs, without requiring manual configuration.
Rather than simply showing raw price differences, this tool highlights potential imbalances in supply and demand, helping to identify phases of market overheating or panic selling.
🔧 Component Breakdown
1. ✅ Auto Symbol Mapping & Prefix Scaling
Automatically identifies and processes common numeric prefixes (`1000`, `1M`, etc.) used in Binance perpetual futures symbols.
Example:
`1000PEPEUSDT.P` → Spot symbol: `PEPEUSDT`, Scaling factor: `1000`
This ensures precise alignment between futures and spot prices by adjusting the scale appropriately.
2. 📈 Premium Calculation Logic
Formula:
(Scaled Futures Price − Spot Price) / Spot Price × 100
Interpretation:
* Positive (+) → Futures are priced higher than spot: indicates possible long-side euphoria
* Negative (−) → Futures are priced lower than spot: indicates possible panic selling or oversold conditions
* Zero → Equilibrium between futures and spot pricing
3. 🎨 Visualization Style
* Rendered as column plots (bar chart) on each candle
* Color-coded based on premium polarity:
* 🟩 Positive premium: Light green (`#52ff7d`)
* 🟥 Negative premium: Light red (`#f56464`)
* ⬜ Neutral / NA: Gray
* A dashed horizontal line at 0% is included to indicate the neutral zone for quick visual reference
💡 Strategic Use Cases
| Market Behavior | Strategy / Interpretation |
| ----------------------------------------- | ------------------------------------------------------------------------ |
| 📈 Premium surging | Strong futures demand → Overheated longs (short setup) |
| 📉 Premium dropping | Aggressive selling in futures → Oversold signal (long setup) |
| 🔄 Near-zero premium | Balanced market → Wait and observe or reassess |
| 🧩 Combined with funding rate or OI delta | Enables multi-factor confirmation for short-term or mid-term signals |
🧠 Technical Advantages
* Fully automated scaling for prefixes like `1000`, `1M`, etc.
* Built-in error handling for inactive or missing symbols (`ignore_invalid_symbol=true`)
* Broad compatibility with Binance USDT Spot & Perpetual Futures markets
🔍 Target Use Cases & Examples
Compatible symbols:
`1000PEPEUSDT.P`, `DOGEUSDT.P`, `1MFLUXUSDT.P`, `ETHUSDT.P`, and most other Binance USDT-margined perpetual futures
Works seamlessly with:
* Binance Spot Market
* Binance Perpetual Futures Market
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
암호화폐 트레이더, 비트코인 및 알트코인 차트 분석.
선물 시장 지표 대시보드, 텔레그램 실시간 시그널 채널.
bigtaker.com
선물 시장 지표 대시보드, 텔레그램 실시간 시그널 채널.
bigtaker.com
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
암호화폐 트레이더, 비트코인 및 알트코인 차트 분석.
선물 시장 지표 대시보드, 텔레그램 실시간 시그널 채널.
bigtaker.com
선물 시장 지표 대시보드, 텔레그램 실시간 시그널 채널.
bigtaker.com
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.