
이 전략은 주로 상대적으로 강한 지수 ((RSI) 를 이용하여 시장의 과매매 상황을 판단하고, 가격과 200일 간단한 이동 평균 ((SMA) 의 위를 트렌드 필터 조건으로 결합하여, 진입 여부를 결정한다. 이 전략은 트리플 RSI 지표를 통해 공동으로 포지션 개시 조건을 구축하고, 단기 RSI가 35보다 작고 3회 연속으로 하향 경향을 보이고 있는 경우에만, 3회 주기 RSI가 60보다 작고, 현재 종결 시점은 200일 SMA의 위에 있을 때만, 더 많이 한다. 평형 포지션 조건은 RSI가 50을 넘어서야 한다.
이 전략은 트리플 RSI를 통해 포지션 개시 조건을 구성하고, 가격과 함께 장기 평균선 위에 트렌드 필터로 사용하여 오버셀 역전 상황을 포착한다. 전략 논리는 간단하고 구현하기 쉽고 최적화된다. 그러나 전략에는 신호 지연, 거래 빈도가 낮고 일방적인 상황을 포착 할 수있는 위험과 부족이 존재하며 실제 응용에서 계속 조정 및 개선이 필요합니다.
/*backtest
start: 2023-05-15 00:00:00
end: 2024-05-14 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
//@author Honestcowboy
//
strategy("Triple RSI [Honestcowboy]" )
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >>
// ---------> User Inputs <----------- >>
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >>
rsiLengthInput = input.int(5, minval=1, title="RSI Length", group="RSI Settings")
rsiSourceInput = input.source(close, "Source", group="RSI Settings")
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >>
// ---------> VARIABLE CALCULATIONS <----------- >>
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >>
up = ta.rma(math.max(ta.change(rsiSourceInput), 0), rsiLengthInput)
down = ta.rma(-math.min(ta.change(rsiSourceInput), 0), rsiLengthInput)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >>
// ---------> CONDITIONALS <----------- >>
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >>
rule1 = rsi<35
rule2 = rsi<rsi[1] and rsi[1]<rsi[2] and rsi[2]<rsi[3]
rule3 = rsi[3]<60
rule4 = close>ta.sma(close, 200)
longCondition = rule1 and rule2 and rule3 and rule4
closeCondition = rsi>50
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >>
// ---------> GRAPHICAL DISPLAY <----------- >>
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >>
hline(30, title="Long Condition Line")
hline(50, title="Exit Condition Line")
plot(rsi)
plotshape(longCondition ? rsi-3 : na, title="Long Condition", style=shape.triangleup, color=color.lime, location=location.absolute)
plotshape(closeCondition and rsi[1]<50? rsi+3 : na, title="Exit Condition", style=shape.triangledown, color=#e60000, location=location.absolute)
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >>
// ---------> AUTOMATION AND BACKTESTING <----------- >>
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >>
if longCondition and strategy.position_size==0
strategy.entry("LONG", strategy.long)
if closeCondition
strategy.close("LONG")