
이 전략은 다중 주기 지수 이동 평균 (EMA), 상대적으로 강한 지표 (RSI) 및 이동 평균 동향 분산 지표 (MACD) 를 기반으로 한 트렌드 추적 거래 시스템입니다. 이 전략은 여러 EMA의 배열형태를 통해 시장의 흐름을 식별하고 RSI와 MACD의 동력을 결합하여 진입 시기를 최적화하며 EMA 기반의 중지 및 수익 방식을 사용하여 위험과 수익을 관리합니다.
전략은 5,14,34 및 55 주기의 EMA를 형성하는 “EMA 폭포” 형태를 사용하여 트렌드 방향을 판단합니다. 상승 추세에서는 EMA5> EMA14> EMA34> EMA55를 요구하고, 하향 추세에서는 반대입니다. MACD 라인이 0축을 통과하고 RSI가 50 이상 (다중) 또는 50 이하 (공백) 에있을 때 거래 신호를 유발합니다.
이것은 합리적으로 설계된 트렌드 추적 전략으로, 다수의 기술적 지표의 조합으로 거래의 신뢰성을 보장하고, 위험의 효과적인 통제를 실현한다. 전략이 흔들리는 시장에서 좋지 않은 성능을 보일 수 있지만, 권장된 최적화 방향으로 인해 그것의 적응성과 안정성을 더욱 향상시킬 수 있다. 실물 거래에서는 먼저 충분한 재검토와 파라미터 최적화를 수행하고, 특정 시장 특성에 따라 타겟 조정하는 것이 좋습니다.
/*backtest
start: 2024-02-19 00:00:00
end: 2025-02-16 08:00:00
period: 4h
basePeriod: 4h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("EMA + MACD + RSI Strategy", overlay=true)
// Parametreler
length5 = 5
length14 = 14
length34 = 34
length55 = 55
rsiLength = 14
macdShort = 12
macdLong = 26
macdSignal = 9
// EMA Hesaplamaları
ema5 = ta.ema(close, length5)
ema14 = ta.ema(close, length14)
ema34 = ta.ema(close, length34)
ema55 = ta.ema(close, length55)
// RSI Hesaplaması
rsi = ta.rsi(close, rsiLength)
// MACD Hesaplaması
[macdLine, signalLine, _] = ta.macd(close, macdShort, macdLong, macdSignal)
macdZeroCross = ta.crossover(macdLine, 0) or ta.crossunder(macdLine, 0)
// Alış ve Satış Koşulları
longCondition = ema5 > ema14 and ema14 > ema34 and ema34 > ema55 and macdZeroCross and rsi > 50
shortCondition = ema5 < ema14 and ema14 < ema34 and ema34 < ema55 and macdZeroCross and rsi < 50
// Plotlar
plot(ema5, color=color.blue, linewidth=1)
plot(ema14, color=color.green, linewidth=1)
plot(ema34, color=color.red, linewidth=1)
plot(ema55, color=color.orange, linewidth=1)
plot(rsi, title="RSI", color=color.purple, linewidth=1, style=plot.style_line)
// Alış ve Satış Sinyalleri
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
// Stop-loss ve Take-profit hesaplamaları
stopLoss = ema34
takeProfit = stopLoss * 3
// Stop-loss ve Take-profit Stratejisi
strategy.exit("Exit Long", from_entry="Long", stop=stopLoss, limit=takeProfit)
strategy.exit("Exit Short", from_entry="Short", stop=stopLoss, limit=takeProfit)