OPEN-SOURCE SCRIPT

Open Interest Profile (OI)- By Leviathan

Updated
This 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 11B, it means that there is 11B worth of long and 11B 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
Release Notes
Renamed
cryptoCVDOIOpen InterestopeninterestprofileSupport and ResistancevolumedeltaVolume Profile

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Register to support free indicators:
BYBIT: partner.bybit.com/b/Leviathan
WOO X: referral.woo.org/7MY2
Also on:

Disclaimer