Skip to main content

BBMod1 Strategy In-Depth Analysis

Strategy ID: #423 (423rd of 465 strategies)
Strategy Type: Multi-Condition Bollinger Band Breakout + Dynamic Stop Loss
Time Frame: 5 minutes (5m) + 1 hour info layer


I. Strategy Overview

BBMod1 is a multi-condition quantitative trading strategy based on Bollinger Bands, inspired by the BB_RPB_TSL strategy and extensively modified and optimized. This strategy combines multiple technical indicators, constructs 17 independent buy signal conditions, and implements complex dynamic stop loss and tiered take profit mechanisms, aiming to capture trading opportunities across different market environments.

Core Characteristics

FeatureDescription
Buy Conditions17 independent buy signals, can trigger independently, multi-dimensional opportunity capture
Sell ConditionsTiered ROI + Custom stop loss + Custom sell signals
Protection MechanismDynamic trailing stop + Tiered take profit system
Time FrameMain timeframe 5m + Info timeframe 1h
Dependenciestalib, pandas_ta, technical, qtpylib, numpy

II. Strategy Configuration Analysis

2.1 Basic Risk Parameters

# ROI exit table
minimal_roi = {
"0": 0.10, # Immediate profit target 10%
"30": 0.05, # After 30 minutes drops to 5%
"60": 0.02 # After 60 minutes drops to 2%
}

# Stop loss setting
stoploss = -0.10 # Fixed stop loss -10% (custom stop loss actually used)

# Custom stop loss
use_custom_stoploss = True

# Trailing stop configuration (custom implementation)
pHSL = -0.99 # Hard stop loss profit threshold
pPF_1 = 0.019 # Profit threshold 1
pSL_1 = 0.017 # Stop loss profit 1
pPF_2 = 0.05 # Profit threshold 2
pSL_2 = 0.045 # Stop loss profit 2

Design Rationale:

  • Tiered ROI: Lower profit expectations as holding time increases
  • Custom stop loss implements dynamic trailing, adjusting stop level based on profit
  • When profit is between 1.9%-5%, stop loss transitions linearly from 1.7% to 4.5%
  • When profit exceeds 5%, stop loss moves up with profit

2.2 Order Type Configuration

order_types = {
'buy': 'limit', # Buy using limit order
'sell': 'limit', # Sell using limit order
'emergencysell': 'limit', # Emergency sell limit order
'forcebuy': 'limit', # Force buy limit order
'forcesell': 'limit', # Force sell limit order
'stoploss': 'limit', # Stop loss using limit order
'stoploss_on_exchange': False, # Exchange stop loss disabled
'stoploss_on_exchange_interval': 60,
'stoploss_on_exchange_limit_ratio': 0.99
}

III. Buy Conditions Detailed Analysis

3.1 Protection Mechanisms (17 Groups)

Each buy condition has independent protection parameter groups including:

Protection TypeParameter DescriptionDefault Example
Hyperopt ParametersOptimization switches, ranges, default valuesis_optimize_xxx = True/False
Condition ThresholdsRSI, CTI, BB width, etc.RSI: 15-50, CTI: -0.9-0.0
1h Info Layer ProtectionHigher timeframe validationrocr_1h, safe_dump_50_1h
Dynamic Stop Loss LabelsSpecific conditions enable lower stop losslower_trailing_list

3.2 Typical Buy Condition Examples

Condition #1: bb_checked (Bollinger Band Pullback + Breakout)

# Logic
- RMI < buy_rmi (Relative Momentum Index oversold)
- CCI <= buy_cci (Commodity Channel Index at low level)
- SRSI FK < buy_srsi_fk (Stochastic RSI fast line at low level)
- BB Delta > buy_bb_delta (Bollinger Band bandwidth expansion)
- BB Width > buy_bb_width (Bollinger Band width sufficient)
- Close price < BB lower band * buy_bb_factor (Price touches lower band area)

Backtest Performance: ~2.32x return / 91.1% win rate / 46.27% max drawdown

Condition #2: local_uptrend (Local Uptrend)

# Logic
- EMA26 > EMA12 (Trend confirmation)
- EMA26 - EMA12 > Open price * buy_ema_diff (Trend strength)
- Close price < BB lower band * buy_bb_factor (Pullback buy)
- Close price change > threshold (Avoid sideways)

Backtest Performance: ~3.28x return / 92.4% win rate / 69.72% max drawdown

Condition #3: clucHA (ClucHA Strategy Variant)

