
이중 RSI 평균선 돌파 전략은 RSI 지표와 평균선 지표를 동시에 사용하여 거래 시기를 판단하는 양적 전략이다. 이 전략의 핵심 아이디어는 RSI 지표가 과매매 과매매 영역에 도달 할 때 평균선의 방향을 사용하여 신호를 필터링하여 더 우수한 돌파점을 찾아 포지션을 구축하는 것이다.
사용자가 설정한 파라미터를 기반으로 각각 RSI 지수와 간단한 이동 평균 SMA를 계산한다.
RSI가 설정된 오버셀 라인을 통과했을 때 (기본 30), 가격이 LONG 퇴출 평균선보다 낮으면 다중 헤드 신호가 발생한다.
RSI 아래에서 설정된 오버 바이 라인 (기본 70) 을 통과하면 SHORT Exit Average 라인보다 가격이 높으면 공백 신호가 발생한다.
사용자가 필터링 평균선을 선택할 수 있으며, 가격이 필터링 평균선 위에 있을 때만 신호가 발생한다.
포지션의 탈퇴는 LONG 탈퇴 평균선과 SHORT 탈퇴 평균선에 따라 결정된다.
이 두가지 지표는 시장의 두 가지 요소를 종합적으로 고려하여 설계되었으며, 의사 결정의 정확성을 높였습니다.
RSI의 역전 특성을 합리적으로 활용하여 역전 시점을 찾아보세요.
평선 필터는 판단의 엄격성을 높여주고, 추종을 막아줍니다.
사용자 정의 매개 변수가 허용되며, 다른 품종과 주기들에 대해 최적화할 수 있다.
간단하고 논리적인 디자인으로 이해하기 쉽고 수정하기 쉽다.
RSI 지표는 수직 선을 생성하기 쉽지만, 밀도 지표는 이 문제를 줄일 수 있다.
큰 주기에서의 RSI는 실패하기 쉽고, 파라미터 최적화를 줄일 수 있거나 다른 지표를 보조할 수 있다.
평균선은 지연성이 있으며, 평균선의 길이를 적절히 줄일 수 있거나 MACD와 같은 지표를 보조한다.
간단한 판단 조건으로 거래 신호의 효과를 보장하는 더 많은 지표를 도입할 수 있습니다.
RSI 파라미터를 최적화하거나 Density 지표를 도입하면 가짜 신호의 가능성을 줄일 수 있다.
추세와 DMI, BOLL와 같은 변동 지표와 결합하여 추세와 지지점을 결정한다.
MACD와 같은 지표의 대안 또는 협력 평평선 판단을 도입한다.
포지션 개시 조건 논리를 추가하여 바람직하지 않은 돌파 신호를 방지한다.
쌍 RSI 평평선 돌파 전략은 RSI 지표를 사용하여 과매매와 평평선을 판단하는 방식을 통합하여 이론적으로 반전 기회를 효과적으로 잡을 수 있습니다. 이 전략은 유연하고 간결하며 쉽게 다루며 다양한 품종에 적합한 최적화이며, 권장되는 양적 입문 전략입니다. 판단을 보조하기 위해 더 많은 지표를 도입함으로써 이 전략은 의사 결정 효과를 더욱 강화하고 수익률을 높일 수 있습니다.
/*backtest
start: 2024-01-16 00:00:00
end: 2024-01-23 00:00:00
period: 5m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//Global Market Signals: RSI Strategy.
//@version=4
strategy("GMS: RSI Strategy", overlay=true)
LongShort = input(title="Long Only or Short Only or Both?", type=input.string, defval="Both", options=["Both", "Long Only", "Short Only"])
RSILength = input(title="RSI Length", type = input.integer ,defval=14)
RSIUpper = input(title="Upper Threshold", type = input.float ,defval=70)
RSILower = input(title="Lower Threshold", type = input.float ,defval=30)
LongExit = input(title="Long Exit SMA Length", type = input.integer ,defval=5)
ShortExit = input(title="Short Exit SMA Length", type = input.integer ,defval=5)
AboveBelow = input(title="Trend SMA Filter?", type=input.string, defval="Above", options=["Above", "Below", "Don't Include"])
TrendLength = input(title="Trend SMA Length", type = input.integer ,defval=200)
//Long Side
if LongShort =="Long Only" and AboveBelow == "Above"
strategy.entry("LONG", true, when = rsi(close,RSILength)<RSILower and close< sma(close,LongExit) and close>sma(close,TrendLength))
strategy.close("LONG", when = close>sma(close,LongExit))
if LongShort =="Long Only" and AboveBelow == "Below"
strategy.entry("LONG", true, when = rsi(close,RSILength)<RSILower and close< sma(close,LongExit) and close<sma(close,TrendLength))
strategy.close("LONG", when = close>sma(close,LongExit))
if LongShort =="Long Only" and AboveBelow == "Don't Include"
strategy.entry("LONG", true, when = rsi(close,RSILength)<RSILower and close< sma(close,LongExit))
strategy.close("LONG", when = close>sma(close,LongExit))
if LongShort =="Both" and AboveBelow == "Above"
strategy.entry("LONG", true, when = rsi(close,RSILength)<RSILower and close< sma(close,LongExit) and close>sma(close,TrendLength))
strategy.close("LONG", when = close>sma(close,LongExit))
if LongShort =="Both" and AboveBelow == "Below"
strategy.entry("LONG", true, when = rsi(close,RSILength)<RSILower and close< sma(close,LongExit) and close<sma(close,TrendLength))
strategy.close("LONG", when = close>sma(close,LongExit))
if LongShort =="Both" and AboveBelow == "Don't Include"
strategy.entry("LONG", true, when = rsi(close,RSILength)<RSILower and close< sma(close,LongExit))
strategy.close("LONG", when = close>sma(close,LongExit))
//SHORT SIDE
if LongShort =="Short Only" and AboveBelow == "Above"
strategy.entry("SHORT", false, when = rsi(close,RSILength)>RSIUpper and close> sma(close,ShortExit) and close>sma(close,TrendLength))
strategy.close("SHORT", when = close<sma(close,ShortExit))
if LongShort =="Short Only" and AboveBelow == "Below"
strategy.entry("SHORT", false, when = rsi(close,RSILength)>RSIUpper and close> sma(close,ShortExit) and close<sma(close,TrendLength))
strategy.close("SHORT", when = close<sma(close,ShortExit))
if LongShort =="Short Only" and AboveBelow == "Don't Include"
strategy.entry("SHORT", false, when = rsi(close,RSILength)>RSIUpper and close> sma(close,ShortExit))
strategy.close("SHORT", when = close<sma(close,ShortExit))
if LongShort =="Both" and AboveBelow == "Above"
strategy.entry("SHORT", false, when = rsi(close,RSILength)>RSIUpper and close> sma(close,ShortExit) and close>sma(close,TrendLength))
strategy.close("SHORT", when = close<sma(close,ShortExit))
if LongShort =="Both" and AboveBelow == "Below"
strategy.entry("SHORT", false, when = rsi(close,RSILength)>RSIUpper and close> sma(close,ShortExit) and close<sma(close,TrendLength))
strategy.close("SHORT", when = close<sma(close,ShortExit))
if LongShort =="Both" and AboveBelow == "Don't Include"
strategy.entry("SHORT", false, when = rsi(close,RSILength)>RSIUpper and close> sma(close,ShortExit))
strategy.close("SHORT", when = close<sma(close,ShortExit))