Skip to main content

BB_RPB_TSL_SMA_Tranz Strategy In-Depth Analysis

Strategy Number: #447 (447th out of 465 strategies)
Strategy Type: Multi-Condition Bollinger Band Reversal + Trailing Stop Loss + Multi-Layer Protection Mechanisms
Timeframe: 5 minutes (5m)


I. Strategy Overview

BB_RPB_TSL_SMA_Tranz is a multi-condition reversal strategy based on Bollinger Bands, inspired by community blog posts. The strategy name breaks down as follows:

  • BB: Bollinger Bands
  • RPB: Real Pull Back
  • TSL: Trailing Stop Loss
  • SMA_Tranz: SMA Transition Module

This strategy integrates multiple technical indicators and buy conditions, combined with multi-layer protection mechanisms, aiming to capture oversold rebound opportunities.

Core Features

FeatureDescription
Buy Conditions52 independent buy signals covering various market scenarios
Sell Conditions8 base sell signals + multi-layer dynamic take-profit logic
Protection MechanismsBTC protection, Pump protection, Dip protection, Slippage control
Timeframe5m main timeframe + 15m/1h informative timeframes
Dependenciespandas_ta, talib, technical, finta

II. Strategy Configuration Analysis

2.1 Base Risk Parameters

# ROI Exit Table
minimal_roi = {
"0": 0.103,
"3": 0.050,
"5": 0.033,
"61": 0.027,
"292": 0.005,
"399": 0,
}

# Stop Loss Settings
stoploss = -0.15

# Trailing Stop Loss
use_custom_stoploss = False

Design Rationale:

  • ROI采用 tiered exit: 10.3% profit target at 0 minutes, gradually decreasing as holding time extends
  • Fixed stop loss at -15%, providing a final defense line for extreme market conditions
  • Custom trailing stop loss not enabled; relies on sell signals and ROI mechanisms

2.2 Order Type Configuration

# Runtime Configuration
process_only_new_candles = True
startup_candle_count = 400
use_sell_signal = True

III. Buy Conditions Detailed Analysis

3.1 Protection Mechanisms (4 Groups)

Each buy condition is equipped with independent protection parameter groups, ensuring entry only under safe conditions:

Protection TypeParameter DescriptionDefault Value Example
BTC ProtectionProhibits buying when BTC drops beyond thresholdbuy_btc_safe=-250, buy_btc_safe_1d=-0.04
Pump ProtectionDetects abnormal price surges, avoids chasing highsmax_change_pump=35%
Dip ProtectionMulti-level decline detection, avoids catching falling knivessafe_dips_10~110 series
Slippage ControlLimits entry price deviationmax_slip=0.983

3.2 Typical Buy Condition Examples

Condition #1: local_uptrend (Local Uptrend)

# Logic
- EMA26 > EMA12 (short-term moving average trending upward)
- EMA difference greater than 2.6% of open price
- Close price breaks below Bollinger Band lower rail
- Close price change meets threshold

Condition #2: local_dip (Local Dip)

# Logic
- EMA26 > EMA12 (trend upward)
- RSI < 21 (relatively oversold)
- Close price below 101.4% of EMA20
- Combined with standard protection conditions

Condition #3: ewo (Elliott Wave Oscillator)

# Logic
- EWO > threshold (identifies trend strength)
- Close price below EMA8 * 0.935
- RSI fast value < 44
- Close price below EMA16 * 0.968

3.3 52 Buy Conditions Classification

Condition GroupCondition NumbersCore Logic
Trend Reversallocal_uptrend, local_dip, ewo, ewo_2EMA alignment + oversold indicator confirmation
Bollinger Bandis_break, nfix_3, nfix_11Price breaks below Bollinger Band lower rail
Oscillatoris_dip, nfi_32, nfi_33CCI/RMI/SRSI oversold combinations
Pattern Recognitionsqzmom, gumbo, r_deadfishSpecial technical patterns
Multi-Timeframenfix_41~nfix_5415m/1h indicator resonance
Moving Average Offsethma, trima, zema, ema_offsetHull/Trimmed/ZLEMA offset buying
Momentum Reversalis_VWAP, is_fama, is_clucHAVWAP/MAMA/Heikin Ashi

IV. Sell Logic Detailed Analysis

4.1 Multi-Layer Take-Profit System

The strategy employs a tiered take-profit mechanism, determining exit timing based on holding profit and RSI status:

