
이 전략은 다중 지수 이동 평균 (EMA) 과 이동 평균 (SMMA) 을 기반으로 한 트렌드 추적 거래 시스템입니다. 단기 및 장기 EMA의 교차를 사용하여 거래 신호를 생성하고 SMMA를 트렌드 확인 지표로 사용하고 추가 EMA 라인을 지원 및 저항 지점에 대한 참조로 도입합니다. 이 방법은 시장의 추세를 포착하고 가짜 돌파구를 초래하는 위험을 효과적으로 제어 할 수 있습니다.
이 전략은 10일과 22일 EMA를 주요 신호선으로, 200일 SMMA를 트렌드 필터로, 그리고 50일, 100일, 200일 EMA를 보조 판단으로 사용한다. 단기 EMA가 상향으로 장기 EMA를 가로지르고 가격이 SMMA 위에 있을 때, 시스템은 다중 신호를 발생시킨다. 단기 EMA가 하향으로 장기 EMA를 가로지르고 가격이 SMMA 아래에 있을 때, 시스템은 공백 신호를 발생시킨다.
이 전략은 다중 평균선 시스템을 통합한 트렌드 추적 전략으로, 다른 주기 평균선을 조합하여 트렌드를 포착하고 위험을 제어 할 수 있습니다. 전략의 핵심 장점은 다중 확인 메커니즘에 있습니다. 그러나 동시에 흔들리는 시장에서의 성능을 주의해야합니다. 합리적인 매개 변수 최적화 및 위험 관리를 통해 이 전략은 트렌드 시장에서 좋은 효과를 얻을 수 있습니다.
/*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)