Skip to main content

SupertrendStrategy Strategy In-Depth Analysis

Strategy Number: #402 (402nd of 465 strategies) Strategy Type: Multi-Factor Trend-Following Strategy (Triple SuperTrend + EMA + Stoch RSI) Timeframe: 1 Hour (1h)


I. Strategy Overview

SupertrendStrategy is a composite trend-following strategy based on triple SuperTrend indicators. The strategy integrates signals from three differently parameterized SuperTrends, EMA trend filtering, and Stoch RSI overbought/oversold assessment to construct a multi-dimensional confirmation trading system. This strategy originates from the Crypto Robot community's public strategy and demonstrated significant returns in 2018-2021 backtesting.

Core Features

FeatureDescription
Buy Condition1 composite buy signal (Triple SuperTrend + Stoch RSI + EMA filter)
Sell Condition1 composite sell signal (Triple SuperTrend + Stoch RSI reversal)
Protection MechanismTiered ROI + Trailing Stop dual protection
Timeframe1h
Dependenciesta, pandas_ta
Hyperparameter OptimizationSupports Hyperopt for buy/sell threshold optimization

Backtest Performance Reference

According to backtest data from source code comments (2018-2021, ADA/USDT):

MetricValue
Starting Capital1,000 USDT
Final Capital41,040 USDT
Total Return4004.05%
Number of Trades202
Best Trade+148.95%
Worst Trade-18.24%
Maximum Drawdown59.98%

II. Strategy Configuration Analysis

2.1 Basic Risk Parameters

# ROI Exit Table
minimal_roi = {
"0": 0.10, # Immediate: 10%
"30": 0.05, # After 30 minutes: 5%
"60": 0.02 # After 60 minutes: 2% (essentially not enabled)
}

# Stop Loss Setting
stoploss = -0.99 # -99% (almost never triggered, relies on trailing stop)

# Trailing Stop
trailing_stop = True
# trailing_stop_positive = 0.01 # Commented out
# trailing_stop_positive_offset = 0.0 # Commented out

Design Rationale:

  • ROI uses a three-tier declining structure, encouraging short-term profit taking
  • Stop loss at -99% is essentially disabled, actual risk control relies on trailing stop
  • Trailing stop parameters are commented out, using Freqtrade defaults

2.2 Order Type Configuration

order_types = {
'buy': 'limit', # Limit buy
'sell': 'limit', # Limit sell
'stoploss': 'market', # Market stop loss
'stoploss_on_exchange': False
}

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

III. Buy Condition Details

3.1 Composite Buy Logic

The strategy employs a multi-dimensional confirmed buy signal:

# Buy Condition
(
((dataframe['supertrend_direction_1'] +
dataframe['supertrend_direction_2'] +
dataframe['supertrend_direction_3']) >= 1) & # At least one SuperTrend bullish
(dataframe['stoch_rsi'] < self.buy_stoch_rsi.value) & # Stoch RSI not overbought
(dataframe['close'] > dataframe['ema90']) & # Price above EMA90
(dataframe['volume'] > 0) # Volume exists
)

Condition Breakdown:

  1. Triple SuperTrend Direction: At least one of three SuperTrends shows bullish (direction = 1)
  2. Stoch RSI Filter: Stoch RSI below buy threshold (default 0.8), avoiding entry in overbought zone
  3. EMA Trend Filter: Close price above EMA90, confirming medium-term uptrend
  4. Volume Confirmation: Basic volume verification

3.2 Triple SuperTrend Parameters

IDATR PeriodATR MultiplierSensitivityPurpose
SuperTrend 1203.0MediumPrimary trend identification
SuperTrend 2204.0LowerStable signal confirmation
SuperTrend 3408.0Very LowLong-term trend confirmation

Design Philosophy:

  • Triple SuperTrend forms multi-timeframe trend assessment
  • At least one bullish allows buying, providing flexible entry opportunities
  • Different parameter combinations balance false signal filtering and entry timing

3.3 Hyperparameter Optimization

The strategy supports Hyperopt optimization:

