OPEN-SOURCE SCRIPT

Abhi's Bollinger Band Reversal Signal

154
This Pine Script indicator is designed to detect reversal trade opportunities using Bollinger Band breakouts. It identifies both buy and sell setups with clearly defined entry, stop-loss (SL), and target (TP) conditions. It also manages trades visually with real-time signal plotting, and limits entries per trading day.

⚙️ How It Works
🔽 Sell Signal Conditions
- The previous candle must close above the upper Bollinger Band, and its entire body must be above the band
- The current candle must fail to break the previous high, and must break below the previous low
- Entry is taken at the previous candle’s low, with SL at its high
- Target is calculated based on a configurable Risk:Reward ratio

🔼 Buy Signal Conditions
- The previous candle must close below the lower Bollinger Band, and its entire body must be below the band
- The current candle must fail to break the previous low, and must break above the previous high
- Entry is at the previous candle’s high, with SL at its low
- Target is calculated using the same Risk:Reward ratio

⏰ Time-Based Exit
- If a trade is still active by a user-defined exit time (e.g. 15:15), the trade is closed
- Labels are plotted to show whether this exit was a profit or loss

🧩 User Inputs
- Start Time for signals
- Exit Time for open trades
- Bollinger Band Settings: Period and Std Dev
- Max Entries Per Day
- Risk:Reward Ratio: Dropdown for 1:1, 1:1.5, ..., 1:3

🎨 Visual Features
✅ BUY and SELL signals are plotted when valid conditions are detected
🟢 TP and 🔴 SL labels show trade outcome
🕒 TIME EXIT labels appear at user-set exit time with green/red coloring based on profitability
📉 Bollinger Bands plotted for visual context

📌 Notes:
- Designed for intraday trading, resets entry counter daily
- Uses bar_index > tradeBarIndex to avoid SL/TP being triggered on the same candle as entry
- Tracks only one trade at a time (tradeActive) — ensures clear, non-overlapping logic

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.