Open Interest with Bollinger Bands and some moving averages
Mar 30, 2022

The Open Interest with Bollinger Bands and some moving averages indicator visualizes Binance Perpetuals Open Interest (OI) data combined with volatility bands and multiple moving average types to help identify liquidity shifts and trend strength.
Usage
The Usage section describes how the script can be used to analyze market commitment through Open Interest. Users can apply this tool to analyze whether new money is entering the market or if positions are being liquidated.
- Identifying Trends: By overlaying Moving Averages on OI, users can identify if the total number of outstanding contracts is trending upwards (indicating increasing market participation) or downwards (indicating capital outflow).
- Volatility Analysis: The Bollinger Bands allow users to see when Open Interest is reaching extreme levels relative to its historical mean. An OI breakout above the upper band often suggests a surge in speculative activity.
- Asset Cross-Checking: Even when viewing a Binance Spot chart, the indicator can be configured to fetch the corresponding Perpetual contract's Open Interest, allowing spot traders to monitor the derivatives market sentiment simultaneously.
Details
The script fetches data using the request.security function, specifically targeting Binance Perpetual Open Interest symbols (e.g., "SYMBOL.P_OI").
Technical Implementation
- Data Handling: The script automatically appends ".P_OI" to the selected symbol to ensure it pulls derivative data. If the chart is not a perpetual pair, it attempts to find the closest match.
- Custom Moving Averages: Beyond standard averages like SMA and EMA, the tool includes advanced smoothing algorithms such as:
- ZLEMA (Zero Lag Exponential Moving Average): Reduces the inherent lag found in traditional EMAs.
- Tillson T3: A smooth moving average that utilizes a volume factor to reduce noise and overshoot.
- VAR (Variable Index Dynamic Average): Adjusts its smoothing constant based on market volatility.
Settings
General Settings
- Show Info Table: Toggles a small UI element on the chart that confirms which specific ticker data is being displayed.
- Override Symbol: Allows the user to manually enter a different ticker to track OI for an asset other than the one currently on the chart.
Bollinger Bands
- Show BB: Toggles the visibility of the Bollinger Bands on the OI pane.
- BB Length: Sets the lookback period for the basis (SMA) and standard deviation calculations.
- BB Source: Determines which OI data point (Open, High, Low, Close, etc.) is used for the bands.
- Standard Deviation: Adjusts the width of the bands.
Moving Averages (MA-1 & MA-2)
- Show OI MA: Toggles the visibility for two independent moving average lines.
- MA Type: Selects from 19 different types, including SMA, EMA, HMA, ALMA, VWMA, ZLEMA, and Tillson.
- MA Length: Sets the lookback period for the chosen average.
- ALMA/Tillson Specifics: Provides additional inputs (Sigma, Offset, Volume Factor) that only affect the calculation if those specific MA types are selected.
FAQ
How can I see Open Interest for a spot pair? While the indicator is primarily designed for Binance Perpetuals, if you select a spot pair that has a corresponding perpetual contract on Binance, the script will automatically fetch and display the perpetual's Open Interest.
What happens if no data is found for a symbol? The script includes a runtime error check. If Binance does not provide Open Interest data for the requested ticker, a message will appear stating that no data was found.
How do I access Open Interest with Bollinger Bands and some moving averages? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
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.