buy_stoch_rsi = DecimalParameter(0.5, 1, decimals=3, default=0.8, space="buy")
sell_stoch_rsi = DecimalParameter(0, 0.5, decimals=3, default=0.2, space="sell")
ParameterRangeDefaultDescription
buy_stoch_rsi0.5 - 1.00.8Stoch RSI buy threshold
sell_stoch_rsi0 - 0.50.2Stoch RSI sell threshold

IV. Sell Logic Details

4.1 Composite Sell Signal

# Sell Condition
(
((dataframe['supertrend_direction_1'] +
dataframe['supertrend_direction_2'] +
dataframe['supertrend_direction_3']) < 1) & # All SuperTrends bearish
(dataframe['stoch_rsi'] > self.sell_stoch_rsi.value) & # Stoch RSI oversold zone
(dataframe['volume'] > 0) # Volume exists
)

Condition Breakdown:

  1. Triple SuperTrend Reversal: Sum of all SuperTrend direction values less than 1, meaning all have turned bearish
  2. Stoch RSI Confirmation: Stoch RSI above sell threshold (default 0.2), confirming momentum exhaustion

4.2 Sell Logic Characteristics

Compared to buy conditions, sell conditions are more stringent:

  • Buy: At least one SuperTrend bullish is sufficient
  • Sell: Requires all SuperTrends to turn bearish

This asymmetric design reflects the "quick in, slow out" trend-following philosophy.

4.3 Tiered Take-Profit System

Holding TimeTarget ReturnDescription
0 minutes10%Immediate take-profit target
30 minutes5%Short-term downgrade
60 minutes2%Longer timeframe (rarely takes effect)

V. Technical Indicator System

5.1 Core Indicators

Indicator CategorySpecific IndicatorParametersPurpose
Trend IndicatorsSuperTrend × 3(20, 3.0), (20, 4.0), (40, 8.0)Multi-timeframe trend assessment
Moving AverageEMA90 periodMedium-term trend filter
Momentum IndicatorStoch RSIDefault parametersOverbought/oversold assessment

5.2 Indicator Calculation Details

# EMA 90
dataframe['ema90'] = ta.trend.ema_indicator(dataframe['close'], 90)

# Stoch RSI
dataframe['stoch_rsi'] = ta.momentum.stochrsi(dataframe['close'])

# SuperTrend (using pandas_ta library)
superTrend = pda.supertrend(high, low, close, length, multiplier)
# Output:
# - SUPERT_length_multiplier: SuperTrend line value
# - SUPERTd_length_multiplier: Direction value (1=bullish, -1=bearish)

5.3 Indicator Combination Logic

Buy Signal = (SuperTrend Direction ≥ 1) AND (Stoch RSI < Threshold) AND (Price > EMA90)
Sell Signal = (SuperTrend Direction < 1) AND (Stoch RSI > Threshold)

Design Philosophy:

  • SuperTrend provides trend direction
  • EMA filters medium-term trend
  • Stoch RSI controls entry timing

VI. Risk Management Features

6.1 Multiple Trend Confirmation

  • Triple SuperTrend: Confirms trend from different timeframes
  • EMA 90 Filter: Ensures price is above medium-term moving average
  • Stoch RSI Filter: Avoids chasing highs in overbought zones

6.2 Asymmetric Risk Control Design

DimensionBuy ConditionSell Condition
SuperTrend≥ 1 (at least one bullish)< 1 (all bearish)
EMARequiredNot required
Stoch RSI< 0.8 (not overbought)> 0.2 (oversold)

Interpretation: Buying requires more condition confirmations, selling is relatively more lenient — typical trend-following strategy design.

6.3 Trailing Stop Protection

trailing_stop = True

Although specific parameters are commented out, enabling trailing stop provides dynamic risk protection.


VII. Strategy Advantages and Limitations

✅ Advantages

  1. Multi-Timeframe Trend Confirmation: Triple SuperTrend provides multi-level trend assessment
  2. Momentum Filtering: Stoch RSI avoids entry at extreme levels
  3. Trend Filtering: EMA 90 ensures trading only in medium-term uptrend
  4. Parameter Optimization: Supports Hyperopt hyperparameter search
  5. Excellent Historical Performance: Backtest shows over 40x returns

