Open interest represents the total number of contracts that have been entered by market participants but have not yet been offset or delivered. This can be a direct indicator of market activity/liquidity, with higher open interest indicating a more active market.
Increasing open interest is highlighted in green on the circular plot, indicating money coming into the market, while decreasing open interests highlighted in red indicates money coming out of the market.
You can set up to 6 different Futures Open interest tickers for a quick follow up:
Circles are drawn, using plot(), with the functions createOuterCircle() (for the largest circle) and createInnerCircle() (for inner circles).
Following snippet will reload the chart, so the circles will remain at the right side of the chart:
if ta.change(chart.left_visible_bar_time ) or ta.change(chart.right_visible_bar_time) n := bar_index
Here is a snippet which will draw a 39-bars wide circle that will keep updating its position to the right.
//@version=5 indicator("") n = bar_index barsTillEnd = last_bar_index - n if ta.change(chart.left_visible_bar_time ) or ta.change(chart.right_visible_bar_time) n := bar_index createOuterCircle(radius) => var int end = na var int start = na var basis = 0. barsFromNearestEdgeCircle = 0. barsTillEndFromCircleStart = radius startCylce = barsTillEnd % barsTillEndFromCircleStart == 0 // start circle bars = ta.barssince(startCylce) barsFromNearestEdgeCircle := barsTillEndFromCircleStart -1 basis := math.min(startCylce ? -1 : basis + 1 / barsFromNearestEdgeCircle * 2, 1) // 0 -> 1 shape = math.sqrt(1 - basis * basis) rad = radius / 2 isOK = barsTillEnd <= barsTillEndFromCircleStart and barsTillEnd > 0 hi = isOK ? (rad + shape * radius) - rad : na lo = isOK ? (rad - shape * radius) - rad : na start := barsTillEnd == barsTillEndFromCircleStart ? n -1 : start end := barsTillEnd == 0 ? start + radius : end [hi, lo, start +1, end] [h, l, s, e] = createOuterCircle(40) plot(h), plot(l)
- Due to the inability to draw between bars, from time to time, drawings can be slightly off.
- Bar-replay can be demanding, since it has to reload on every bar progression. We don't recommend using this script on bar-replay. If you do, please choose the lowest speed and from time to time pause bar-replay for a second. You'll see the script gets reloaded.
• Enabled -> uses the first column with a pre-filled list of Futures Open Interest tickers/symbols
• Disabled -> uses the empty field where you can enter your own ticker/symbol
- Pre-filled list: the first column is filled with a list, so you can choose your open interest easily, otherwise you would see COT:088691_F_OI aka Gold Futures Open Interest for example.
If applicable, you will see 3 different COT data:
• COT: Legacy Commitments of Traders report data
• COT2: Disaggregated Commitments of Traders report data
• COT3: Traders in Financial Futures report data
- Empty field: When needed, you can pick another ticker/symbol in the empty field at the right and disable the toggle.
- Timeframe: Commitments of Traders (COT) data is tallied by the Commodity Futures Trading Commission (CFTC) and is published weekly. Therefore data won't change every day.
Default set TF is Daily
- From middle:
• Enabled (default): Drawings start from the middle circle -> towards outer circle is + %change, towards middle of the circle is - %change
• Disabled: Drawings start from the middle POINT of the circle, towards outer circle is + OR -
-> in both options, + %change will be coloured green, - %change will be coloured red.
-> 0 %change will be coloured blue, and when no data is available, this will be coloured gray.
- Size circle: options tiny, small, normal, large, huge.
- Angle: Only applicable if "From middle" is disabled!
-> sets the angle of the spike:
- Show Ticker: Name of ticker, as seen in table, will be added to labels.
- Text - fill
• Sets colour for +/- %change
• Sets 2 text colours, size and position
• Sets the colour of circles, style can be changed in the Style section.
You can make it as crazy as you want:
Join our 100k+ community: discord.gg/lux
All scripts & content provided by LuxAlgo are for informational & educational purposes only. Past performance does not guarantee future results.
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 a publication is governed by House Rules. You can favorite it to use it on a chart.