Skip to main content

BBands Strategy In-Depth Analysis

Strategy Number: #455 (455th out of 465 strategies)
Strategy Type: Trend Following (TEMA Momentum Strategy)
Timeframe: 1 minute (1m)


1. Strategy Overview

BBands is a trend-following strategy based on Triple Exponential Moving Average (TEMA) momentum. Despite the name "BBands" (Bollinger Bands), its core trading signals actually rely on TEMA momentum direction changes, with Bollinger Bands serving only as auxiliary indicators.

Core Features

FeatureDescription
Buy Conditions1 buy signal (TEMA upward trigger)
Sell Conditions1 sell signal (TEMA downward trigger)
Protection MechanismsTrailing stop + Fixed stop + Tiered ROI take-profit
Timeframe1 minute (1m)
Dependenciestalib, pandas_ta, qtpylib

2. Strategy Configuration Analysis

2.1 Base Risk Parameters

# ROI Exit Table
minimal_roi = {
"60": 0.01, # After 60 minutes, exit at 1% profit
"30": 0.02, # After 30 minutes, exit at 2% profit
"0": 0.04 # Immediately, exit at 4% profit
}

# Stoploss Settings
stoploss = -0.05 # 5% fixed stoploss

# Trailing Stop
trailing_stop = True

Design Rationale:

  • Tiered ROI design: longer holding time = lower profit target, reflecting "quick profit" philosophy
  • 5% fixed stoploss as baseline protection
  • Trailing stop enabled to lock profits as trend moves

2.2 Order Type Configuration

order_types = {
'buy': 'limit', # Limit buy
'sell': 'limit', # Limit sell
'stoploss': 'market', # Stoploss market order
'stoploss_on_exchange': False
}

order_time_in_force = {
'buy': 'gtc', # Good Till Cancelled
'sell': 'gtc'
}

3. Buy Conditions Detailed

3.1 Single Buy Signal

The strategy has only one buy condition, with simple and direct logic:

dataframe.loc[
(
(dataframe['tema'] > dataframe['tema'].shift(1)) & # TEMA rising
(dataframe['volume'] > 0) # Volume non-zero
),
'buy'] = 1

Buy Logic:

  • TEMA Momentum Detection: Current TEMA value greater than previous candle's TEMA, indicating upward short-term momentum
  • Volume Filter: Ensures actual trading activity

3.2 TEMA (Triple Exponential Moving Average) Characteristics

CharacteristicDescription
CalculationTriple-smoothed exponential moving average
Response SpeedFaster response to price changes than regular EMA
SmoothnessEffectively reduces false signals
Use CaseShort-term trend following

4. Sell Logic Detailed

4.1 Single Sell Signal

dataframe.loc[
(
(dataframe['tema'] < dataframe['tema'].shift(1)) & # TEMA falling
(dataframe['volume'] > 0) # Volume non-zero
),
'sell'] = 1

Sell Logic:

  • TEMA Momentum Reversal: Current TEMA value less than previous candle, indicating weakening momentum
  • Volume Filter: Ensures trade validity

4.2 Tiered ROI Take-Profit

Holding TimeTarget ProfitTrigger Condition
0-30 minutes4%Immediately triggerable
30-60 minutes2%After 30 minutes holding
60+ minutes1%After 60 minutes holding

4.3 Trailing Stop Mechanism

The strategy enables trailing stop, which can lock in profits as price moves favorably while exiting promptly on trend reversal.


5. Technical Indicator System

5.1 Core Indicators

The strategy uses a rich technical indicator library. Although trading signals rely only on TEMA, other indicators provide foundation for potential optimization and expansion:

Indicator CategorySpecific IndicatorsPurpose
Trend IndicatorsTEMA (9-period), EMA20, EMA50, SARTrend direction judgment
Momentum IndicatorsRSI, ADX, Stochastic FastMomentum strength assessment
Volatility IndicatorsBollinger Bands (20, 2)Volatility channel
Volume IndicatorsMFICapital flow analysis
Trend ConfirmationMACDTrend validation
Cycle IndicatorsHilbert Transform Sine WaveCycle identification

