Skip to main content

SMAOPv1_TTF Strategy In-Depth Analysis

Strategy ID: #357 (357th of 465 strategies)
Strategy Type: SMA Offset + TTF Trend Trigger + EWO Protection Combination
Timeframe: 5 minutes (5m) + 1 hour (1h) informational layer


I. Strategy Overview

SMAOPv1_TTF is a multi-condition trend-following strategy that combines SMA Offset, Trend Trigger Factor (TTF), and Elliott Wave Oscillator (EWO). The strategy identifies entry opportunities through price deviation from moving averages, uses EWO for trend filtering, and employs TTF as a dynamic exit signal, building a complete trend trading system.

Core Features

FeatureDescription
Buy Conditions2 independent buy signals, can trigger entry independently
Sell Conditions2 base sell signals + trailing stop mechanism
Protection MechanismsTriple protection: EWO filter + RSI constraint + trailing stop
TimeframeMain timeframe 5m + informational timeframe 1h
Dependenciestalib, numpy, qtpylib, technical

II. Strategy Configuration Analysis

2.1 Basic Risk Parameters

# ROI exit table
minimal_roi = {
"0": 0.10, # 10% profit immediately
"30": 0.05, # Drops to 5% after 30 minutes
"60": 0.02 # Drops to 2% after 60 minutes
}

# Stop loss setting
stoploss = -0.10 # Fixed stop loss at 10%

# Trailing stop
trailing_stop = True
trailing_stop_positive = 0.001
trailing_stop_positive_offset = 0.01
trailing_only_offset_is_reached = True

Design Philosophy:

  • ROI table uses a stepped declining design, initial target of 10%, gradually reducing profit expectations as holding time increases
  • Stop loss set at 10%, appropriate for the high volatility of cryptocurrency markets
  • Trailing stop activates after 1% profit, locking in 0.1% positive profit to protect gains

2.2 Order Type Configuration

use_sell_signal = True          # Enable sell signals
sell_profit_only = True # Only sell when profitable
sell_profit_offset = 0.01 # Sell profit offset 1%
ignore_roi_if_buy_signal = True # Ignore ROI when buy signal active

III. Buy Conditions Detailed Analysis

3.1 Optimizable Parameter Groups

The strategy provides multiple optimizable parameters through Hyperopt:

Parameter TypeParameter NameDefault ValueOptimization Range
MA Periodbase_nb_candles_buy165-80
Buy Offsetlow_offset0.9780.9-0.99
EWO High Thresholdewo_high5.6382.0-12.0
EWO Low Thresholdewo_low-19.993-20.0 to -8.0
RSI Buy Thresholdrsi_buy6130-70
TTF Periodttf_length151-50
TTF Upper Triggerttf_upperTrigger1001-400
TTF Lower Triggerttf_lowerTrigger-100-400 to -1

3.2 Buy Conditions Analysis

Condition #1: Trend Continuation Buy

# Logic
- Price below offset MA (close < ma_buy * low_offset)
- EWO at high level (EWO > ewo_high), indicating strong trend
- RSI not overbought (RSI < rsi_buy)
- Volume greater than 0

Interpretation: This condition captures pullback opportunities in an uptrend. When price falls below the offset MA, if EWO shows the trend remains strong and RSI is not overheated, it's a quality entry point.

Condition #2: Trend Reversal Buy

# Logic
- Price below offset MA (close < ma_buy * low_offset)
- EWO at low level (EWO < ewo_low), indicating oversold
- Volume greater than 0

Interpretation: This condition captures oversold bounce opportunities. When EWO is at extreme lows, the market may be oversold, presenting bounce opportunities.

3.3 Buy Condition Classification

Condition GroupCondition #Core Logic
Trend Continuation#1Pullback buy + trend confirmation
Reversal Capture#2Oversold buy + bounce expectation

IV. Sell Logic Detailed Analysis

4.1 ROI Take Profit System

The strategy employs a stepped ROI take profit mechanism:

Holding Time      Target Profit
────────────────────────
0 minutes 10%
30 minutes 5%
60 minutes 2%

4.2 Trailing Stop Mechanism

Activation      Profit Offset    Locked Profit
──────────────────────────────
Profit > 1% 0.1% Current profit - 0.1%

4.3 Sell Signals (2 signals)

Signal #1: SMA Offset Sell

# Sell signal 1: Offset MA breakout
- Price above offset MA (close > ma_sell * high_offset)
- Volume greater than 0

Interpretation: When price breaks above the offset MA, it's considered trend overheating, triggering profit taking.

Signal #2: TTF Trend Trigger Sell

# Sell signal 2: TTF crosses above trigger line
- TTF indicator crosses above 100 trigger line
- Volume greater than 0

Interpretation: TTF (Trend Trigger Factor) crossing above 100 indicates buying power has reached an extreme, suggesting potential reversal - a good time for profit taking.


V. Technical Indicator System

5.1 Core Indicators

Indicator CategorySpecific IndicatorPurpose
TrendEMA (Exponential Moving Average)Offset buy/sell line calculation
OscillatorEWO (Elliott Wave Oscillator)Trend strength assessment
MomentumRSI (Relative Strength Index)Overbought/oversold filtering
TrendTTF (Trend Trigger Factor)Trend extreme identification

5.2 TTF Indicator Detailed Analysis

TTF (Trend Trigger Factor) is the core innovative indicator of this strategy:

