이 전략은 9일과 20일 지수 이동 평균 ((EMA) 교차 신호에 기반한 트렌드 추적 거래 시스템이다. 빠른 EMA ((9일) 와 느린 EMA ((20일) 의 교차 관계를 모니터링하여 시장 트렌드 전환 시점을 포착한다. 이 전략은 프로그래밍 된 거래 방식을 채택하고 완전히 자동화 된 운영을 구현하여 인간의 감정적 간섭을 효과적으로 피할 수 있습니다.
전략의 핵심은 두 개의 다른 주기의 지수 이동 평균을 사용하여 트렌드 방향과 전환점을 식별하는 것입니다. 9일 EMA가 상향으로 20일 EMA를 통과했을 때, 시스템은 여러 신호를 냅니다. 9일 EMA가 하향으로 20일 EMA를 통과했을 때, 시스템은 빈 신호를 냅니다. 지수 이동 평균은 최신 가격에 더 큰 무게를 부여하고, 가격 변화에 더 빨리 반응하여 트렌드 전환 시점을 파악하는 데 도움이됩니다.
이 전략은 클래식 트렌드 추적 시스템으로, EMA를 통해 트렌드 전환 기회를 잡습니다. 전략 논리는 간단하고 명확하며 이해하기 쉽고 실행이 쉽습니다. 그러나 실장 거래에서는 다른 기술 지표와 자금 관리 방법을 결합하여 거래 시스템을 더 개선하는 것이 좋습니다. 동시에, 다양한 시장 특성에 따라 매개 변수를 최적화하면 전략의 실용성을 향상시킬 수 있습니다.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-04 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("EMA Crossover Strategy with Buttons", overlay=true)
// Input parameters for EMAs
shortEmaLength = input(9, title="Short EMA Length")
longEmaLength = input(20, title="Long EMA Length")
// Calculate EMAs
shortEma = ta.ema(close, shortEmaLength)
longEma = ta.ema(close, longEmaLength)
// Plot EMAs
plot(shortEma, color=color.blue, title="9 EMA")
plot(longEma, color=color.red, title="20 EMA")
// Buy and Sell Logic
longCondition = ta.crossover(shortEma, longEma)
shortCondition = ta.crossunder(shortEma, longEma)
// Buy Button
if (ta.change(longCondition))
if (longCondition)
strategy.entry("Buy", strategy.long)
// Sell Button
if (ta.change(shortCondition))
if (shortCondition)
strategy.entry("Sell", strategy.short)
// Alert Conditions
alertcondition(longCondition, title="Buy Alert", message="Buy Signal")
alertcondition(shortCondition, title="Sell Alert", message="Sell Signal")