
This strategy is an advanced trend-following system that combines the Supertrend indicator with multiple momentum filters, designed specifically to capture strong trends. Its core utilizes the Supertrend indicator with dynamically adjusted ATR (Average True Range), complemented by EMA (Exponential Moving Average) and DEMA (Double Exponential Moving Average) as trend confirmation tools, while integrating RSI (Relative Strength Index) and volume filters to enhance entry signal credibility. The strategy features built-in ATR-based stop-loss, take-profit, and trailing stop mechanisms, offering parameter presets for multiple timeframes to accommodate different trading styles. Notably, the strategy includes intelligent re-entry logic that captures pullback opportunities during uptrends, effectively capturing continuation rallies.
The core principle of this strategy is based on a multi-layered signal confirmation mechanism, constructing a comprehensive trading decision framework:
Supertrend Core Signal System: Uses ATR to calculate dynamic trend bands, generating buy signals when the closing price breaks above the lower band (upflip) and sell signals when breaking below the upper band (downflip). ATR period and multiplier are adjustable to adapt to volatility in different market environments.
Momentum Confirmation Filter: Requires price to be above both short-term EMA (default 21-period) and long-term DEMA (default 200-period), ensuring trade direction aligns with the main trend and avoiding counter-trend trades.
Signal Strength Verification: Confirms price momentum through RSI (default >50) and market participation with volume greater than its EMA (default 20-period), improving entry signal quality.
Intelligent Re-entry Mechanism: During confirmed uptrends, the strategy re-enters when price pulls back and then crosses back above the EMA while meeting other conditions, effectively capturing opportunities in trend continuation.
Risk Management System:
Multi-timeframe Parameter Presets:
After in-depth analysis, this strategy demonstrates the following significant advantages:
Strong Adaptability: The Supertrend indicator dynamically adjusts based on ATR, automatically adapting to changes in market volatility and maintaining effectiveness across different market environments.
Multi-layer Confirmation Reduces False Signals: Multiple verifications through EMA, DEMA, RSI, and volume significantly reduce the risk of false signals, improving trade quality.
Intelligent Re-entry Captures Continuation Moves: The innovative re-entry logic allows re-entering after pullbacks during uptrends, effectively utilizing volatility within trends and improving capital efficiency.
Comprehensive Risk Management System: Built-in ATR-based stop-loss, take-profit, and trailing stop mechanisms both limit single trade losses and effectively protect accumulated profits, reducing drawdown risk.
Multi-timeframe Presets Simplify Operation: Preset parameters for different timeframes make the strategy easy to implement across various trading periods, accommodating different traders’ time preferences.
Visual Assistance Provides Clarity: Color-filled areas distinguish between uptrends and downtrends, combined with clear buy/sell signal markers, making market conditions immediately apparent and facilitating trading decisions.
Validated Through Backtesting: Shows approximately 60% win rate and profit factor greater than 4 on daily timeframes, particularly suitable for markets with distinct trends.
Despite its comprehensive design, the strategy still presents the following potential risks:
Underperformance in Choppy Markets: In range-bound markets without clear trends, stop-losses may be frequently triggered, resulting in accumulated small losses. The solution is to pause trading when market structure is unclear or increase the ATR multiplier to reduce signal sensitivity.
Filtering Conditions May Miss Opportunities: While multiple filtering conditions improve signal quality, they may cause missed opportunities in early trend stages. Traders should consider adjusting filter strictness based on personal risk preferences.
Parameter Sensitivity: ATR period and multiplier settings significantly impact strategy performance, with different market environments potentially requiring different parameters. Backtesting is recommended to optimize parameter settings for specific markets.
Drawdown Risk: Backtesting shows potentially large drawdowns (up to 100%+) when using full position sizing. Strict money management must be implemented, limiting risk to 1-2% per trade.
Historical Data Limitations: The strategy has primarily been backtested in specific markets and time periods, posing potential overfitting risk. More extensive testing across various markets and time periods is advisable before live implementation.
Lack of Testing in Extreme Market Conditions: The strategy may not have been tested under extreme situations such as severe market volatility or liquidity crises, making its performance under such conditions unknown.
Through deep code analysis, the strategy can be optimized in the following directions:
Adaptive Parameter Adjustment: Develop mechanisms to dynamically adjust ATR multipliers and periods based on market volatility, allowing the strategy to automatically adapt to changing market conditions. For example, increase ATR multiplier when volatility rises and decrease it when volatility falls.
Integrate Market State Classification: Introduce a market state recognition module (using Bollinger Band width, ADX, etc.) to automatically adjust strategy parameters or pause trading based on whether the market is trending or oscillating.
Multi-timeframe Analysis Framework: Add multi-timeframe analysis functionality, requiring higher timeframe trends to align with the current timeframe before executing trades, improving trend judgment accuracy.
Optimize Re-entry Logic: Refine re-entry conditions by considering Fibonacci retracement levels or key support confirmations to improve re-entry precision.
Money Management Optimization: Implement dynamic position sizing based on market volatility, account equity, and consecutive profit/loss status to automatically adjust position size and optimize equity curve performance.
Add Market Sentiment Indicators: Integrate market sentiment indicators such as the VIX index (volatility index) or volume change rates to adjust strategy behavior during market panic or excessive optimism.
Machine Learning Optimization: Utilize machine learning algorithms to optimize parameter selection and entry timing by training models on historical data to predict optimal trading parameter combinations.
The Multi-Timeframe Supertrend EMA Momentum Filtering Strategy is a well-designed trend-following system that establishes a comprehensive trading decision framework by combining the Supertrend indicator with multiple momentum filters. Its core strengths lie in strong adaptability, multi-layer confirmation to reduce false signals, intelligent re-entry to capture continuation moves, and a comprehensive risk management system. The strategy is particularly suitable for markets with clear trends, demonstrating good backtesting performance on daily timeframes.
However, the strategy may underperform in choppy markets and exhibits parameter sensitivity and potential drawdown risks. To further enhance strategy robustness, consider developing adaptive parameter adjustments, integrating market state classification, building multi-timeframe analysis frameworks, optimizing re-entry logic, improving money management approaches, adding market sentiment indicators, and applying machine learning techniques.
Ultimately, this strategy provides a technically rigorous framework with sound risk management for trend-following trading, but users should always remember the importance of risk control, limiting each trade’s risk to an acceptable range, and appropriately adjusting strategy parameters based on personal trading style and market environment.
/*backtest
start: 2024-08-15 00:00:00
end: 2025-08-13 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT"}]
*/
//@version=5
strategy("Supertrend EMA Strategy _V29", overlay=true, format=format.price, precision=2, initial_capital=1000)
// Inputs
tf_preset = input.string("Manual", title="Timeframe Preset", options=["Manual", "Auto-1H/4H", "Auto-1D", "Auto-1W"])
atr_period = input.int(10, title="ATR Period")
src = hl2
atr_multiplier = input.float(3.0, title="ATR Multiplier", step=0.1)
change_atr = input.bool(true, title="Change ATR Calculation Method?")
show_signals = input.bool(true, title="Show Buy/Sell Signals?")
highlighting = input.bool(true, title="Highlighter On/Off?")
ema_length = input.int(21, title="EMA Length")
dema_length = input.int(200, title="DEMA Length")
tp_multiplier = input.float(3.0, title="Take Profit Multiplier (ATR, 0=off)", step=0.5)
allow_long = input.bool(true, title="Allow Long Trades")
allow_short = input.bool(false, title="Allow Short Trades")
sl_multiplier = input.float(1.0, title="Stop Loss Multiplier (ATR, 0=off)", step=0.5)
use_vol_filter = input.bool(true, title="Use Volume Filter?")
vol_ema_length = input.int(20, title="Volume EMA Length", minval=1)
use_rsi_filter = input.bool(true, title="Use RSI Filter?")
rsi_length = input.int(14, title="RSI Length")
rsi_threshold = input.int(50, title="RSI Buy Threshold")
// Auto-adjust
int atr_period_final = atr_period
float atr_mult_final = atr_multiplier
string preset_label = tf_preset
if tf_preset == "Auto-1H/4H"
atr_period_final := 10
atr_mult_final := 3.0
preset_label := "1H/4H"
else if tf_preset == "Auto-1D"
atr_period_final := 14
atr_mult_final := 3.0
preset_label := "Daily"
else if tf_preset == "Auto-1W"
atr_period_final := 20
atr_mult_final := 4.0
preset_label := "Weekly"
// Show settings
if barstate.islast
label.new(x=bar_index[barstate.isrealtime ? 0 : 50], y=high, text="Preset: " + preset_label + "\nATR: " + str.tostring(atr_period_final) + "\nMult: " + str.tostring(atr_mult_final), color=color.white, style=label.style_label_left, textcolor=color.black, size=size.small, yloc=yloc.abovebar)
// Calculations
atr2 = ta.sma(ta.tr, atr_period_final)
atr = change_atr ? ta.atr(atr_period_final) : atr2
up = src - (atr_mult_final * atr)
up1 = nz(up[1], up)
up := close[1] > up1 ? math.max(up, up1) : up
dn = src + (atr_mult_final * atr)
dn1 = nz(dn[1], dn)
dn := close[1] < dn1 ? math.min(dn, dn1) : dn
trend = 1
trend := nz(trend[1], trend)
trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend
buy_signal = trend == 1 and trend[1] == -1
sell_signal = trend == -1 and trend[1] == 1
ema = ta.ema(close, ema_length)
ema1 = ta.ema(close, dema_length)
dema = 2 * ema1 - ta.ema(ema1, dema_length)
vol_ema = ta.ema(volume, vol_ema_length)
rsi = ta.rsi(close, rsi_length)
// Plots (global)
up_plot = plot(trend == 1 ? up : na, title="Up Trend", style=plot.style_linebr, linewidth=2, color=color.green)
dn_plot = plot(trend == -1 ? dn : na, title="Down Trend", style=plot.style_linebr, linewidth=2, color=color.red)
plot(dema, title="DEMA 200", color=color.blue, style=plot.style_linebr, linewidth=2)
plotshape(buy_signal ? up : na, title="UpTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.green)
plotshape(buy_signal and show_signals ? up : na, title="Buy", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green, textcolor=color.white)
plotshape(sell_signal ? dn : na, title="DownTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.red)
plotshape(sell_signal and show_signals ? dn : na, title="Sell", text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.red, textcolor=color.white)
m_plot = plot(ohlc4, title="", style=plot.style_circles, linewidth=1)
long_fill_color = highlighting ? (trend == 1 ? color.new(color.green, 90) : color.white) : color.white
short_fill_color = highlighting ? (trend == -1 ? color.new(color.red, 90) : color.white) : color.white
fill(m_plot, up_plot, title="UpTrend Highlighter", color=long_fill_color)
fill(m_plot, dn_plot, title="DownTrend Highlighter", color=short_fill_color)
plot(ema, title="EMA", color=color.blue, linewidth=2)
// Strategy Logic with Re-Entry (in if for skip)
var float entry_price = na
vol_condition = not use_vol_filter or volume > vol_ema
rsi_condition = not use_rsi_filter or rsi > rsi_threshold
buy_cond_met = buy_signal and close > ema and close > dema and allow_long and vol_condition and rsi_condition
re_entry_cond = trend == 1 and strategy.position_size == 0 and close[1] < ema and close > ema and close > dema and vol_condition and rsi_condition
sell_cond_met = sell_signal and strategy.position_size > 0 and (close < dema or true)
if buy_cond_met or re_entry_cond
strategy.entry("Long", strategy.long)
entry_price := close
if sell_cond_met
strategy.close("Long")
entry_price := na
if sell_signal and close < ema and close < dema and allow_short and vol_condition
strategy.entry("Short", strategy.short)
entry_price := close
if buy_signal and strategy.position_size < 0
strategy.close("Short")
entry_price := na
// SL & TP with Trailing
if strategy.position_size != 0 and not na(entry_price)
if sl_multiplier > 0
sl_price = strategy.position_size > 0 ? entry_price - (sl_multiplier * atr) : entry_price + (sl_multiplier * atr)
trail_condition = strategy.position_size > 0 ? (close - entry_price > atr) : (entry_price - close > atr)
trail_sl = strategy.position_size > 0 ? up : dn
final_sl = trail_condition ? trail_sl : sl_price
strategy.exit("SL Exit", stop=final_sl)
if tp_multiplier > 0
tp_price = strategy.position_size > 0 ? entry_price + (tp_multiplier * atr) : entry_price - (tp_multiplier * atr)
strategy.exit("TP Exit", limit=tp_price)
// Alerts
alertcondition(buy_signal, title="SuperTrend Buy", message="SuperTrend Buy!")
alertcondition(sell_signal, title="SuperTrend Sell", message="SuperTrend Sell!")
change_cond = trend != trend[1]
alertcondition(change_cond, title="SuperTrend Direction Change", message="SuperTrend has changed direction!")