def ttf(df, ttf_length):
buyPower = high.rolling(ttf_length).max() - low.shift(ttf_length).min()
sellPower = high.shift(ttf_length).max() - low.rolling(ttf_length).min()
ttf = 200 * (buyPower - sellPower) / (buyPower + sellPower)
return ttf

Calculation Logic:

  • Buying Power: Current period's highest price - previous period's lowest price
  • Selling Power: Previous period's highest price - current period's lowest price
  • TTF Value: Normalized to -100 to +100 range

Interpretation: TTF > 100 indicates extremely strong buying power, possibly overheated; TTF < -100 indicates extremely strong selling power, possibly oversold.

5.3 Informational Timeframe Indicators (1h)

The strategy uses 1 hour as an informational layer, providing higher-dimensional trend assessment:

  • Supports 1-hour level trend confirmation
  • Can be used for multi-timeframe analysis

VI. Risk Management Features

6.1 Triple Buy Filtering

Filter LayerIndicatorFunction
First LayerEWOTrend direction confirmation
Second LayerRSIOverbought/oversold filtering
Third LayerVolumeLiquidity assurance

6.2 Dynamic Trailing Stop

trailing_stop = True
trailing_stop_positive = 0.001
trailing_stop_positive_offset = 0.01
trailing_only_offset_is_reached = True

Protection Logic:

  • Trailing stop activates after 1% profit
  • Stop line follows price increase, locking 99.9% of profit
  • Effectively protects existing gains

6.3 Only Sell When Profitable

sell_profit_only = True
sell_profit_offset = 0.01

Interpretation: The strategy only responds to sell signals when at least 1% profitable, avoiding exits during small losses.


VII. Strategy Advantages and Limitations

✅ Advantages

  1. Multi-dimensional Entry Assessment: Combines SMA offset, EWO, RSI triple filtering for more reliable entry signals
  2. Trend and Reversal Balance: Two buy conditions capture trend continuation and reversal opportunities
  3. Dynamic Exit Mechanism: TTF indicator provides trend extreme identification, combined with ROI and trailing stop for flexible exits
  4. Large Optimization Space: 11 tunable parameters, suitable for different market conditions

⚠️ Limitations

  1. High Parameter Sensitivity: Many tunable parameters, high overfitting risk
  2. Informational Timeframe Underutilized: Although 1h informational layer is defined, actual application in code is limited
  3. TTF Indicator Less Common: Limited community validation, real trading performance needs further observation
  4. Ranging Market Performance Questionable: Offset strategies may produce frequent false signals in sideways consolidation

VIII. Applicable Scenario Recommendations

Market EnvironmentRecommended ConfigurationNotes
UptrendRaise ewo_highTrend continuation signals more effective
DowntrendLower ewo_lowReversal signals need more extreme conditions
Ranging MarketUse with cautionRecommend reducing position size or pausing
High Volatility CoinsAppropriately widen stop lossGive price more room to fluctuate

IX. Applicable Market Environment Details

SMAOPv1_TTF is a trend-following strategy combining SMA offset and TTF trend trigger. Based on its code architecture and community experience, it performs best in clear trending markets, while potentially underperforming in sideways consolidation markets.

9.1 Strategy Core Logic

  • SMA Offset Entry: Enter when price falls below MA by certain percentage, waiting for reversion
  • EWO Trend Filtering: Use EWO to assess current trend strength, avoid counter-trend trading
  • TTF Dynamic Exit: Exit promptly when TTF reaches extremes to prevent profit giveback

9.2 Performance in Different Market Environments

Market TypePerformance RatingAnalysis
📈 Uptrend⭐⭐⭐⭐⭐SMA offset captures pullbacks, TTF timely exits
🔄 Ranging Market⭐⭐☆☆☆Frequent offset line touches, many false signals
📉 Downtrend⭐⭐☆☆☆EWO low threshold can catch bounces, but higher risk
⚡ High Volatility⭐⭐⭐☆☆Trailing stop protects profits, but may be triggered frequently

9.3 Key Configuration Recommendations

Configuration ItemRecommended ValueNotes
base_nb_candles_buy16-30Shorter period for faster pace, longer for stability
low_offset0.95-0.98Larger offset = more conservative entry
ttf_upperTrigger80-120Higher = more aggressive profit taking

X. Important Note: The Cost of Complexity

10.1 Learning Cost

The strategy involves non-standard indicators like EWO and TTF, requiring time to understand their calculation logic and meaning.

10.2 Hardware Requirements

Trading PairsMinimum MemoryRecommended Memory
1-10 pairs2GB4GB
10-50 pairs4GB8GB

10.3 Backtesting vs Live Trading Differences

  • EWO and TTF performance in backtesting may differ from live trading
  • Recommend running on paper trading for at least 2 weeks
  • Note trailing stop slippage impact in extreme market conditions

10.4 Manual Trading Recommendations

  • Understand SMA offset concept: enter when price falls below MA by certain percentage
  • Watch for TTF > 100 extreme signals
  • EWO positive value indicates uptrend, negative indicates downtrend

XI. Summary

SMAOPv1_TTF is a trend-following strategy combining SMA offset, EWO trend filtering, and TTF dynamic exit. Its core value lies in:

  1. Multiple Filtering Mechanisms: SMA offset + EWO + RSI triple confirmation, reducing false signals
  2. Trend and Reversal Coverage: Two buy conditions cover different market phases
  3. Dynamic Exit System: TTF + ROI + trailing stop combination, protecting profits

For quantitative traders, this is a strategy suitable for trending markets, but requires parameter optimization for specific trading pairs and attention to risk control in ranging markets.