⚠️ Limitations

  1. Many Parameters: Three sets of SuperTrend parameters + EMA + Stoch RSI, large optimization space but prone to overfitting
  2. Large Drawdown: Historical maximum drawdown near 60%, requires strong psychological tolerance
  3. Stop Loss Effectively Disabled: -99% stop loss rarely triggers, risk control relies on trailing stop
  4. Signal Lag: Multiple indicator confirmations increase reliability but slow entry
  5. Third-Party Library Dependency: Requires pandas_ta library support

VIII. Applicable Scenario Recommendations

Market EnvironmentRecommended ConfigurationDescription
Strong Trend MarketDefault parametersMultiple confirmations perform excellently in trending markets
Ranging MarketUse cautiouslyStoch RSI filter can reduce false signals, but still needs testing
High Volatility MarketIncrease ATR multiplierReduce SuperTrend sensitivity
Bear MarketStay in cash or shortStrategy only supports long positions

IX. Applicable Market Environment Details

SupertrendStrategy is a typical multi-factor trend strategy. Based on its code architecture and community feedback, it is most suitable for unilateral trending markets, while potentially underperforming in consolidation/ranging markets.

9.1 Strategy Core Logic

  • Triple Confirmation Mechanism: Three differently parameterized SuperTrends form multi-timeframe assessment
  • Momentum Filtering: Stoch RSI controls entry timing, avoiding extreme level entries
  • Trend Filtering: EMA 90 ensures trading only in medium-term uptrend

9.2 Performance in Different Market Environments

Market TypePerformance RatingReason Analysis
📈 Unilateral Uptrend⭐⭐⭐⭐⭐Multiple trend confirmations perfectly capture big moves
🔄 Consolidation/Ranging⭐⭐⭐☆☆Stoch RSI filter reduces some false signals, but still has wear
📉 Unilateral Downtrend⭐☆☆☆☆Long only, continuous cash position in bear market
⚡️ Extreme Volatility⭐⭐⭐☆☆Multi-layer filtering can reduce false breakout risk

9.3 Key Configuration Recommendations

Configuration ItemRecommended ValueDescription
Pair SelectionStrong-trending mainstream coinsBTC, ETH, etc.
Timeframe1h-4hMaintain original design or extend appropriately
Position ControlDiversified investmentSingle strategy not suitable for full position

X. Important Reminder: The Cost of Complexity

10.1 Learning Cost

Compared to simple strategies, SupertrendStrategy requires understanding:

  • SuperTrend indicator calculation principles
  • Triple SuperTrend combination logic
  • Stoch RSI overbought/oversold assessment
  • EMA trend filtering mechanism

Recommendation: Start with single SuperTrend strategies before gradually understanding composite strategies.

10.2 Hardware Requirements

Number of PairsMinimum MemoryRecommended Memory
1-10 pairs2GB4GB
10-50 pairs4GB8GB
50+ pairs8GB16GB

Strategy involves multiple indicator calculations, computational load is moderate.

10.3 Backtest vs Live Trading Differences

Backtest pitfalls to note:

  • Overfitting Risk: Multi-parameter strategies easily fit historical data
  • Slippage Costs: Trend breakouts may have significant slippage
  • Rejected Signals: Backtest shows 14,100 rejected buy signals, live execution may differ

10.4 Recommendations for Manual Traders

Strategy relies on multiple indicators, manual execution requires:

  1. Configure three differently parameterized SuperTrend indicators
  2. Add EMA 90 and Stoch RSI
  3. Manually execute when all conditions are met

Recommendation: Better suited for programmatic automated trading.


XI. Summary

SupertrendStrategy is a mature multi-factor trend-following strategy. Its core value lies in:

  1. Multiple Confirmations: Triple SuperTrend + EMA + Stoch RSI construct a reliable signal system
  2. Historical Validation: Community public strategy, tested in live trading
  3. Adjustable Parameters: Supports Hyperopt optimization, adaptable to different markets

For quantitative traders, this is an excellent advanced trend strategy suitable for use in confirmed trending markets. However, note that multi-factor strategies have many parameters, historical performance does not guarantee future results, require careful optimization and live trading validation.