5.2 Actually Used Indicators

Despite calculating many indicators, current trading logic only uses:

  • TEMA: Core signal source
  • Volume: Basic filter

6. Risk Management Features

6.1 Multi-Layer Protection System

Protection LayerParameterFunction
Fixed Stoploss-5%Maximum loss limit
Trailing StopEnabledDynamically lock profits
Tiered ROI4%/2%/1%Time-dimension risk control

6.2 Signal Simplicity Advantages

  • Single buy signal reduces overfitting risk
  • Clear logic, easy to understand and debug
  • Low computational overhead, suitable for high-frequency trading

7. Strategy Strengths and Limitations

✅ Strengths

  1. Simple Logic: Single signal source, easy to understand and maintain
  2. Fast Response: TEMA sensitive to price changes, suitable for short-term trading
  3. Complete Risk Control: Multi-layer stoploss mechanisms protect capital
  4. Strong Extensibility: Pre-loaded indicators provide space for future optimization

⚠️ Limitations

  1. Misleading Name: Strategy named "BBands" but doesn't use Bollinger Bands as trading signals
  2. Single Signal: Lacks signal confirmation mechanism, may generate many false signals
  3. Ultra-Short-Term Risk: 1-minute timeframe has significant noise
  4. Indicator Redundancy: Calculates many unused indicators, affecting performance

Market EnvironmentRecommended ConfigurationDescription
Strong Trend MarketDefault configurationTEMA can effectively track trends
Ranging MarketNot recommendedEasily stopped out frequently
High Volatility MarketIncrease stoplossAvoid being stopped out by normal volatility

9. Suitable Market Environments Detailed

BBands is a short-term trend-following strategy. Based on its code architecture, it is best suited for markets with clear trends, and performs poorly in ranging markets.

9.1 Strategy Core Logic

  • Momentum Tracking: Uses TEMA change direction to judge trend
  • Fast Response: 1-minute cycle quickly captures price changes
  • Risk Control: Multi-layer stoploss protects capital

9.2 Performance in Different Market Environments

Market TypePerformance RatingReason Analysis
📈 Strong Trend⭐⭐⭐⭐TEMA can effectively track trend direction
🔄 Ranging Market⭐⭐Frequent false signals lead to losses
📉 Unidirectional Downtrend⭐⭐Trend-following strategy not adaptive
⚡️ High Volatility⭐⭐⭐May be interfered by noise

9.3 Key Configuration Recommendations

Configuration ItemRecommended ValueDescription
Timeframe1m (default)Strategy designed for short-term
Stoploss-5% (default)Can be adjusted based on risk preference
Trailing StopEnabledLock floating profits

10. Important Reminder: The Cost of Complexity

10.1 Learning Curve

Strategy logic is simple, but requires understanding TEMA indicator characteristics and short-term trading risks.

10.2 Hardware Requirements

Number of PairsMinimum RAMRecommended RAM
1-5 pairs2GB4GB
5-20 pairs4GB8GB

10.3 Backtest vs Live Trading Differences

  • 1-minute cycle backtest data volume is large
  • Slippage and fees significantly impact short-term strategies
  • Live execution latency may affect performance

10.4 Manual Trader Recommendations

Can manually observe TEMA momentum changes as entry reference, but should combine with other confirmation indicators.


11. Summary

BBands is a concise short-term trend-following strategy. Its core value lies in:

  1. Clear Logic: Single signal source, easy to understand
  2. Fast Response: TEMA sensitive to price changes
  3. Complete Risk Control: Multi-layer stoploss mechanisms

For quantitative traders, it is recommended to use with additional trend confirmation indicators, or as part of a sub-strategy combination.