
이 전략은 지수 이동 평균(EMA) 교차와 이치모쿠 클라우드를 결합한 복합 거래 시스템입니다. EMA 크로스오버는 주로 트렌드 시작 신호를 포착하고 매수 기회를 확인하는 데 사용되는 반면, 이치모쿠 클라우드는 시장 전환점을 식별하고 매도 기회를 결정하는 데 사용됩니다. 다차원적 기술 지표의 조정된 협력을 통해 이러한 전략은 추세를 효과적으로 파악할 수 있을 뿐만 아니라 적절한 시기에 위험을 피할 수도 있습니다.
전략 운영 메커니즘은 주로 두 가지 핵심 부분으로 구성됩니다.
이 전략은 EMA 크로스오버와 이치모쿠 클라우드 차트의 유기적인 조합을 통해 추세 추적과 반전 캡처 기능을 모두 갖춘 거래 시스템을 구축합니다. 전략은 합리적으로 설계되었으며, 위험 통제가 제대로 갖춰져 있고, 실제 적용 가치가 좋습니다. 제안된 최적화 방향을 통해 전략을 더욱 개선할 수 있는 여지가 여전히 남아 있습니다. 실시간으로 적용할 경우, 백테스팅을 통해 적절한 매개변수 조합을 먼저 결정한 다음, 실제 시장 상황에 따라 동적으로 조정하는 것이 좋습니다.
/*backtest
start: 2019-12-23 08:00:00
end: 2025-01-04 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("EMA Crossover Buy + Ichimoku Cloud Sell Strategy", overlay=true)
// Input Parameters for the EMAs
shortEmaPeriod = input.int(9, title="Short EMA Period", minval=1)
longEmaPeriod = input.int(21, title="Long EMA Period", minval=1)
// Input Parameters for the Ichimoku Cloud
tenkanPeriod = input.int(9, title="Tenkan-Sen Period", minval=1)
kijunPeriod = input.int(26, title="Kijun-Sen Period", minval=1)
senkouSpanBPeriod = input.int(52, title="Senkou Span B Period", minval=1)
displacement = input.int(26, title="Displacement", minval=1)
// Calculate the EMAs
shortEma = ta.ema(close, shortEmaPeriod)
longEma = ta.ema(close, longEmaPeriod)
// Ichimoku Cloud Calculations
tenkanSen = ta.sma(close, tenkanPeriod)
kijunSen = ta.sma(close, kijunPeriod)
senkouSpanA = ta.sma(tenkanSen + kijunSen, 2)
senkouSpanB = ta.sma(close, senkouSpanBPeriod)
chikouSpan = close[displacement]
// Plot the EMAs on the chart
plot(shortEma, color=color.green, title="Short EMA")
plot(longEma, color=color.red, title="Long EMA")
// Plot the Ichimoku Cloud
plot(tenkanSen, color=color.blue, title="Tenkan-Sen")
plot(kijunSen, color=color.red, title="Kijun-Sen")
plot(senkouSpanA, color=color.green, title="Senkou Span A", offset=displacement)
plot(senkouSpanB, color=color.purple, title="Senkou Span B", offset=displacement)
plot(chikouSpan, color=color.orange, title="Chikou Span", offset=-displacement)
// Buy Condition: Short EMA crosses above Long EMA
buyCondition = ta.crossover(shortEma, longEma)
// Sell Condition: Tenkan-Sen crosses below Kijun-Sen, and price is below the cloud
sellCondition = ta.crossunder(tenkanSen, kijunSen) and close < senkouSpanA and close < senkouSpanB
// Plot Buy and Sell signals
plotshape(series=buyCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=sellCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Execute Buy and Sell Orders
if (buyCondition)
strategy.entry("Buy", strategy.long)
if (sellCondition)
strategy.entry("Sell", strategy.short)
// Optional: Add Stop Loss and Take Profit (risk management)
stopLossPercentage = input.float(1.5, title="Stop Loss Percentage", minval=0.1) / 100
takeProfitPercentage = input.float(3.0, title="Take Profit Percentage", minval=0.1) / 100
longStopLoss = close * (1 - stopLossPercentage)
longTakeProfit = close * (1 + takeProfitPercentage)
shortStopLoss = close * (1 + stopLossPercentage)
shortTakeProfit = close * (1 - takeProfitPercentage)
strategy.exit("Take Profit/Stop Loss", "Buy", stop=longStopLoss, limit=longTakeProfit)
strategy.exit("Take Profit/Stop Loss", "Sell", stop=shortStopLoss, limit=shortTakeProfit)