Introduction to Bollinger Bands
Bollinger Bands® are a versatile technical analysis tool developed by John Bollinger. They consist of:
- Upper Band: N-period moving average + (M × standard deviation).
- Middle Band: N-period simple moving average (SMA).
- Lower Band: N-period moving average − (M × standard deviation).
In this strategy:
BOLL_N = 20(period length).BOLL_M = 2(standard deviation multiplier).
Strategy Implementation
Key Rules
Long Entry: Triggered when the candle closes above the Lower Band.
if (close[-2] < lowers[-2]) and (close[-1] >= lowers[-1]): order.up_cross_order(symbol, 'Long: Price crosses above Lower Band')Short Entry: Activated when the candle closes below the Upper Band.
elif (close[-2] > uppers[-2]) and (close[-1] <= uppers[-1]): order.down_cross_order(symbol, 'Short: Price crosses below Upper Band')- Exit Long Positions: Close when price crosses below the Middle Band.
- Exit Short Positions: Close when price crosses above the Middle Band.
Backtesting Considerations
- Leverage: Set to 25x (adjust based on risk tolerance).
- Timeframe: 15-minute candles for optimal signal clarity.
FAQs
Q1: How reliable are Bollinger Bands for crypto trading?
A: Bollinger Bands excel in volatile markets like crypto but should be combined with volume analysis or RSI to filter false signals.
Q2: What’s the optimal BOLL_M value?
A: While 2 is standard, backtest with values between 1.5–2.5 to match asset volatility.
Q3: Can this strategy be automated on OKX?
A: Yes! Use 👉 OKX’s API integration to deploy this algorithmically.
Advanced Tips
- Mean Reversion: Works best in ranging markets; avoid during strong trends.
- Confirmation: Add a 50-period SMA to distinguish trending vs. sideways conditions.
Risk Management
- Always use stop-loss orders (e.g., 2% below Lower Band for long positions).
- Limit position size to 5% of capital per trade.
Conclusion
This Bollinger Bands strategy leverages statistical volatility to identify high-probability trades. For seamless execution, explore 👉 OKX’s trading tools. Backtest thoroughly before live deployment!