
이 전략은 RSI 지표와 두 개의 EMA 선의 교차 신호를 기반으로 매도 시점을 판단한다. 매도 가격이 EMA100과 EMA20을 넘어 RSI 값이 30보다 낮으면 매도 신호를 발생시키고 매도 가격이 EMA100과 EMA20을 넘어 RSI 값이 70보다 높으면 매도 신호를 발생시킨다. 이 전략의 주요 아이디어는 RSI 지표를 사용하여 매도 상황을 판단하고 EMA 선의 추세 판단과 결합하여 시장의 변동적 낮은 점과 높은 점을 포착하기 위해 낮은 점과 높은 점의 파업 작업을 수행한다.
RSI와 쌍 EMA 교차 신호량화 전략은 RSI 지표와 EMA 평행선을 결합하여 변동적 상황의 높은 낮은 지점을 더 잘 포착하여 차분 하차 할 수 있는 간단한 실용적인 양적 거래 전략이다. 그러나 이 전략은 또한 몇 가지 제한과 위험이 있습니다.
/*backtest
start: 2024-03-01 00:00:00
end: 2024-03-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("RSI-EMA100&20 Buy/Sell Signal", overlay=true)
// Input parameters
rsiLength = input.int(14, "RSI Length")
emaCloseLength = input.int(100, "EMA Length (Closing Price)")
emaLowLength = input.int(20, "EMA Length (Low Price)")
oversoldLevel = input.int(30, "Oversold Level")
overboughtLevel = input.int(70, "Overbought Level")
// Calculate RSI
rsi = ta.rsi(close, rsiLength)
// Calculate EMA of closing price
emaClose = ta.ema(close, emaCloseLength)
// Calculate EMA of low price
emaLow = ta.ema(low, emaLowLength)
// Determine overbought and oversold conditions
isOversold = rsi <= oversoldLevel
isOverbought = rsi >= overboughtLevel
// Plot RSI and its EMAs
plot(rsi, color=color.blue, title="RSI")
plot(emaClose, color=color.green, title="EMA 100 (Closing Price)")
plot(emaLow, color=color.orange, title="EMA 20 (Low Price)")
// Strategy entry condition: Closing price is below both EMAs and RSI is less than or equal to oversold level
buySignal = close < emaClose and close < emaLow and isOversold
// Plot buy signals
plotshape(series=buySignal, style=shape.triangleup, location=location.abovebar, color=color.green, size=size.small)
// Strategy entry
if (buySignal)
strategy.entry("Buy", strategy.long)
// Strategy exit condition: Price crosses above both EMAs and RSI is greater than or equal to overbought level
sellSignal = close > emaClose and close > emaLow and isOverbought
// Plot sell signals
plotshape(series=sellSignal, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
// Strategy exit
if (sellSignal)
strategy.entry("Sell", strategy.short)
// Plot sell signals
plotshape(series=sellSignal, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
// Strategy exit
if (sellSignal)
strategy.entry("Sell", strategy.short)