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
| Feature | Description |
|---|---|
| Buy Conditions | Inherits parent strategy's 52 buy signals + trailing buy mechanism |
| Sell Conditions | 8 base sell signals + trailing sell mechanism |
| Protection Mechanisms | BTC protection, Pump protection, Dip protection, Slippage control |
| Timeframe | 5m main timeframe + 15m/1h informative timeframes |
| Special Features | Trailing Buy, Trailing Sell, Custom Stop Loss |
| Dependencies | pandas_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
| Scenario | Traditional Buy | Trailing Buy |
|---|---|---|
| Price declines after signal trigger | Buy at signal price | Wait for lower price to buy |
| Price rises after signal trigger | Buy at signal price | May cancel or chase high to buy |
| Price oscillates after signal trigger | Buy at signal price | Buy 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 Group | Quantity | Core Logic |
|---|---|---|
| Trend Reversal | 4 | EMA alignment + oversold indicator confirmation |
| Bollinger Band | 3 | Price breaks below Bollinger Band lower rail |
| Oscillator | 4 | CCI/RMI/SRSI oversold combinations |
| Pattern Recognition | 3 | Special technical pattern recognition |
| Multi-Timeframe | 14 | 15m/1h indicator resonance |
| Moving Average Offset | 4 | Hull/Trimmed/ZLEMA offset buying |
| Momentum Reversal | 4 | VWAP/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 Category | Specific Indicators | Usage |
|---|---|---|
| Trend Indicators | EMA(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 Indicators | RSI(2,4,14,20,84,112), CCI(26,170), RMI | Overbought/oversold judgment |
| Volatility Indicators | BB(20,2), BB(20,3), BB(40,2) | Price channels, breakout signals |
| Volume Indicators | CMF, MFI, Volume_MA(4,12,24,30) | Volume confirmation |
| Oscillator Indicators | Williams %R(14,32,64,84,96,112,480), CTI | Extreme position identification |
| Composite Indicators | EWO, CRSI, Fisher | Multi-dimensional confirmation |
7.2 Informative Timeframes
| Timeframe | Usage | Key Indicators |
|---|---|---|
| 1h | Trend Confirmation | RSI, EMA, SMA, CTI, Williams %R |
| 15m | Precise Entry | EMA, SMA, BB, CCI, CTI, EWO |
VIII. Risk Management Features
8.1 Four-Fold Protection Mechanism
| Protection Type | Parameter Description | Function |
|---|---|---|
| BTC Protection | Prohibits buying when BTC drops beyond threshold | Prevent systemic risk |
| Pump Protection | Detects abnormal surges, avoids chasing highs | Prevent being trapped at highs |
| Dip Protection | Multi-level decline detection, avoids catching falling knives | Wait for stability before entry |
| Slippage Control | Limits entry price deviation | Control trading costs |
8.2 Trailing Mechanism Risks
| Risk Type | Description | Countermeasures |
|---|---|---|
| Trailing Timeout | Price rises during trailing, missing entry | Set trailing upper limit and timeout |
| Price Reversal | Price continues to rise during trailing | Trailing buy maximum stop threshold |
| Market Changes | Market conditions change during trailing | Uptrend fast trailing mechanism |
IX. Strategy Advantages and Limitations
✅ Advantages
- Trailing Buy Optimizes Costs: Waits for better entry price after signal trigger, reducing holding costs
- Trailing Sell Optimizes Returns: Waits for higher exit price after sell signal trigger, increasing profits
- Inherits Parent Strategy Advantages: Multi-layer protection mechanisms, multi-timeframe confirmation
- Custom Stop Loss: More flexible risk control than parent strategy
- Diamond Indicator Enhancement: New indicator parameters, more refined signals
⚠️ Limitations
- Increased Complexity: Trailing mechanism adds strategy complexity
- Risk of Missing Opportunities: Price rising during trailing may cause missed entry
- Parameter Sensitivity: Trailing parameters require fine-tuning
- Computational Overhead: Trailing state management increases computational burden
X. Recommended Application Scenarios
| Market Environment | Recommended Configuration | Description |
|---|---|---|
| Range-Bound Market | Enable trailing buy/sell | Price volatility provides more trailing opportunities |
| Slow Bull Market | Shorten trailing time | Fast entry more important when trend is upward |
| High Volatility | Adjust trailing thresholds | Prevent large volatility from causing trailing failure |
| Low Volatility | Extend trailing time | Wait 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 Type | Performance Rating | Reason 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 Item | Recommended Value | Description |
|---|---|---|
| Trailing Validity Period | 1800 seconds | Adjust based on market volatility |
| Trailing Maximum Stop | 2% | Stop trailing when price rises above this value |
| Stop Loss | -0.10 | Stricter than parent strategy |
| ROI Initial Target | 20.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:
- Trailing Buy: Waits for better entry price after signal trigger, reducing holding costs
- Trailing Sell: Waits for higher exit price after sell signal trigger, increasing profits
- Multi-Layer Protection: Inherits parent strategy's four-fold protection mechanism, risk control in place
- 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.