Skip to main content

BBRSIOptimStrategy Strategy Deep Analysis

Strategy ID: #431 (431st of 465 strategies)
Strategy Type: Bollinger Band + RSI Oversold Bounce Strategy
Timeframe: 5 minutes (5m)


I. Strategy Overview

BBRSIOptimStrategy is an oversold bounce strategy based on Bollinger Bands and RSI indicators. The strategy seeks rebound profit opportunities by capturing moments when price breaks below the Bollinger Band lower band and RSI is in an extremely low region.

Core Features

FeatureDescription
Entry Conditions1 core entry signal (Bollinger Band + RSI combination)
Exit Conditions1 base exit signal + Tiered ROI take-profit
Protection MechanismStop-loss + Trailing stop
Timeframe5m
Dependenciestalib, qtpylib

II. Strategy Configuration Analysis

2.1 Basic Risk Parameters

# ROI exit table
minimal_roi = {
"0": 0.323, # Immediate profit of 32.3%
"107": 0.097, # After 107 minutes, profit 9.7%
"150": 0.019, # After 150 minutes, profit 1.9%
"238": 0 # After 238 minutes, break-even exit
}

# Stop-loss setting
stoploss = -0.344 # 34.4% stop-loss

# Trailing stop
trailing_stop = True

Design Philosophy:

  • ROI adopts an aggressive tiered exit strategy, aiming for 32.3% profit at open
  • Stop-loss is set wide (-34.4%), giving price enough room to fluctuate
  • Trailing stop enabled to lock in upward profits

2.2 Order Type Configuration

order_types = {
'buy': 'limit',
'sell': 'limit',
'stoploss': 'market',
'stoploss_on_exchange': False
}

order_time_in_force = {
'buy': 'gtc',
'sell': 'gtc'
}

III. Entry Conditions Detailed

3.1 Core Entry Logic

The strategy adopts a concise dual-condition entry signal:

def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(
(dataframe['rsi'] > 12) &
(dataframe['close'] < dataframe['bb_lowerband_2sd'])
),
'buy'] = 1
return dataframe

Condition Interpretation:

ConditionMeaningParameter Value
RSI ConditionRSI greater than 12Avoid extreme oversold
Bollinger Band ConditionClose price breaks below 2SD lower bandCapture oversold opportunity

3.2 Entry Signal Trigger Mechanism

The entry signal design embodies the core concept of "oversold bounce":

  1. Bollinger Band Lower Breakthrough: Price breaks below the Bollinger Band 2SD lower band, which is a statistically extreme deviation
  2. RSI Filter: RSI > 12 ensures not entering during extreme oversold (avoiding catching falling knives)
  3. Combined Logic: Both conditions must be satisfied simultaneously

IV. Exit Logic Detailed

4.1 Multi-tier Take-Profit System

The strategy adopts a tiered ROI take-profit mechanism:

Time (minutes)    Target Profit Rate
─────────────────────────────────────
0 32.3%
107 9.7%
150 1.9%
238 0% (break-even)

4.2 Trailing Stop Mechanism

The strategy enables trailing stop (trailing_stop = True), locking in profits when price reverses.

4.3 Base Exit Signal

def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(
(dataframe['rsi'] > 96) &
(dataframe['close'] > dataframe['bb_lowerband_1sd'])
),
'sell'] = 1
return dataframe

Condition Interpretation:

ConditionMeaningParameter Value
RSI ConditionRSI greater than 96Extreme overbought
Bollinger Band ConditionClose price returns within 1SD lower bandPrice returns to normal range

V. Technical Indicator System

5.1 Core Indicators

Indicator CategorySpecific IndicatorPurpose
Momentum IndicatorRSI (default period 14)Judge overbought/oversold
Volatility IndicatorBollinger Band 1SD, 2SDIdentify price channels

5.2 Indicator Calculation Method

def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
# RSI
dataframe['rsi'] = ta.RSI(dataframe)

# Bollinger Band 1SD
bollinger_1sd = qtpylib.bollinger_bands(
qtpylib.typical_price(dataframe), window=20, stds=1
)
dataframe['bb_lowerband_1sd'] = bollinger_1sd['lower']

# Bollinger Band 2SD
bollinger_2sd = qtpylib.bollinger_bands(
qtpylib.typical_price(dataframe), window=20, stds=2
)
dataframe['bb_lowerband_2sd'] = bollinger_2sd['lower']

return dataframe

Indicator Description:

  • Uses typical price ((high+low+close)/3) to calculate Bollinger Bands
  • Bollinger Band window is 20 candles
  • Calculates both 1SD and 2SD lower bands for different scenarios