Profit Range    RSI Threshold    Signal Name
──────────────────────────────────
> 20% < 34 signal_profit_11
12%~20% < 42 signal_profit_10
10%~12% < 54 signal_profit_9
9%~10% < 55 signal_profit_8
8%~9% < 54 signal_profit_7
7%~8% < 48 signal_profit_6
6%~7% < 45 signal_profit_5
5%~6% < 43 signal_profit_4
4%~5% < 42 signal_profit_3
3%~4% < 40 signal_profit_2
2%~3% < 37 signal_profit_1
1%~2% < 35 signal_profit_0

4.2 Special Sell Scenarios

ScenarioTrigger ConditionSignal Name
Below EMA200 Take-ProfitProfit target met + RSI low + close price < EMA200signal_profit_u_0~11
Post-Pump Take-Profit48h/36h/24h surge exceeds threshold + profit target metsignal_profit_p_1~3
Trailing Take-ProfitProfit pullback + SMA200 decliningsignal_profit_t_1~3
Recovery Take-ProfitLarge max loss + current profit recoverysignal_profit_r_1~2

4.3 Base Sell Signals (8 Signals)

# Sell Signal 1: RSI breaks above Bollinger Band upper rail (6 consecutive candles)
- RSI > 79.5
- Close price above BB upper rail for 6 consecutive candles

# Sell Signal 2: RSI breaks above Bollinger Band upper rail (3 consecutive candles)
- RSI > 81
- Close price above BB upper rail for 3 consecutive candles

# Sell Signal 3: RSI extreme high
- RSI > 82

# Sell Signal 4: Double RSI confirmation
- RSI > 73.4 and RSI_1h > 79.6

# Sell Signal 6: EMA200 rebound below
- Close price < EMA200 and > EMA50
- RSI > 79

# Sell Signal 7: EMA crossover downward
- RSI_1h > 81.7
- EMA12 crosses below EMA26

# Sell Signal 8: Bollinger Band relative position
- Close price > BB upper rail * 1.1

V. Technical Indicator System

5.1 Core Indicators

Indicator CategorySpecific IndicatorsUsage
Trend IndicatorsEMA(4,8,12,13,14,16,20,25,26,50,100,200), SMA(5,9,15,20,21,28,30,75,200)Trend judgment, moving average offset buying
Momentum IndicatorsRSI(2,4,14,20,84,112), CCI(26,170), RMIOverbought/oversold judgment
Volatility IndicatorsBB(20,2), BB(20,3), BB(40,2)Price channels, breakout signals
Volume IndicatorsCMF, MFI, Volume_MA(4,12,24,30)Volume confirmation
Oscillator IndicatorsWilliams %R(14,32,64,84,96,112,480), CTIExtreme position identification
Composite IndicatorsEWO, CRSI, Fisher, PMAXMulti-dimensional confirmation

5.2 Informative Timeframe Indicators (1h)

The strategy uses 1h as an informative layer, providing higher-dimensional trend judgment:

  • RSI_14, EMA series, SMA_200
  • CTI(20,40) for trend strength judgment
  • Williams %R(96,480) for long-term extreme positions
  • Safe Pump/Dip detection
  • MOMDIV buy/sell signals

5.3 Informative Timeframe Indicators (15m)

The 15m timeframe is used for more precise entry timing:

  • EMA(12,16,20,25,26,50,100,200)
  • SMA(15,30,200)
  • BB(20,2), Williams %R(14,64,96)
  • CCI, CTI, EWO, CRSI

VI. Risk Management Features

6.1 BTC Protection Mechanism

# 5m BTC Protection
- Calculate BTC/USDT 5-minute price change
- Prohibit buying when change exceeds threshold

# 1d BTC Protection
- Calculate BTC/USDT intraday price change
- Prohibit buying when intraday decline is too large

6.2 Pump Protection

The strategy implements a multi-level Pump detection system:

Pump TypeTimeframeDetection Logic
Short-term Pump8 candlesPrice change > 15%
Medium-term Pump12 candlesPrice change > 24%
Long-term Pump60 candlesRolling historical Pump detection

6.3 Dip Protection

Multi-level Dip detection to avoid "catching falling knives":

# 11-level Dip detection (from 10 to 120)
safe_dips_X = (
top_pct_change_0 < threshold_1
& top_pct_change_2 < threshold_2
& top_pct_change_12 < threshold_3
& top_pct_change_144 < threshold_4
)

6.4 Slippage Control

# Entry Slippage Detection
max_slip = 0.983 # Maximum allowed slippage 1.7%
slippage = (rate / close - 1) * 100
if slippage > max_slip:
return False # Reject entry

VII. Strategy Advantages and Limitations

