HyperStra_GSN_SMAOnly Strategy: In-Depth Analysis
Strategy ID: #199 (199th of 465 strategies) Strategy Type: Hyper-Parameterized Optimization Strategy Timeframe: 5 Minutes (5m)
I. Strategy Overview
HyperStra_GSN_SMAOnly is a hyper-parameterized moving average strategy. "HyperStra" in the name stands for Hyperopt Strategy (hyper-parameter optimization strategy), "GSN" represents Gradient Stochastic Normalization, and "SMAOnly" indicates it uses only Simple Moving Averages as technical indicators. The strategy uses 7 SMAs of different periods (5, 6, 15, 50, 55, 100, 110) for mathematical operations, seeking optimal trading signal combinations through normalized ratios and crossover conditions.
Core Features
| Feature | Description |
|---|---|
| Entry Conditions | 3 groups of SMA normalized ratio conditions must be met simultaneously |
| Exit Conditions | 3 groups of SMA crossover/normalized conditions must be met simultaneously |
| Protections | Hard stop-loss -5%, trailing stop, trade frequency limit |
| Timeframe | 5 Minutes |
| Dependencies | TA-Lib, numpy |
| Optimization Required | Requires Hyperopt parameter optimization |
II. Strategy Configuration Analysis
2.1 ROI Take-Profit Configuration
minimal_roi = {
"0": 0.288, # Immediate exit: 28.8% profit
"90": 0.101, # After 90 minutes: 10.1% profit
"180": 0.049, # After 180 minutes: 4.9% profit
"480": 0 # After 480 minutes: break-even exit
}
Design Philosophy:
- Aggressive Take-Profit Start: Immediate exit set at 28.8%; pursues high returns
- Time Decay Mechanism: Longer holding time means lower take-profit threshold
- Break-Even Floor: Break-even exit after 480 minutes; controls holding risk
- Obvious Optimization Traces: Non-integer parameter characteristics indicate Hyperopt optimization
2.2 Stop-Loss Configuration
stoploss = -0.05 # Hard stop-loss -5%
# Trailing Stop Configuration
trailing_stop = True
trailing_stop_positive = 0.005 # Activation point 0.5%
trailing_stop_positive_offset = 0.016 # Offset 1.6%
Design Philosophy:
- Moderate Stop-Loss Amplitude: -5% controls single-trade loss
- Trailing Stop Locks Profits: Activates trailing after 0.5% profit
- Activation Offset Protection: Price must rise 1.6% to activate trailing stop
2.3 Risk Control Parameters
# Trade frequency limits
max_entry_position = 1 # Maximum 1 trade per single entry
stoploss_guard = 2 # Maximum 1 trade within 2 candles
cooldown_period = 2 # Cooldown of 2 candles after trade
III. Entry Conditions Details
3.1 Entry Signal Logic
The strategy requires 3 groups of SMA normalized ratio conditions to be met simultaneously to trigger entry:
# Group 1: Short-term/long-term ratio
condition_1 = (sma_5 / sma_110) < 0.3 # SMA(5)/SMA(110) normalized < 0.3
# Group 2: Ultra-short-term ratio
condition_2 = (sma_5 / sma_6) < 0.5 # SMA(5)/SMA(6) normalized < 0.5
# Group 3: Mid-term ratio
condition_3 = (sma_55 / sma_100) < 0.9 # SMA(55)/SMA(100) normalized < 0.9
# Entry signal: all three groups met
buy_signal = condition_1 & condition_2 & condition_3
3.2 Condition Analysis
| Condition Group | Ratio Calculation | Threshold | Technical Meaning |
|---|---|---|---|
| Group 1 | SMA(5) / SMA(110) | < 0.3 | Short-term MA far below long-term MA; price in deep decline |
| Group 2 | SMA(5) / SMA(6) | < 0.5 | Ultra-short-term MA below short-term MA; short-term momentum bearish |
| Group 3 | SMA(55) / SMA(100) | < 0.9 | Mid-term MA below long-term MA; mid-term trend bearish |
3.3 Entry Condition Classification
| Condition Type | Core Logic | Signal # |
|---|---|---|
| Oversold Rebound | Multiple MA ratios simultaneously below threshold | Condition #1 |
3.4 Design Philosophy
The three groups of conditions present multi-confirmation logic:
- Group 1: Measures deviation degree between short and long term
- Group 2: Measures ultra-short-term momentum state
- Group 3: Confirms mid-term trend direction
When all three groups are met simultaneously, it means price is at a relatively low level across multiple timeframes, potentially presenting a rebound opportunity.
IV. Exit Logic Details
4.1 Exit Signal Logic
The strategy requires 3 groups of SMA conditions to be met simultaneously to trigger exit:
# Group 1: Normalized condition
condition_1 = (sma_50_normalized == 0.9) # SMA(50) normalized value equals 0.9
# Group 2: Crossover condition
condition_2 = crossover(sma_50, sma_110) # SMA(50) crosses above SMA(110)
# Group 3: Reverse crossover
condition_3 = crossunder(sma_110, sma_5) # SMA(110) crosses below SMA(5)
# Exit signal: all three groups met
sell_signal = condition_1 & condition_2 & condition_3
4.2 Condition Analysis
| Condition Group | Detection Method | Technical Meaning |
|---|---|---|
| Group 1 | SMA(50) normalized == 0.9 | Mid-term MA approaching high zone |
| Group 2 | SMA(50) crosses above SMA(110) | Mid-term MA crosses above long-term MA; trend strengthening |
| Group 3 | SMA(110) crosses below SMA(5) | Long-term MA below ultra-short-term MA; price has risen |
4.3 Exit Condition Classification
| Condition Type | Core Logic | Signal # |
|---|---|---|
| Trend Reversal | Multiple MA crossovers and normalized combination | Condition #1 |
4.4 Design Philosophy
The exit condition design reflects multi-confirmation:
- Normalized Value Confirmation: SMA(50) near high zone
- Trend Confirmation: Mid-term MA crosses above long-term MA
- Momentum Confirmation: Ultra-short-term MA already above long-term MA
The three groups of conditions suggest price has experienced a rally and may be time to take profits.
V. Technical Indicator System
5.1 Core Indicators
The strategy uses 7 simple moving averages of different periods:
| Indicator Period | Classification | Purpose |
|---|---|---|
| SMA(5) | Ultra-short-term | Captures rapid price changes |
| SMA(6) | Ultra-short-term | Pairs with SMA(5) to judge ultra-short-term momentum |
| SMA(15) | Short-term | Auxiliary judgment (parameter retained) |
| SMA(50) | Mid-term | Mid-term trend judgment; exit signal core |
| SMA(55) | Mid-term | Pairs with SMA(100) to judge mid-term trend |
| SMA(100) | Long-term | Long-term trend baseline |
| SMA(110) | Long-term | Pairs with SMA(5) to judge long-term deviation |
5.2 Normalized Calculation
The strategy's core innovation is using normalized ratios instead of original prices:
# Normalized ratio example
normalized_ratio = sma_short / sma_long
# Ratio meaning:
# < 1.0 : Short-term MA below long-term MA (downtrend)
# = 1.0 : Two MAs equal (balance point)
# > 1.0 : Short-term MA above long-term MA (uptrend)
Advantages:
- Eliminates impact of price absolute value
- Easy to set universal thresholds
- Adapts to trading pairs at different price levels
5.3 Indicator Dependency Relationships
Entry Judgment:
SMA(5) ←→ SMA(110) (ultra-short-term vs long-term)
SMA(5) ←→ SMA(6) (ultra-short-term internal comparison)
SMA(55) ←→ SMA(100) (mid-term vs long-term)
Exit Judgment:
SMA(50) normalized value
SMA(50) ←→ SMA(110) (mid-term crosses above long-term)
SMA(110) ←→ SMA(5) (long-term vs ultra-short-term)
VI. Risk Management Highlights
6.1 Tiered Take-Profit Mechanism
The strategy uses a time-decaying ROI take-profit mechanism:
| Holding Time | Take-Profit Threshold | Risk Appetite |
|---|---|---|
| Immediate exit | 28.8% | Aggressive (awaiting large profits) |
| After 90 minutes | 10.1% | Moderate |
| After 180 minutes | 4.9% | Conservative |
| After 480 minutes | 0% | Break-even exit |
Features:
- High initial take-profit target (28.8%); strategy expects to capture large swings
- Time decay design; avoids uncertainty of prolonged holding
- Break-even floor setting; ensures gains don't turn into losses after being profitable
6.2 Dual Stop-Loss Protection
# Fixed stop-loss
stoploss = -0.05 # 5% hard stop-loss
# Trailing stop
trailing_stop_positive = 0.005 # Activate at 0.5% profit
trailing_stop_positive_offset = 0.016 # Price must rise 1.6% to activate
Design Philosophy:
- Fixed stop-loss protects principal; controls maximum loss
- Trailing stop locks in profits; lets winners run
- Offset setting avoids being shaken out too early by oscillation
6.3 Trade Frequency Limits
# Prevent over-trading
stoploss_guard = 2 # Maximum 1 trade within 2 candles
cooldown_period = 2 # Cooldown of 2 candles after trade
Effect:
- Avoids consecutive stop-losses
- Gives market time to recover
- Reduces fee consumption
VII. Strategy Pros & Cons
Strengths
- Hyper-Parameterized Design: Multiple optimizable parameters; strong adaptability
- Rigorous Mathematical Logic: Normalized ratios eliminate price absolute value impact
- Multi-Confirmation Mechanism: Both entry and exit require multiple conditions met; reduces false signals
- Trend + Mean Reversion: Combines trend judgment and mean reversion thinking
- Complete Risk Control: Tiered take-profit, trailing stop, frequency limit three-layer protection
Weaknesses
- Too Many Parameters: 7 MAs + multiple thresholds; high overfitting risk
- Optimization Dependent: Default parameters may not be optimal; requires Hyperopt tuning
- Not Beginner-Friendly: High learning barrier; complex parameter adjustment
- Computational Resource Demand: Hyperopt optimization requires substantial computing resources and time
- Market Adaptability: Parameters may only be effective in specific market environments
VIII. Applicable Scenarios
| Market Environment | Recommendation | Notes |
|---|---|---|
| Needs Optimization | Suitable | Original strategy design intent |
| Quantitative Users | Suitable | Users with Hyperopt experience |
| Beginner Users | Not Suitable | Parameter complex; tuning difficulty high |
| Direct Use | Use with Caution | Default parameters may not be optimal |
IX. Applicable Market Environment Analysis
HyperStra_GSN_SMAOnly is a hyper-parameterized strategy requiring parameter optimization. Its performance is highly dependent on parameter optimization results; different market environments require different parameter combinations.
9.1 Strategy Core Logic
- Normalized Ratios: Eliminate price absolute value impact; easy to set universal thresholds
- Multi-Confirmation: Multiple conditions must be met simultaneously to trigger signals; reduces false signals
- Mean Reversion Thinking: Entry conditions suggest price is at relatively low level
- Trend Following: Exit conditions confirm profit-taking after trend strengthens
9.2 Performance in Different Market Environments
| Market Type | Rating | Analysis |
|---|---|---|
| Trending Upward | ⭐⭐⭐⭐☆ | Exit conditions capture trend strengthening; entry conditions buy on pullbacks |
| Ranging Market | ⭐⭐⭐☆☆ | Normalized ratios may repeatedly trigger at threshold edges |
| Trending Downward | ⭐⭐☆☆☆ | Entry conditions may trigger but trend continues downward |
| High Volatility | ⭐⭐⭐☆☆ | Parameters need adjustment to adapt to volatility |
9.3 Key Configuration Recommendations
| Config Item | Recommended Action | Notes |
|---|---|---|
| Hyperopt | Required | Use Hyperopt to optimize all threshold parameters |
| Time Period | 1000+ candles | Optimize with at least 1000 candles |
| Trading Pairs | Selective optimization | Different pairs may need different parameters |
| Backtest Period | Multi-period verification | Avoid overfitting to single time period |
X. Important Notes: Strategy Usage Considerations
10.1 Must Use Hyperopt
This strategy is hyper-parameterized design; default parameters are only examples:
# Recommended optimization command
freqtrade hyperopt --hyperopt-loss SharpeHyperOptLoss \
--epochs 500 \
--spaces buy sell roi stoploss
Optimization Focus:
- Entry condition thresholds (0.3, 0.5, 0.9)
- Exit condition normalized values (0.9)
- ROI take-profit time nodes and ratios
- Stop-loss and trailing stop parameters
10.2 Overfitting Risk Warning
Hyper-parameterized strategies are prone to overfitting:
| Risk Point | Manifestation | Countermeasure |
|---|---|---|
| Too many parameters | Backtest excellent; live trading loses | Reduce parameters; add constraints |
| Single period optimization | Only effective in specific time | Multi-period out-of-sample verification |
| Excessive optimization | Parameter precision too high | Round parameters; reduce precision |
10.3 Resource Requirements
# Hyperopt optimization resource requirements
epochs: 500-1000+
timeframe: 5m
sample size: 10000+ candles
estimated time: several hours to several days
10.4 Pre-Live Trading Checklist
- Complete Hyperopt parameter optimization
- Out-of-sample backtest verification
- Multi-trading-pair parameter testing
- Set reasonable fees and slippage
- Small-capital live trading test
XI. Summary
HyperStra_GSN_SMAOnly is a complex, parameter-rich hyper-parameterized moving average strategy. Its core value lies in:
- Normalized Innovation: Uses SMA normalized ratios to eliminate price absolute value impact; improves strategy universality
- Multi-Confirmation: Both entry and exit require multiple conditions met simultaneously; reduces false signal interference
- Flexible Adaptation: Hyper-parameterized design can optimize parameters for different market environments
For quantitative traders with experience, this strategy provides a good parameter optimization framework, but beginners should use it cautiously. Strategy success is highly dependent on Hyperopt optimization results; recommended to conduct thorough backtesting and small-capital live verification before deploying significant capital.
Core Recommendation: For those who know how to tune parameters, have time to tune them, and are willing to verify. Not suitable for quantitative traders seeking "out-of-the-box" use.