OPEN-SOURCE SCRIPT
Telah dikemas kini BB Live Alert Engine (Clean Cycle Logic)

This script gives real-time entry and exit alerts for scalping trades in GC & SI
Nota Keluaran
Cleaner entry exit symbols and alertsNota Keluaran
Bollinger Band Live Alert Engine (Mean Reversion Alerts)Most Bollinger Band strategies look great on charts — but they are difficult to monitor in real time.
This script solves that problem by providing fully automated alerts for Bollinger Band mean-reversion setups, allowing traders to receive signals instantly without constantly watching the chart.
The indicator detects band breaches, averaging opportunities, and mean-reversion exits, making it ideal for traders who execute trades manually but want reliable alerting.
Key Features
✔ Real-time entry alerts when price breaches Bollinger Bands
✔ Automatic averaging signals when price continues extending
✔ Exit alerts when price reverts to the middle band
✔ Clean visual markers for entries and exits
✔ Designed specifically for live trading alerts
✔ Prevents duplicate alerts and alert spam
✔ Works well in volatile markets
Strategy Overview
The script uses Bollinger Bands (21, 2.1) and follows a classic mean reversion approach.
When price moves too far from the average, the system looks for a reversion back toward the middle band.
Only one trade cycle is active at a time, ensuring signals remain clear and structured.
Entry Conditions
Long Entry
A long signal occurs when:
• The low of a candle breaks below the lower Bollinger Band
The candle does not need to close below the band.
The signal triggers as soon as the band is breached.
Short Entry
A short signal occurs when:
• The high of a candle breaks above the upper Bollinger Band
Again, the candle does not need to close above the band.
Averaging Signals
If price continues extending after entry, the script generates averaging signals.
Long Averaging
Occurs when:
• A subsequent candle closes below the lower Bollinger Band
Short Averaging
Occurs when:
• A subsequent candle closes above the upper Bollinger Band
Averaging signals are only generated after the candle closes, preventing intrabar noise.
Exit Conditions
All positions close when price reverts to the middle Bollinger Band.
Long Exit
Triggered when:
• The high of a candle touches or crosses the middle band
Short Exit
Triggered when:
• The low of a candle touches or crosses the middle band
This allows traders to capture the mean reversion move back to the average.
Visual Signals
The indicator uses minimal markers to keep the chart clean:
▲ Green Triangle → Long entry or averaging
▼ Red Triangle → Short entry or averaging
✕ Orange Cross → Trade exit at the middle band
Alerts
The script automatically generates alerts for:
• OPEN LONG
• OPEN SHORT
• AVERAGE LONG
• AVERAGE SHORT
• CLOSE LONG
• CLOSE SHORT
To enable alerts:
Create a TradingView alert and select:
Condition → Any alert() function call
The script will handle all alert logic internally.
Recommended Setup
This script works best when combined with the standard TradingView Bollinger Band indicator for visual reference.
Recommended timeframe: 5 minutes (but can be used on others).
Ideal Markets
This indicator works particularly well on liquid instruments that exhibit mean-reverting behavior, such as:
• Gold Futures
• Silver Futures
• Index futures
• High-liquidity forex pairs
Why This Script Exists
Many traders use Bollinger Bands for mean-reversion strategies, but manually watching charts for band breaches and exits can be exhausting.
This script was created to provide reliable, structured alerts so traders can focus on execution rather than constant chart monitoring.
Open Source
This script is open-source so traders can study, modify, and improve it.
If you find it useful, consider boosting the script so more traders can discover it.
Disclaimer
This script is provided for educational purposes only and should not be considered financial advice. Always test and manage risk appropriately.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.