
이 전략은 상대적으로 강한 지수 ((RSI) 와 슈퍼트렌드 두 가지의 기술 지표를 결합하여 시장 추세를 포착하고 잠재적인 거래 기회를 식별합니다. 전략의 주요 아이디어는 RSI를 사용하여 시장의 과매매 및 과매매 상태를 판단하고, 동시에 슈퍼트렌드 지표를 사용하여 트렌드 방향을 확인합니다. RSI와 슈퍼트렌드 지표가 특정 조건을 동시에 충족하면 전략은 구매 또는 판매 신호를 발생시킵니다.
RSI+Supertrend 트렌드 추적 거래 전략은 RSI와 Supertrend의 두 가지 기술 지표를 결합하여 시장 추세를 효과적으로 포착하고 거래 신호를 생성합니다. 전략의 장점은 논리적으로 명확하고 실행하기 쉽고 동력과 트렌드 요소를 고려합니다. 그러나 전략에는 빈번한 거래와 매개 변수 설정의 한계와 같은 몇 가지 위험이 있습니다. 전략의 성능을 더욱 향상시키기 위해 다른 지표를 도입하고 매개 변수를 최적화하고 위험 관리 조치를 강화하고 지속적인 모니터링과 조정을 수행하는 것이 고려 될 수 있습니다.
/*backtest
start: 2024-05-21 00:00:00
end: 2024-05-28 00:00:00
period: 45m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("RSI + Supertrend Strategy", overlay=true)
// Input parameters
rsiLength = input.int(14, title="RSI Length")
rsiOverbought = input.int(58, title="RSI Overbought Level")
rsiOversold = input.int(38, title="RSI Oversold Level")
supertrendLength = input.int(10, title="Supertrend Length")
supertrendMultiplier = input.int(3, title="Supertrend Multiplier")
// Calculate indicators
rsiValue = ta.rsi(close, rsiLength)
[supertrend, _] = ta.supertrend(supertrendLength, supertrendMultiplier)
// Plot Supertrend on main chart
plot(supertrend, color = supertrend < close ? color.green : color.red, linewidth = 2, title="Supertrend")
// Plot RSI
hline(rsiOverbought, "Overbought", color.red)
hline(rsiOversold, "Oversold", color.green)
plot(rsiValue, title="RSI", color=color.blue)
// Strategy
var float entryPrice = na
// Long conditions
longCondition = (rsiValue > rsiOverbought) and (supertrend < close)
// Short conditions
shortCondition = (rsiValue < rsiOversold) and (supertrend > close)
// Exit conditions
longExitCondition = (rsiValue < 50) and (supertrend > close)
shortExitCondition = (rsiValue > 45) and (supertrend < close)
// Execute strategy
if (longCondition)
strategy.entry("Long", strategy.long)
entryPrice := close
if (shortCondition)
strategy.entry("Short", strategy.short)
entryPrice := close
if (longExitCondition and strategy.position_size > 0)
strategy.close("Long")
if (shortExitCondition and strategy.position_size < 0)
strategy.close("Short")
// Date and time range for backtest
startDate = timestamp("2023-01-01 00:00")
endDate = timestamp("2024-01-01 00:00")
if (time < startDate or time > endDate)
strategy.close_all()