
이 전략은 상대적으로 강하고 약한 지수 ((RSI) 지표를 사용하여 시장 과매매 상황을 판단합니다. RSI가 30 미만일 때 포지션을 더 많이 열고, 포지션 개시 가격의 98.5%로 중지 손실을 설정합니다. 이 전략의 주요 아이디어는 시장에서 과매매 신호가 발생했을 때 출장하고, 위험을 엄격히 제어하고, 가격이 중지 가격보다 떨어지면 즉시 포지션을 종료합니다.
RSI 중지 추적 거래 전략은 RSI 지표를 통해 과매매 상황을 판단하고, 동시에 고정 중지 비율을 엄격하게 제어합니다. 전체적인 아이디어는 간단하고 이해하기 쉽고, 초보자 학습에 적합합니다. 그러나이 전략은 지연성, 중지 장치의 단순성, 수익 수준이 높지 않은 문제도 있습니다. 실제 응용에서 지속적인 최적화 개선, 전략의 안정성 및 수익성을 향상시킬 필요가 있습니다.
/*backtest
start: 2024-02-01 00:00:00
end: 2024-02-29 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy('RSI Trading Bot', overlay=true)
// RSI threshold value and stop loss percentage
rsiThreshold = 30
stopLossPercentage = 1.5
// Calculate RSI
rsiLength = 14
rsiValue = ta.rsi(close, rsiLength)
// Initialize variables
var bool positionOpen = false
var float entryPrice = na
var float stopLossPrice = na
// Enter position when RSI crosses below threshold
if ta.crossunder(rsiValue, rsiThreshold)
strategy.entry('Long', strategy.long)
positionOpen := true
entryPrice := close
stopLossPrice := entryPrice * (1 - stopLossPercentage / 100)
stopLossPrice
// Exit position on stop loss
if positionOpen and close < stopLossPrice
strategy.close('Long')
positionOpen := false
entryPrice := na
stopLossPrice := na
stopLossPrice
// Plot entry and stop loss prices
plot(entryPrice, title='Entry Price', color=color.new(color.green, 0), linewidth=2)
plot(stopLossPrice, title='Stop Loss Price', color=color.new(color.red, 0), linewidth=2)