HyperStra_SMAOnly Strategy: In-Depth Analysis
Strategy ID: #200 (200th of 465 strategies) Strategy Type: Hyper-Parameterized Optimization Strategy Timeframe: 5 Minutes (5m)
I. Strategy Overview
HyperStra_SMAOnly is a hyper-parameterized moving average strategy. "HyperStra" in the name stands for Hyperopt Strategy (hyper-parameter optimization strategy), and "SMAOnly" indicates it uses only Simple Moving Averages as technical indicators. The strategy uses multiple SMAs of different periods for mathematical operations, seeking optimal trading signal combinations through normalized ratios and crossover conditions. It is highly similar in design philosophy to the HyperStra_GSN_SMAOnly strategy and can be considered a "twin brother" strategy.
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_fast / sma_slow) < threshold_1
# Group 2: Ultra-short-term ratio
condition_2 = (sma_short_1 / sma_short_2) < threshold_2
# Group 3: Mid-term ratio
condition_3 = (sma_mid_1 / sma_mid_2) < threshold_3
# Entry signal: all three groups met
buy_signal = condition_1 & condition_2 & condition_3
3.2 Condition Analysis
The strategy uses multiple SMAs (covering ultra-short-term, short-term, mid-term, long-term periods) for ratio calculations, judging price's relative position through normalized ratios:
| Ratio Range | Technical Meaning |
|---|---|
| Ratio < 1.0 | Short-term MA below long-term MA (downtrend) |
| Ratio = 1.0 | Two MAs equal (balance point) |
| Ratio > 1.0 | Short-term MA above long-term MA (uptrend) |
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, measuring price deviation degree across different timeframes. When multiple 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_normalized == threshold_1)
# Group 2: Crossover condition
condition_2 = crossover(sma_a, sma_b)
# Group 3: Reverse crossover or ratio condition
condition_3 = crossunder(sma_c, sma_d)
# Exit signal: all three groups met
sell_signal = condition_1 & condition_2 & condition_3
4.2 Condition Analysis
Exit conditions combine normalized value judgment and moving average crossover signals, confirming profit-taking timing after trend strengthens:
| Condition Type | Detection Method | Technical Meaning |
|---|---|---|
| Normalized Value | SMA near high zone | Price has risen a certain amount |
| Trend Confirmation | Mid-term MA crosses above long-term MA | Trend strengthening |
| Momentum Confirmation | Ultra-short-term MA vs long-term MA relationship | Price position confirmation |
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 mechanism: using normalized values to confirm price position, trend crossovers to confirm direction, and momentum to confirm timing. 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 multiple simple moving averages of different periods:
| Indicator Period Classification | Purpose |
|---|---|
| Ultra-short-term SMA | Captures rapid price changes |
| Short-term SMA | Short-term trend judgment |
| Mid-term SMA | Mid-term trend baseline |
| Long-term SMA | Long-term trend reference |
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 (ultra-short) ←→ SMA (long) (deviation judgment)
SMA (ultra-short) ←→ SMA (ultra-short) (ultra-short-term momentum)
SMA (mid) ←→ SMA (long) (trend confirmation)
Exit Judgment:
SMA normalized value
SMA mid ←→ SMA long (trend strengthening)
SMA long ←→ SMA ultra-short (price position)
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
- Complementary with GSN Version: Can conduct comparative testing of twin strategy performance
Weaknesses
- Too Many Parameters: Multiple 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 |
| Comparative Testing with GSN | Recommended | Can simultaneously test both strategies' performance |
IX. Applicable Market Environment Analysis
HyperStra_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 Relationship with HyperStra_GSN_SMAOnly
The two strategies share similar design philosophy, both using multiple SMA normalized ratios for signal judgment:
| Comparison | HyperStra_SMAOnly | HyperStra_GSN_SMAOnly |
|---|---|---|
| Indicator Type | Multi-period SMA | 7 SMAs (5/6/15/50/55/100/110) |
| Number of Condition Groups | 3 entry + 3 exit | 3 entry + 3 exit |
| Design Philosophy | Hyper-parameterized optimization | Hyper-parameterized optimization + Gradient Stochastic Normalization |
| Applicable Scenario | Needs Hyperopt | Needs Hyperopt |
Recommendation: Run both strategies simultaneously; compare optimization results and live trading performance; choose the version more suitable for the current market environment.
9.3 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.4 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 |
| Comparative Testing | Recommended | Compare with GSN version; choose the better one |
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 normalized thresholds
- Exit condition normalized values and crossover parameters
- 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
- Comparative testing with GSN version
- Small-capital live trading test
XI. Summary
HyperStra_SMAOnly is a rigorously designed, 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
- Twin Strategy: Forms complementarity with HyperStra_GSN_SMAOnly; can compare to choose the better version
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, comparative testing with the GSN version, 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. Recommended to simultaneously test HyperStra_GSN_SMAOnly and this strategy, choosing the version with better performance.