OPEN-SOURCE SCRIPT

Contract Interest Turnover T3 [T69]

147
Overview
--------
Contract Interest Turnover (CIT) estimates how “churny” a crypto derivatives market is by comparing the amount traded in a bar to the base stock of outstanding contracts (open interest). It normalizes both Volume and Open Interest (OI) by Price (Close), then plots a Turnover Rate = (Volume/Close) ÷ (OI/Close) as colored columns. Higher values = faster contract recycling (strong momentum / hype potential).

Features
--------
- Auto-fetch OI: Pulls OI via request.security(<current>_OI, …) when the exchange/symbol exposes an OI stream on TradingView.
- Price-normalized comparison: Converts both Volume and OI into comparable notional terms by dividing each by Close.
- Turnover columns with threshold: Color the columns green once Turnover ≥ your set threshold; gray otherwise.
- Status-line readouts: Displays normalized Volume and OI values for quick sanity checks.
- Crypto-aware timeframe: Uses chart TF for crypto; forces daily OI when not crypto to avoid noisy intraday pulls.

How to Use
----------
1. Add the script on a perpetual/futures symbol that has OI on TradingView (e.g., BTC perps where an _OI feed exists).
2. Watch the Turnover Rate bars: spikes above your threshold flag sessions where contracts are actively flipping.
3. Interpret spikes as a signal of movement or activity — it does not specify price direction, only that the market is engaged and contracts are being traded more intensely than usual.


Configuration
-------------
- Interest Turnover Threshold (default 1.0): colors columns green when Turnover ≥ threshold. Tune per market’s typical churn profile.

Under the Hood (Formulas & Logic)
---------------------------------
- Fetch OI
oiClose ← request.security(ticker.standard(syminfo.tickerid) + "_OI", timeframe, close) with ignore_invalid_symbol = true.
If none is found, the script throws a clear runtime error.

- Normalize to price
vol_norm = volume / close
oi_norm = oiClose / close
This converts both to a common notional basis so their ratio is meaningful even as price changes.

- Turnover Rate
turnover = vol_norm / oi_norm
Interpretation: fraction/multiples of the outstanding contract base traded in the bar. Color = green if turnover ≥ threshold.

Why Open Interest ≈ “Float” Proxy
---------------------------------
In stocks, float ≈ shares the public can trade. In derivatives, there are no “shares,” so Open Interest acts as the live stock of active contracts. It’s the best proxy for “what’s available in play” because it counts open positions that persist across bars. Using Volume ÷ OI mirrors stock float-turnover logic: how fast the tradable base is being recycled each period.

Why Normalize by Price
----------------------
Derivatives volume and OI may be reported in contracts, not notional value. One contract’s economic weight changes with price (especially on inverse contracts). Dividing both Volume and OI by Close:
- Puts them on a comparable notional footing.
- Prevents false spikes purely from price moves.
- Makes Turnover comparable across time even as price trends.

Advanced Tips
-------------
- Calibrate threshold: Start from the 80th–90th percentile of the last 60–90 bars of Turnover; set the threshold a touch below that to surface early heat.
- Add OI-delta: Layer an OI change histogram (current − prior) to separate new positioning from pure churn.
- Linear vs inverse: For linear (USDT-margined) contracts, the normalization still works and keeps visuals consistent; for inverse, it’s essential.

Limitations
-----------
- Data availability: Works only if your symbol exposes an _OI feed on TradingView; otherwise it errors out.
- Exchange conventions: Volume units differ by venue (contracts, coin, notional). Normalization mitigates, but cross-symbol comparisons still need caution.
- Intrabar gaps: OI is typically end-of-bar; rapid intrabar shifts won’t appear until the bar closes.

Notes
-----
- Designed primarily for crypto derivatives. For non-crypto, the script blanks OI to avoid misleading plots and uses a daily TF when needed.

Credit
------
- Concept & data: Built for TradingView data feeds.
- Acknowledgment: Credit to TradingView default indicator as requested.
- Source: This write-up reflects the logic present in your uploaded script.

Disclaimer
----------
Markets move; indicators simplify. Use with position sizing, hard stops, and catalyst awareness. The Turnover Rate flags activity, not direction.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.