BandGrid
Overview
Mean-reversion grid strategy that anchors buy and sell levels to Bollinger Bands. The grid automatically widens during volatile periods and tightens during calm periods as Bollinger Bands expand and contract with realized volatility. Buy orders are placed in the lower half of the band range (statistically oversold) and sell orders in the upper half (overbought), with take-profit targets aiming for mean reversion to the SMA middle line. A three-tier regime detection system (Active, Cautious, Paused) protects against trending markets using ADX and band width analysis. Entry quality is enhanced with optional RSI confirmation filtering.
Requirements
Required Indicators
| Supported Markets | Spot & Futures |
Configuration Parameters
Grid Settings
Configure grid structure and Bollinger Band parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
TRADE_DIRECTIONTrade Direction | Select: long | short | both | long | Grid direction: long/short/both |
SPACING_MODESpacing Mode | Select: bb | atr | percentage | fixed | percentage | Spacing source: percentage (default), bb derives from band width |
BB_PERIODBB Period | Number | 20 | Bollinger Band period |
BB_STDDEVBB Std Dev | Number | 2 | Bollinger Band standard deviation multiplier |
GRID_LEVELSGrid Levels | Number | 3 | Grid levels per side within bands |
SPACING_ATR_MULTSpacing ATR Multiplier | Number | 1 | ATR multiplier (when mode=atr) |
SPACING_PERCENTSpacing Percent | Number | 1.5 | Percentage spacing (when mode=percentage) |
SPACING_FIXEDSpacing Fixed | Number | 100 | Fixed dollar spacing (when mode=fixed) |
Risk Management
Configure margin limits and position sizing
| Parameter | Type | Default | Description |
|---|---|---|---|
SIZE_PER_LEVEL_PCTSize Per Level (%) | Number | 5 | Balance percentage per grid level |
MAX_FILLED_LEVELSMax Filled Levels | Number | 6 | Max simultaneous filled levels |
MAX_POSITION_MARGIN_PCTMax Margin (%) | Number | 35 | Max margin usage percentage |
EMERGENCY_SIGMAEmergency Sigma | Number | 3 | Emergency close at N sigma deviation |
Strategy Logic
Configure regime detection and RSI filtering
| Parameter | Type | Default | Description |
|---|---|---|---|
RSI_OVERSOLDRSI Oversold | Number | 50 | RSI threshold for buy entry — buys placed when RSI below this |
RSI_OVERBOUGHTRSI Overbought | Number | 50 | RSI threshold for sell entry — sells placed when RSI above this |
ENABLE_RSI_FILTEREnable RSI Filter | Boolean | Disabled | Filter limit orders by RSI momentum direction (opt-in) |
REGIME_ADX_MAXRegime ADX Max | Number | 22 | ADX ceiling for active grid operation |
TRAIL_PERCENTTrail Percent | Number | 1 | Trailing stop for paused regime positions |
TP/SL Configuration
Configure take profit and stop loss distance modes
| Parameter | Type | Default | Description |
|---|---|---|---|
TAKE_PROFIT_MULTTake Profit Multiplier | Number | 1 | Take profit as fraction of grid spacing (1.0 = TP at one full spacing from fill) |
LEVEL_SL_MULTLevel SL Multiplier | Number | 2 | Per-level stop loss as multiple of grid spacing (0 = disabled) |
TP_SL_MODETP/SL Mode | Select: spacing | percentage | atr | spacing | TP/SL distance mode: spacing = fraction of grid spacing, percentage = fixed %, atr = ATR-based |
TP_PERCENTTP Percent | Number | 1.5 | TP distance as percentage of fill price (when mode=percentage) |
SL_PERCENTSL Percent | Number | 3 | SL distance as percentage of fill price (when mode=percentage) |
TP_ATR_MULTTP ATR Multiplier | Number | 1 | TP distance as ATR multiple (when mode=atr) |
SL_ATR_MULTSL ATR Multiplier | Number | 2 | SL distance as ATR multiple (when mode=atr) |
Version Info
Current Version: v1.0
Latest Changes
Initial release
Changelog
| Version | Date | Type | Changes |
|---|---|---|---|
| v1 | 2025-02-18 | Initial release |