VI. Risk Management Features

6.1 Wide Stop-loss Design

  • Stop-loss Value: -34.4%
  • Design Philosophy: Oversold bounce strategies need enough volatility room to avoid being shaken out by normal fluctuations

6.2 Trailing Stop Protection

trailing_stop = True

When price rises, trailing stop follows upward to lock in profits.

6.3 ROI Gradient Design

The strategy adopts a "high early, low later" ROI gradient:

  • 32.3% immediate profit at open (extremely high target)
  • Gradually lowers expectations over time
  • Eventually break-even exit

VII. Strategy Advantages and Limitations

✅ Advantages

  1. Simple Logic: Entry conditions are simple and clear, easy to understand and debug
  2. Oversold Capture: Bollinger Band 2SD lower band is a statistically extreme position with high bounce probability
  3. Controllable Risk: RSI filter avoids blind bottom-fishing in extreme market conditions

⚠️ Limitations

  1. Wide Stop-loss: -34.4% stop-loss may bear significant drawdown
  2. Aggressive ROI Target: 32.3% immediate target is difficult to achieve in live trading
  3. Single Signal: Only one entry logic, signal frequency may be low

VIII. Applicable Scenario Suggestions

Market EnvironmentRecommended ConfigurationDescription
Oscillating DowntrendDefault configurationBest environment for oversold bounce
High VolatilityReduce stop-lossAvoid large drawdowns
One-way UptrendNot recommendedLacks oversold entry opportunities

IX. Applicable Market Environment Detailed

BBRSIOptimStrategy is a classic oversold bounce strategy. Based on its code architecture, it is best suited for oscillating downtrend or high volatility markets, while performing poorly in one-way bull markets.

9.1 Strategy Core Logic

  • Oversold Trigger: Price must break below Bollinger Band 2SD lower band, which is a statistically extreme event
  • RSI Filter: RSI > 12 avoids entering during extreme panic
  • Bounce Exit: Exit when RSI > 96, capturing extreme overbought

9.2 Performance in Different Market Environments

Market TypePerformance RatingReason Analysis
📈 One-way Bull⭐⭐☆☆☆Lacks oversold entry opportunities, high risk of missing out
🔄 Oscillating Downtrend⭐⭐⭐⭐⭐Best environment for oversold bounce
📉 One-way Bear⭐⭐☆☆☆Stop-loss may be frequently triggered
⚡️ High Volatility⭐⭐⭐⭐☆More oversold opportunities, but watch stop-loss

9.3 Key Configuration Suggestions

Configuration ItemSuggested ValueDescription
timeframe5mStrategy's designed timeframe
startup_candle_count30Minimum periods needed for indicator calculation
stoplossCan adjust to -0.25Adjust according to risk preference

X. Important Reminder: The Cost of Complexity

10.1 Learning Cost

The strategy logic is concise with low learning cost. Mainly need to understand:

  • Basic principles of Bollinger Bands
  • Meaning of RSI overbought/oversold
  • Trading logic of oversold bounce

10.2 Hardware Requirements

Number of Trading PairsMinimum MemoryRecommended Memory
1-10 pairs2GB4GB
10-50 pairs4GB8GB

Strategy calculation is small, hardware requirements are low.

10.3 Differences Between Backtesting and Live Trading

  • Backtesting Performance: Aggressive ROI targets, historical backtesting may show high returns
  • Live Trading Differences: 32.3% immediate target is hard to achieve in live trading
  • Suggestion: Adjust ROI parameters to be more realistic for actual markets

10.4 Suggestions for Manual Traders

If wanting to execute this strategy manually:

  1. Set price alerts: Alert when price breaks below Bollinger Band 2SD lower band
  2. Check RSI: Consider entry after confirming RSI > 12
  3. Set take-profit and stop-loss: Can refer to strategy parameters to adjust

XI. Summary

BBRSIOptimStrategy is a classic oversold bounce strategy. Its core value lies in:

  1. Simple Logic: Entry and exit conditions are clear, easy to understand and execute
  2. Statistical Foundation: Bollinger Band 2SD is a statistically extreme deviation with bounce probability advantage
  3. Risk Filter: RSI condition avoids blind bottom-fishing during extreme panic

For quantitative traders, this is a basic strategy suitable for oscillating downtrend markets. It's recommended to adjust ROI and stop-loss parameters according to actual market conditions.


Strategy ID: #431
Strategy Type: Bollinger Band + RSI Oversold Bounce Strategy