Bollinger Breakout Entries with ATR-Based Trailing Stops
Summary
This strategy uses 15-minute bars to calculate Bollinger Bands, a simple moving average, and average true range. When flat, it places stop entries at the upper and lower Bollinger bands, allowing a move beyond either boundary to initiate a long or short position. The order size is fixed. Once in a position, it tracks the highest price reached for a long or the lowest for a short, then sets an exit level using an ATR multiple. The middle Bollinger line constrains that stop level, providing an additional exit reference.
The implementation also manages pending entry and exit orders by cancelling existing orders and tracking stop-order updates. It describes rules and order handling, but supplies no backtest, performance evidence, transaction-cost assumptions, or market-specific evaluation. The code excerpt therefore cannot establish that the parameters or signals are profitable, and its practical behavior depends on the trading framework and execution conditions.
Key ideas
- Upper and lower Bollinger bands define stop-entry levels for long and short trades.
- A moving average and ATR are calculated from 15-minute bars.
- The strategy trails exits from the favorable price extreme using an ATR-based distance.
- The Bollinger middle line constrains the trailing stop level.
- Order tracking and cancellation logic manage pending stop orders.
Tags
From a private course collection; the original is not published.