Strategy vault / Trend following
Multi EMA Trend Following Strategy with SMMA Confirmation
This strategy is a trend-following trading system based on multiple Exponential Moving Averages (EMAs) and Smoothed Moving Average (SMMA). It generates trading signals through the crossover of short-term and…

Overview
This strategy is a trend-following trading system based on multiple Exponential Moving Averages (EMAs) and Smoothed Moving Average (SMMA). It generates trading signals through the crossover of short-term and long-term EMAs, uses SMMA as a trend confirmation indicator, and incorporates additional EMA lines as support and resistance references. This approach enables both trend capture and effective control of false breakout risks.
Strategy Principle
The strategy employs 10-day and 22-day EMAs as primary signal lines, 200-day SMMA as a trend filter, along with 50-day, 100-day, and 200-day EMAs as auxiliary indicators. A buy signal is generated when the short-term EMA crosses above the long-term EMA and price is above the SMMA; a sell signal is generated when the short-term EMA crosses below the long-term EMA and price is below the SMMA. The additional three EMA lines provide further technical support and resistance reference points.
Strategy Advantages
- Multiple timeframe confirmation improves trading reliability
- SMMA integration effectively filters false breakout signals
- Additional EMA lines provide clear support and resistance reference points
- Simple and clear strategy logic, easy to understand and execute
- Complete trend-following mechanism ensures capture of major trend movements
Strategy Risks
- May generate frequent false signals in ranging markets
- Moving average crossover signals have inherent lag
- Multiple moving averages might create confusion in certain situations
- Potential for significant drawdowns in highly volatile markets
- Slow response to rapid market reversals
Strategy Optimization Directions
- Incorporate volatility indicators for position sizing
- Add volume confirmation mechanism
- Implement stop-loss and take-profit conditions for risk control
- Optimize moving average parameters for specific markets
- Consider adding trend strength filters
Summary
This is a trend-following strategy that integrates multiple moving average systems, capturing trends while controlling risks through the coordinated use of different period moving averages. The strategy's core strength lies in its multiple confirmation mechanism, though attention must be paid to its performance in ranging markets. Through appropriate parameter optimization and risk management, this strategy can achieve good results in trending markets.
Source Pine Script
/*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)Published by ChaoZhang on the FMZ strategy square · last modified 2024-12-12. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Multi-EMA-Trend-Following-Strategy-with-SMMA-Confirmation.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- EMA SMA Trend Following with Swing Trading Strategy Combined Volume Filter and Percentage Take Profit Stop Loss SystemPine Script · Trend following · 1d
- Fixed Range Volume Profile And Anchored VWAP Trend Identification Strategy With Dynamic Stop LossPine Script · Trend following · 1h
- Multi Factor Trend Price Action Strategy with Dynamic Risk Management SystemPine Script · Trend following · 2h
- Advanced Multi Indicator Trend Confirmation Trading StrategyPine Script · Trend following · 1d
- Multi Indicator Trend Following Strategy with ATR Dynamic Stop Loss Take ProfitPine Script · Trend following · 1d
- Dynamic Risk Managed EMA Crossover with Bollinger Bands StrategyPine Script · Trend following · 1d