NotAnotherSMAOffsetStrategy Strategy Analysis
Strategy Number: #23 (23rd of 465 strategies)
Strategy Type: SMA Offset + EWO Trend Following
Timeframe: 5 minutes (5m)
I. Strategy Overview
NotAnotherSMAOffsetStrategy is a trend following strategy based on SMA offset, developed by @Rallipanos. The strategy name self-deprecatingly says "Not Another" (yet another), indicating this is another variant among many SMA strategies, but captures deep pullbacks through offset, combined with EWO (Elliot Wave Oscillator) to confirm trends.
Core Features
| Feature | Description |
|---|---|
| Entry Conditions | 3 modes (EWO high + EWO low + EWO very low) |
| Exit Conditions | Multi-condition combination (SMA9 + EMA + RSI) |
| Protection | Trailing stop + Confirm trade exit |
| Timeframe | 5 minutes |
| Dependencies | TA-Lib, technical, numpy |
| Special Features | SMA offset trading, EWO confirmation |
II. Strategy Configuration Analysis
2.1 Base Risk Parameters
# ROI exit table
minimal_roi = {
"0": 0.215, # Immediate exit: 21.5% profit
"40": 0.032, # After 40 minutes: 3.2% profit
"87": 0.016, # After 87 minutes: 1.6% profit
"201": 0, # After 201 minutes: exit at breakeven
}
# Stoploss setting
stoploss = -0.35 # -35% hard stoploss (very loose)
# Trailing stop
trailing_stop = True
trailing_stop_positive = 0.005 # 0.5% trailing activation
trailing_stop_positive_offset = 0.03 # 3% offset trigger
trailing_only_offset_is_reached = True
Design Logic:
- High ROI: First-level 21.5% ROI, expecting to capture large trends
- Very Loose Stoploss: -35% hard stoploss, giving extreme room for fluctuation
- Trailing Stop: 0.5% trailing activates after 3% profit
III. Entry Conditions Explained
3.1 Entry Logic (3 Modes)
Mode 1: EWO High Pullback
(
(rsi_fast < 35) &
(close < ma_buy_14 * low_offset_0.975) &
(EWO > ewo_high_2.327) &
(rsi < rsi_buy_69) &
(volume > 0) &
(close < ma_sell_24 * high_offset_0.991)
)
Mode 2: EWO High Deep Pullback
(
(rsi_fast < 35) &
(close < ma_buy_14 * low_offset_2_0.955) &
(EWO > ewo_high_2_-2.327) &
(rsi < rsi_buy_69) &
(volume > 0) &
(close < ma_sell_24 * high_offset_0.991) &
(rsi < 25)
)
Mode 3: EWO Low Pullback
(
(rsi_fast < 35) &
(close < ma_buy_14 * low_offset_0.975) &
(EWO < ewo_low_-20.988) &
(volume > 0) &
(close < ma_sell_24 * high_offset_0.991)
)
Logic Analysis:
- RSI Fast Oversold: RSI(4) < 35, confirming short-term oversold
- SMA Offset Buy: Price below SMA × offset (e.g., 0.975), capturing deep pullbacks
- EWO Confirmation: EWO high or low, confirming wave position
- Volume Filter: Exclude abnormal volume
IV. Exit Logic Explained
4.1 Technical Sell Signals
Mode 1: SMA9 + EMA Offset
(
(close > sma_9) &
(close > ma_sell_24 * high_offset_2_0.997) &
(rsi > 50) &
(volume > 0) &
(rsi_fast > rsi_slow)
)
Mode 2: HMA + EMA Offset
(
(close < hma_50) &
(close > ma_sell_24 * high_offset_0.991) &
(volume > 0) &
(rsi_fast > rsi_slow)
)
4.2 Confirm Trade Exit
def confirm_trade_exit(self, pair, trade, order_type, amount, rate, time_in_force, sell_reason, current_time, **kwargs) -> bool:
if sell_reason in ["sell_signal"]:
if (last_candle["hma_50"] * 1.149 > last_candle["ema_100"]) and (
last_candle["close"] < last_candle["ema_100"] * 0.951
):
return False # Block exit
return True
Purpose:
- Block premature exit based on HMA and EMA relationship
- Let profits run in trends
V. Risk Management Features
5.1 Very Loose Hard Stoploss
stoploss = -0.35 # -35%
Description: Very loose stoploss, giving extreme room for fluctuation, suitable for capturing large trends.
5.2 Trailing Stop
trailing_stop = True
trailing_stop_positive = 0.005
trailing_stop_positive_offset = 0.03
trailing_only_offset_is_reached = True
Working Mechanism:
- Trailing stop activates after 3% profit
- Exit triggers when 0.5% pullback from highest point
5.3 Confirm Trade Exit
if (hma_50 * 1.149 > ema_100) and (close < ema_100 * 0.951):
return False # Block exit
Purpose:
- Block premature exit based on HMA and EMA relationship
- Let profits run in trends
VI. Strategy Pros & Cons
✅ Advantages
- SMA Offset Trading: Captures deep pullbacks
- EWO Confirmation: Wave oscillator confirms trend
- Multi Entry Modes: 3 modes covering different scenarios
- Confirm Trade Exit: Blocks premature exit based on HMA/EMA
- Hyperopt Optimization: Supports Hyperopt for key parameters
- Trailing Stop: Locks profits, protects gains
⚠️ Limitations
- High Complexity: Multi-mode + multi-indicator, difficult to debug
- No BTC Correlation: Does not detect Bitcoin market trend
- Parameter Sensitive: Hyperopt results may overfit
- Very Loose Stoploss: -35% stoploss may cause significant losses in extreme conditions
- High Computation: Multi EMA + HMA + EWO increases computation
VII. Applicable Scenarios
| Market Environment | Recommended Configuration | Description |
|---|---|---|
| Ranging Market | Default configuration | SMA offset suitable for ranging markets |
| Uptrend | Default configuration | EWO + trailing stop performs well |
| Downtrend | Pause or light position | No long-term trend filter, easy to lose |
| High Volatility | Adjust parameters | May need to adjust stoploss threshold |
| Low Volatility | Adjust ROI | Lower ROI threshold for small moves |
VIII. Summary
NotAnotherSMAOffsetStrategy is a well-designed SMA offset strategy, its core value lies in:
- SMA Offset Trading: Captures deep pullbacks
- EWO Confirmation: Wave oscillator confirms trend
- Multi Entry Modes: 3 modes covering different scenarios
- Confirm Trade Exit: Blocks premature exit based on HMA/EMA
- Hyperopt Optimization: Supports Hyperopt for key parameters
- Trailing Stop: Locks profits, protects gains
For quantitative traders, this is an excellent SMA offset learning template. Recommendations:
- Use as an advanced case for learning SMA offset strategies
- Understand EWO wave oscillator usage
- Learn confirm trade exit application
- Note that hyperopt parameters may overfit, testthoroughly before live trading