
이 전략은 지수 이동 평균 ((EMA) 의 이중 교차 원리에 기초하여 동적 스톱 메커니즘을 결합하여 설계되었습니다. 전략은 10일 EMA와 20일 EMA의 금포크/죽음포크를 주요 거래 신호로 사용하고 50일 EMA를 트렌드 필터로 사용하고 10일 EMA를 동적 스톱 라인으로 사용합니다. 가격이 50일 EMA 상위와 10일 EMA를 통과하면 구매 신호가 발생하고, 가격이 50일 EMA를 넘어 10일 EMA를 통과하면 판매 신호가 발생합니다.
이 전략은 EMA 이중 교차와 동적 상쇄를 결합하여 트렌드 추적과 위험 통제의 균형을 이룬다. 핵심 장점은 명확한 논리 구조와 직관적인 시각적 디자인으로 중저 주파수 거래 시나리오에 적합하다. 미래에 더 많은 차원의 시장 데이터를 도입하여 안정성을 더욱 향상시킬 수 있습니다.
/*backtest
start: 2024-04-24 00:00:00
end: 2025-04-23 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"DOGE_USDT"}]
*/
//@version=5
//@description Ovtlyer EMA Crossover price over 50 Indicator
//@author YourName
strategy("EMA Crossover Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Input EMA lengths
length10 = input.int(10, minval=1, title="10 EMA Length")
length20 = input.int(20, minval=1, title="20 EMA Length")
length50 = input.int(50, minval=1, title="50 EMA Length")
// Calculate EMAs
ema10 = ta.ema(close, length10)
ema20 = ta.ema(close, length20)
ema50 = ta.ema(close, length50)
// Bullish Condition: 10 EMA crosses above 20 EMA AND price is above 50 EMA
bullishCondition = ta.crossover(ema10, ema20) and close > ema50
// Bearish Condition: 10 EMA crosses below 20 EMA AND price is below 50 EMA
bearishCondition = ta.crossunder(ema10, ema20) and close < ema50
// Track the current market state
var isBullish = false
var isBearish = false
if (bullishCondition)
isBullish := true
isBearish := false
if (bearishCondition)
isBearish := true
isBullish := false
// Exit conditions
bullishExit = isBullish and close < ema10
bearishExit = isBearish and close > ema10
// Plot EMAs
plot(ema10, title="10 EMA", color=color.rgb(0, 255, 0), linewidth=3) // Thick green line for 10 EMA
plot(ema20, title="20 EMA", color=color.rgb(0, 150, 255), linewidth=2) // Medium blue line for 20 EMA
plot(ema50, title="50 EMA", color=color.rgb(255, 165, 0), linewidth=1) // Thin orange line for 50 EMA
// Strategy Entry and Exit
if (bullishCondition)
strategy.entry("Long", strategy.long)
if (bearishCondition)
strategy.entry("Short", strategy.short)
if (bullishExit)
strategy.close("Long")
if (bearishExit)
strategy.close("Short")
// Plot Entry Signals (for visualization)
plotshape(bullishCondition, title="Bullish Signal",
location=location.belowbar, style=shape.triangleup,
size=size.small, color=color.green)
plotshape(bearishCondition, title="Bearish Signal",
location=location.abovebar, style=shape.triangledown,
size=size.small, color=color.red)
// Plot Exit Signals (for visualization)
plotshape(bullishExit, title="Bullish Exit",
location=location.abovebar, style=shape.xcross,
size=size.small, color=color.orange)
plotshape(bearishExit, title="Bearish Exit",
location=location.belowbar, style=shape.xcross,
size=size.small, color=color.purple)