Open Interest Chart
By LuxAlgoJun 8, 2023

The Open Interest Chart is an innovative trading indicator that visually represents the percentage change of futures open interest using a circular plotting technique, drawing inspiration from the concept of Periodic Ellipses. This method allows traders to easily discern changes in market activity, as open interest reflects the total number of unclosed contracts in a market.
How to Trade the Open Interest Trading Indicator?
In trading, open interest is crucial as it indicates the level of activity and liquidity in a given market. When open interest rises, it typically signifies an inflow of money into the market, depicted in green on the chart. Conversely, a decrease in open interest, shown in red, suggests that money is exiting the market.
With this indicator, traders can track up to six different Futures Open Interest tickers simultaneously, making it easier to stay informed about market movements.
Indicator Details and Code Implementation
The indicator uses a series of circles, plotted via the plot() function, utilizing two main functions: createOuterCircle() for the largest circle representation and createInnerCircle() for inner circles. This design ensures that circles are consistently placed at the chart’s right side, keeping the data timely and relevant.
Here's a technical snippet illustrating the circle-creating mechanism, ensuring it updates correctly:
if ta.change(chart.left_visible_bar_time ) or
ta.change(chart.right_visible_bar_time)
n := bar_index
The below code details how a 39-bar wide circle updates in position, demonstrating the dynamic nature of this visualization:
//@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)
Market Limitations
- The indicator's visuals can at times be slightly misaligned due to the restriction of drawing only on bars, not between them.
- Utilizing bar-replay might demand considerable processing power, as the chart needs to reload consistently with each bar's evolution. If necessary, it's advisable to run bar-replay on the lowest speed and occasionally pause to let the script refresh.
Indicator Settings and Customization
Ticker Options
-
Toggle: • Enabled: Use pre-set symbols for Futures Open Interest tickers. • Disabled: Input your own custom ticker or symbol.
-
Pre-filled list: Quickly select your Futures Open Interest ticker from a ready-made list or opt for custom entries. Options include: • COT: Legacy Commitments of Traders report data • COT2: Disaggregated Commitments of Traders report data • COT3: Traders in Financial Futures report data
-
Timeframe: COT data, orchestrated by the CFTC, is updated weekly, hence the daily timeframe setup as default.
Styling Features
-
From middle: • Enabled (default): Begins drawing from the middle going outward. • Disabled: Starts from the center point of the circle with optional angles.
- Positive %change is marked in green, negative in red, neutral (0% change) is blue, and no data conditions appear gray.
-
Circle Size: Adjust circle dimensions to tiny, small, normal, large, or huge.
-
Angle: Relevant when "From middle" is disabled, allowing angle adjustments for the representation spike.
-
Ticker Display: Add ticker names directly on chart labels for clarity.
-
Text and Fill Options: Designate color schemes for % change and table information.
-
Circle Customization: Beyond color changes, tailor the style and presentation as desired:
FAQ
How do you access the Open Interest Chart indicator?
- You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
This Open Interest Chart offers a nuanced yet clear approach to understanding market interest and fluctuations, tailored for both novice and expert traders aiming to optimize their trading strategy through informed decisions.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.