
이 전략은 9일과 15일 지수 이동 평균을 계산하여, EMA 골드 포크와 데드 포크가 형성된 구매 및 판매 신호를 식별하여, 일간 단선 거래에 사용한다. 9EMA 상에서 15EMA를 뚫고, 가장 최근의 K 라인이 양선일 때 구매 신호를 생성한다. 9EMA 아래에서 15EMA를 뚫고, 가장 최근의 K 라인이 음선일 때 판매를 생성한다.
이 전략은 다음과 같은 장점을 가지고 있습니다.
이 전략에는 위험도 있습니다.
대책:
이 전략은 다음과 같은 부분에서 최적화될 수 있습니다.
이 전략은 트렌드 방향을 판단하는 이중 EMA 지표와 K선 엔티티 필터 신호를 통합하고, ATR 동적 스톱로스를 적용하여, 간단한 실용적인 일일 스킬렛 거래 전략이다. 파라미터 최적화 및 다중 요소 조합을 통해 전략의 안정성과 수익성을 더욱 향상시킬 수 있다.
/*backtest
start: 2023-01-17 00:00:00
end: 2024-01-23 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("EMA Scalping Strategy", shorttitle="EMAScalp", overlay=true)
// Input parameters
ema9_length = input(9, title="9 EMA Length")
ema15_length = input(15, title="15 EMA Length")
// Calculate EMAs
ema9 = ta.ema(close, ema9_length)
ema15 = ta.ema(close, ema15_length)
// Plot EMAs on the chart
plot(ema9, color=color.blue, title="9 EMA")
plot(ema15, color=color.red, title="15 EMA")
// Identify Bullish and Bearish candles
bullish_candle = close > open
bearish_candle = close < open
// Bullish conditions for Buy Signal
buy_condition = ta.crossover(close, ema9) and ema15 < ema9 and bullish_candle
// Bearish conditions for Sell Signal
sell_condition = ta.crossunder(close, ema9) and ema15 > ema9 and bearish_candle
// Plot Buy and Sell signals
plotshape(series=buy_condition, title="Buy Signal", color=color.green, style=shape.triangleup, location=location.belowbar)
plotshape(series=sell_condition, title="Sell Signal", color=color.red, style=shape.triangledown, location=location.abovebar)
// Optional: Add stop-loss levels
atr_length = input(14, title="ATR Length for Stop Loss")
atr_multiplier = input(1.5, title="ATR Multiplier for Stop Loss")
atr_value = ta.atr(atr_length)
stop_loss_level = strategy.position_size > 0 ? close - atr_multiplier * atr_value : close + atr_multiplier * atr_value
plot(stop_loss_level, color=color.gray, title="Stop Loss Level", linewidth=2)
// Strategy rules
if (buy_condition)
strategy.entry("Buy", strategy.long)
strategy.exit("Exit Buy", from_entry="Buy", loss=stop_loss_level)
if (sell_condition)
strategy.entry("Sell", strategy.short)
strategy.exit("Exit Sell", from_entry="Sell", loss=stop_loss_level)