# Logic
- ROCR_1h > buy_clucha_rocr_1h (1-hour momentum confirmation)
- BB lower band 40 period > 0 (Valid Bollinger Band)
- BB Delta > Close price * buy_clucha_bbdelta_close (Bandwidth expansion)
- Wick < BB Delta * buy_clucha_bbdelta_tail (Limit wick)
- Heikin Ashi close price < BB lower band 40 period (Price at low level)

Backtest Performance: ~7.2x return / 92.5% win rate / 97.98% max drawdown

3.3 Classification of 17 Buy Conditions

Condition GroupCondition NumbersCore Logic
Bollinger Band ClassbbBB pullback + oversold indicator combination
Trend Classlocal_uptrend, local_uptrend2EMA trend + price pullback
Pullback Classlocal_dipShort-term decline in trend
EWO Classewo, ewo2Elliott Wave Oscillator
ClucHA ClassclucHA, clucHA2ClucHA strategy variants
Momentum ClasscofiStochastic crossover + ADX
NFI Seriesnfi_32, nfi_33, nfi_38, nfix_5, nfix_39, nfix_49Multiple NFI variants
NFI7 Seriesnfi7_33, nfi7_37PMAX + EWO combination
Volume-Price ClassvwapVWAP support + RSI oversold

IV. Sell Logic Detailed Analysis

4.1 Multi-Layer Take Profit System

The strategy employs a tiered ROI + custom sell dual mechanism:

Holding Time      Target Profit
─────────────────────────
0 minutes 10%
30 minutes 5%
60 minutes 2%

4.2 Custom Stop Loss System

Tiered Take Profit Stop Loss (Profit-driven):

Profit Range         Stop Loss Level
──────────────────────────────
< 1.9% -99% (hard stop loss)
1.9% - 5% 1.7% → 4.5% (linear interpolation)
> 5% Profit - 5% + 4.5%

Lower Stop Loss Label Protection: Some buy conditions (vwap, clucHA, clucHA2, nfi_38, nfi7_33, nfi7_37, cofi) enable protection at small profits:

  • Profit 1%-1.9%: Stop loss 0.9%
  • Profit ≥1.9%: Resume normal stop loss

4.3 Custom Sell Signals

ScenarioTrigger ConditionSignal Name
CTI + R OverboughtCTI > 0.844 and R_14 > -19.99sell_profit_cti_r_0_1
nfix_39 ScalpingFisher > 0.39, HA consecutive decline, price > EMA4sell_scalp
Loss Exit 1Price > SMA9, price > EMA24*0.997, RSI > 50sell_offset
Loss Exit 2Price > EMA49*1.006sell_offset2

V. Technical Indicator System

5.1 Core Indicators

Indicator CategorySpecific IndicatorsUsage
Trend ClassEMA(4,8,12,13,16,20,24,26,49,50,100,200)Trend determination, support/resistance
Volatility ClassBB(20,2), BB(20,3), BB(40,2), BB(20,4)Price channel, volatility
Momentum ClassRSI(4,14,20,84,112), RMI, SRSI, CCIOverbought/oversold, momentum strength
Volume ClassCMF, Volume Mean(4,12,24)Volume-price relationship, money flow
Oscillator ClassEWO, CTI, Williams %R(14,32,64,96,480)Market cycle, extreme positions
Special ClassPMAX, MOMDIV, T3, Fisher, VWAPAdvanced signals

5.2 Info Timeframe Indicators (1h)

The strategy uses 1 hour as the info layer for higher-dimensional trend validation:

  • EMA Series: 8, 50, 100, 200 period EMAs
  • CTI 40: 40-period Correlation Trend Index
  • CRSI: Composite RSI (3,2,100)
  • Williams %R: 96, 480 periods
  • Bollinger Band Width: BB Width (1h)
  • MOMDIV: Momentum Divergence Indicator
  • Safe_dump_50: 5-period decline protection

VI. Risk Management Features

6.1 Multi-Dimensional Condition Validation

Each buy signal undergoes multi-dimensional validation:

  • Trend Validation: EMA alignment, PMAX direction
  • Volatility Validation: BB width, price position
  • Momentum Validation: RSI, CTI, Williams %R
  • Cycle Validation: EWO, CRSI
  • Volume Validation: Volume Mean, CMF

6.2 Dynamic Stop Loss System

The strategy implements tiered dynamic stop loss:

  • Profit 0-1.9%: Hard stop loss -99% (rarely triggered)
  • Profit 1.9-5%: Stop loss rises linearly from 1.7% to 4.5%
  • Profit >5%: Stop loss = Profit - 0.5% (protects most profit)

6.3 Special Condition Protection

Some high-risk buy conditions enable additional protection:

lower_trailing_list = ["vwap", "clucHA", "clucHA2", "nfi_38", "nfi7_33", "nfi7_37", "cofi"]

