Skip to main content

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

FeatureDescription
Entry Conditions3 groups of SMA normalized ratio conditions must be met simultaneously
Exit Conditions3 groups of SMA crossover/normalized conditions must be met simultaneously
ProtectionsHard stop-loss -5%, trailing stop, trade frequency limit
Timeframe5 Minutes
DependenciesTA-Lib, numpy
Optimization RequiredRequires 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 RangeTechnical Meaning
Ratio < 1.0Short-term MA below long-term MA (downtrend)
Ratio = 1.0Two MAs equal (balance point)
Ratio > 1.0Short-term MA above long-term MA (uptrend)

3.3 Entry Condition Classification

Condition TypeCore LogicSignal #
Oversold ReboundMultiple MA ratios simultaneously below thresholdCondition #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 TypeDetection MethodTechnical Meaning
Normalized ValueSMA near high zonePrice has risen a certain amount
Trend ConfirmationMid-term MA crosses above long-term MATrend strengthening
Momentum ConfirmationUltra-short-term MA vs long-term MA relationshipPrice position confirmation

4.3 Exit Condition Classification

Condition TypeCore LogicSignal #
Trend ReversalMultiple MA crossovers and normalized combinationCondition #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 ClassificationPurpose
Ultra-short-term SMACaptures rapid price changes
Short-term SMAShort-term trend judgment
Mid-term SMAMid-term trend baseline
Long-term SMALong-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 TimeTake-Profit ThresholdRisk Appetite
Immediate exit28.8%Aggressive (awaiting large profits)
After 90 minutes10.1%Moderate
After 180 minutes4.9%Conservative
After 480 minutes0%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

  1. Hyper-Parameterized Design: Multiple optimizable parameters; strong adaptability
  2. Rigorous Mathematical Logic: Normalized ratios eliminate price absolute value impact
  3. Multi-Confirmation Mechanism: Both entry and exit require multiple conditions met; reduces false signals
  4. Trend + Mean Reversion: Combines trend judgment and mean reversion thinking
  5. Complete Risk Control: Tiered take-profit, trailing stop, frequency limit three-layer protection
  6. Complementary with GSN Version: Can conduct comparative testing of twin strategy performance

Weaknesses

  1. Too Many Parameters: Multiple MAs + multiple thresholds; high overfitting risk
  2. Optimization Dependent: Default parameters may not be optimal; requires Hyperopt tuning
  3. Not Beginner-Friendly: High learning barrier; complex parameter adjustment
  4. Computational Resource Demand: Hyperopt optimization requires substantial computing resources and time
  5. Market Adaptability: Parameters may only be effective in specific market environments

VIII. Applicable Scenarios

Market EnvironmentRecommendationNotes
Needs OptimizationSuitableOriginal strategy design intent
Quantitative UsersSuitableUsers with Hyperopt experience
Beginner UsersNot SuitableParameter complex; tuning difficulty high
Direct UseUse with CautionDefault parameters may not be optimal
Comparative Testing with GSNRecommendedCan 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:

ComparisonHyperStra_SMAOnlyHyperStra_GSN_SMAOnly
Indicator TypeMulti-period SMA7 SMAs (5/6/15/50/55/100/110)
Number of Condition Groups3 entry + 3 exit3 entry + 3 exit
Design PhilosophyHyper-parameterized optimizationHyper-parameterized optimization + Gradient Stochastic Normalization
Applicable ScenarioNeeds HyperoptNeeds 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 TypeRatingAnalysis
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 ItemRecommended ActionNotes
HyperoptRequiredUse Hyperopt to optimize all threshold parameters
Time Period1000+ candlesOptimize with at least 1000 candles
Trading PairsSelective optimizationDifferent pairs may need different parameters
Backtest PeriodMulti-period verificationAvoid overfitting to single time period
Comparative TestingRecommendedCompare 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 PointManifestationCountermeasure
Too many parametersBacktest excellent; live trading losesReduce parameters; add constraints
Single period optimizationOnly effective in specific timeMulti-period out-of-sample verification
Excessive optimizationParameter precision too highRound 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:

  1. Normalized Innovation: Uses SMA normalized ratios to eliminate price absolute value impact; improves strategy universality
  2. Multi-Confirmation: Both entry and exit require multiple conditions met simultaneously; reduces false signal interference
  3. Flexible Adaptation: Hyper-parameterized design can optimize parameters for different market environments
  4. 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.