
이 전략은 상대적으로 약한 지수 ((RSI) 와 선형 회귀 통로 ((LRC) 의 두 가지 기술 지표를 결합하여 시장의 과매매와 과매매 기회를 잡기 위해 고안되었습니다. 가격이 선형 회귀 통로의 하단 궤도에 닿아 RSI 지수가 30 미만으로 떨어지면 전략은 구매 신호를 발산합니다. 가격이 선형 회귀 통로의 상단 궤도에 닿아 RSI 지수가 70 미만으로 떨어지면 전략은 판매 신호를 발산합니다.
이 전략의 핵심은 RSI 지표와 선형 회귀 통로이다. RSI는 최근 가격 변화의 폭과 방향을 측정하는 동력 지표이다. RSI가 30보다 낮으면 시장은 과매매 상태에 있다고 간주되며, RSI가 70보다 높으면 시장은 과매매 상태에 있다고 간주된다.
RSI와 선형 회귀 통로 거래 전략은 동력 지표와 트렌드 추적 지표를 결합하여 시장의 과매매 과매매 기회를 잡으려고합니다. 이 전략의 장점은 논리적으로 명확하고 구현하기 쉽고 다른 시간 프레임에 적용 될 수 있다는 것입니다. 그러나 전략에는 가짜 신호, 변수 민감성 및 위험 관리 부족 등과 같은 위험도 있습니다. 전략의 성능을 향상시키기 위해 더 많은 지표 최적화, 변수 설정, 위험 관리 조치 및 트렌드 필터를 추가하는 것을 고려 할 수 있습니다.
/*backtest
start: 2024-05-01 00:00:00
end: 2024-05-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("RSI and Linear Regression Channel Strategy", overlay=true)
// Define input parameters
rsiLength = input(14, title="RSI Length")
channelLength = input(100, title="Linear Regression Channel Length")
rsiBuyThreshold = 30
rsiSellThreshold = 70
// Calculate RSI
rsi = ta.rsi(close, rsiLength)
// Calculate Linear Regression Channel
basis = ta.linreg(close, channelLength, 0)
dev = ta.stdev(close, channelLength)
upperChannel = basis + dev
lowerChannel = basis - dev
// Plot Linear Regression Channel
plot(basis, color=color.blue, title="Basis")
plot(upperChannel, color=color.red, title="Upper Channel")
plot(lowerChannel, color=color.green, title="Lower Channel")
// Entry condition: Price touches lower channel and RSI crosses below buy threshold
longCondition = (close <= lowerChannel) and (rsi < rsiBuyThreshold)
// Exit condition: Price touches upper channel and RSI crosses above sell threshold
shortCondition = (close >= upperChannel) and (rsi > rsiSellThreshold)
// Strategy execution
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.close("Long")
// Plot buy/sell signals on the chart
plotshape(series=longCondition, location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=shortCondition, location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")