Skip to main content

BB_RPB_TSL_RNG_TBS_GOLD Strategy Analysis

Strategy Number: #33
Strategy Type: Multi-Condition Trend Following + Bollinger Bands Protection + Dynamic Trailing Stop
Timeframe: 5 minutes (5m)


I. Strategy Overview

BB_RPB_TSL_RNG_TBS_GOLD is a highly complex professional-grade trading strategy. Each abbreviation in its name represents an important technical component: BB (Bollinger Bands), RPB (Real Pull Back), TSL (Trailing Stop Loss), RNG (Range), TBS (To Be Determined), GOLD (Golden Level Optimization).

This strategy was developed by Freqtrade community user jilv220, inspired by the combined optimization of multiple well-known strategies. The strategy integrates Bollinger Band regression strategies, RMI momentum indicators, CCI trend-following indicators, EWO wave indicators, and various other technical analysis tools, while implementing a complex multi-layer trailing stop system.

Core Features

FeatureDescription
Entry Conditions7 independent entry signals, can be enabled/disabled independently
Exit Conditions1 base exit condition + multi-layer trailing stop
Protection3 main protection parameter groups (BTC protection, dynamic take-profit, trend filtering)
TimeframeMain timeframe 5 minutes + informative timeframe 1 hour
Dependenciestalib, technical, pandas_ta, numpy

II. Strategy Configuration Analysis

2.1 Base Risk Parameters

# ROI exit table
minimal_roi = {
"0": 0.10, # Immediate exit requires 10% profit
}

# Stoploss setting
stoploss = -0.049 # 4.9% fixed stoploss

Design Logic:

This strategy adopts a minimalist ROI table design, setting only a 10% take-profit threshold at time 0. This indicates that the strategy's design focus is not on time-based gradient take-profit, but rather on managing profits through trailing stops and exit conditions.

The 4.9% fixed stoploss is a relatively balanced setting, tolerating normal price fluctuations while effectively protecting capital safety when trends reverse.

2.2 Complex Trailing Stop System

# Trailing stop parameters
pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3)
pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3)
pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3)
pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3)
pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3)

Dynamic Take-Profit Mechanism Explained:

This strategy implements a complex hierarchical trailing stop system:

Profit RangeStoploss Trigger PointDesign Intent
< 1.6%Use hard stoploss -8%Protect principal, avoid small gains turning into big losses
1.6% - 8%Linearly adjust between 1.1% - 4%Lock in partial profits
> 8%Allow retracement to 4% before exitLet profits run

2.3 Order Type Configuration

order_types = {
"entry": "limit",
"exit": "limit",
"stoploss": "limit",
"stoploss_on_exchange": False,
}

The strategy uses limit orders for trading and does not enable exchange-native stoploss functionality.


III. Entry Conditions Details

3.1 Seven Entry Conditions Classification

This strategy implements 7 independent entry conditions, each targeting specific market states:

Condition GroupCondition NumberCore LogicEnabled Status
Bollinger Band BounceBB CheckedBounce after price touches lower Bollinger BandEnabled
Local Uptrendlocal uptrendEMA moving averages bullish alignment + price contractionEnabled
EWO WaveEWOMomentum indicator oversold bounceEnabled
EWO Wave 2EWO2Enhanced EWO signalEnabled
Bollinger Band + StochasticCoFiBollinger Band narrow rail + KDJ golden crossEnabled
NFI Fast ModeNFI 32RSI divergence + price oversoldEnabled
NFI Fast ModeNFI 33Extreme oversold + volume surgeEnabled

3.2 Condition Details

Condition 1: Bollinger Band Bounce (BB Checked)

is_BB_checked = is_dip & is_break

is_dip = (
(dataframe[f'rmi_length_{self.buy_rmi_length.value}'] < self.buy_rmi.value) &
(dataframe[f'cci_length_{self.buy_cci_length.value}'] <= self.buy_cci.value) &
(dataframe['srsi_fk'] < self.buy_srsi_fk.value)
)

is_break = (
(dataframe['bb_delta'] > self.buy_bb_delta.value) &
(dataframe['bb_width'] > self.buy_bb_width.value)
)

Technical Meaning: When Bollinger Band width and delta simultaneously meet conditions, it represents price at the critical point of breakout after contraction.

Conditions 2-7: Various Trend Conditions

ConditionCore IndicatorTrigger Threshold Example
local uptrendEMA difference> 0.022
EWOWave indicator> 4.179
EWO2Wave indicator> 8.0
CoFiStochastic + ADXfastk < 22, adx > 20
NFI 32RSI divergencersi_slow < rsi_slow.shift(1), rsi_fast < 46
NFI 33Extreme oversoldEWO > 8, cti < -0.88

IV. Exit Logic Details

4.1 Trailing Stop System

This strategy implements multi-level trailing stops, which is its core profit protection mechanism:

Profit Range        Stoploss Trigger Point
──────────────────────────────────────────
< 1.6% Hard stoploss -8%
1.6% - 8% Linear interpolation 1.1% - 4%
> 8% Dynamic exit point (current profit - 4%)

4.2 Base Exit Conditions

