This indicator is designed to calculate and visualize average prices for long and short positions based on Open Interest (OI) and volume changes.
Key Features
Open Interest-Based Analysis: Utilizes Open Interest (OI) data to track changes in positions. Separates long and short positions based on the direction of the OI change.
Multiple Look-Back Periods: Short, medium, and long-term look-back periods are configurable. Each period calculates average long and short prices for those timeframes.
Real-Time Updates: Plots the average prices as lines on the chart. Displays labels for the most recent values at the last candle.
Customizable Settings:
Allows users to enable/disable short, medium, and long look-back periods and adjust their lengths.
How It Works
Input Parameters: Users can enable or disable the look-back periods (short, medium, long). Configurable periods define how many bars to look back for each calculation.
Fetching Data: The script determines the correct Open Interest symbol (_OI) for the current chart symbol. Open Interest (OI): Open, high, low, close values. Volume: Total trading volume for each bar.
Open Interest Changes: Calculates the change in Open Interest (oiChange) between the current and previous bar: Positive OI Change: Represents long positions opening. Negative OI Change: Represents short positions opening.
Volume Segmentation: Separates the total trading volume into: Open Volume: Volume associated with opening long or short positions. Close Volume: Remaining volume (assumed to be closing positions).
Cumulative Long/Short Data: Tracks cumulative long and short volumes and their respective values (price × volume). Calculates the Max Average Prices: Average Long Price Max: Total long value ÷ total long volume. Average Short Price Max: Total short value ÷ total short volume.
Look-Back Calculations: For each enabled period (short, medium, long): A custom summation function (f_sum) calculates the sum of volumes and values over the specified look-back period. Average prices for longs and shorts are computed: averageLongPrice = lookBackLongValue / lookBackLongVolume averageShortPrice = lookBackShortValue / lookBackShortVolume
Plotting Data:
Lines:
Plots lines for Max Average Long/Short Prices. Look-back period averages (short, medium, long).
Labels: Labels are displayed for the most recent average prices at the last candle, including descriptions like "Max Avg Long" or "Short Avg Long".
Use Case This indicator is particularly useful for futures traders who:
Want to analyze the behavior of long and short positions in the market.
Use Open Interest as a metric for sentiment (e.g., increasing OI = more positions opening).
Need a visual representation of average entry prices for long and short positions across different time horizons.
What It Tells You
Max Average Long/Short Prices: Represents the overall average entry price of all open long/short positions in the market. Useful for understanding where the majority of traders are positioned.
Look-Back Periods: Highlights recent trends in long/short positioning. Shorter look-back periods are more responsive to recent data, while longer periods show broader trends.
Volume Dynamics: Helps identify whether the market is dominated by long or short volume.
Trend Reversals: When the current price approaches the average price lines, it can indicate areas of potential support or resistance.
Example Scenarios
Trend Analysis: If the price is above the average long price and trending upward, the market is dominated by longs. Conversely, if the price is below the average short price, the market is dominated by shorts.
Support/Resistance: Average prices often act as psychological levels for traders, where support or resistance may occur.
Volume Insights: Significant increases in open/close volume can signal an impending breakout or trend change.
Advanced Notes
Real-Time Data: This indicator is most effective with intraday or daily timeframes for futures markets, as Open Interest is critical for short-term trading.
Customization: Users can adjust the look-back periods and enable only the periods relevant to their trading style.
Open Interest Ticker: The _OI ticker needs to exist for the current chart symbol; otherwise, the indicator won't fetch data.
This indicator combines market sentiment analysis with price action and volume to provide a powerful tool for futures traders.
L'accesso a questo script è riservato agli utenti autorizzati dall'autore, solitamente dietro pagamento di una commissione. Puoi aggiungerlo ai preferiti, ma sarai in grado di utilizzarlo solo una volta ricevuto il via libera da parte dell'autore. Per ulteriori informazioni, contatta Angick o segui le istruzioni dell'autore riportate di seguito.
TradingView non suggerisce di pagare per uno script e di utilizzarlo a meno che non ci si fidi al 100% del suo autore e non si comprenda il suo funzionamento. In molti casi, è possibile trovare gratuitamente una buona alternativa open-source nei nostri Script della comunità.
Istruzioni dell'autore
″Terms of Use:
"By requesting access to this script, you agree to use it for personal trading purposes only. Redistribution is prohibited."
Custom Request:
"Send me a private message on TradingView with your username and reason for requesting access."
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.