
이 전략은 3개의 서로 다른 주기의 지수 이동 평균 (EMA) 와 상대적으로 약한 지수 (RSI) 를 포함한 여러 기술 지표를 결합하여, 이들 사이의 관계를 분석하여 잠재적인 매매 신호를 식별한다. 이 전략의 주요 아이디어는, 단기, 중기, 그리고 장기 EMA의 교차를 사용하여 트렌드 방향을 결정하고, 동시에 RSI를 사용하여 가능한 휴가를 필터링하는 것이다.
이 전략은 세 개의 다른 주기의 EMA와 RSI 지표를 결합하여 간단한 효과적인 트렌드 추적 거래 시스템을 형성한다. 그것은 EMA를 사용하여 트렌드 방향을 식별하고 RSI를 통해 가능한 가짜 신호를 필터링하여 트렌드를 포착하면서 위험을 통제한다. 이 전략에는 파라미터 최적화 위험과 트렌드 역전 위험과 같은 몇 가지 제한이 있지만, 다이내믹 파라미터 선택, 다른 필터 조건을 추가하고 스톱 스톱 전략을 개선하는 등의 추가적인 최적화를 통해 전략의 적응성과 건전성을 향상시킬 수 있으며, 더 완벽한 신뢰할 수있는 거래 시스템으로 만들 수 있습니다.
/*backtest
start: 2023-06-11 00:00:00
end: 2024-06-16 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © fitradn
//@version=4
//@version=4
strategy("EMA & RSI Strategy with 200 EMA", shorttitle="EMARSI200", overlay=true)
// Input for EMAs
shortEmaLength = input(4, title="Short EMA Length")
longEmaLength = input(12, title="Long EMA Length")
longTermEmaLength = input(48, title="Long Term EMA Length")
// Calculate EMAs
shortEma = ema(close, shortEmaLength)
longEma = ema(close, longEmaLength)
longTermEma = ema(close, longTermEmaLength)
// Plot EMAs
plot(shortEma, color=color.blue, title="Short EMA")
plot(longEma, color=color.red, title="Long EMA")
plot(longTermEma, color=color.orange, title="200 EMA")
// Input for RSI
rsiLength = input(14, title="RSI Length")
overbought = input(70, title="Overbought Level")
oversold = input(30, title="Oversold Level")
// Calculate RSI
rsi = rsi(close, rsiLength)
// Buy and Sell Conditions
buySignal = crossover(shortEma, longEma) and rsi < overbought and close > longTermEma
sellSignal = crossunder(shortEma, longEma) and rsi > oversold and close < longTermEma
// Execute Trades
if (buySignal)
strategy.entry("Buy", strategy.long)
if (sellSignal)
strategy.entry("Sell", strategy.short)
// Plot Buy and Sell Signals
plotshape(series=buySignal, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Signal")
plotshape(series=sellSignal, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal")