Skip to main content

BB_RPB_TSL_SMA_Tranz_TB_1_1_1 Strategy In-Depth Analysis

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


I. Strategy Overview

BB_RPB_TSL_SMA_Tranz_TB_1_1_1 is an enhanced version of the BB_RPB_TSL_SMA_Tranz strategy, adding Trailing Buy and Trailing Sell mechanisms on top of the original foundation. The strategy name breaks down as follows:

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

This strategy uses the trailing buy mechanism to wait for better entry prices after signal triggers, thereby reducing holding costs.

Core Features

FeatureDescription
Buy ConditionsInherits parent strategy's 52 buy signals + trailing buy mechanism
Sell Conditions8 base sell signals + trailing sell mechanism
Protection MechanismsBTC protection, Pump protection, Dip protection, Slippage control
Timeframe5m main timeframe + 15m/1h informative timeframes
Special FeaturesTrailing Buy, Trailing Sell, Custom Stop Loss
Dependenciespandas_ta, talib, technical

II. Strategy Configuration Analysis

2.1 Base Risk Parameters

# ROI Exit Table
minimal_roi = {
"0": 0.205, # 0 minutes: Target profit 20.5%
"81": 0.038, # 81 minutes: Target profit 3.8%
"292": 0.005, # 292 minutes: Target profit 0.5%
}

# Stop Loss Settings
stoploss = -0.10

# Trailing Stop Loss
use_custom_stoploss = True

Design Rationale:

  • ROI采用 three-tier exit, initial profit target as high as 20.5%, reflecting the cost advantage brought by trailing buy
  • Fixed stop loss at -10%, stricter than the parent strategy
  • Custom stop loss enabled, supporting more flexible stop loss strategies

2.2 Trailing Buy Configuration

# Trailing Buy Parameters
trailing_buy_order_enabled = True
trailing_expire_seconds = 1800 # Trailing validity period 30 minutes
trailing_buy_max_stop = 0.02 # Stop trailing when price rises above 2%
trailing_buy_max_buy = 0.000 # Immediate buy threshold

# Uptrend Trailing Parameters
trailing_buy_uptrend_enabled = True
trailing_expire_seconds_uptrend = 90 # Uptrend trailing validity period 90 seconds
min_uptrend_trailing_profit = 0.02 # Uptrend minimum profit requirement 2%

2.3 Trailing Sell Configuration

# Trailing Sell Parameters
trailing_sell_order_enabled = True
trailing_sell_max_stop = 0.02 # Stop trailing when price drops below 2%
trailing_sell_max_sell = 0.000 # Immediate sell threshold

# Uptrend Trailing Sell
trailing_sell_uptrend_enabled = True

III. Trailing Buy Mechanism Detailed Analysis

3.1 Working Principle

The core idea of the trailing buy mechanism is: After signal triggers, do not buy immediately; wait for price to pull back to a more favorable position before entering.

Signal Trigger → Start Trailing → Price Declines → Buy Execution
→ Price Rises Above Threshold → Cancel Trailing
→ Timeout → Buy at Current Price

3.2 Trailing State Management

init_trailing_buy_dict = {
'trailing_buy_order_started': False, # Whether trailing has started
'trailing_buy_order_uplimit': 0, # Trailing upper limit price
'start_trailing_price': 0, # Starting trailing price
'buy_tag': None, # Buy tag
'start_trailing_time': None, # Trailing start time
'offset': 0, # Offset
'allow_trailing': False, # Whether trailing is allowed
}

3.3 Trailing Buy Advantages

ScenarioTraditional BuyTrailing Buy
Price declines after signal triggerBuy at signal priceWait for lower price to buy
Price rises after signal triggerBuy at signal priceMay cancel or chase high to buy
Price oscillates after signal triggerBuy at signal priceBuy at oscillation low point

IV. Trailing Sell Mechanism Detailed Analysis

4.1 Working Principle

The core idea of the trailing sell mechanism is: After sell signal triggers, do not sell immediately; wait for price to rebound to a more favorable position before exiting.

Sell Signal Trigger → Start Trailing → Price Rises → Sell Execution
→ Price Drops Below Threshold → Cancel Trailing
→ Timeout → Sell at Current Price

4.2 Trailing State Management

init_trailing_sell_dict = {
'trailing_sell_order_started': False, # Whether trailing has started
'trailing_sell_order_downlimit': 0, # Trailing lower limit price
'start_trailing_sell_price': 0, # Starting trailing price
'sell_tag': None, # Sell tag
'start_trailing_time': None, # Trailing start time
'offset': 0, # Offset
'allow_sell_trailing': False, # Whether sell trailing is allowed
}

V. Buy Conditions Overview

The strategy inherits the 52 buy conditions from the parent strategy BB_RPB_TSL_SMA_Tranz, mainly categorized as follows:

Condition GroupQuantityCore Logic
Trend Reversal4EMA alignment + oversold indicator confirmation
Bollinger Band3Price breaks below Bollinger Band lower rail
Oscillator4CCI/RMI/SRSI oversold combinations
Pattern Recognition3Special technical pattern recognition
Multi-Timeframe1415m/1h indicator resonance
Moving Average Offset4Hull/Trimmed/ZLEMA offset buying
Momentum Reversal4VWAP/MAMA/Heikin Ashi

