PROTECTED SOURCE SCRIPT
Simulated OI Proxy with Trend Table

1. In Simple Terms
This script mimics open interest analysis using price and volume changes.
It visually marks possible bullish and bearish setups directly on your price chart.
It’s especially useful for markets where real OI data is not available (like Indian stocks)
=======================================================================
2. Calculating Price and Volume Changes
close - close: Calculates the change in closing price from the previous bar to the current bar.
volume - volume: Calculates the change in trading volume from the previous bar to the current bar.
Purpose:
These calculations help determine if price and volume are increasing or decreasing, which is used as a proxy for open interest (OI) since real OI data may not be available.
===================================================================
3. Proxy Logic for OI Signals
long_buildup: Both price and volume are rising. This suggests new buying interest (bullish signal).
short_buildup: Price is falling but volume is rising. This suggests new short positions are being opened (bearish signal).
short_covering: Price is rising but volume is falling. This suggests shorts are closing their positions, causing a price rise (cautiously bullish).
long_unwinding: Both price and volume are falling. This suggests long positions are being closed (cautiously bearish).
====================================================================
4. Plotting the Signals
plotshape(condition, ...): Draws a shape on the chart when the condition is true.
Long Buildup: Green triangle below the bar (bullish).
Short Buildup: Red triangle above the bar (bearish).
Short Covering: Blue circle below the bar (cautiously bullish).
Long Unwinding: Orange circle above the bar (cautiously bearish).
======================================================================
5. Signal Detection:
The script checks price and volume changes to determine which signal is active.
Trend Assignment:
It assigns a text label and color for the detected trend.
Table Display:
A table appears at the top-right of your chart, showing the current trend based on the latest bar.
This script mimics open interest analysis using price and volume changes.
It visually marks possible bullish and bearish setups directly on your price chart.
It’s especially useful for markets where real OI data is not available (like Indian stocks)
=======================================================================
2. Calculating Price and Volume Changes
close - close: Calculates the change in closing price from the previous bar to the current bar.
volume - volume: Calculates the change in trading volume from the previous bar to the current bar.
Purpose:
These calculations help determine if price and volume are increasing or decreasing, which is used as a proxy for open interest (OI) since real OI data may not be available.
===================================================================
3. Proxy Logic for OI Signals
long_buildup: Both price and volume are rising. This suggests new buying interest (bullish signal).
short_buildup: Price is falling but volume is rising. This suggests new short positions are being opened (bearish signal).
short_covering: Price is rising but volume is falling. This suggests shorts are closing their positions, causing a price rise (cautiously bullish).
long_unwinding: Both price and volume are falling. This suggests long positions are being closed (cautiously bearish).
====================================================================
4. Plotting the Signals
plotshape(condition, ...): Draws a shape on the chart when the condition is true.
Long Buildup: Green triangle below the bar (bullish).
Short Buildup: Red triangle above the bar (bearish).
Short Covering: Blue circle below the bar (cautiously bullish).
Long Unwinding: Orange circle above the bar (cautiously bearish).
======================================================================
5. Signal Detection:
The script checks price and volume changes to determine which signal is active.
Trend Assignment:
It assigns a text label and color for the detected trend.
Table Display:
A table appears at the top-right of your chart, showing the current trend based on the latest bar.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.