conditions.append(
(
(dataframe['close'] > dataframe['sma_9'])&
(dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &
(dataframe['rsi']>50)&
(dataframe['volume'] > 0)&
(dataframe['rsi_fast'] > dataframe['rsi_slow'])
)
|
(
(dataframe['sma_9'] > (dataframe['sma_9'].shift(1) + dataframe['sma_9'].shift(1)*0.005 )) &
(dataframe['close'] < dataframe['hma_50'])&
(dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &
(dataframe['volume'] > 0)&
(dataframe['rsi_fast']>dataframe['rsi_slow'])
)
)

Exit Conditions Interpretation:

  • Condition 1: Price breaks above short-term moving average, RSI in bullish state
  • Condition 2: Moving average starts declining, but price still above moving average

V. Technical Indicator System

5.1 Core Indicators

Indicator CategorySpecific IndicatorPurpose
Trend IndicatorsEMA(8,12,13,16,26,100)Multi-period trend judgment
Trend IndicatorsSMA(9,15,30)Support/resistance identification
Trend IndicatorsHMA(50)Fast trend confirmation
Bollinger BandsBB(20,2), BB(20,3)Volatility measurement
Momentum IndicatorsRSI(4,14,20)Overbought/oversold judgment
Momentum IndicatorsRMI(8-20)Improved RSI
Momentum IndicatorsCCI(25,170)Commodity Channel Index
Momentum IndicatorsEWOWave momentum
StochasticStochRSIOverbought/oversold
VolumeVolume MeanVolume validation
BTC ProtectionBTC 5m/1dMarket trend filtering

5.2 BTC Protection Mechanism

# BTC 5m sharp drop protection
informative_past_delta = informative_past['close'].shift(1) - informative_past['close']
informative_diff = informative_threshold - informative_past_delta

# BTC 1d trend protection
dataframe['btc_1d'] = informative_past_1d_source

The strategy filters counter-trend trading signals by monitoring BTC's short-term and long-term trends.


VI. Risk Management Features

6.1 Multi-Layer Stoploss Protection

Protection LayerTrigger ConditionAction
Hard StoplossLoss 4.9%Close all positions
Soft StoplossProfit > 1.6%Enable trailing stop
Trailing StopProfit retraces to thresholdPartial or full close

6.2 Condition-Level Protection

Each entry condition can be independently enabled/disabled:

buy_is_dip_enabled = CategoricalParameter([True, False], default=True)
buy_is_break_enabled = CategoricalParameter([True, False], default=True)

6.3 Volume Protection

dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)
# Used in NFI33 condition
(dataframe['volume'] < (dataframe['volume_mean_4'] * 2.5))

VII. Strategy Pros & Cons

✅ Pros

  1. Multi-Condition Combination: 7 independent conditions covering various market patterns
  2. Dynamic Trailing Stop: Complex take-profit system balancing risk and reward
  3. BTC Protection: Filters counter-trend trades during market declines
  4. Independently Configurable Conditions: Each condition can be enabled/disabled separately
  5. Professional-Grade Indicator Combination: Integrates RMI, CCI, EWO and other advanced indicators
  6. Community Verified: Long-term live trading verification by Freqtrade community

⚠️ Cons

  1. Numerous Parameters: 50+ hyperparameters, difficult to optimize
  2. High Computational Load: Demands high hardware resources
  3. Easy to Overfit: Historical data may produce false optimization
  4. High Complexity: High debugging and maintenance costs
  5. Large Memory Footprint: Multi-indicator calculation causes memory pressure

VIII. Applicable Scenarios

Market EnvironmentRecommended ConfigurationDescription
Clear bullish marketEnable most conditionsHigh signal quality
Ranging marketReduce number of pairsLower false signals
High volatility coinsTighten stoplossControl risk
Mainstream coinsCan increase pair countGood liquidity

IX. Detailed Applicable Market Environments

9.1 Strategy Core Logic

BB_RPB_TSL_RNG_TBS_GOLD is a typical "multi-condition confirmation" strategy. It doesn't rely on a single indicator, but requires multiple conditions to be met simultaneously before triggering entry. This design significantly reduces the probability of false signals, but also increases requirements for market adaptability.

9.2 Performance in Different Market Environments

Market TypePerformance RatingReason Analysis
📈 Uptrend⭐⭐⭐⭐⭐Multi-condition resonance, best effect when trend continues
📉 Downtrend⭐⭐BTC protection filters some signals, but may still go counter-trend
🔄 Ranging market⭐⭐⭐Bollinger Band conditions effective in ranging markets
⚡ High volatility⭐⭐⭐⭐Large volatility brings large profits

9.3 Key Configuration Recommendations

Configuration ItemSuggested ValueDescription
Number of pairs10-20Risk diversification
Memory requirement4GB+Complex calculations needed
TimeframeKeep 5mStrategy specifically designed for this

X. Important Reminders: The Cost of Complexity

10.1 Learning Cost

This strategy has numerous parameters requiring deep understanding of each indicator's function:

  • 7 entry conditions need individual understanding
  • Trailing stop system requires mathematical foundation
  • BTC protection mechanism requires technical analysis knowledge
  • Suggested learning time: 2-4 weeks

10.2 Hardware Requirements

Number of PairsMinimum MemoryRecommended Memory
1-102GB4GB
10-304GB8GB
30+8GB16GB

10.3 Backtest vs Live Trading Differences

  • Hyperparameters may overfit historical data
  • Complex conditions may perform inconsistently in live trading
  • Walk-forward optimization method recommended

10.4 Manual Trader Suggestions

When executing manually:

  • Understand the trigger logic of each condition
  • Prioritize main conditions (such as BB Checked)
  • Set reasonable position management

XI. Summary

BB_RPB_TSL_RNG_TBS_GOLD is a professional-grade complex strategy suitable for experienced quantitative traders. Its multi-condition confirmation mechanism and dynamic trailing stop system constitute a complete trading system.

Its core values are:

  1. Systematic: Complete entry-exit-risk control system
  2. Flexible: Conditions can be independently configured
  3. Professional: Integrates multiple advanced technical indicators
  4. Community Support: Long-term verified

For quantitative traders, this strategy requires significant learning and testing time, but in return, it provides a verified configurable trading system. It's recommended to start with default parameters and optimize gradually.


Document Version: v1.0
Strategy Series: Multi-Condition Trend Following