5.1 Diamond Indicator Parameters

This strategy adds Diamond indicator parameters for more refined signal filtering:

# Diamond Parameters
buy_fast = 31 # Fast line period
buy_slow = 2 # Slow line period
buy_push = 0.72 # Push threshold
buy_shift = -7 # Displacement offset

sell_fast = 17 # Sell fast line period
sell_slow = 28 # Sell slow line period
sell_push = 1.493 # Sell push threshold
sell_shift = -7 # Sell displacement offset

VI. Sell Logic Detailed Analysis

6.1 Tiered 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
──────────────────────────────────
> 5% < 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

6.2 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~8: Other condition combinations

VII. Technical Indicator System

7.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, FisherMulti-dimensional confirmation

7.2 Informative Timeframes

TimeframeUsageKey Indicators
1hTrend ConfirmationRSI, EMA, SMA, CTI, Williams %R
15mPrecise EntryEMA, SMA, BB, CCI, CTI, EWO

VIII. Risk Management Features

8.1 Four-Fold Protection Mechanism

Protection TypeParameter DescriptionFunction
BTC ProtectionProhibits buying when BTC drops beyond thresholdPrevent systemic risk
Pump ProtectionDetects abnormal surges, avoids chasing highsPrevent being trapped at highs
Dip ProtectionMulti-level decline detection, avoids catching falling knivesWait for stability before entry
Slippage ControlLimits entry price deviationControl trading costs

8.2 Trailing Mechanism Risks

Risk TypeDescriptionCountermeasures
Trailing TimeoutPrice rises during trailing, missing entrySet trailing upper limit and timeout
Price ReversalPrice continues to rise during trailingTrailing buy maximum stop threshold
Market ChangesMarket conditions change during trailingUptrend fast trailing mechanism

IX. Strategy Advantages and Limitations

✅ Advantages

  1. Trailing Buy Optimizes Costs: Waits for better entry price after signal trigger, reducing holding costs
  2. Trailing Sell Optimizes Returns: Waits for higher exit price after sell signal trigger, increasing profits
  3. Inherits Parent Strategy Advantages: Multi-layer protection mechanisms, multi-timeframe confirmation
  4. Custom Stop Loss: More flexible risk control than parent strategy
  5. Diamond Indicator Enhancement: New indicator parameters, more refined signals

⚠️ Limitations

  1. Increased Complexity: Trailing mechanism adds strategy complexity
  2. Risk of Missing Opportunities: Price rising during trailing may cause missed entry
  3. Parameter Sensitivity: Trailing parameters require fine-tuning
  4. Computational Overhead: Trailing state management increases computational burden

Market EnvironmentRecommended ConfigurationDescription
Range-Bound MarketEnable trailing buy/sellPrice volatility provides more trailing opportunities
Slow Bull MarketShorten trailing timeFast entry more important when trend is upward
High VolatilityAdjust trailing thresholdsPrevent large volatility from causing trailing failure
Low VolatilityExtend trailing timeWait for better entry opportunities

XI. Detailed Applicable Market Environments

BB_RPB_TSL_SMA_Tranz_TB_1_1_1 is an enhanced reversal strategy with trailing mechanisms. Compared to the parent strategy, it is more refined in entry and exit timing selection.

11.1 Strategy Core Logic

  • Trailing Buy: Waits for price pullback after signal trigger, reducing entry costs
  • Trailing Sell: Waits for price rebound after sell signal trigger, increasing exit profits
  • Multi-Layer Protection: Inherits parent strategy's four-fold protection mechanism

11.2 Performance in Different Market Environments

Market TypePerformance RatingReason Analysis
📈 Slow Bull⭐⭐⭐⭐⭐Trailing buy enters on pullbacks, lower costs
🔄 Range-Bound⭐⭐⭐⭐⭐Trailing mechanism advantages maximized in range-bound markets
📉 Bear Market⭐⭐⭐☆☆Trailing may miss some rebound opportunities
⚡️ Sharp Decline⭐⭐☆☆☆Protection mechanisms may still not fully mitigate risk

11.3 Key Configuration Recommendations

Configuration ItemRecommended ValueDescription
Trailing Validity Period1800 secondsAdjust based on market volatility
Trailing Maximum Stop2%Stop trailing when price rises above this value
Stop Loss-0.10Stricter than parent strategy
ROI Initial Target20.5%Leverage cost advantage from trailing buy

XII. Summary

BB_RPB_TSL_SMA_Tranz_TB_1_1_1 is an enhanced reversal strategy with trailing mechanisms. Its core value lies in:

  1. Trailing Buy: Waits for better entry price after signal trigger, reducing holding costs
  2. Trailing Sell: Waits for higher exit price after sell signal trigger, increasing profits
  3. Multi-Layer Protection: Inherits parent strategy's four-fold protection mechanism, risk control in place
  4. Flexible Configuration: Trailing parameters can be dynamically adjusted based on market environment

For quantitative traders, this is a further optimized version based on the parent strategy, suitable for traders who hope to be more refined in entry and exit timing selection.