OPEN-SOURCE SCRIPT
PSX OBV Divergence Labels (1D)

PSX OBV Divergence Labels (1H/4H/1D/1W, Enhanced)
Description:
This indicator marks bullish and bearish OBV divergences on the price chart for PSX and other markets. Designed specifically for swing traders who operate on 1H, 4H, 1D, and 1W timeframes, it enhances basic divergence detection by incorporating volume spikes and OBV slope confirmation — improving signal reliability and reducing noise.
Key Features:
📈 Bullish Divergence: Marks potential buy zones when price hits a local low while OBV shows upward momentum with volume spike confirmation.
📉 Bearish Divergence: Flags potential sell zones when price hits a local high while OBV trends lower with volume weakness.
✅ Slope Confirmation: Filters signals based on sustained OBV direction over a user-defined number of bars.
🔊 Volume Filter: Detects divergence only when volume exceeds the average by a customizable multiplier (default 1.0).
🔍 Clean Visualization: Green “BUY” and red “SELL” labels show clearly on the chart, synced with candle price movement.
Best Timeframes to Use:
1H, 4H, 1D, and 1W (optimized for PSX stocks, KSE100, and KMI30)
Swing traders aiming for 2–4 week holding windows will find the most utility.
Recommended Settings:
OBV Lookback: 20
Volume Smoothing: 20
Spike Multiplier: 1.0
Slope Confirmation: 3 bars
Strategy Tip:
Use divergences in confluence with key support/resistance levels, price action traps, and market structure for high-probability setups. This tool is best used for trend exhaustion detection and reversal signals.
Description:
This indicator marks bullish and bearish OBV divergences on the price chart for PSX and other markets. Designed specifically for swing traders who operate on 1H, 4H, 1D, and 1W timeframes, it enhances basic divergence detection by incorporating volume spikes and OBV slope confirmation — improving signal reliability and reducing noise.
Key Features:
📈 Bullish Divergence: Marks potential buy zones when price hits a local low while OBV shows upward momentum with volume spike confirmation.
📉 Bearish Divergence: Flags potential sell zones when price hits a local high while OBV trends lower with volume weakness.
✅ Slope Confirmation: Filters signals based on sustained OBV direction over a user-defined number of bars.
🔊 Volume Filter: Detects divergence only when volume exceeds the average by a customizable multiplier (default 1.0).
🔍 Clean Visualization: Green “BUY” and red “SELL” labels show clearly on the chart, synced with candle price movement.
Best Timeframes to Use:
1H, 4H, 1D, and 1W (optimized for PSX stocks, KSE100, and KMI30)
Swing traders aiming for 2–4 week holding windows will find the most utility.
Recommended Settings:
OBV Lookback: 20
Volume Smoothing: 20
Spike Multiplier: 1.0
Slope Confirmation: 3 bars
Strategy Tip:
Use divergences in confluence with key support/resistance levels, price action traps, and market structure for high-probability setups. This tool is best used for trend exhaustion detection and reversal signals.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
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 sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
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.