OPEN-SOURCE SCRIPT
업데이트됨 Spot Premium with ROC

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:
Let me know if you would like additional features.
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.
릴리즈 노트
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.
릴리즈 노트
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.
릴리즈 노트
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
릴리즈 노트
Added tooltips릴리즈 노트
- Volume Intensity: histogram bars adjust opacity based on volume relative to its SMA over a lookback period.
릴리즈 노트
Fix to the Auto mode릴리즈 노트
added ribbons for the ROC릴리즈 노트
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.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.