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
| Feature | Description |
|---|---|
| Buy Condition | 1 composite buy signal (Triple SuperTrend + Stoch RSI + EMA filter) |
| Sell Condition | 1 composite sell signal (Triple SuperTrend + Stoch RSI reversal) |
| Protection Mechanism | Tiered ROI + Trailing Stop dual protection |
| Timeframe | 1h |
| Dependencies | ta, pandas_ta |
| Hyperparameter Optimization | Supports Hyperopt for buy/sell threshold optimization |
Backtest Performance Reference
According to backtest data from source code comments (2018-2021, ADA/USDT):
| Metric | Value |
|---|---|
| Starting Capital | 1,000 USDT |
| Final Capital | 41,040 USDT |
| Total Return | 4004.05% |
| Number of Trades | 202 |
| Best Trade | +148.95% |
| Worst Trade | -18.24% |
| Maximum Drawdown | 59.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:
- Triple SuperTrend Direction: At least one of three SuperTrends shows bullish (direction = 1)
- Stoch RSI Filter: Stoch RSI below buy threshold (default 0.8), avoiding entry in overbought zone
- EMA Trend Filter: Close price above EMA90, confirming medium-term uptrend
- Volume Confirmation: Basic volume verification
3.2 Triple SuperTrend Parameters
| ID | ATR Period | ATR Multiplier | Sensitivity | Purpose |
|---|---|---|---|---|
| SuperTrend 1 | 20 | 3.0 | Medium | Primary trend identification |
| SuperTrend 2 | 20 | 4.0 | Lower | Stable signal confirmation |
| SuperTrend 3 | 40 | 8.0 | Very Low | Long-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")
| Parameter | Range | Default | Description |
|---|---|---|---|
| buy_stoch_rsi | 0.5 - 1.0 | 0.8 | Stoch RSI buy threshold |
| sell_stoch_rsi | 0 - 0.5 | 0.2 | Stoch 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:
- Triple SuperTrend Reversal: Sum of all SuperTrend direction values less than 1, meaning all have turned bearish
- 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 Time | Target Return | Description |
|---|---|---|
| 0 minutes | 10% | Immediate take-profit target |
| 30 minutes | 5% | Short-term downgrade |
| 60 minutes | 2% | Longer timeframe (rarely takes effect) |
V. Technical Indicator System
5.1 Core Indicators
| Indicator Category | Specific Indicator | Parameters | Purpose |
|---|---|---|---|
| Trend Indicators | SuperTrend × 3 | (20, 3.0), (20, 4.0), (40, 8.0) | Multi-timeframe trend assessment |
| Moving Average | EMA | 90 period | Medium-term trend filter |
| Momentum Indicator | Stoch RSI | Default parameters | Overbought/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
| Dimension | Buy Condition | Sell Condition |
|---|---|---|
| SuperTrend | ≥ 1 (at least one bullish) | < 1 (all bearish) |
| EMA | Required | Not 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
- Multi-Timeframe Trend Confirmation: Triple SuperTrend provides multi-level trend assessment
- Momentum Filtering: Stoch RSI avoids entry at extreme levels
- Trend Filtering: EMA 90 ensures trading only in medium-term uptrend
- Parameter Optimization: Supports Hyperopt hyperparameter search
- Excellent Historical Performance: Backtest shows over 40x returns
⚠️ Limitations
- Many Parameters: Three sets of SuperTrend parameters + EMA + Stoch RSI, large optimization space but prone to overfitting
- Large Drawdown: Historical maximum drawdown near 60%, requires strong psychological tolerance
- Stop Loss Effectively Disabled: -99% stop loss rarely triggers, risk control relies on trailing stop
- Signal Lag: Multiple indicator confirmations increase reliability but slow entry
- Third-Party Library Dependency: Requires pandas_ta library support
VIII. Applicable Scenario Recommendations
| Market Environment | Recommended Configuration | Description |
|---|---|---|
| Strong Trend Market | Default parameters | Multiple confirmations perform excellently in trending markets |
| Ranging Market | Use cautiously | Stoch RSI filter can reduce false signals, but still needs testing |
| High Volatility Market | Increase ATR multiplier | Reduce SuperTrend sensitivity |
| Bear Market | Stay in cash or short | Strategy 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 Type | Performance Rating | Reason 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 Item | Recommended Value | Description |
|---|---|---|
| Pair Selection | Strong-trending mainstream coins | BTC, ETH, etc. |
| Timeframe | 1h-4h | Maintain original design or extend appropriately |
| Position Control | Diversified investment | Single 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 Pairs | Minimum Memory | Recommended Memory |
|---|---|---|
| 1-10 pairs | 2GB | 4GB |
| 10-50 pairs | 4GB | 8GB |
| 50+ pairs | 8GB | 16GB |
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:
- Configure three differently parameterized SuperTrend indicators
- Add EMA 90 and Stoch RSI
- 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:
- Multiple Confirmations: Triple SuperTrend + EMA + Stoch RSI construct a reliable signal system
- Historical Validation: Community public strategy, tested in live trading
- 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.