TTP OI + LS signal filterThis oscillator helps filtering specific conditions in the market based on open interest (OI) and the ratio of longs and shorts (LS) for crypto assets.
Currently it works with BINANCE:BTCUSDT.P but soon I'll be adding support for more assets.
It flags areas of interest like:
- Too many longs, too many shorts in the market
- Open interest too high or too low
It accepts an external signal as a source in which case filters can be applied to the original signal. For example the external signal might trigger and plot a 1 when RSI break below 70. By connecting such signal with this oscillator you'll be able to only pass-through the ones that occur when any of the areas of interest mentioned above are also valid.
If both filter are applied it acts as an OR. For example, if too many longs and too many shorts are active, it will pass through the signal in either condition.
The results of the original signal filtered is printed to be able to later use it in any external backtester strategy that accepts external sources too.
If external source signal is disabled it will trigger any time the combined filters are returning true.
Open interest and the ratio of longs/shorts is considered too high whenever the stochastic RSI calculation of the OI or ratio LS reaches a level above 80 and too low when below 20
The ratio of long/shorts is calculated by dividing the ratio of longs vs shorts from BITFINEX:BTCUSDLONGS and BITFINEX:BTCUSDSHORTS
Open Interest
Biddles OI Weighted Average PriceAhoy!
This script calculates Open Interested Weighted Average Price for the following lookback periods:
- 7, 30, 60
e.g. On the 1D chart, you will see OIWAP for the past 7, 30, and 60 days. It works on any timeframe though.
It works with any ticker that TV's OI indicator supports, and has ticker override if you are looking at an exchange that's unsupported, but for an asset that is.
e.g. If you're looking at Bybit's BTCUSDT.P which is unsupported- you can override to get OI data from Binance's BTCUSDT.P which is supported.
=====
Open-Sourced + Crowd Sourcing Goals
=====
I am open sourcing this in hopes we can work together to find interesting signal/observation, and make the script better.
The only way I could think of to calculate the OIWAP for the lookback periods was to manually factor in each period in the formula.
e.g. For the 60-period lookback, it's manually taking price and OI for each individual period.
I am also hoping other folks will make interesting observations.
With the few hours I've spent thus far, they seem to operate much like MA bands, with crossovers having similar implications.
But I feel like there are many other observations left unnoticed!
If you find any, hmu on twitter: @thalamu_
=====
Interesting Calculations in the Script, but not Plotted on the Chart
=====
There are calculations for up to 60 days of OIWAP taking change in OI rather than just OI.
There's one set for absolute value of change in OI, and one set for raw change in OI.
I didn't notice anything spectacularly interesting - but perhaps you will if you tinker with it!
=====
Find something cool? Have an improvement?
=====
Hmu on twitter: @thalamu_
Open Interest OffsetThis indicator is used to display whether there has been an abnormal increase or decrease in recent contract positions. Its usage is similar to the RSI indicator.
Please note that this indicator uses fixed (customizable) thresholds of 0.4 and 0.6 to indicate when abnormal opening and closing occur respectively. For some altcoins, their values may far exceed 0.4 so please adjust accordingly based on your symbol.
(1) When there is an abnormal increase in recent contract positions, the value of the indicator will be above 0.4. This means that there may be a liquidation market situation occurring subsequently. If the market background at this time is rising, it may not be suitable to continue buying because the indicator shows that it is currently overbought. On the contrary, it may be appropriate to sell now.
(2) When there is an abnormal decrease in recent contract positions, the value of the indicator will be below -0.4. This means that a liquidation market situation has occurred recently. If the market background at this time is falling, it may not be suitable to continue shorting because the indicator shows that it is currently oversold. On the contrary, it may be appropriate to buy now.
Special thanks to the following TradingView community members for providing open-source indicators and contributing to the development of this indicator!
Open Interest Delta - By Leviathan - @LeviathanCapital
Regarding the relationship with the above-mentioned open source indicator:
Indicator Open Interest Delta - By Leviathan - @LeviathanCapital obtained OI data for Binance USDT perpetual contracts in the code. We refer to their method of obtaining OI data in our code.
============= 中文版本 =============
该指标用于显示近期合约持仓量是否有异常的增加和减少。它的用法类似于RSI指标
请注意,该指标使用了固定的(可定制的)阈值0.4和0.6来提示异常开仓和平仓的发生。对于某些山寨币而言,指标的数值可能远大于0.4。请根据你所关注的标的自行调整
(1)当近期合约持仓量有异常的增加时,指标的值会在0.4以上。这意味着后续可能有清算行情的发生。若此时市场背景为上涨,此时可能不太适合继续做多,因为指标显示目前处于超买行情。相反,现在可能适合卖出
(2)当近期合约的持仓量有异常的减少时,指标的值会在-0.4以下。这意味着近期已经发生了清算行情。若此时市场背景为下跌,此时可能不太适合继续做空,因为指标显示目前处于超卖行情。相反,现在可能适合买入
特别感谢以下TradingView社区成员提供开源指标并为该指标的开发做出贡献!
Open Interest Delta - By Leviathan - @LeviathanCapital
与上述开源指标的关系:
指标Open Interest Delta - By Leviathan - @LeviathanCapital在代码中获取了Binance USDT永续合约的OI数据。我们在代码中参考他们获取OI数据的方式
Open Interest All ExchangesThe indicator collects data from available exchanges based on open interest. The indicators are calculated in the amount of Bitcoin.
Below are the tickers of the exchanges that provide the data:
- BITFINEX:BTCUSD
- BITFINEX:BTCUST
- KRAKEN:BTCUSDPERP
- BITMEX:XBTUSD
- BITMEX:XBTUSDT
- BINANCE:BTCUSDTPERP
- BINANCE:BTCUSDPERP (due to low volumes and limitations of 40 requests of the request.security function, the code contains data without using the calculation)
For me, Open Interest indicators play an important role in the trading system, for this reason I share with you. I am not a financial advisor.
**Open for cooperation**
Crypto Leverage Ratio [Market Cap / Open Interest in %]This indicator calculates what percentage of market cap data corresponds to open interest data.
Leverage Ratio = 1/(Market Cap / 100 * Open Interest)
Market Cap data comes from TradingView -> CRYPTOCAP:YOURCOINSYMBOL
Open Interest data comes from IntoTheBlock -> INTOTHEBLOCK:YOURCOINSYMBOL_PERPETUALOPENINTEREST
IntoTheBlock refresh perpetual data at the end of the day. It means there is no intraday data.
It can only be used in Daily or higher time intervals.
This indicator and any other indicator can not precisely calculate real leverage ratio except exchanges itself. This calculation is just based on assumption.
You can see the exact same result by just adding:
1/(CRYPTOCAP:BTC/100*INTOTHEBLOCK:BTC_PERPETUALOPENINTEREST)
to your symbol search, if your chart is a BTC chart.
"
The Futures Open Interest Leverage Ratio is calculated by dividing the market open contract value, by the market cap of the asset (presented as %). This returns an estimate of the degree of leverage that exists relative to market size as a gauge for whether derivatives markets are a source of deleveraging risk.
High Values indicate that futures market open interest is large relative to the market size. This increases the risk of a short/long squeeze, deleveraging event, or liquidation cascade.
Low Values indicate that futures market open interest is small relative to the market size. This is generally coincident with a lower risk of derivative led forced buying/selling and volatility.
Deleveraging Events such as short/long squeezes, or liquidation cascades can be identified by rapid declines in OI relative to market cap, and vertical drops in the metric.
-glassnode
"
says glassnode. I think it is more than that. Especially with MAs.
Net Positions (Net Longs & Net Shorts) - By LeviathanThis script is an experimental indicator that visualizes the entering and exiting of long and short positions in the market. It also includes other useful tools, such as NL/NS Profile, NL/NS Delta, NL/NS Ratio, Volume Heatmap, Divergence finder, Relative Strength Index of Net Longs and Net Shorts, EMAs and VWMAs and more.
To avoid misinterpretation, it's important to understand some basics. The “real” ratio between net long and net short positions in a given market is always 1:1. A futures contract is an agreement between two parties to buy or sell an underlying asset at an agreed-upon price. Each contract has a long side and a short side, with one party agreeing to buy (long) and the other party agreeing to sell (short) the asset at the agreed-upon price. The long position holder anticipates that the asset's price will rise, while the short position holder expects it to fall. Because every futures contract involves both a buyer and a seller, it is impossible to have more net longs than net shorts or vice versa (in terms of the net value). For every long position opened, there must be a corresponding short position taken by another market participant (and vice versa), thus maintaining the 1:1 ratio between longs and shorts. While there can be an imbalance in the number of traders/accounts holding long and short contracts, the net value of positions held on each side remains 1 to 1.
Open Interest (OI) is a metric that tracks the number of open (unsettled) contracts in a given market. For example, Open Interest of 100 BTC means that there are currently 100 BTC worth of longs and 100 BTC worth of shorts open in the market. There may be more traders on one side holding smaller positions, and fewer traders on the other side holding larger positions, but the net value of positions on one side is equal to the net value of positions on the other side → 100 BTC in longs and 100 BTC in shorts (1:1). Consider a scenario in which a trader decides to open a long position for 1 BTC at a price of HKEX:30 ,000. For this long order to be executed, a counterparty must take the opposite side of the contract by placing an order to short 1 BTC at the same price of HKEX:30 ,000. When both the long and short orders are matched and executed, the open interest increases by 1 BTC, reflecting the addition of this new contract to the market.
Changes in Open Interest essentially tell us 3 things:
- OI Increase - new positions entered the market (both longs and shorts!)
- OI Decrease - positions exited the market (both longs and shorts!)
- OI Flat - no change in open positions due to low activity or simply lots of transfers of contracts
However, different concepts can be used to analyze sentiment, aggressiveness, and activity in the market by analyzing data such as Open Interest, price, volume, etc. This indicator combines Open Interest data and price action to simplify the visualization of positions entering and exiting the market. It is based on the following concept:
Increase in Open Interest + Increase in price = Longs Opening
Decrease in Open Interest + Decrease in price = Longs Closing
Increase in Open Interest + Decrease in price = Shorts Opening
Decrease in Open Interest + Increase in price = Shorts Closing
When "Longs Opening" occurs, the OI Delta value is added to the running total of Net Longs, and when "Longs Closing" occurs, the OI Delta value is subtracted from the running total of Net Longs.
When "Shorts Opening" occurs, the OI Delta value is added to the running total of Net Shorts, and when "Shorts Closing" occurs, the OI Delta value is subtracted from the running total of Net Shorts.
To summarize:
Net Longs: Cumulative value of Longs Opening and Longs Closing (LO - LC)
Net Shorts: Cumulative value of Shorts Opening and Shorts Closing (SO - SC)
Net Delta: Net Longs - Net Shorts
Net Ratio: Net Longs / Net Shorts
This is the fundamental logic of how this script functions, but it also includes several other tools and options. Here is an overview of the settings:
Type:
- Net Positions (display values of Net Longs, Net Shorts, Net Delta, Net Ratio as described above)
- Relative Strength (display Net Longs, Net Shorts, Net Delta, Net Ratio in the form of a momentum oscillator that measures the speed and change of movements. Same logic as RSI for price)
Display as:
- Candles (display the data in the form of candlesticks)
- Lines (display the data in the form of candlesticks)
- Columns (display the data in the form of columns)
Cumulation:
- Visible Range (data is cumulated from the first visible bar on your chart)
- Full Data (data is cumulated from the beginning)
Quoted in:
- Base Currency (all data is presented in the pair’s base currency eg. BTC)
- Quote Currency (all data is presented in the pair’s quote currency eg USDT)
OI Sources
- Pick the sources from where the data is collected (if available).
Net Positions:
- NET LONGS (show/hide Net Longs plot, choose candle colors, choose line color)
- NET SHORTS (show/hide Net Shorts plot, choose candle colors, choose line color)
- NET DELTA (show/hide Net Delta plot, choose candle colors, choose line color)
- NET RATIO (show/hide Net Ratio plot, choose candle colors, choose line color)
Moving Averages:
- Type (choose between EMA and Volume Weighted Moving Average)
- NET LONGS (show/hide NL moving average plot, choose length, choose color)
- NET SHORTS (show/hide NS moving average plot, choose length, choose color)
- NET DELTA (show/hide ND moving average plot, choose length, choose color)
- NET RATIO (show/hide NR moving average plot, choose length, choose color)
Profile:
- Profile Data (choose the source data of the profile)
- Value Area % (set the percentage width of profile’s value area)
- Positions (set the position of the profile to left or right of the visible range)
- Node Size (set the relative size of nodes to make them appear smaller or larger)
- Rows (select the amount of rows displayed by the profile to control granularity)
- POC (show/hide POC- Point Of Control and select its color)
- VA (show/hide VA- Value Area and select its color)
Divergence finder
- Source (choose the source data used by the script to compare it with price pivot points)
- Maximum distance (the maximum distance between two divergent pivot points)
- Lookback Bars Left (the number of bars to the left of the current bar that the function will consider when looking for a pivot point)
- Lookback Bars Right (the number of bars to the right of the current bar that the function will consider when looking for a pivot point)
Stats:
- Show/Hide the Stats table
- Bars Back (choose the length of data analyzed for stats in number of bars)
- Position (choose the position of the Stats table)
- Select Data you want to display in the Stats table
Additional Settings:
- Volume Heatmap (show/hide volume heatmap and select its color)
- Label Offset (select how much the plot label is shifted to the right
- Position Relative Strength Length (select the length used in the calculation)
- Value Label (show/hide OI Delta values when candles are displayed)
- Plot Labels (show/hide the labels next to the plot)
- Wicks (show/hide wick when candles are displayed)
Code used for generating profiles is taken from @KioseffTrading's "Profile Any Indicator" script (used with author's permission)
Wunder OI botWunder OI bot
1. Wunder OI bot is based on the search for divergences on the Open Interest indicator. The strategy determines the divergence between the price and the Open Interest for a given period.
2. 50 EMA is used as an additional filter. If a divergence is found for a specified number of bars ago and the price is above or below, a trade will be opened.
3. A function for calculating risk on the portfolio (your deposit) has been added to the Wunder OI bot script. When this option is enabled, you get a calculation of the entry amount in dollars relative to your Stop Loss. In the settings, you can select the risk percentage on your portfolio. The loss will be calculated from the amount that will be displayed on the chart.
For example, if your deposit is $1000 and you set the risk to 1%, with a Stop Loss of 5%, the entry volume will be $200. The loss at SL will be $10. 10$, which is your 1% risk or 1% of the deposit.
*Important!** The risk per trade must be less than the Stop Loss value. If the risk is greater than SL, then you should use leverage.
The amount of funds entering the trade is calculated in dollars. This option was created if you want to send the dollar amount from Tradingview to the exchange. However, putting your volume in dollars you get the incorrect net profit and drawdown indication in the backtest results, as TradingView calculates the backtest volume in contracts.
To display the correct net profit and drawdown values in Tradingview Backtest results, use the ”Volume in contract” option.
OI Profile Composite [CE]OI Profile Composite
This indicator is a compliment tool to the OI Profile Remastered, the indicator works by allowing the user to choose:
-Start Time
-End Time
On load so the profile is built as a composite of this data.
the indicator provides the opportunity to show: Delta, Positive and negative OI in separation,
as well as calculate the High Value Nodes ( HVN ) + Liquidations independently of the OI shown.
Users are granted options such as
HVN - Auto detects areas of High Open Interest
Liquidations - Provides points of maximum likely liquidation areas
Extend Liquidations
Liquidation levels can also optionally be chosen to be extended, this may be useful e.g.
if a user wishes to see all positions built during expansion from swing low to swing high, we can gain insight into where participants have taken trades,
this will give us areas of potential liquidations for these traders and then extend these points beyond the swing high. This prevents more data being injested,
aside from the data in this movement, and the levels can be used for future trades accounting for historical liq generated data. Very useful feature of the composite creation.
Users can select their margin manually else the Auto settings for margin will do its job based on the chart selected, perp vs usdt.
All settings are set to defaults that I currently use for BTC trading.
Liquidation points can be useful for Targets when taking a trade.
HVN /OI. Can be used as S/R dynamically as well as the OI develops throughout the session.
OI Profile RemasteredOI Profile Remastered
This indicator is the successor to the very popular first open interest profile,
the indicator provides the opportunity to show: Delta, Positive and negative OI in seperation,
as well as calculate the High Value Nodes (HVN) + Liquidations independently of the OI shown.
Users are granted options such as
HVN - Auto detects areas of High Open Interest
Liquidations - Provides points of maximum likely liquidation areas
Users can select their margin manually else the Auto settings for margin will do its job based on the chart selected, perp vs usdt.
All settings are set to defaults that I currently use for BTC trading.
Liquidation points can be useful for Targets when taking a trade.
HVN /OI. Can be used as S/R dynamically as well as the OI develops throughout the session.
Positive Profile With Positive HVN Calculation
Delta Profile with Positive HVN Calculation (shows indepedence)
Volume / Open Interest "Footprint" - By LeviathanThis script generates a footprint-style bar (profile) based on the aggregated volume or open interest data within your chart's visible range. You can choose from three different heatmap visualizations: Volume Delta/OI Delta, Total Volume/Total OI, and Buy vs. Sell Volume/OI Increase vs. Decrease.
How to use the indicator:
1. Add it to your chart.
2. The script will use your chart's visible range and generate a footprint bar on the right side of the screen. You can move left/right, zoom in/zoom out, and the bar's data will be updated automatically.
Settings:
- Source: This input lets you choose the data that will be displayed in the footprint bar.
- Resolution: Resolution is the number of rows displayed in a bar. Increasing it will provide more granular data, and vice versa. You might need to decrease the resolution when viewing larger ranges.
- Type: Choose between 3 types of visualization: Total (Total Volume or Total Open Interest increase), UP/DOWN (Buy Volume vs Sell Volume or OI Increase vs OI Decrease), and Delta (Buy Volume - Sell Volume or OI Increase - OI Decrease).
- Positive Delta Levels: This function will draw boxes (levels) where Delta is positive. These levels can serve as significant points of interest, S/R, targets, etc., because they mark the zones where there was an increase in buy pressure/position opening.
- Volume Aggregation: You can aggregate volume data from 8 different sources. Make sure to check if volume data is reported in base or quote currency and turn on the RQC (Reported in Quote Currency) function accordingly.
- Other settings mostly include appearance inputs. Read the tooltips for more info.
Cuban's Open Interest Spaghetti [CE]Cuban's Open Interest Spaghetti is an indicator built for traders to track the open interest changes of highly correlated markets, spreads, and ecosystems.
The tool provides three different viewing modes for tracking open interest; a rolling bar lookback, a specific data and time anchor, and a visible range -- similar to the native Tradingview 'Compare' tool.
Included are pre-built lists for tracking the open interest of all 160+ Binance Futures assets, including custom fields for creating new spreads or watchlists. This gives the trader the ability to monitor the entire futures ecosystem within a single charting window.
We have also added an optional table to the right of the screen so that the trader can clearly see outperforming assets. This table is toggleable using radio buttons within the Style menu.
To improve asset visibility, the script also calculates the 'long tail' of the asset distribution and automatically lowers the visibility of clustered assets in the center.
While the Compare tool only allows for % returns and absolute value on the chart asset or separate scale, Cuban's Open Interest Spaghetti allows the trader to use a separate oscillator window with the open interest on a % scale. This gives the trader the ability to watch OI changes in real-time within any Tradingview window.
Within the user inputs, the user gains the ability to customize the following:
Lookback mode
Rolling lookback period
Timezone and time anchor
Percentage of assets highlighted
Dynamic label offset
Asset lists
TO DO:
Add % labels to assets in the tails of the distribution
Open Interest Wiser [WISY]This script calculates the open interest (OI) of a given futures contract and identifies when the OI is increasing or decreasing.
It then plots bubbles on the chart to indicate when the OI is increasing or decreasing, with larger bubbles indicating a larger increase or decrease.
The script also calculates the rate of change (ROC) and the relative strength index (RSI) of the OI and its delta.
The user can adjust the input parameters to change the sensitivity of the indicator to changes in OI.
Dear traders, while we strive to provide you with the best trading tools and resources, we want to remind you to exercise caution and diligence in your investing decisions.
It is important to always do your own research and analysis before making any trades. Remember, the responsibility for your investments ultimately lies with you.
Happy trading!
Range Analysis - By LeviathanThe Interactive Range Analysis script is an essential tool for analyzing price ranges. It automatically draws important range levels, generates a Volume Profile or Open Interest profile and horizontal/vertical heatmaps, plots the anchored VWAP, draws Fibonacci levels, and much more.
How to use the indicator:
1. The script will prompt you to select the "Start Time" and "End Time" using Tradingview's interactive interface. These two points will determine the length of the range.
2. Once you have selected the range, the script will automatically anchor the range highs and lows to the highest and lowest close/wick/hlc3/ohlc4 (whichever you prefer).
3. You can then begin exploring different tools and options such as Quarters, Eighths, Fibonacci, Outer Levels, VWAP, Horizontal Volume/OI Heatmap, Vertical Volume/OI Heatmap, Fixed Range Volume Profile, Open Interest Profile, Value Area, VAH, VAL, and POC.
4. You can adjust the range by dragging the Start Time and End Time anchors or by removing/reapplying the script.
Tool overview
Range Levels
After selecting your preferred time range, the script will identify and draw a range high level and a range low level, which serve as a base for other important levels. “Half” is the level halfway between the range high and range low. “Quarters” will, as the name suggests, split the range into four equal zones (quarters) and “Eighths” will split the range into eight equal zones (eighths).
”Fibonacci” option allows you to display Fibonacci retracement levels (0.786, 0.618, 0.382, 0.236). “VWAP” will plot a Volume Weighted Average Price, anchored to the start of the range. “Direction” input lets you choose whether your range is UP or DOWN trending in order to make sure that the Fibonacci levels and labels are generated and assigned correctly. With “Outer” turned ON, the script will also generate active levels (quarters/eighths/Fibonacci) above and below the selected price range. “Extend Right” will extend all levels to the right indefinitely, while “Extend (+Bars)” lets you choose how far right the levels get extended. “Diagonal Line” is drawn from the bottom left of the range to the top right of the range or from the top left of the range to the bottom right of the range, depending on the “Direction” input.
Volume Profile / Open Interest Profile
After selecting the “Data Type”, Volume Profile or OI Profile can be generated by turning ON the “Volume/OI Profile” option.
“Resolution” input defines the amount of nodes/rows in the range that are used in profile/heatmap generation for distributing the data. While you can increase the “Resolution” to get better, more granular profiles, you should keep in mind that you might need to lower the resolution when generating profiles for larger ranges.
”Node Type” offers you two options when it comes to the representation of data: Up/Down - divides a node in two sections for up volume/OI and down volume/OI, Total - one node for total volume/OI and Delta - net difference in up volume/OI and down volume/OI.
”Profile Position” lets you choose whether the profile is positioned on the left side of the range or on the right side of the range.
“Profile Direction” determines whether the profile nodes are facing right or left.
“Profile Type” enables you to visualize the nodes in a classic way (Type 1) or in a way where down volume/negative OI are positioned on the left side of the y axis and up volume/positive OI on the right side of the y axis.
“Node Size (%)” defines how much space in the range can be taken by the profile’s nodes. Eg. 50% will allow the largest node to extend to the middle of the range (and others scaled accordingly), 100% will allow the largest node to extend the max right point of the range (and others scaled accordingly).
”Value Area (%)” defines the VA zone, which represents the area where the most volume occured (usually 70% or 68%).
”Horizontal Heatmap” will display a heatmap-like overlay, that will help you identify the price levels where most volume/open interest action occurred.
”Vertical Heatmap” will display a heatmap-like overlay, that will help you identify the points in time where most volume/open interest action occurred.
A more detailed description of this indicator is coming in the next few days.
Important:
* If volume or OI profile does not get generated, try lowering the resolution.
* Once in a while, the script will disappear from your chart. Just remove and reapply.
* Open Interest data is only avaiable on Binance Perpetual Futures pairs
To learn more, read the tooltips in the indicator’s settings and stay tuned for upcoming additions (Range Market Structure, Liquidation Levels, Range Statistics,…)
Open Interest with Heikin Ashi candlesA simple modification of the Tradingview free script of futures Open Interest to Heikin Ashi candles. It displays the volume of the Open Interest futures contracts by applying the HA formula.
I use it to clear out the "noise" of up's and down's especially in intraday small time frames when I am scalping in crypto.
Background color can be turned on/off.
Just to give back a little something to a community that gave me A LOT!
Let me know what you think and if you need anything to add.
Have fun :)
P.S. The way I use it is to try to find traps in the market and take (fast) advantage of them. When the OI are going up really fast in small time frames (which means either longs or shorts are going up) this creates a good opportunity for a squeeze (the trap).
Of course I use other indicators/oscillators to determine that but it gets me on my toes to look for... something ;)
Open Interest Delta - By LeviathanThis script plots Open Interest Delta (change in OI). It also draws a heatmap and colors chart's candles to help you identify bars with large OI increase or decrease and apply Open Interest analysis concepts to your trading.
Positive OI Delta = net increase in open/unsettled positions
Negative OI Delta = net decrease in open/unsettled positions
Liquidation Levels - By LeviathanThis indicator generates liquidation levels of over-leveraged traders and utilizes a variety of different tools to analyze data such as Open Interest and Volume to provide an edge in your trading system and help you with valuable market insights.
The concept of this indicator is inspired by the platform Hyblock and their Liquidation Levels tool.
The script offers a lot of flexibility in settings, so please read these instructions and test out different parameters to see what works best for you. Here is a short overview of all inputs, one by one.
PRIMARY SOURCE OF DATA
This input allows you to choose the primary source of data that the script uses to calculate liquidation levels. I encourage you to test them all and see which works best for the assets and timeframes you trade. You can also regularly switch between to see confluences.
My personal favorite inputs (and also most accurate ones) are Open Interest, Open Interest + Volume (OI+VOL), and Open Interest + CVD (OI+CVD), as they utilize Open Interest in the calculations, which is the most important factor when it comes to analyzing position opening/closing and market activity in general. The other options that do not include Open Interest (Volume, CVD) were mainly added to provide the possibility to use the indicator on pairs where OI data is not available. Please note that this indicator is built on Tradingview and can only use data (e.g., Open Interest) provided by Tradingview, which is unfortunately quite limited. This is why I recommend using the script with OI-based data source inputs on Binance's perpetual futures pairs, as this is where OI data is available. The volume-based data source inputs can be used on spot pairs, forex, indices, and other markets, where Open Interest data is not provided.
To summarize the use of Primary Source of Data input:
1. Open Interest - use on Binance’s perpetual futures or anywhere else where OI data is available
2. OI + VOL - use on Binance’s perpetual futures or anywhere else where OI data is available
3. OI + CVD - use on Binance’s perpetual futures or anywhere else where OI data is available
4. CVD - use on any pair you wish
5. Volume - use on any pair you wish
DIRECTIONAL BIAS
If turned on, the Directional bias function uses volume and some other calculations to predict which side’s liquidation levels are more likely to be filled and only keep those levels on your chart.
- Directional Bias for Liquidation Levels
Turned ON: only one side’s liquidation levels are shown on the chart
Turned OFF: all liquidation levels are shown on the chart
- Directional Bias for Liquidation Level Bubbles
Turned ON: only one side’s liquidation level bubbles are shown on the chart
Turned OFF: all liquidation level bubbles are shown on the chart
I've separated directional bias options between Liquidation Levels and Liquidation Level Bubbles because sometimes it can be useful to have one of them ON and the other one OFF.
REDUCE SENSITIVITY
The Reduce Sensitivity option allows you to multiply the thresholds for "Smaller Size Liquidation," "Medium Size Liquidation," and "Large Size Liquidation" simultaneously. This is a useful feature as it enables you to easily filter larger positions and their liquidations without having to manually alter the standard deviation multipliers, which will be discussed in further detail later in the article.
The default value is 1, which means that it does nothing.
Increasing it above 1 will increase all thresholds and therefore generate fewer liquidation levels but with larger relative sizes.
Decreasing it below 1 will lower all thresholds and therefore generate more liquidation levels but with both smaller and larger relative sizes.
BASE
This input gives you the possibility to choose between four different bases, from which the liquidation levels will be generated.
CLOSE ⇒ Levels are plotted above and below the close of the candle
HALF ⇒ Levels are plotted above and below the middle of the candle ((high+low)/2)
VWAP ⇒ Levels are plotted above and below the volume-weighted average price
VWMA ⇒ Levels are plotted above and below the volume-weighted moving average
I suggest that you backtest them and see what works best for you.
LIQUIDATION LEVEL BUBBLES
If enabled, "Liquidation Level Bubbles" mark the beginning of a new liquidation level and indicate the relative size of liquidations that would occur if the price were to reach that level.
Liquidation Bubbles or Liquidation Levels in general appear when there is a large influx of new positions and logically, (significant) new positions lead to (significant) new liquidation levels. Liquidation Bubbles can be used to estimate the size and therefore significance of a given liquidation level. It could be argued that the price is more likely to be attracted to larger Liquidation Level Bubbles. While this is often true, it is not always the case as the strong momentum created by large positions can sustain for a prolonged period before reversing and filling the remaining levels Similarly to other features in this indicator, significant new positions are identified and filtered using standard deviation thresholds and their multipliers. New positions are considered significant when newly opened positions exceed the threshold for "Smaller Size Liquidation," leading to the creation of new liquidation levels and bubbles.
1. If new positions exceed the first standard deviation multiplier ("Smaller Size Liquidation Level"), but do not exceed “Medium Size Liquidation Level”, a smaller-sized bubble appears.
2. If new positions exceed the second standard deviation multiplier (”Medium Size Liquidation Level”), but do not exceed “Large Size Liquidation Level”, a medium-sized bubble appears.
3. If new positions surpass the third standard deviation multiplier (”Large Size Liquidation Level”), a large-sized bubble appears.
Significant opened positions are identified and filtered by size using three "thresholds" in the form of standard deviations, which can be modified in the indicator settings, in the section called "Standard Deviation Multipliers".
**Increasing** the standard deviation multipliers of Liquidation Level Bubbles effectively increases the threshold for a given bubble to occur, making the conditions for its appearance stricter.
⇒ Fewer Liquidation Levels - just larger positions are included
**Decreasing** the standard deviation multipliers of Liquidation Level Bubbles effectively decreases the threshold for a given bubble to occur, making the conditions for its appearance looser.
⇒ More Liquidation Levels - smaller positions are included
Keep in mind that this should always be the case:
*Smaller Size Liquidation Level < Medium Size Liquidation Level < Large Size Liquidation Level*
MARKET ORDER BUBBLES
"Market Order Bubbles" is my experimental concept used as a way to analyze large volumes and visualize the market activity at significant levels under certain conditions. It is based on my imitation of CVD which is also used in other parts of the script. The aim of this concept is to give you an idea about the real-time heavy market buying and selling, which could indicate eg. large liquidations, large entries/exits. in order to add confluence to your analysis. Please note that this concept is still in its early stages and may be confusing as it might have been poorly implemented. I recommend taking the time to thoroughly read through this section in order to fully understand it. On the other hand, early backtesting results appear very promising, as the win rate of countertrading buy and sell bubbles under certain conditions was fairly high (70%). I will continue working on this tool, so stay tuned for future updates.
**Market Buy Order Bubbles** appear above the price and possibly signal the following:
- Short positions being liquidated (exit short = buy order)
- New traders entering late longs based on FOMO (enter long = buy order)
- New short positions (sells) of “smarter” traders absorbing liquidated/closed shorts (buys)
⇒ Possible reversal to the downside - look for the liquidation levels of longs to get filled
**Market Sell Order Bubbles** appear below the price and possibly signal the following:
- Long positions being liquidated (exit long = sell order)
- New traders entering late shorts based on FOMO (enter short = sell order)
- New long positions (buys) of “smarter” traders absorbing liquidated/closed longs (sells)
⇒ Possible reversal to the upside - look for the liquidation levels of shorts to get filled
significant volumes are identified and filtered using three “thresholds” in the form of standard deviations, which can be modified in indicator settings.
1. If buy/sell volume surpasses the first standard deviation (”**Smaller Size Market Orders**”), then the **smaller-sized bubble** appears.
2. If buy/sell volume surpasses the second standard deviation (”**Medium Size Market Orders**”), then the **medium-sized bubble** appears.
3. If buy/sell volume surpasses the third standard deviation (”**Large Size Market Orders**”), then the **large-sized bubble** appears.
**Increasing** the standard deviation multipliers effectively increases the threshold for a given bubble to appear, making the conditions for its occurrence more strict.
**Decreasing** the standard deviation multipliers effectively decreases the threshold for a given bubble to appear, making the conditions for its occurrence more strict.
Keep in mind that this should always be the case:
*Smaller Size Market Orders < Medium Size Market Orders < Large Size Market Orders*
COLOR CANDLES
The Color Candles function is a useful and interesting feature that will enhance your analysis with additional context. If enabled, the indicator will color the chart's candles based on different data. Currently, there are three options to choose from, with more to be added in future updates.
Color Candles: OI DELTA
This option will color the candles to reflect Open Interest Delta. If there is a net increase in open positions (positive Open Interest Delta), the candle will be colored green. If there is a net decrease in open positions (negative Open Interest Delta), the candle will be colored red. It is important to note that this option only functions on pairs for which Tradingview provides OI data
Color Candles: VOLUME
This option utilizes volume data to help you identify the trend and momentum, coloring the candles accordingly - upward impulses are colored green and downward impulses are colored red. This makes it easier to recognize trend reversals and adjust your directional bias accordingly.
Color Candles: STOCH
This option uses the Stochastic Oscillator and SMA to color the candles, helping you identify momentum as upward green moves transition to downward red moves and vice versa.
LEVERAGE RATIO
Leverage ratio is another experimental concept I have added to this script. If turned on, it provides a broad insight into whether the market is relatively over-leveraged or if the leverage is relatively low. The aim is to use it as a confluence in anticipating incoming volatility and possibly use it to understand other aspects of market activity. It is still in its early stages of development and needless to say, it only works on pairs where Open Interest data is provided by Tradingview.
Crosses above price = Leverage is relatively high
Crosses below price = Leverage is relatively low
MARKET INFO SCREENER, LEVEL LEGEND, HIDE FILLED LINES
The last three inputs of Basic Settings section:
”The Market Info Screener” feature will display a small panel on the right side of your chart that provides useful data about the market, including Open Interest, Volume, the aggressive side of traders, and the Leverage Ratio. More data coming in future updates.
"Level Legend" option will display a small legend on the right side of the chart, helping you or others viewing the chart to understand what the objects on the chart mean.
"Hide Filled Lines" option will hide liquidation levels that have already been filled, only displaying the active ones in order to reduce clutter on your chart.
APPEARANCE
The “Appearance” settings offer a variety of modifications for colors, styles, and visibility.
The "Line Style" input allows you to choose the style and width of the liquidation level lines. You can also select which levels to display, as well as the color of the liquidation level lines and bubbles. The "Max Number of Lines" input allows you to specify the number of level lines you want on a chart. If you feel that there is too much clutter, you can decrease this number, and old lines will be removed. Please note that Tradingview has a built-in limit of 500 lines on a given chart, so this value cannot be set above 500. The "Market Buy/Sell Bubble Style" input can be used to modify the color and style of the market order bubbles. Enabling the "Show Settings Screener" option will display a screener with a list of all your settings on the right side of the chart, making it easier to share your preferred settings with others."
STANDARD DEVIATION MULTIPLIERS
This is where you can set the standard deviation thresholds for Liquidation Levels and Market Order Bubbles. These values can be customized to your preference, as the default values may not be suitable for your needs or you may want to experiment with different values to see more or fewer liquidation levels or market order bubbles on your chart. Personally, I sometimes use this feature to increase the Large Size Market Orders or Large Size Liquidation Levels multipliers so that large-sized bubbles are only assigned to extremely large positions or volumes.
If you want to only analyze larger positions or volumes, you can increase the "Smaller Size" multipliers, which act as a minimum threshold.
If you also want to include even smaller positions or volumes in your analysis, you can decrease the values of the "Smaller Size" multipliers, which act as a minimum threshold
Please note that the "Reduce Sensitivity" option in Basic Settings affects the standard deviation multipliers of the liquidation levels. Changing the "Reduce Sensitivity" value will equally multiply all of them (the ratio between Smaller, Medium, and Large multiplier values will remain the same)
STANDARD DEVIATION LENGTH
"Standard Deviation Length" defines the length (number of bars) used in all calculations that utilize the standard deviation function in this script. Decreasing it will generate Liquidation Levels and Liquidation Bubbles based more on recent data. Increasing it will generate Liquidation Levels and Liquidation Bubbles based on more long-term data.
CVD LENGTH
"CVD Length" refers to the length used in calculating cumulative volumes. Decreasing it will generate Liquidation Levels, Market Order Bubbles, and apply Directional bias based more on recent data. Increasing it will generate those based on more long-term data."
LEVEL CALCULATION MODES
“Level Calculation Modes” enable you to switch between three modes of calculating the distance between the base and actual liquidation levels.
COPYRIGHT
"Copyright" option will add your username to the copyright section at the bottom of the chart, giving you credit for your analysis if you post it somewhere.
Open Interest Profile (OI)- By LeviathanThis script implements the concept of Open Interest Profile, which can help you analyze the activity of traders and identify the price levels where they are opening/closing their positions. This data can serve as a confluence for finding the areas of support and resistance , targets and placing stop losses. OI profiles can be viewed in the ranges of days, weeks, months, Tokyo sessions, London sessions and New York sessions.
A short introduction to Open Interest
Open Interest is a metric that measures the total amount of open derivatives contracts in a specific market at a given time. A valid contract is formed by both a buyer who opens a long position and a seller who opens a short position. This means that OI represents the total value of all open longs and all open shorts, divided by two. For example, if Open Interest is showing a value of $1B, it means that there is $1B worth of long and $1B worth of short contracts currently open/unsettled in a given market.
OI increasing = new long and short contracts are entering the market
OI decreasing = long and short contracts are exiting the market
OI unchanged = the net amount of positions remains the same (no new entries/exits or just a transfer of contracts occurring)
About this indicator
*This script is basically a modified version of my previous "Market Sessions and Volume Profile by @LeviathanCapital" indicator but this time, profiles are generated from Tradingview Open Interest data instead of volume (+ some other changes).
The usual representation of OI shows Open Interest value and its change based on time (for a particular day, time frame or each given candle). This indicator takes the data and plots it in a way where you can see the OI activity (change in OI) based on price levels. To put it simply, instead of observing WHEN (time) positions are entering/exiting the market, you can now see WHERE (price) positions are entering/exiting the market. This is the same concept as when it comes to Volume and Volume profile and therefore, similar strategies and ways of understanding the given data can be applied here. You can even combine the two to gain an edge (eg. high OI increase + Volume Profile showing dominant market selling = possible aggressive shorts taking place)
Green nodes = OI increase
Red nodes = OI decrease
A cluster of large green nodes can be used for support and resistance levels (*trapped traders theory) or targets (lots of liquidations and stop losses above/below), OI Profile gaps can present an objective for the price to fill them (liquidity gaps, imbalances, inefficiencies, etc), and more.
Indicator settings
1. Session/Lookback - Choose the range from where the OI Profile will be generated
2. OI Profile Mode - Mode 1 (shows only OI increase), Mode 2 (shows both OI increase and decrease), Mode 3 (shows OI decrease on left side and OI increase on the right side).
3. Show OI Value Area - Shows the area where most OI activity took place (useful as a range or S/R level )
4. Show Session Box - Shows the box around chosen sessions/lookback
5. Show Profile - Show/hide OI Profile
6. Show Current Session - Show/hide the ongoing session
7. Show Session Labels - Show/hide the text labels for each session
8. Resolution - The higher the value, the more refined a profile is, but fewer profiles are shown on the chart
9. OI Value Area % - Choose the percentage of VA (same as in Volume Profile's VA)
10. Smooth OI Data - Useful for assets that have very large spikes in OI over large bars, helps create better profiles
11. OI Increase - Pick the color of OI increase nodes in the profile
12. OI Decrease - Pick the color of OI decrease nodes in the profile
13. Value Area Box - Pick the color of the Value Area Box
14. Session Box Thickness - Pick the thickness of the lines surrounding the chosen sessions
Advice
The indicator calculates the profile based on candles - the more candles you can show, the better profile will be formed. This means that it's best to view most sessions on timeframes like 15min or lower. The only exception is the Monthly profile, where timeframes above 15min should be used. Just take a few minutes and switch between timeframes and sessions and you will figure out the optimal settings.
This is the first version of Open Interest Profile script so please understand that it will be improved in future updates.
Thank you for your support.
** Some profile generation elements are inspired by @LonesomeTheBlue's volume profile script
Volume CVD and Open Interest HeatmapTaking Volume and Open Interest data to the next level of visualization I created a 'heatmap'. The indicator uses a colour gradient and plots boxes from the source candle to the current candle with one of the following data sources:
- Volume - the total volume of transactions, buys and sells
- Up Volume - the total volume from buys only
- Down Volume - the total volume from sells only
- Up/Down Volume (Net) - the difference in the Buy Volume and Sell Volume
- Cumulative Delta - the sum of the up/down volume for the previous 14 bars
- Cumulative Delta EMA - a smoothed average of the sum of the up/down volume for the previous 14 bars, over a 14 period EMA
- Open Interest - a user defined ticker, whose value is added to the plot, while this is designed to be used with Open Interest tickers, you can actually choose any ticker you want, perhaps you want to see DXY while charting Bitcoin!
You can define the lookback period, though you should make sure your timeframe for volume source data, is high enough to accommodate the lookback. TradingView will only fetch 5000 candles worth of data, so at 1 min volume data, you can only lookback 83 hours.
While similar, Volume and Open Interest are not the same. To me the simplest explanation is Volume shows the trades that have been executed and the buy/sell direction, while Open Interest shows the value of open trades that are yet to be completed.
Volume shows strength, sentiment and volatility .
Open Interest does not show direction, but does indicate momentum and liquidity in the market.
With this novel way of visualizing these, you can also now determine where all that liquidity and positions came from and therefore might have resting liquidity below.
Volume CVD and Open InterestVolume, Cumulative Delta Volume and Open Interest are great indications of strength and sentiment in the market. Until now they have required separate indicators, but this indicator can show them all.
With a clean and aesthetic plot, this indicator has the option to choose the data source:
- Volume - the total volume of transactions, buys and sells
- Up Volume - the total volume from buys only
- Down Volume - the total volume from sells only
- Up/Down Volume (Net) - the difference in the Buy Volume and Sell Volume
- Cumulative Delta - the sum of the up/down volume for the previous 14 bars
- Cumulative Delta EMA - a smoothed average of the sum of the up/down volume for the previous 14 bars, over a 14 period EMA
- Open Interest - a user defined ticker, whose value is added to the plot, while this is designed to be used with Open Interest tickers, you can actually choose any ticker you want, perhaps you want to see DXY while charting Bitcoin!
There are several customization features for the colour of the plot, with a nice gradient colouring from high to low. You can choose the lookback which defines only the highest and lowest values for the colour gradient. There is also an option for how the Open Interest value is determined, based on Close, Open or differences between previous values.
While similar, Volume and Open Interest are not the same. To me the simplest explanation is Volume shows the trades that have been executed and the buy/sell direction, while Open Interest shows the value of open trades that are yet to be completed.
Volume shows strength, sentiment and volatility.
Open Interest does not show direction, but does indicate momentum and liquidity in the market.
Volume Profile Volume Delta OI Delta [Kioseff Trading]Hello!
This script serves to distinguish volume delta for any asset and open interest delta for Binance perpetual futures.
The image above provides further explanation of functionality and color correspondence.
The image above shows the indicator calculating volume at each tick level and displaying the metric.
The label color outline (neon effect) is configurable; the image above is absent the feature.
The image above shows Open Interest (OI) Delta calculated - similar to how the script calculates volume delta - for a Binance Perpetual Future pair.
This feature only works for Binance Futures pairs; the script will not load when trying to calculate OI Delta on other assets.
Additionally, a heatmap is displayable should you configure the indicator to calculate it.
The image above shows a heatmap using volume delta calculations.
The image above shows a heatmap using OI delta calculations.
Of course, these calculations - when absent requisite data - require some assumptions to better replicate calculations with access to requisite data.
The indicator assumes a 60/40 split when a tick level is traded at and only one metric - "buy volume" or "sell volume" is recorded. This means there shouldn't be any levels recorded where "buy volume" is greater than 0 and "sell volume" equals 0 and vice versa. While this assumption was performed arbitrarily, it may help better replicate volume delta and OI delta calculations seen on other charting platforms.
This option is configurable; you can select to have the script not assume a 60/40 split and instead record volume "as is" at the corresponding tick level.
The script also divides volume and open interest if a one-minute bar violates multiple tick levels. The volume or open interest generated on the one-minute bar will be divided by the number of tick levels it exceeds. The results are, subsequently, appended to the violated tick levels.
Further, the script can be set to recalculate after a user-defined time threshold is exceeded. You can also define the percentage or tick distance between levels.
Also, it'd be great if this indicator can nicely replicate volume delta indicators on other charting platforms. If you've any ideas on how price action can be used to better assume volume at the corresponding price area please let me know!
Thank you (:
[PlayBit]Correlation-Co _OI Correlation-Co _OI
This Indicator uses a Correlation Coefficient to compare a Crypto Currency to the Binance Open Interest feed if the data is provided
A move in the same direction is indicated with a positive value (the indicator will move up)
A move in the opposite direction the indicator will indicate with a negative value (the indicator will move down)
If both are moving in the same direction and are converging or diverging this will be shown by larger values for divergence and smaller for convergence but will be a positive value
Negative values are shown when price and _OI are moving opposite each other
You can toggle the auto Open Interest option in the settings to use something other than Open Interest if you would like
I still need to add a visual showing when longs are unwinding or opening and when shorts are covering or opening
This is a concept that I made for @Johnny a while back and I'm republishing public from private
This can be useful when comparing a Asset with its Open Interest
The main bit of code was taken from:
by @mortdiggiddy
Let me know if you have any Ideas or suggestions or if I overlooked something
Hope you enjoy,
@FFriZz | @FrizLabz
ILM NSE Futures - Open Interest Analysis - FnOUse this indicator on Daily Timeframe
This script works only on India NSE Futures (Indices and Fno Stocks)
This script pulls Stock/Index Price/Volume Info + Futures Current/Next Price/Volume/Open Interest Info
Calculates the Combined OI and identifies the OI Buildup based on the Price Change and color codes the info for easy reading
This script also calculates Stock/Futures Volume action to identify if big players are aggressively trading in Futures
Also OI Buildup to Future Volume is calculated to track the presence of big players.
Summary Row is displayed at the bottom which shows Futures Premium/Discount to Index/Stock
NSE Open Interest Current + Future Month - OI - COIUse this indicator on Daily Timeframe
This script enhances the standard Open Interest indicator in the following ways
Pulls Current Month and Next Month OI and sums up the data - COI
Works even if input symbol is stock/index and appends Current and Future suffix to pull the data