Open Interest Stochastic Money Flow Index
Nov 25, 2019

The Open Interest Stochastic Money Flow Index indicator integrates Commitments of Traders (COT) open interest data into a stochastic oscillators framework to identify momentum shifts and liquidity-driven price reversals in futures and CFD markets.
Usage
The Usage section describes how the script can be used to gauge market momentum by substituting traditional volume with open interest. This is particularly effective in futures markets, such as Bitcoin or commodities, where open interest provides a more stable representation of speculative positioning.
- Momentum Identification: Users can monitor the %K (blue) and %D (gray) lines. A crossover of the %K line above the %D line indicates positive momentum, while a crossunder indicates negative momentum.
- Overbought/Oversold Conditions: The indicator features horizontal levels (defaulting to 20 and 80) to highlight extreme conditions where price reversals may occur.
- Adaptive Market Selection: Users can toggle between "FUTURES" and "OTHERS". Selecting "FUTURES" pulls open interest data via COT reports for supported assets, while "OTHERS" utilizes standard volume, making the tool applicable to equities and forex.
- Signal Reversal: The "Reverse Signal" setting allows users to flip the interpreted direction of the signal, which can be useful for contrarian strategies or specific hedging scenarios.
Details
The script calculates the Money Flow Index (MFI) by weighting price changes with open interest (or volume). It then applies a Stochastic calculation to this MFI value rather than the price itself. This dual-layered approach filters out minor price noise and focuses on the capital flowing into or out of the market.
For the "FUTURES" mode, the indicator requests data from CFTC reports. Because these reports are released on a weekly schedule, the open interest data may update less frequently than price, potentially resulting in adjustments when new reports are disclosed. Using the weekly (1W) timeframe ensures the data aligns perfectly with report releases, eliminating any visual repainting.
Settings
- Source: The price data point used for calculations (default is Close).
- Reverse Signal: Inverts the output signals for "K-line" and "D-line" positioning.
- Barcolor I / 0: Enables or disables price bar recoloring based on the current momentum state.
- Market Type: Switches between "FUTURES" (Open Interest) and "OTHERS" (Volume) as the weighting factor.
- MFI Period: The lookback window for the Money Flow Index calculation.
- Oversold: The lower threshold for identifying potential bullish reversals.
- Overbought: The upper threshold for identifying potential bearish reversals.
FAQ
How do I interpret the background highlights and crosses? Green background highlights and green crosses represent bullish crossovers (%K crossing above %D), while red highlights and crosses represent bearish crossunders (%K crossing below %D).
Why does the indicator look different on the "FUTURES" setting? The "FUTURES" setting uses Open Interest data from COT reports. This data tracks the total number of outstanding derivative contracts, providing a different view of market participation compared to standard trading volume.
How can I access this indicator? 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.