✅ Advantages

  1. Multi-Layer Protection: BTC protection, Pump protection, Dip protection, and slippage control provide four-fold protection, effectively reducing risk
  2. Rich Buy Conditions: 52 buy conditions cover various market scenarios, not relying on a single signal
  3. Multi-Timeframe Verification: 5m/15m/1h triple timeframe confirmation improves signal reliability
  4. Dynamic Take-Profit System: Dynamically adjusts take-profit strategy based on profit and RSI status
  5. Large Optimization Space: Extensive Hyperopt parameters support strategy tuning

⚠️ Limitations

  1. Complex Parameters: Over 200 adjustable parameters, making optimization difficult
  2. Overfitting Risk: Excellent historical backtest performance may result from parameter fitting
  3. High Computational Overhead: 400 startup candles + multi-timeframe indicators require significant hardware resources
  4. Steep Learning Curve: Understanding and debugging the strategy requires substantial time
  5. BTC Correlation Dependency: BTC protection mechanism may miss some independent market movements

Market EnvironmentRecommended ConfigurationDescription
Range-Bound MarketEnable all Dip protectionsMany oversold rebound opportunities, protection mechanisms effective
Slow Bull MarketIncrease ROI thresholdsCan hold longer when trend is upward
Bear MarketEnable BTC protectionPrevent systemic decline risk
High VolatilityReduce position sizeMultiple protections may not fully mitigate risk

IX. Detailed Applicable Market Environments

BB_RPB_TSL_SMA_Tranz is a multi-condition reversal strategy. Based on its code architecture and community long-term live trading verification experience, it is most suitable for range-bound to slightly bullish markets, and performs poorly in extreme one-sided market conditions.

9.1 Strategy Core Logic

  • Oversold Rebound Capture: Identifies oversold opportunities through multiple conditions including Bollinger Band lower rail and RSI oversold
  • Trend Filtering: EMA alignment confirms trend direction, avoiding counter-trend operations
  • Multi-Layer Protection: BTC/Pump/Dip protections avoid extreme market losses

9.2 Performance in Different Market Environments

Market TypePerformance RatingReason Analysis
📈 Slow Bull⭐⭐⭐⭐☆Effective dip buying in upward trends, flexible take-profit mechanism
🔄 Range-Bound⭐⭐⭐⭐⭐Many oversold rebound opportunities, strategy advantages maximized
📉 Bear Market⭐⭐☆☆☆BTC protection may trigger frequently, reducing trading opportunities
⚡️ Sharp Decline⭐☆☆☆☆Multiple protections may not fully mitigate systemic risk

9.3 Key Configuration Recommendations

Configuration ItemRecommended ValueDescription
Number of Trading Pairs10-30 pairsDiversify risk, increase opportunity coverage
Stop Loss-0.15Adjust based on risk preference
ROI 00.10Initial profit target 10%
Startup Candles400Ensure accurate indicator calculation

X. Important Reminder: The Cost of Complexity

10.1 Learning Cost

The strategy code exceeds 3,900 lines, containing 52 buy conditions and complex sell logic. Fully understanding the strategy requires:

  • Familiarity with various technical indicators including Bollinger Bands, EMA, RSI, EWO
  • Understanding multi-timeframe analysis principles
  • Mastery of Hyperopt parameter optimization methods

10.2 Hardware Requirements

Number of Trading PairsMinimum RAMRecommended RAM
1-10 pairs4 GB8 GB
10-30 pairs8 GB16 GB
30+ pairs16 GB32 GB

10.3 Differences Between Backtesting and Live Trading

Historical backtest performance is often extremely excellent, but this presents traps:

  • Too many parameters easily "fit" historical optimal solutions
  • Backtesting cannot simulate slippage, latency, and other live trading factors
  • Market environment changes may cause strategy failure

10.4 Recommendations for Manual Traders

Manual execution of this strategy is not recommended:

  • Complex buy conditions make manual judgment difficult
  • Multi-timeframe monitoring requires professional tools
  • Take-profit logic relies on real-time profit calculation

XI. Summary

BB_RPB_TSL_SMA_Tranz is a highly complex multi-condition reversal strategy. Its core value lies in:

  1. Multi-Layer Protection: BTC/Pump/Dip/Slippage four-fold protection, reducing extreme risk
  2. Rich Signals: 52 buy conditions cover various market scenarios
  3. Dynamic Take-Profit: Flexibly adjusts exit strategy based on profit and RSI
  4. Scalability: Extensive parameters support continuous strategy optimization

For quantitative traders, this is a strategy framework worthy of in-depth research and optimization, but attention must be paid to overfitting risks and practical issues in live execution.