These conditions use 0.9% stop loss at 1%-1.9% profit to avoid premature stop loss.


VII. Strategy Advantages and Limitations

✅ Advantages

  1. Multi-Signal Coverage: 17 buy conditions cover trend, pullback, oversold and other market states
  2. Refined Risk Management: Tiered stop loss + condition protection, different signals use different stop strategies
  3. Timeframe Validation: 5m trading + 1h confirmation reduces false signals
  4. Parameter Optimization: Extensive Hyperopt parameters adjustable for market conditions
  5. Flexible Stop Loss: Custom stop loss function implements profit protection

⚠️ Limitations

  1. High Complexity: 17 buy conditions + multiple indicators, difficult to understand and maintain
  2. Numerous Parameters: Over 80 adjustable parameters, high overfitting risk
  3. High Computational Load: Multiple indicators + multiple timeframes, high hardware requirements
  4. Live Trading Differences: Backtest performance may not fully replicate in live trading
  5. Debugging Difficulty: Many conditions make problem identification complex

VIII. Applicable Scenario Recommendations

Market EnvironmentRecommended ConfigurationDescription
Slow Bull MarketEnable all conditionsClear trend, multiple signals can profit
Sideways MarketEnable clucHA, local_dipCapture rebounds in oscillation
Downtrend MarketEnable vwap, nfi seriesOversold rebound strategy
High VolatilityEnable BB-related conditionsBollinger strategies more effective when volatility is high

IX. Applicable Market Environment Detailed Analysis

BBMod1 is a typical multi-strategy combination strategy. Based on its code architecture and community long-term live trading verification, it is most suitable for moderate to low volatility trend pullback markets, while performing poorly in one-way surges or extreme crashes.

9.1 Strategy Core Logic

  • Multi-Signal Risk Diversification: 17 buy signals trigger independently, spreading single signal risk
  • Bollinger Band as Core: Most signals based on BB price position and bandwidth
  • Multi-Indicator Validation: RSI, CTI, EWO and other indicators as auxiliary validation
  • Dynamic Stop Loss Protection: Adjust stop loss based on profit level, protecting gains

9.2 Performance in Different Market Environments

Market TypePerformance RatingReason Analysis
📈 Slow Bull Market⭐⭐⭐⭐⭐Trend pullback signals effective, stop loss protects profits
🔄 Sideways Market⭐⭐⭐⭐☆BB strategies perform well in oscillation, watch stop loss
📉 Downtrend Market⭐⭐⭐☆☆Oversold rebound signals can profit, but higher risk
⚡️ Extreme Volatility⭐⭐☆☆☆Extreme volatility may cause stop loss sweep or signal failure

9.3 Key Configuration Recommendations

Configuration ItemRecommended ValueDescription
Number of Pairs5-15 pairsAvoid too many pairs causing resource shortage
Startup Memory≥4GBMulti-indicator calculation requires sufficient memory
CPUMulti-core recommendedParallel processing of multiple pairs
Timeframe5mDefault configuration, modification not recommended

X. Important Reminder: The Cost of Complexity

10.1 Learning Curve

  • Need to understand 17 different buy logics
  • Need to master BB, EMA, RSI, EWO, CTI and other indicators
  • Need to understand how tiered stop loss works
  • Need to be familiar with Hyperopt parameter optimization

10.2 Hardware Requirements

Number of PairsMinimum MemoryRecommended Memory
1-5 pairs2GB4GB
5-15 pairs4GB8GB
15+ pairs8GB16GB

10.3 Differences Between Backtest and Live Trading

  • Backtest: Historical data is perfect, all conditions can trigger
  • Live Trading: Network latency, exchange rate limits, price slippage
  • Recommendation: Verify with small capital live trading first, then gradually increase position

10.4 Advice for Manual Traders

Not recommended to manually execute this strategy because:

  • 17 buy signals need real-time monitoring
  • Dynamic stop loss needs calculation every minute
  • Multi-timeframe analysis requires watching multiple charts simultaneously

XI. Summary

BBMod1 is a multi-condition Bollinger Band breakout strategy that trades complexity for comprehensiveness. Its core value lies in:

  1. Rich Signals: 17 buy conditions cover multiple market states
  2. Controlled Risk: Tiered stop loss + condition protection, refined management
  3. Full Validation: Multi-indicator + multi-timeframe confirmation
  4. Flexible Optimization: Extensive Hyperopt parameters adjustable for different markets

For quantitative traders, this is a strategy suitable for users with some experience. It is recommended to verify in backtest first, then test with small capital live trading, and finally adjust parameters based on actual performance.