Logo

dev-resources.site

for different kinds of informations.

Multi-EMA Trend Following Strategy with SMMA Confirmation

Published at
1/14/2025
Categories
strategy
trading
cryptocurrency
trend
Author
FMZQuant
Multi-EMA Trend Following Strategy with SMMA Confirmation

Image description

Overview
This strategy is a trend-following trading system based on multiple exponential moving averages (EMA) and smoothed moving averages (SMMA). It uses the crossover of short-term and long-term EMAs to generate trading signals, while using SMMA as a trend confirmation indicator and introducing additional EMA lines as references for support and resistance levels. This method can capture market trends while effectively controlling the risks of false breakouts.

Strategy Principle
The strategy uses the 10-day and 22-day EMA as the main signal lines, the 200-day SMMA as a trend filter, and the 50-day, 100-day and 200-day EMA as auxiliary judgments. When the short-term EMA crosses the long-term EMA upward and the price is above the SMMA, the system generates a long signal; when the short-term EMA crosses the long-term EMA downward and the price is below the SMMA, the system generates a short signal. The additional three EMA lines provide more technical support and resistance level references for trading.

Strategy Advantages

  1. Multiple time frame validation increases trading reliability
  2. The introduction of SMMA effectively filters out false breakthrough signals
  3. Additional EMA lines provide clear support and resistance levels for trading
  4. The strategy logic is simple and clear, easy to understand and execute
  5. The complete trend tracking mechanism ensures that the big trend can be captured

Strategy Risks

  1. Frequent false signals may occur in volatile markets
  2. The moving average crossover signal has a certain lag
  3. The use of multiple moving averages can be confusing in some cases
  4. In a volatile market, large retracements may occur
  5. Slow response to rapid market reversals

Strategy Optimization Direction

  1. Introducing volatility indicators to adjust position size
  2. Add transaction volume confirmation mechanism
  3. Add stop loss and take profit conditions to control risk
  4. Optimize moving average parameters to make them more suitable for specific markets
  5. Consider adding a trend strength filter

Summary
This is a trend tracking strategy that integrates multiple moving average systems. By using different period moving averages together, it can capture trends and control risks. The core advantage of the strategy lies in its multiple confirmation mechanism, but it also needs to pay attention to its performance in a volatile market. Through reasonable parameter optimization and risk management, this strategy can achieve good results in a trending market.

Strategy source code

/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-10 08:00:00
period: 2d
basePeriod: 2d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("EMA Crossover with SMMA and Additional EMAs", overlay=true)

// Input parameters for EMAs and SMMA
emaShortLength = input.int(10, title="Short EMA Length")
emaLongLength = input.int(22, title="Long EMA Length")
smmaLength = input.int(200, title="SMMA Length")

// Additional EMA lengths
ema1Length = input.int(50, title="EMA 1 Length")
ema2Length = input.int(100, title="EMA 2 Length")
ema3Length = input.int(200, title="EMA 3 Length")

// Calculate EMAs and SMMA
emaShort = ta.ema(close, emaShortLength)
emaLong = ta.ema(close, emaLongLength)
smma = ta.sma(ta.sma(close, smmaLength), 2) // SMMA approximation
ema1 = ta.ema(close, ema1Length)
ema2 = ta.ema(close, ema2Length)
ema3 = ta.ema(close, ema3Length)

// Plot EMAs and SMMA on the chart
plot(emaShort, color=color.blue, linewidth=2, title="Short EMA")
plot(emaLong, color=color.red, linewidth=2, title="Long EMA")
plot(smma, color=color.white, linewidth=2, title="SMMA")
plot(ema1, color=color.green, linewidth=1, title="EMA 1")
plot(ema2, color=color.purple, linewidth=1, title="EMA 2")
plot(ema3, color=color.yellow, linewidth=1, title="EMA 3")

// Buy condition: Short EMA crosses above Long EMA and price is above SMMA
buyCondition = ta.crossover(emaShort, emaLong) and close > smma

// Sell condition: Short EMA crosses below Long EMA and price is below SMMA
sellCondition = ta.crossunder(emaShort, emaLong) and close < smma

// Execute Buy order
if (buyCondition)
    strategy.entry("Buy", strategy.long)
    alert("Buy Signal: Short EMA crossed above Long EMA and price is above SMMA.", alert.freq_once_per_bar_close)

// Execute Sell order
if (sellCondition)
    strategy.entry("Sell", strategy.short)
    alert("Sell Signal: Short EMA crossed below Long EMA and price is below SMMA.", alert.freq_once_per_bar_close)

Strategy Parameters

Image description

The original address: https://www.fmz.com/strategy/474862

Featured ones: