该策略是一个基于多重指数移动平均线(EMA)和平滑移动平均线(SMMA)的趋势跟踪交易系统。它利用短期与长期EMA的交叉来产生交易信号,同时使用SMMA作为趋势确认指标,并引入了额外的EMA线作为支撑与阻力位的参考。这种方法既能捕捉市场趋势,又能有效控制假突破带来的风险。
策略采用了10日和22日EMA作为主要信号线,200日SMMA作为趋势过滤器,同时配合50日、100日和200日EMA作为辅助判断。当短期EMA向上穿越长期EMA,且价格位于SMMA之上时,系统产生做多信号;当短期EMA向下穿越长期EMA,且价格位于SMMA之下时,系统产生做空信号。额外的三条EMA线则为交易提供了更多的技术支撑和阻力位参考。
这是一个融合了多重均线系统的趋势跟踪策略,通过不同周期均线的配合使用,既能捕捉趋势,又能控制风险。策略的核心优势在于其多重确认机制,但同时也需要注意在震荡市场中的表现。通过合理的参数优化和风险管理,该策略能够在趋势市场中取得不错的效果。
/*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)