TradingView
LuxAlgo
13 feb 2024 13:36

Open Interest Inflows & Outflows [LuxAlgo] 

Bitcoin / TetherUSBinance

Descrizione

â‹…
The Open Interest Inflows & Outflows indicator focuses on highlighting alterations in the overall count of active contracts associated with a specific financial instrument.

The indicator also includes an oscillator highlighting the price sentiment to use in conjunction with the open interest flow sentiment and also includes a rolling correlation of the open interest flow sentiment with a user-selected source.

🔶 USAGE



Open Interest (OI) indicates the total number of active contracts, encompassing both long and short positions, for a specific financial instrument at any given moment. This key indicator helps traders and analysts assess market activity and sentiment.

An increase in open interest generally indicates new money flowing into the market, suggesting increased activity and the potential for a trending market. Conversely, a decrease in open interest indicates that traders are closing their positions, suggesting less interest in that particular contract.



Open Interest Flow Sentiment assesses the correlation between the initiation of new positions (inflows) and the closure of existing positions (outflows) for a particular instrument. Positive values suggest a prevalence of inflows, while negative values signify a prevalence of outflows.

The magnitude of the deviation from zero reflects the extent of dominance, either in inflows or outflows.

Price Sentiment estimates the relationship between the strength of bulls (buyers) and bears (sellers) on an instrument. Positive values indicate higher bull power and negative values indicate higher bear power.



The correlation feature is a key component of the indicator and helps analyze the relationship between trading volume and Open Interest changes. If volume increases along with rising Open Interest, it supports the validity of the price trend.

A divergence between price movement, volume, and Open Interest may signal potential reversals.

🔶 DETAILS

This indicator, based on Dr. Alexander Elder's acclaimed Elder-Ray concept, aids traders in evaluating the strength of both bulls and bears by delving beneath the surface of the markets. It uncovers data not immediately apparent from a superficial glance at prices. The indicator comprises two components: Bull Power and Bear Power.

Considering that the high price of any candle signifies the maximum power of buyers and the low price represents the maximum power of sellers, Elder employs the 13-period Exponential Moving Average (EMA) to depict the average consensus of price value. Bull Power assesses whether buyers can drive prices above the average consensus of value, while Bear Power assesses whether sellers can push prices below this average.

Here are the formulas for Bull Power and Bear Power:

bull_power = high - ema(close, 13) bear_power = low - ema(close, 13)


This concept is utilized to calculate Open Interest Flow Sentiment and Price Sentiment. The Open Interest Flow Sentiment estimates the relationship between new positions (inflows) and positions being closed (outflows), providing insights into market dynamics. The Price Sentiment, on the other hand, gauges the correlation between price movements and the Elder-Ray components, aiding traders in identifying potential shifts in market sentiment and momentum.

🔶 SETTINGS

🔹Open Interest Inflows & Outflows

  • OI Sentiment Correlation: toggles the visibility of Open Interest correlation with a variety of sources.
  • Money Flow Estimates: toggles the visibility of Money Flow Estimates calculated for the last bar.


🔹Style

  • OI Flow Sentiment: toggles the visibility of Open Interest Flow Sentiment, along with color customization options.
  • Price Sentiment: toggles the visibility of Price Sentiment, along with color customization options.
  • Correlation Colors: color customization option for the Correlation Area.


🔹Others

  • Smoothing: smoothing length applicable for Open Interest Flow Sentiment and Price Sentiment.


🔶 RELATED SCRIPTS

Open-Interest-Chart
Liquidation-Estimates

Thanks to our community for recommending this script. For more conceptual scripts and related content, we welcome you to explore by visiting >>> LuxAlgo-Scripts.
Commenti
FarhadCCM
â‹…
It doesn't support Gold and many pairs of FOREX. Promptem me "No Open Interest data found for the [pair] symbol. like GBPJPY
FarhadCCM
â‹…
@FarhadCCM, *Prompted me....
NoveltyTrade
â‹…
it is impossible to use on crypto swap(USDT$-M) with appendix USDT.P - your script gives notification 'No Open Interest data found for the BTCUSDT.P symbol'
because pine script syminfo.type on cryptocurrency returns "crypto" not "futures"
all the OI data for BINANCE:tickerUSDT.P is on TW
if you will revise code line 59 it will work correctly
GKLanselot2
â‹…
just tested on btcusdt spot pair it works fine but on futures is not working
Pratik_4Clover
â‹…
Thanks!!!
GKLanselot2
â‹…
no data on btcusdt.p pair binance but works on btc1 any sulution about this , thanks
kurthhestate
â‹…
HELLO. IT DOESNT WORK IN ALL CRYPTO & BTC - No Open Interest data found for the symbol--HOW IT FIX?
NoveltyTrade
â‹…
@kurthhestate, change code line 59 for :

sym = futures or str.endswith(syminfo.ticker, "USDT.P") ? syminfo.ticker + "_OI" : str.endswith(syminfo.ticker, "USDT") ? syminfo.ticker + ".P_OI" : syminfo.ticker + "T.P_OI"

and it will work in crypto USDT.P contracts
rajasekaranmari
â‹…
@NoveltyTrade, do we have permission to edit this code
NoveltyTrade
â‹…
@rajasekaranmari, yes, code is opened and you could copy it and edit all you need
Altro