OPEN-SOURCE SCRIPT
Volume-Weighted SMI with Divergence Alerts

📊 Volume-Weighted SMI with Divergence Alerts
This indicator is a modified version of the Stochastic Momentum Index (SMI) that incorporates volume-weighting to give more significance to price movements during high-volume periods. It also includes optional divergence alerts for improved signal precision.
🔍 Key Features:
Volume-Weighted SMI: Enhances the traditional SMI by amplifying signals during high-volume conditions.
WMA Smoothing: Applies a weighted moving average for clearer trend structure.
Custom Thresholds: Adjustable upper and lower bounds (default ±80) to identify overbought/oversold zones.
Divergence Alerts:
Detects bullish divergence (price makes lower lows, SMI makes higher lows).
Detects bearish divergence (price makes higher highs, SMI makes lower highs).
Sends alerts without plotting markers to keep your chart clean.
⚙️ Inputs:
SMI Length: Lookback for high/low range.
K Smoothing: Smooths the volume-weighted SMI signal.
WMA Length: Period of the WMA applied to the smoothed SMI.
Upper/Lower Threshold: Custom levels for signal zones.
Pivot Lookback: Defines the swing structure used in divergence detection.
🔔 Alerts:
Set a TradingView alert on:
“Any alert() function call”
to receive real-time divergence notifications (bullish or bearish) directly from the indicator.
🧠 How to Use:
Look for crossovers of the WMA with the SMI line to confirm shifts in momentum.
Use threshold levels for overbought/oversold identification.
Watch for divergence alerts to anticipate potential reversals or exhaustion.

This indicator is a modified version of the Stochastic Momentum Index (SMI) that incorporates volume-weighting to give more significance to price movements during high-volume periods. It also includes optional divergence alerts for improved signal precision.
🔍 Key Features:
Volume-Weighted SMI: Enhances the traditional SMI by amplifying signals during high-volume conditions.
WMA Smoothing: Applies a weighted moving average for clearer trend structure.
Custom Thresholds: Adjustable upper and lower bounds (default ±80) to identify overbought/oversold zones.
Divergence Alerts:
Detects bullish divergence (price makes lower lows, SMI makes higher lows).
Detects bearish divergence (price makes higher highs, SMI makes lower highs).
Sends alerts without plotting markers to keep your chart clean.
⚙️ Inputs:
SMI Length: Lookback for high/low range.
K Smoothing: Smooths the volume-weighted SMI signal.
WMA Length: Period of the WMA applied to the smoothed SMI.
Upper/Lower Threshold: Custom levels for signal zones.
Pivot Lookback: Defines the swing structure used in divergence detection.
🔔 Alerts:
Set a TradingView alert on:
“Any alert() function call”
to receive real-time divergence notifications (bullish or bearish) directly from the indicator.
🧠 How to Use:
Look for crossovers of the WMA with the SMI line to confirm shifts in momentum.
Use threshold levels for overbought/oversold identification.
Watch for divergence alerts to anticipate potential reversals or exhaustion.
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.