이 전략은 상대적 강도 지수 (RSI) 를 기반으로 하는 역전 트렌드 추적 ETF 거래 전략이다. 역전 입출출을 위해 RSI 지표를 통해 단기적인 과잉 구매 및 과잉 판매 조건을 판단합니다. 한편, 전체 트렌드 방향을 결정하기 위해 200일 이동 평균을 사용합니다.
이 전략의 핵심 논리는 RSI 지표의 반전 원리에 기반합니다. RSI 지표는 거래 품종이 과소매 또는 과소매 상태에 있는지 판단하기 위해 일정 기간 동안 상승과 하락의 평균 진폭을 계산합니다. 70 이상의 RSI는 과소매 조건을 나타냅니다. 30 이하의 RSI는 과소매 조건을 나타냅니다. 이 시점에서 반전 추세가 발생할 수 있습니다.
이 전략은 오늘의 RSI가 조정 가능한 매개 변수보다 낮을 때 구매 트리거를 설정하여 이 원리를 활용합니다.TodaysMinRSI
, 그리고 3일 전의 RSI는 조정 가능한 매개 변수 아래입니다.Day3RSIMax
이것은 가격이 단기 초판 지역에있을 수 있음을 나타내고 반등이 발생할 가능성이 있음을 나타냅니다. 또한 지난 3 일 동안 하향 RSI 추세를 요구합니다. 즉 거짓 브레이크오프를 피하기 위해 구매 전에 지속적인 RSI 하락.
전략의 출구 메커니즘은 RSI 지표가 조정 가능한 매개 변수의 임계 값을 다시 초과 할 때입니다.Exit RSI
, 리바운드가 끝난 것으로 간주되며 그 지점은 닫아야합니다.
이 전략은 또한 전체 트렌드 방향을 판단하기 위해 200일 이동 평균을 도입한다. 가격은 200일 라인 이상일 때만 긴 엔트리 오더를 할 수 있다. 이는 상승 트렌드 단계에서만 구매하는 것을 보장하고 역 트렌드 거래의 위험을 피하는 데 도움이 된다.
이 전략은 리버설 트레이드를 위해 과잉 구매 및 과잉 판매 구역을 판단하여 고전적인 RSI 입출점을 활용합니다. 한편, 주요 트렌드와 매개 변수 최적화를 고려하면 매우 신뢰할 수있는 단기 리버설 ETF 전략입니다. 추가 최적화로 실용적인 효과를 가진 양적 전략이 될 수 있습니다.
/*backtest start: 2024-01-14 00:00:00 end: 2024-01-21 00:00:00 period: 3m basePeriod: 1m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // @version = 5 // Author = TradeAutomation strategy(title="R3 ETF Strategy", shorttitle="R3 ETF Strategy", overlay=true) // Backtest Date Range Inputs // StartTime = input(defval=timestamp('01 Jan 2012 05:00 +0000'), title='Start Time') EndTime = input(defval=timestamp('01 Jan 2099 00:00 +0000'), title='End Time') InDateRange = true // Calculations and Inputs // RSILen = input.int(2, "RSI Length") RSI = ta.rsi(close, RSILen) TodaysMinRSI = input.int(10, "Today's Min RSI for Entry", tooltip = "The RSI must be below this number today to qualify for trade entry") Day3RSIMax = input.int(60, "Max RSI 3 Days Ago for Entry", tooltip = "The RSI must be below this number 3 days ago to qualify for trade entry") EMA = ta.ema(close, 200) // Strategy Rules // Rule1 = close>ta.ema(close, 200) Rule2 = RSI[3]<Day3RSIMax and RSI<TodaysMinRSI Rule3 = RSI<RSI[1] and RSI[1]<RSI[2] and RSI[2]<RSI[3] Exit = ta.crossover(RSI, input.int(70, "Exit RSI", tooltip = "The strategy will sell when the RSI crosses over this number")) // Plot // plot(EMA, "200 Day EMA") // Entry & Exit Functions // if (InDateRange) strategy.entry("Long", strategy.long, when = Rule1 and Rule2 and Rule3) // strategy.close("Long", when = ta.crossunder(close, ATRTrailingStop)) strategy.close("Long", when = Exit) if (not InDateRange) strategy.close_all()