ElliotV2 - Strategy Analysis
I. Strategy Overview and Theoretical Foundation
1.1 Strategy Background
ElliotV2 is a quantitative trading strategy based on the Elliott Wave Oscillator (EWO), specifically designed for the cryptocurrency market. This strategy combines the core ideas of Elliott Wave theory with multiple technical analysis indicators to capture band-like market opportunities, achieving profits by identifying trend turning points.
Elliott Wave Theory, proposed by Ralph Nelson Elliott in the 1930s, holds that market price movements follow recognizable wave patterns. ElliotV2 is precisely a product combining this classical theory with the modern Freqtrade quantitative trading framework, using algorithmic methods to identify wave start and end points for automated trading.
1.2 Core Design Philosophy
The core design philosophy of ElliotV2 can be summarized as "follow the trend, counter-trend entry." Specifically:
Trend Identification: Uses the Elliott Wave Oscillator (EWO) to identify the current wave position of the market, distinguishing the main trend direction from correction phases.
Value Entry: Builds positions when prices are relatively low — specifically, seeks entry opportunities at a certain percentage below the EMA moving average.
Momentum Confirmation: Combines momentum indicators such as RSI to ensure sufficient upward momentum exists at entry timing, avoiding being trapped in weak markets.
Risk Control: Constructs a complete risk management system through tiered ROI targets, fixed stop-loss, and trailing stop mechanisms.
1.3 Timeframe and Applicability
ElliotV2 uses 5 minutes (5m) as the primary timeframe while referencing 1 hour (1h) as the auxiliary timeframe. This configuration enables the strategy to:
- Capture medium-short-term price fluctuations
- Use the 1-hour timeframe to confirm major trend direction
- Precisely execute entries and exits on the 5-minute timeframe
The strategy is suitable for highly volatile cryptocurrency markets, especially for trading mainstream coins such as BTC and ETH. Note that the strategy requires at least 139 candlesticks of historical data at startup to calculate all indicators.
II. Elliott Wave Oscillator (EWO) Deep Dive
2.1 EWO Mathematical Principles
The Elliott Wave Oscillator (EWO) is this strategy's core indicator, with the following formula:
EWO = (EMA(5) - EMA(35)) / Close × 100
Where:
- EMA(5) is the 5-period exponential moving average
- EMA(35) is the 35-period exponential moving average
- Close is the current closing price
In ElliotV2, the strategy author has optimized the periods:
- Fast EMA period: 50
- Slow EMA period: 200
This configuration makes EWO more sensitive to medium-long-term trends, enabling more accurate identification of major wave turning points.
2.2 EWO Market Implications
EWO values reflect the degree of deviation between short-term and long-term trends:
Positive EWO: Indicates the short-term moving average is above the long-term moving average, and the market is in an upward momentum state. When EWO is positive and rising, it may mean an upward impulse wave is in progress.
Negative EWO: Indicates the short-term moving average is below the long-term moving average, and the market is in a downward momentum state. When EWO is negative and declining (absolute value increasing), it may mean a downtrend is strengthening.
Zero-Line Crossover: EWO crossing the zero axis is typically viewed as a trend change signal and serves as an important reference for judging wave conversion in Elliott Wave theory.
2.3 Application in ElliotV2
The ElliotV2 strategy uses EWO as the core filter for entry signals, setting two key thresholds:
-
ewo_high = 4.471: When EWO exceeds this value, it indicates the market is in a correction phase of a strong uptrend, and entry long may be considered in combination with other conditions.
-
ewo_low = -13.043: When EWO falls below this value, it indicates the market is in an oversold state, possibly about to rebound — representing another entry opportunity.
This bidirectional entry mechanism enables the strategy to buy on dips during uptrend corrections (strong-gets-stronger logic) while also capturing rebound opportunities in oversold areas (mean reversion logic).
III. Moving Average Offset System
3.1 EMA Offset Entry Mechanism
ElliotV2 introduces a Moving Average Offset (MA Offset) system as the price entry condition. Its core logic: wait for the price to deviate from the moving average by a certain percentage before entering, ensuring an entry price with relative advantage.
Buy Offset:
Entry Price < EMA(base_nb_candles_buy) × low_offset
Where:
- base_nb_candles_buy = 31 (optimizable range: 5-80)
- low_offset = 0.978 (optimizable range: 0.9-0.99)
This means the price must be below 97.8% of the 31-period EMA to consider entry.
Sell Offset:
Exit Price > EMA(base_nb_candles_sell) × high_offset
Where:
- base_nb_candles_sell = 99 (optimizable range: 5-80)
- high_offset = 1.054 (optimizable range: 0.99-1.1)
This means the price must be above 105.4% of the 99-period EMA to consider selling.
3.2 Design Logic Analysis
This offset system design embodies the "buy low, sell high" principle while providing flexibility through parameterization:
Conservative Design on the Buy Side:
- low_offset set to 0.978 requires price to be 97.8% of EMA
- This means waiting for a certain "discount" relative to the moving average
- In an uptrend, this typically corresponds to pullback entry opportunities
Aggressive Design on the Sell Side:
- high_offset set to 1.054 requires price to be 105.4% of EMA
- This means waiting for a certain "premium" relative to the moving average
- Ensures sufficient profit margin before executing a sale
IV. Entry Conditions Deep Dive
4.1 Entry Condition 1: Trend Pullback Buy
The first entry condition of ElliotV2 targets uptrend pullback opportunities:
(
dataframe['close'] < (ma_buy × low_offset) &
dataframe['EWO'] > ewo_high &
dataframe['rsi'] < rsi_buy &
dataframe['volume'] > 0
)
Condition Breakdown:
- Price Condition: Closing price below EMA × 0.978, ensuring relatively low entry
- EWO Condition: EWO > 4.471, confirming market is in a strong uptrend
- RSI Condition: RSI < 63, ensuring not in an excessively overbought zone for entry
- Volume Condition: Volume greater than 0, filtering invalid data
Logic Analysis:
This condition's design philosophy is "riding the trend on pullbacks." When EWO shows the market is in a strong upward phase, the price pulls back to below the EMA at a certain percentage, while RSI hasn't entered extreme overbought territory — this is when entry can capture the continuation of the uptrend.
This strategy performs excellently in trending markets, capturing the next wave of advances when pullbacks end. However, note that it may generate more false signals in choppy markets.
4.2 Entry Condition 2: Oversold Rebound Buy
The second entry condition targets oversold rebound opportunities:
(
dataframe['close'] < (ma_buy × low_offset) &
dataframe['EWO'] < ewo_low &
dataframe['volume'] > 0
)
Condition Breakdown:
- Price Condition: Closing price below EMA × 0.978
- EWO Condition: EWO < -13.043, confirming market is in a deep oversold state
- Volume Condition: Volume greater than 0
Logic Analysis:
This condition embodies the "mean reversion" strategy. When EWO falls below -13.043, it indicates the short-term moving average is significantly below the long-term moving average, and the market shows excessive panic or selling. Although the trend is downward at this point, the oversold degree is already extreme, and rebound probability is high.
Compared to the first condition, the second condition doesn't require RSI confirmation, because an extremely low EWO already implies market sentiment is extremely pessimistic, and RSI is likely also at low levels.
4.3 Complementary Nature of Entry Conditions
The two entry conditions form a complementary relationship:
- Condition 1 captures trend continuation, finding pullback opportunities in strong rallies
- Condition 2 captures oversold rebounds, finding reversal opportunities in extreme declines
This design enables the strategy to adapt to different market states — whether trending or reversing — with corresponding entry mechanisms.
V. Exit Conditions and Profit Strategies
5.1 Exit Signal Conditions
The exit conditions of ElliotV2 are relatively concise:
(
dataframe['close'] > (ma_sell × high_offset) &
dataframe['volume'] > 0
)
That is: the closing price above 99-period EMA × 1.054 triggers the exit signal.
Design Logic:
The strategy uses simple moving average deviation as the exit basis. When the price shows sufficient premium relative to EMA, considering the profit margin sufficient, it executes profit-taking.
This design's advantages:
- Simple and clear logic
- Ensures a minimum profit target
- Avoids premature exits in choppy markets
5.2 ROI Tiered Profit-Taking
Beyond signal-based exits, the strategy also configures tiered ROI targets:
minimal_roi = {
"0": 0.154, # Immediately: 15.4% target
"18": 0.074, # After 18 periods: 7.4% target
"50": 0.039, # After 50 periods: 3.9% target
"165": 0.02 # After 165 periods: 2% target
}
Tiered Logic Analysis:
This ROI configuration embodies the "the longer the time, the lower the target" strategy philosophy:
-
Immediate Stage: If 15.4% profit is achieved immediately after trading, execute the sell. This is typically rapid profit-taking when the trend is strong.
-
After 18 Periods: If the trade has been held for 18 periods, profit target drops to 7.4%. This considers the time cost and opportunity cost of capital.
-
After 50 Periods: Holding beyond 50 periods reduces the profit target further to 3.9%.
-
After 165 Periods: After approximately 7 days, only a 2% profit triggers a sell, avoiding prolonged capital occupation.
Coordination with Signal Exits:
The strategy sets ignore_roi_if_buy_signal = True, meaning if a buy signal still exists, ROI exits are ignored. This prevents premature exits when the trend is still continuing.
Additionally, sell_profit_only = True and sell_profit_offset = 0.01 ensure signal exits only occur when profit exceeds 1%.
VI. Risk Management System
6.1 Fixed Stop-Loss Settings
ElliotV2 sets a -17.9% fixed stop-loss:
stoploss = -0.179
This means the maximum loss per trade is limited to 17.9%. This is a relatively loose stop-loss setting, suitable for the high-volatility cryptocurrency market.
Considerations for Stop-Loss Width:
-
Cryptocurrency Volatility: Mainstream cryptocurrencies' daily volatility can reach 5-10%; too tight a stop-loss would cause frequent shakeouts.
-
Entry Logic Coordination: The strategy enters below EMA, inherently providing some price cushion. The 17.9% stop-loss provides space for normal price fluctuations.
-
Psychological Tolerance: For long-term holders, approximately 18% drawdown is an acceptable range.
6.2 Trailing Stop Mechanism
The strategy enables trailing stop functionality:
trailing_stop = True
trailing_stop_positive = 0.01
trailing_stop_positive_offset = 0.049
trailing_only_offset_is_reached = True
Trailing Stop Logic:
-
Activation Condition: Trailing stop only activates when profit reaches 4.9% (
trailing_only_offset_is_reached = True) -
Trailing Distance: After activation, the stop line follows price increases, always staying at 1% below the highest price
-
Protection Mechanism: Once the price retraces to touch the trailing stop line, an immediate sell executes, locking in profit
Example Illustration:
Assuming an entry price of 100 USDT:
- When profit reaches 4.9% (price at 104.9), trailing stop activates
- If price continues climbing to 110 (profit 10%), the stop line is at 110 × 0.99 = 108.9
- If price retraces to 108.9, a sell triggers, with actual profit approximately 8.9%
This mechanism maximizes profit in trending markets while protecting profit promptly upon reversal.
6.3 Risk Management Parameters Summary
| Parameter | Value | Description |
|---|---|---|
| Fixed Stop-Loss | -17.9% | Maximum loss per trade |
| Trailing Stop Activation | 4.9% Profit | Activates after reaching this threshold |
| Trailing Stop Distance | 1% | Distance of stop line from highest price |
| Signal Exit Threshold | 1% Profit | Only allows signal exits when profitable |
| ROI Time Decay | 15.4%→2% | Longer holding = lower target |
VII. Technical Indicator Overview
7.1 Core Indicators
EWO (Elliott Wave Oscillator)
- Calculation: EMA(50) - EMA(200), normalized and multiplied by 100
- Purpose: Judge trend direction and strength, identify wave turning points
EMA (Exponential Moving Average)
- Entry EMA period: 5-80 (default 31)
- Exit EMA period: 5-80 (default 99)
- Purpose: Price deviation baseline
RSI (Relative Strength Index)
- Period: 14
- Purpose: Confirm momentum state, prevent entry during excessive overbought
7.2 Auxiliary Indicators
While the strategy's core trading logic relies only on EWO, EMA, and RSI, the code defines rich auxiliary indicators for analysis and visualization:
Momentum Indicators: ADX, Plus/Minus DM and DI, Aroon and Aroon Oscillator, CCI, MFI, ROC
Volatility Indicators: Bollinger Bands, Keltner Channel
Candlestick Patterns: The strategy identifies 15+ candlestick patterns, including bullish (Hammer, Morning Star, Three White Soldiers), bearish (Hanging Man, Evening Star, Dark Cloud Cover), and neutral (Doji, Spinning Top, Engulfing)
Other: MACD, Parabolic SAR, TEMA, Heikin Ashi
7.3 Indicator Synergy
Auxiliary indicators primarily serve:
- Visualization Analysis: Display market state through Freqtrade's charting features
- Extensibility: Provide data foundations for future strategy optimization
- Debugging Reference: Offer multi-dimensional market perspectives in backtesting and live analysis
The core trading decisions rely only on EWO, EMA, and RSI, maintaining strategy simplicity and maintainability.
VIII. Parameter Optimization Guide
8.1 Optimizable Parameters Overview
| Parameter | Range | Default | Description |
|---|---|---|---|
| base_nb_candles_buy | 5-80 | 31 | Buy EMA period |
| base_nb_candles_sell | 5-80 | 99 | Sell EMA period |
| low_offset | 0.9-0.99 | 0.978 | Buy price offset |
| high_offset | 0.99-1.1 | 1.054 | Sell price offset |
| ewo_high | 2.0-12.0 | 4.471 | EWO high threshold |
| ewo_low | -20.0--8.0 | -13.043 | EWO low threshold |
| rsi_buy | 30-70 | 63 | RSI buy threshold |
8.2 Hyperopt Optimization Suggestions
Optimization Time Range:
- At least 6 months of historical data recommended
- Data should contain trending and choppy markets
- Avoid optimizing only for specific time periods
Parameter Tuning Strategy:
- First optimize buy parameters: Entry quality determines trade quality; prioritize optimizing the
buyspace - Then optimize sell parameters: After buy parameters stabilize, optimize
sellspace - Prevent overfitting: Use out-of-sample data to verify optimization results
- Consider trading costs: Factor in fees and slippage during optimization
8.3 Parameter Adjustments for Different Market Environments
Trending Markets:
- Lower
ewo_highthreshold to capture trends earlier - Raise
rsi_buyto allow higher RSI entries - Loosen
low_offsetto accept smaller pullbacks
Choppy Markets:
- Raise
ewo_highthreshold to reduce false signals - Lower
rsi_buyto require lower entry prices - Tighten
low_offsetto wait for larger discounts
High-Volatility Markets:
- Loosen stop-loss distance
- Raise trailing stop activation threshold
- Adjust ROI schedule
IX. Backtesting and Live Trading Suggestions
9.1 Backtesting Configuration Suggestions
Startup Candle Count:
startup_candle_count = 139
Ensure backtest data contains at least 139 candlesticks for correct indicator calculation.
Timeframe Settings:
- Primary: 5 minutes
- Auxiliary: 1 hour
- Backtest period: At least 3-6 months recommended
Trading Pair Selection:
- Mainstream coins: BTC/USDT, ETH/USDT
- Moderate volatility: Avoid extremely volatile coins
- Good liquidity: Ensure controllable slippage
9.2 Live Deployment Notes
Order Type Settings:
order_time_in_force = {
'buy': 'gtc', # Good Till Cancelled
'sell': 'ioc' # Immediate Or Cancel
}
Buy orders use GTC to ensure execution at the right price; sell orders use IOC to avoid locking unfavorable prices during rapid market changes.
New Candle Processing:
process_only_new_candles = True
The strategy processes signals only when a candle closes, avoiding misfirings caused by intra-candle price fluctuations.
9.3 Monitoring and Maintenance
Key Monitoring Indicators:
- Entry success rate (price movement after signal triggers)
- Maximum drawdown monitoring
- Stop-loss trigger frequency
- Trailing stop activation frequency
Regular Maintenance Suggestions:
- Monthly review of strategy performance
- Adjust parameters based on market changes
- Regularly rerun hyperopt optimization
X. Strategy Pros & Cons Analysis
10.1 Strategy Advantages
1. Solid Theoretical Foundation
- Based on Elliott Wave theory with complete theoretical support
- Wave identification helps understand market structure
2. Dual Entry Mechanism
- Trend pullback entries capture continuation moves
- Oversold rebound entries capture reversal opportunities
- Two mechanisms complement each other, adapting to various market states
3. Comprehensive Risk Management
- Fixed stop-loss protects capital
- Trailing stop locks in profits
- Tiered ROI controls time costs
4. Parameterized Design
- Key parameters are all optimizable
- Convenient adjustment for different markets
5. Clear Code Structure
- Core logic is concise and clear
- Easy to understand and modify
10.2 Potential Risks and Limitations
1. EWO Indicator Lag
- Based on EMA calculations, has some inherent lag
- May not react fast enough in rapid reversal markets
2. Choppy Market Performance Uncertainty
- Trend strategies easily generate false signals in choppy markets
- May experience frequent stop-losses
3. Wide Stop-Loss Distance
- 17.9% stop-loss may be too wide for conservative investors
- Individual losses may be significant
4. Parameter Sensitivity
- Optimal parameters may differ across markets and periods
- Requires regular optimization and adjustment
5. Dependence on Historical Data
- Requires sufficient historical data to calculate indicators
- May not apply to newly listed coins
10.3 Applicable Scenarios
Best For:
- Medium-long-term trending markets
- Mainstream coins with moderate volatility
- Timeframes above 5 minutes
Not Recommended For:
- Extremely volatile altcoins
- High-frequency trading scenarios
- Extreme market periods
XI. Summary and Outlook
11.1 Core Strategy Points Review
ElliotV2 is a trend-following strategy with the Elliott Wave Oscillator as its core. Its core points can be summarized as:
Entry Logic:
- Trend pullback entry: EWO high + low price + low RSI
- Oversold rebound entry: EWO extremely low + low price
Exit Logic:
- Signal exit: Price above EMA offset
- ROI exit: Tiered time targets
- Stop-loss exit: Fixed and trailing stop-loss
Risk Management:
- Fixed stop-loss: -17.9%
- Trailing stop: 4.9% activation, 1% trailing
- Signal exits only when profitable
11.2 Future Optimization Directions
Strategy Level:
- Add market state judgment, switching parameters between trending and choppy markets
- Introduce multi-timeframe confirmation to improve signal quality
- Add volume indicators as filters
Technical Level:
- Develop custom stop-loss functions
- Implement dynamic parameter adjustment mechanisms
- Add machine learning model-assisted decision-making
Operations Level:
- Establish regular parameter optimization mechanisms
- Improve monitoring and alerting systems
- Accumulate live trading data for strategy iteration
11.3 Conclusion
ElliotV2 combines classical Elliott Wave theory with modern quantitative trading, providing a well-structured, parameter-adjustable, and comprehensive risk-control trading framework. For quantitatively inclined traders with some experience, this strategy offers a good starting point and optimization space.
However, no strategy is universally applicable. In practical applications, adjustments should be made considering market environment, capital scale, and risk preference. It is recommended to gradually deploy live capital only after sufficient backtesting and simulated verification.
The path of trading is long and winding. May ElliotV2 become a valuable addition to your quantitative trading toolkit.