SuperTrendPure Strategy In-Depth Analysis
Strategy Number: #401 (401st of 465 strategies) Strategy Type: Pure Trend-Following Strategy Timeframe: 1 Hour (1h)
I. Strategy Overview
SuperTrendPure is a pure trend-following strategy based on the SuperTrend indicator. The strategy design is extremely concise, relying solely on a single indicator for trading decisions, embodying the "less is more" quantitative philosophy. The strategy uses ATR (Average True Range) to construct dynamic support and resistance lines, capturing trend reversal points.
Core Features
| Feature | Description |
|---|---|
| Buy Condition | 1 independent buy signal (close price crosses above SuperTrend line) |
| Sell Condition | 1 basic sell signal (close price crosses below SuperTrend line) |
| Protection Mechanism | Tiered ROI + Stop Loss + Trailing Stop triple protection |
| Timeframe | 1h |
| Dependencies | talib, qtpylib, numpy |
II. Strategy Configuration Analysis
2.1 Basic Risk Parameters
# ROI Exit Table
minimal_roi = {
"0": 0.087, # Immediate: 8.7%
"372": 0.058, # After 372 minutes: 5.8%
"861": 0.029, # After 861 minutes (~14 hours): 2.9%
"2221": 0 # After 2221 minutes (~37 hours): Breakeven exit
}
# Stop Loss Setting
stoploss = -0.265 # -26.5%
# Trailing Stop
trailing_stop = True
trailing_stop_positive = 0.05 # Activates after 5% profit
trailing_stop_positive_offset = 0.144 # Activates after 14.4% profit
trailing_only_offset_is_reached = False
Design Rationale:
- ROI uses a four-tier declining structure, encouraging longer holding periods to capture trend gains
- Stop loss at -26.5% is relatively wide, allowing room for trend pullbacks
- Trailing stop with 14.4% offset ensures sufficient profit locking space
2.2 Order Type Configuration
The strategy does not explicitly configure order_types, using Freqtrade's default configuration (limit buy/sell).
III. Buy Condition Details
3.1 Core Buy Logic
The strategy has only one buy condition with clear logic:
# Buy Condition
(
(qtpylib.crossed_above(dataframe['close'], dataframe['st'])) & # Close crosses above SuperTrend line
(dataframe['volume'].gt(0)) # Volume exists
)
Technical Interpretation:
- crossed_above: Close price crosses the SuperTrend line from below, forming a trend reversal signal
- volume > 0: Basic volume filtering to avoid zero-volume anomalies
3.2 SuperTrend Indicator Parameters
supertrend = self.supertrend(dataframe, 2, 8) # multiplier=2, period=8
| Parameter | Value | Description |
|---|---|---|
| ATR Period | 8 | Short-period ATR, faster response |
| ATR Multiplier | 2 | Standard multiplier, moderate sensitivity |
SuperTrend Calculation Logic:
- Calculate True Range and ATR (SMA smoothed)
- Calculate basic upper and lower bands: (High+Low)/2 ± Multiplier × ATR
- Calculate final upper and lower bands (considering trend continuity)
- Determine trend direction based on price-band relationship
IV. Sell Logic Details
4.1 Basic Sell Signal
# Sell Condition
(
(qtpylib.crossed_below(dataframe['close'], dataframe['st'])) & # Close crosses below SuperTrend line
(dataframe['volume'].gt(0)) # Volume exists
)
Technical Interpretation:
- crossed_below: Close price breaks below the SuperTrend line from above, a trend reversal signal
- The signal is completely symmetrical with the buy condition, forming a complete trend-following loop
4.2 Tiered Take-Profit System
The strategy implements tiered take-profit through the ROI table:
| Holding Time | Target Return | Description |
|---|---|---|
| 0 minutes | 8.7% | Immediate take-profit target |
| 372 minutes (~6 hours) | 5.8% | First tier downgrade |
| 861 minutes (~14 hours) | 2.9% | Second tier downgrade |
| 2221 minutes (~37 hours) | 0% | Breakeven exit |
4.3 Trailing Stop Mechanism
| Parameter | Value | Description |
|---|---|---|
| trailing_stop | True | Enable trailing stop |
| trailing_stop_positive | 0.05 | Start tracking after 5% profit |
| trailing_stop_positive_offset | 0.144 | Activate after 14.4% profit |
| trailing_only_offset_is_reached | False | Track before offset is reached |
Working Mechanism:
- When profit reaches 5%, trailing stop starts recording highest price
- When profit reaches 14.4%, a pullback from highest price triggers stop
- Pullback amount is automatically calculated by Freqtrade
V. Technical Indicator System
5.1 Core Indicators
| Indicator Category | Specific Indicator | Purpose |
|---|---|---|
| Trend Indicator | SuperTrend (ATR multiplier 2, period 8) | Trend direction judgment, buy/sell signal generation |
| Volatility Indicator | ATR (Average True Range) | Dynamic band width calculation |
| Basic Filter | Volume | Volume validity verification |
5.2 SuperTrend Indicator Details
The strategy has a built-in SuperTrend calculation function with the following core logic:
def supertrend(self, dataframe, multiplier, period):
# 1. Calculate True Range and ATR
df['TR'] = ta.TRANGE(df)
df['ATR'] = ta.SMA(df['TR'], period)
# 2. Calculate basic bands
df['basic_ub'] = (df['high'] + df['low']) / 2 + multiplier * df['ATR']
df['basic_lb'] = (df['high'] + df['low']) / 2 - multiplier * df['ATR']
# 3. Calculate final bands (considering continuity)
# 4. Determine trend direction
df[stx] = np.where((df[st] > 0.00),
np.where((df['close'] < df[st]), 'down', 'up'),
np.NaN)
Output:
ST: SuperTrend line value (support/resistance level)STX: Trend direction ('up' or 'down')
VI. Risk Management Features
6.1 Wide Stop Loss Design
- Stop Loss Value: -26.5%
- Design Rationale: Trend strategies need sufficient room to handle normal pullbacks
- Applicable Scenarios: Medium to long-term trend trading, not high-frequency short-term
6.2 Trailing Stop Protection
- Activation Threshold: 14.4% profit
- Tracking Start Point: 5% profit
- Protection Effect: Ensures locking most profits in trending markets
6.3 Time Decay Mechanism
- ROI Downgrade: From 8.7% gradually down to 0
- Time Limit: Maximum holding period approximately 37 hours
- Risk Control: Avoids indefinite holding and loss expansion
VII. Strategy Advantages and Limitations
✅ Advantages
- Minimalist Design: Single indicator, clear logic, easy to understand and debug
- Trend Capture: Based on ATR dynamic bands, adapts to market volatility
- Controllable Risk: Multi-tier take-profit + trailing stop, offensive and defensive balance
- High Efficiency: Simple indicator calculation, suitable for parallel trading of many pairs
⚠️ Limitations
- Disadvantage in Ranging Markets: Pure trend strategies suffer repeated stop losses in sideways consolidation
- Lag: SuperTrend as a trend indicator has delayed entry
- Single Dimension: Does not consider volume changes, momentum confirmation, etc.
- Parameter Sensitivity: ATR period and multiplier parameters significantly affect performance
VIII. Applicable Scenario Recommendations
| Market Environment | Recommended Configuration | Description |
|---|---|---|
| Strong Trend Market | Default parameters | SuperTrend excels at capturing medium to long-term trends |
| Ranging Market | Not recommended | Suggest adding other filter conditions or pausing strategy |
| High Volatility Market | Increase ATR multiplier | Raise to 2.5-3, reduce false signals |
| Low Volatility Market | Decrease ATR period | Lower to 5-6, increase sensitivity |
IX. Applicable Market Environment Details
SuperTrendPure is a typical single-factor trend strategy. Based on its code architecture, it is most suitable for unilateral trending markets, while performing poorly in consolidation/ranging markets.
9.1 Strategy Core Logic
- Trend Identification: Judges trend reversal through price breaking ATR dynamic bands
- Trend Following: Buy on upward cross, exit on downward cross
- Dynamic Adaptation: Band width changes with ATR, automatically adapting to market volatility
9.2 Performance in Different Market Environments
| Market Type | Performance Rating | Reason Analysis |
|---|---|---|
| 📈 Unilateral Uptrend | ⭐⭐⭐⭐⭐ | SuperTrend perfectly tracks uptrend, large profit space |
| 🔄 Consolidation/Ranging | ⭐⭐☆☆☆ | Frequent band crossings, repeated stop losses, significant wear |
| 📉 Unilateral Downtrend | ⭐⭐⭐☆☆ | Stay in cash, no trades (requires short strategy) |
| ⚡️ Extreme Volatility | ⭐⭐⭐☆☆ | ATR rapidly expands, bands widen, signals decrease |
9.3 Key Configuration Recommendations
| Configuration Item | Recommended Value | Description |
|---|---|---|
| Timeframe | 1h-4h | Too short has noise, too long has obvious lag |
| Pair Selection | High-trending instruments | Avoid sideways coins |
| ATR Multiplier | 2-3 | Higher multiplier means fewer but more reliable signals |
X. Important Reminder: The Cost of Complexity
10.1 Learning Cost
SuperTrendPure is one of the simplest trend strategies with extremely low learning cost:
- Only need to understand SuperTrend indicator principle
- No complex parameter optimization needed
- Code less than 100 lines
10.2 Hardware Requirements
| Number of Pairs | Minimum Memory | Recommended Memory |
|---|---|---|
| 1-10 pairs | 1GB | 2GB |
| 10-50 pairs | 2GB | 4GB |
| 50+ pairs | 4GB | 8GB |
Strategy calculation is minimal, hardware requirements are extremely low.
10.3 Backtest vs Live Trading Differences
Due to strategy simplicity, backtest and live trading differences are small:
- No resampling issues: Single timeframe
- No look-ahead bias: Indicator calculation has no forward-looking deviation
- Slippage Impact: Main cost source, especially in fast markets
10.4 Recommendations for Manual Traders
SuperTrendPure is extremely suitable for manual traders to reference:
- Clear Signals: Breakout = entry/exit, no subjective judgment needed
- Universal Indicator: All major charting software have SuperTrend indicator
- Clear Risk Control: Stop loss, take-profit, trailing stop rules are clear
XI. Summary
SuperTrendPure is a minimalist trend-following strategy. Its core value lies in:
- Simplicity: Single indicator, transparent logic, easy to understand and verify
- Trend Capture: ATR dynamic bands effectively identify trend reversals
- Complete Risk Control: Tiered take-profit + trailing stop + stop loss triple protection
For quantitative traders, this is an excellent entry-level trend strategy and the best case for understanding the SuperTrend indicator. However, note that pure trend strategies perform poorly in ranging markets and need to be combined with market environment filters or other strategies.