OPEN-SOURCE SCRIPT
Aggiornato

Spot Premium with ROC

968
Description:
This indicator tracks the spot premium of BTC by comparing the perpetual futures price (perp) from Binance against the spot price on Coinbase. The histogram displays the price difference (spot minus perp) with green bars when spot is higher and red when perp carries a premium. The Rate of Change (ROC) line measures how quickly this premium shifts, with an option to normalize fluctuations for greater stability.

Implications & Possible Use Cases:
  • • Market Sentiment Gauge: A sustained positive premium often indicates bullish sentiment, while a discount can signal bearish bias.
  • • Arbitrage Signals: Significant divergences between perp and spot may present short-term arbitrage opportunities across exchanges.
  • • Risk Management & Hedging: Traders can align derivatives and spot positions when premiums deviate sharply, reducing funding cost exposures.
  • • Funding Rate Insights: Since perp funding rates tend to follow premium levels, this indicator can act as an early warning for funding spikes.
  • • Trend Confirmation: Use the normalized ROC to confirm continuation or reversal of premium trends, filtering out noise around small diff values.


Let me know if you would like additional features.
Note di rilascio
Description:
This indicator tracks the spot premium of BTC by comparing the perpetual futures price (perp) from Binance against the spot price on Coinbase. The histogram displays the price difference (spot minus perp) with green bars when spot is higher and red when perp carries a premium. The Rate of Change (ROC) line measures how quickly this premium shifts, with an option to normalize fluctuations for greater stability.

Implications & Possible Use Cases:
  • • Market Sentiment Gauge: A sustained positive premium often indicates bullish sentiment, while a discount can signal bearish bias.
  • • Arbitrage Signals: Significant divergences between perp and spot may present short-term arbitrage opportunities across exchanges.
  • • Risk Management & Hedging: Traders can align derivatives and spot positions when premiums deviate sharply, reducing funding cost exposures.
  • • Funding Rate Insights: Since perp funding rates tend to follow premium levels, this indicator can act as an early warning for funding spikes.
  • • Trend Confirmation: Use the normalized ROC to confirm continuation or reversal of premium trends, filtering out noise around small diff values.
Note di rilascio
Description:
This indicator tracks the spot premium of BTC by comparing the perpetual futures price (perp) from Binance against the spot price on Coinbase. The histogram displays the price difference (spot minus perp) with green bars when spot is higher and red when perp carries a premium. The Rate of Change (ROC) line measures how quickly this premium shifts, with an option to normalize fluctuations for greater stability.

Implications & Possible Use Cases:
  • • Market Sentiment Gauge: A sustained positive premium often indicates bullish sentiment, while a discount can signal bearish bias.
  • • Arbitrage Signals: Significant divergences between perp and spot may present short-term arbitrage opportunities across exchanges.
  • • Risk Management & Hedging: Traders can align derivatives and spot positions when premiums deviate sharply, reducing funding cost exposures.
  • • Funding Rate Insights: Since perp funding rates tend to follow premium levels, this indicator can act as an early warning for funding spikes.
  • • Trend Confirmation: Use the normalized ROC to confirm continuation or reversal of premium trends, filtering out noise around small diff values.
Note di rilascio
Mode:
  • “Auto” uses the chart’s symbol with chosen exchange prefixes; “Manual” lets you input full symbol codes.
  • Spot Exchange: exchange prefix for spot (e.g., “COINBASE”)
  • Derivatives Exchange: ex
change prefix for perp/futures (e.g., “BINANCE”)
Note di rilascio
Added tooltips
Note di rilascio
  • Volume Intensity: histogram bars adjust opacity based on volume relative to its SMA over a lookback period.
Note di rilascio
Fix to the Auto mode
Note di rilascio
added ribbons for the ROC
Note di rilascio
Update Summary — Spot/Perp Premium + Basis (Vol-Weighted)

Core upgrade
• Added the “tri-calculation” basis:
Tri-Calc = (CB–BIN Spot) − (CB–BIN Perp) = BIN Perp − BIN Spot
→ isolates Binance perp premium vs. Binance spot (local leverage sentiment).
• Keeps your prior two spreads for context:
1) CB Spot − BIN Spot (inter-venue spot flow)
2) CB Spot − BIN Perp (cross-venue spot vs. perp)

Display & defaults
• Toggles: Show CB−BIN Spot (ON), Show CB−BIN Perp (OFF), Show Tri-Calc (ON).
• Tri-Calc style: Line (default) or Histogram, with a “Tri-Calc Visual Scale” multiplier.
• Tri EMA line: always available via “Always Show Tri EMA (Line)”; color-coded by sign:
>0 → #00FFBD (teal), <0 → #E600FF (magenta). Honors optional −1 offset.

Symbol handling
• Auto/Manual symbol mode with robust base-asset detection (suffix-aware strip of .P/USDT/USDC/USD).
• Manual symbol overrides for CB spot, BIN spot, BIN perp.

Volume → histogram opacity
• Choose volume source: Spot / Deriv / Average.
• Mapping: SMA Ratio (squashed) or Percentile (more regime-stable), or Off.
• High volume = opaque bars; low volume = more transparent.

Momentum / impulse context (experimental overlays)
• Z-Score: shades when |Z| > threshold (mean/stdev).
• EMA+ROC: plots Tri EMA; background shades off MAD-normalized ROC of that EMA.
• Robust Z (MAD): outlier-resistant z-score flavor.
• RSI (of Tri): optional line plotted as (RSI−50)×scale for on-pane visibility; shade above/below bands.
• MACD (of Tri): optional MACD/Signal lines + histogram with a visual scale.

ROC ribbon (spread momentum)
• Short/long SMA of absolute changes on the first enabled series (spot-spot, else spot-perp, else tri).
• Filled ribbon flips color on short>long.

Reading the signals (quick cheat-sheet)
• CB Spot − BIN Spot rising while Tri-Calc (basis) depressed → spot-led accumulation, leverage risk-off:
Bias toward relief-up once perps re-engage (basis turns up).
• Basis ramping with CB premium flattening/falling → perp-led chase, prone to fade if spot demand isn’t present.
• RSI/MACD overlays on Tri help time the leverage “baton pass” (crosses/thresholds confirm rotation).

Good defaults to start
• Volume Lookback = 30, Volume Source = Spot, Mapping = Percentile.
• Z-Score: Lookback = 50, Threshold = 2.0.
• EMA+ROC: EMA = 9, ROC = 5, ROC threshold ≈ 1.0–1.5.
• RSI: Length = 14, Bands = 31 / 69, Visual Scale ≈ 0.5–1.0.
• MACD: 8/21/9 with Visual Scale ≈ 1.0–2.0.

Notes / pitfalls
• Pine arg ordering: once you use named args in plot(), name them all — start with series=...
• If overlays seem “invisible,” raise the RSI/MACD visual scale knobs to fit the pane amplitude.
• Tri EMA color is sign-based; Tri-Calc line/hist colors remain as configured.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.