NotAnotherSMAOffSetStrategy_V2 Strategy Analysis
Chapter 1: Strategy Overview
1.1 Strategy Positioning and Design Philosophy
NotAnotherSMAOffSetStrategy_V2 is a quantitative trading strategy based on the Moving Average Offset concept, developed and optimized by trader @Rallipanos. The "Not Another" in its name hints that this is not a simple moving average crossover strategy, but rather uses an innovative offset mechanism to transform traditional trend-following indicators into precise price boundary detection tools.
The strategy's core design philosophy: markets are not always in perfect trend states, but frequently oscillate between overbought and oversold zones. By calculating the offset percentage of moving averages, the strategy precisely identifies key positions where price deviates from the mean, seeking buy opportunities when markets are excessively pessimistic and locking in profits when markets are overly optimistic.
1.2 Technical Architecture Overview
This strategy uses the Freqtrade framework's IStrategy interface, running on a 5-minute timeframe with 1-hour timeframe data for trend confirmation. The strategy integrates multiple classic technical indicators:
- Moving Average System: Combination of EMA (Exponential Moving Average) and SMA (Simple Moving Average)
- Elliott Wave Oscillator (EWO): Identifies market sentiment and potential reversal points
- RSI (Relative Strength Index): Multi-period RSI for momentum confirmation
- Volume Analysis: Dynamic volume baseline for market activity assessment
- Hull Moving Average (HMA): For rapid trend direction confirmation
1.3 Trading Style Positioning
This is a mean reversion trading strategy, characterized by:
- Direction: Long only, no shorting
- Holding Period: Short to medium-term, typically hours to days
- Risk Tolerance: Moderate, with -35% stop-loss
- Market Environment: Suitable for ranging markets and trend pullback scenarios
Chapter 2: Core Indicator System
2.1 Moving Average Offset System
Moving average offset is the strategy's most distinctive design. Traditional moving average strategies typically use price crossing the MA as a signal, but this strategy introduces an offset coefficient to transform the MA into a dynamic price channel.
Buy MA Offset Mechanism:
The strategy uses two sets of buy offset parameters:
low_offset: Default 0.975 — triggers buy when price falls below 97.5% of EMAlow_offset_2: Default 0.955 — triggers more aggressive buy when price falls below 95.5% of EMA
Sell MA Offset Mechanism:
Similarly, two sets of sell offset parameters:
high_offset: Default 0.998 — may trigger sell when price exceeds 99.8% of EMAhigh_offset_2: Default 1.0 — confirms sell when price equals or exceeds EMA
This offset mechanism advantages:
- Avoids the lag of traditional MA crossover
- Provides clear entry price boundaries
- Parameters can be auto-adjusted via optimizer for different markets
2.2 Elliott Wave Oscillator (EWO) Deep Analysis
EWO is the strategy's core auxiliary indicator, calculated as:
EWO = (EMA_short - EMA_long) / Low × 100
Default parameters:
fast_ewo: 50 (short EMA period)slow_ewo: 200 (long EMA period)
EWO Value Market Interpretation:
| EWO Range | Market State | Strategy Interpretation |
|---|---|---|
| High positive (>2.327) | Strong upward momentum | Trend may be overheating, pullback is buying opportunity |
| Low positive or near zero | Trend unclear | Stay on sidelines |
| Low negative (<-8) | Oversold state | Potential rebound opportunity |
| Extremely low (<-20.988) | Extremely oversold | Strong rebound possible |
The strategy uses three EWO threshold parameters:
ewo_high: 2.327 (default), identifies strong pullback buy opportunitiesewo_high_2: -2.327 (default), for special buy signalsewo_low: -20.988 (default), for extreme oversold buys
2.3 RSI Multi-Period Analysis System
The strategy builds a three-layer RSI analysis system:
Main RSI (14-period):
- Primary momentum judgment indicator
- Buy threshold default 69 (optimizable 30-70)
- Judges overall momentum state
Fast RSI (4-period):
- Short-term momentum fast feedback
- Fixed threshold 35, identifies short-term oversold
- Fast response, suitable for capturing entry timing
Slow RSI (20-period):
- Long-term momentum trend reference
- Used with Fast RSI together
- Fast RSI crossing above Slow RSI is potential sell signal
2.4 Dynamic Volume Baseline System
Volume is a key indicator for validating price behavior effectiveness. The strategy uses an innovative volume baseline calculation:
vol_7_max = volume.rolling(window=20).max()
vol_7_min = volume.rolling(window=20).min()
roll_7 = 100 × (volume - vol_7_max) / (vol_7_max - vol_7_min)
vol_base = SMA(roll_7, timeperiod=5)
Volume Baseline Interpretation:
vol_base > -20: Active volume, high market participation-77 > vol_base > -96: Moderate-low volume, suitable for specific buy signalsvol_base < -96: Extremely low volume, avoid trading
The strategy also calculates 26-period and 100-period volume moving averages for long-term volume trend judgment.
Chapter 3: Entry Signal Details
3.1 EWO1 Buy Signal
EWO1 is the strategy's primary buy signal, with trigger conditions:
Condition combination:
1. vol_base > -96 and vol_base < -77 (volume in moderate-low zone)
2. rsi_fast < 35 (short-term momentum oversold)
3. close < ma_buy × low_offset (price below buy MA offset position)
4. EWO > ewo_high (EWO shows upward momentum)
5. rsi < rsi_buy (main RSI not at overbought)
6. close < ma_sell × high_offset (price hasn't reached sell channel)
7. volume > 0 (volume verification)
Signal Characteristics:
This signal captures deep pullbacks in strong trends. EWO is positive and high, indicating the market is in an uptrend, but price has deeply pulled back (below MA offset), RSI fast drops to oversold, and volume is relatively shrinking — often the final shakeout before trend resumption.
3.2 EWO2 Buy Signal
EWO2 is the strategy's aggressive buy signal, with stricter trigger conditions:
Condition combination:
1. vol_base > -96 and vol_base < -77 (moderate-low volume)
2. rsi_fast < 35 (short-term oversold)
3. close < ma_buy × low_offset_2 (price below deeper offset, default 95.5%)
4. EWO > ewo_high_2 (default -2.327)
5. rsi < rsi_buy
6. close < ma_sell × high_offset
7. volume > 0
8. rsi < 25 (additional condition: main RSI extremely oversold)
Signal Characteristics:
EWO2 captures rebound opportunities after extreme panic selling. Price must be below 95.5% of MA, and RSI must be below 25 (extremely oversold), indicating extreme market pessimism. Such extremes often come with strong technical rebounds.
3.3 EWO3 Buy Signal
EWO3 targets abnormally active volume scenarios:
Condition combination:
1. vol_base > -96 and vol_base > -20 (active volume)
2. rsi_fast < 35 (short-term oversold)
3. close < ma_buy × low_offset
4. EWO > ewo_high
5. rsi < rsi_buy
6. volume > 0
7. close < ma_sell × high_offset
Signal Characteristics:
When volume is active (vol_base > -20), the market is often in high volatility. The oversold signal here may indicate testing of important support levels and rebound. This signal is suitable for capturing short-term reversals in high-volatility markets.
3.4 EWOLow Buy Signal
EWOLow is designed for extreme oversold markets:
Condition combination:
1. vol_base > -96 and vol_base < -77
2. rsi_fast < 35
3. close < ma_buy × low_offset
4. EWO < ewo_low (default -20.988, extremely negative)
5. volume > 0
6. close < ma_sell × high_offset
Signal Characteristics:
When EWO is at extreme negative values (below -20.988), the market is in extreme oversold. This is a typical bottom-fishing signal, but high risk. The strategy reduces risk through volume limits and price position verification. Such signals typically appear after panic selling, with higher rebound probability but requiring strict risk control.
Chapter 4: Exit Signal Details
4.1 Exit Signal Architecture
The strategy uses a dual exit signal system combining two independent conditions via OR logic:
Condition A (Trend Continuation Exit):
1. close > sma_9 (price above 9-period simple moving average)
2. close > ma_sell × high_offset_2 (price above sell MA offset position)
3. rsi > 50 (momentum restored to above neutral)
4. volume > 0
5. rsi_fast > rsi_slow (fast RSI above slow RSI)
Condition B (Trend Reversal Warning Exit):
1. close < hma_50 (price below 50-period Hull moving average)
2. close > ma_sell × high_offset (price still above sell channel)
3. volume > 0
4. rsi_fast > rsi_slow
4.2 Exit Signal Deep Analysis
Condition A — Trend Continuation:
This signal captures profit-taking at target zones. Price rebounds above SMA-9, touches sell channel upper edge, RSI recovers above 50, indicating the rebound has begun and momentum is healthy. Fast RSI crossing above slow RSI confirms sustained momentum. This is an ideal profit-taking timing.
Condition B — Trend Reversal Warning:
This signal identifies potential reversal risk after rebound. Price is still above sell channel, but has fallen below HMA_50 — an early trend reversal warning. HMA is known for low lag; when price breaks below HMA_50, it may signal exhaustion of upward momentum. Exiting here avoids potential subsequent declines.
4.3 Exit Confirmation Mechanism (confirm_trade_exit)
The strategy implements confirm_trade_exit for secondary confirmation after exit signal triggers:
Situations blocking exit:
Situation 1: Trend still strong
- hma_50 > ema_100 (short-term trend up)
- rsi < 45 (momentum not overheated)
→ Exit signal rejected, continue holding
Situation 2: False breakout risk
- hma_50 × 1.149 > ema_100 (short-term still near long-term trend)
- close < ema_100 × 0.951 (price below 95.1% of long-term MA)
→ May be false breakout, reject exit
This secondary confirmation ensures trades aren't ended prematurely, especially locking in profits when trends are strong without missing larger gains.
Chapter 5: Risk Management System
5.1 Stop-Loss Mechanism
The strategy uses a composite stop-loss system:
Hard Stop-Loss:
stoploss = -0.35 # Maximum loss 35%
This is a relatively loose stop-loss, primarily considering the strategy's mean reversion characteristics — prices may experience significant declines before rebounding.
Trailing Stop:
trailing_stop = True
trailing_stop_positive = 0.005 # Trail distance 0.5%
trailing_stop_positive_offset = 0.025 # Activation threshold 2.5%
trailing_only_offset_is_reached = True # Activate only after threshold
Trailing stop working:
- Activates when profit reaches 2.5%
- Stop price follows highest price, maintaining 0.5% distance
- Price retraces over 0.5% triggers sell
This design ensures:
- Maximize profits in trending markets
- Lock in gains on reversal
- Avoid being stopped out by volatility
5.2 ROI Target Management
The strategy uses tiered ROI targets:
minimal_roi = {
"0": 0.215, # Immediate target: 21.5%
"40": 0.032, # After 40 minutes: 3.2%
"87": 0.016, # After 87 minutes: 1.6%
"201": 0 # After 201 minutes: accept any positive
}
5.3 Exit Signal Filtering Mechanism
sell_profit_only = True # Only execute exit signals when profitable
sell_profit_offset = 0.01 # Minimum profit 1%
This ensures the strategy won't sell at a loss due to technical signals; losses can only exit via stop-loss or ROI.
Chapter 6: Parameter Optimization System
6.1 Optimizable Parameters Overview
Buy Parameter Space:
| Parameter | Type | Range | Default | Description |
|---|---|---|---|---|
| base_nb_candles_buy | Int | 5-80 | 14 | Buy MA period |
| low_offset | Decimal | 0.9-0.99 | 0.975 | Buy offset coefficient |
| low_offset_2 | Decimal | 0.9-0.99 | 0.955 | Aggressive buy offset coefficient |
| ewo_high | Decimal | 2.0-12.0 | 2.327 | EWO high threshold |
| ewo_high_2 | Decimal | -6.0-12.0 | -2.327 | EWO high threshold 2 |
| ewo_low | Decimal | -20.0--8.0 | -20.988 | EWO low threshold |
| rsi_buy | Int | 30-70 | 69 | RSI buy threshold |
Sell Parameter Space:
| Parameter | Type | Range | Default | Description |
|---|---|---|---|---|
| base_nb_candles_sell | Int | 5-80 | 24 | Sell MA period |
| high_offset | Decimal | 0.95-1.1 | 0.998 | Sell offset coefficient |
| high_offset_2 | Decimal | 0.99-1.5 | 1.0 | Aggressive sell offset coefficient |
Chapter 7: Strategy Execution Flow
7.1 Initialization Stage
On strategy startup:
- Load historical data:
startup_candle_count = 200 - Set timeframes: Main 5 minutes, auxiliary 1 hour
- Pre-calculate MAs: Pre-calculate EMA values for all possible periods (5-80)
7.2 Indicator Calculation Stage (populate_indicators)
Each new candle:
- Calculate buy MAs in batch
- Calculate sell MAs in batch
- Calculate trend indicators (HMA_50, EMA_100)
- Calculate momentum indicators (EWO, RSI series)
- Calculate volume indicators
7.3 Entry Signal Generation (populate_entry_trend)
Signal generation priority:
- Check EWO1 conditions first (main signal)
- If EWO1 not met, check EWO3 (active volume scenario)
- If EWO3 not met, check EWO2 (aggressive signal)
- Finally check EWOLow (extreme oversold signal)
7.4 Exit Signal Generation (populate_exit_trend)
Exit signals use OR logic combining two independent conditions.
Chapter 8: Strategy Pros & Cons
8.1 Advantages
- Innovative MA offset mechanism: Transforms MAs into dynamic price channels, identifying overbought/oversold earlier
- Multi-dimensional signal verification: Each buy signal requires 6-8 conditions, significantly reducing false signals
- Flexible signal classification: Four independent buy signals cover different market states
- Smart exit confirmation: Secondary confirmation prevents premature exits during strong trends
- Complete trailing stop: Locks in profits in trending markets while controlling drawdowns
8.2 Limitations
- Single-direction trading: Long only, cannot profit in bear markets
- Wide stop-loss: 35% hard stop-loss may be too loose for risk-averse traders
- Parameter sensitivity: Many optimizable parameters require thorough backtesting
- Ranging market dependency: Performs best in ranging markets, may underperform in strong trending markets
- Timeframe limitations: 5-minute timeframe requires high trading frequency and monitoring
Chapter 9: Live Application Advice
9.1 Market Environment Selection
Best suited for:
- Ranging or range-bound markets
- Moderate volatility but not extreme one-sided trends
- Moderate-volume major trading pairs
Not suited for:
- Extreme bear markets or sustained declines
- Low-liquidity markets
- Extreme high volatility markets (major news events)
9.2 Risk Control Advice
- Position sizing: No single trade exceeds 5-10% of total capital
- Diversification: Run multiple trading pairs simultaneously, diversify risk
- Regular checks: Monitor strategy performance, adjust parameters if needed
- Stop-loss discipline: Strictly execute stop-loss, avoid manual intervention
- Capital management: Maintain sufficient margin, avoid liquidation risk
Chapter 10: Comparison with Other Strategies
| Feature | This Strategy | Traditional MA Strategy |
|---|---|---|
| Entry signal | Offset percentage trigger | Price/MA crossover |
| Lag | Lower | Higher |
| Signal frequency | Medium | Low |
| Suitable market | Ranging | Trending |
| Parameter count | Many | Few |
Chapter 11: Summary
11.1 Core Value
NotAnotherSMAOffSetStrategy_V2 represents an innovative direction in applying traditional technical indicators. Its core value:
- Innovation: Combines traditional MA with offset mechanism, creating new entry logic
- Systematic: Multi-dimensional signal verification reduces false signals
- Flexibility: Rich optimizable parameters adapt to different markets
- Completeness: Complete trading system from entry to exit, from stop-loss to trailing
11.2 Suitable Users
- Traders with some quantitative trading experience
- Those who understand MA systems and momentum indicators
- Willing to do backtesting and optimization
- Accepting mean reversion trading philosophy
Document Version: v1.0 Last Updated: 2024 Strategy Author: @Rallipanos