축적 RSI 돌파 전략


생성 날짜: 2023-10-27 11:20:50 마지막으로 수정됨: 2023-10-27 11:20:50
복사: 0 클릭수: 759
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

축적 RSI 돌파 전략

개요

이 전략은 축적된 RSI 지표의 트렌드 식별을 활용하여 RSI 지표의 축적된 값이 중요한 경계를 넘어서면 구매 및 판매 작업을 수행합니다. 이 전략은 시장 소음을 효과적으로 필터링하여 더 긴 선의 트렌드 거래 기회를 잠금 할 수 있습니다.

전략 원칙

이 전략은 주로 누적된 RSI 지표에 기반한 거래 결정을 한다. 누적된 RSI 지표는 RSI 지표의 누적값이며, 변수 cumlen을 설정하여 RSI 지표의 수치를 cumlen 일 내에 누적하여 누적된 RSI 지표를 얻을 수 있다. 이 지표는 단기 시장 소음을 필터링 할 수 있다.

축적된 RSI 지표에 볼링거 반을 통과할 때, 상위권 거래가 이루어집니다. 축적된 RSI 지표 아래에서 볼링거 반을 통과할 때, 상위권 거래가 이루어집니다. 볼링거 반 반 반은 수년간의 역사적 데이터를 통해 계산되어, 동적 변화의 기준 가격입니다.

또한, 전략은 트렌드 필터 옵션을 추가했다. 가격이 100일 이동 평균보다 높을 때만, 즉 상승 경로에 있을 때만, 거래가 이루어진다. 이 필터는 가격이 흔들릴 때 잘못된 거래를 피할 수 있다.

전략적 이점

  • 축적된 RSI를 사용하여 잡음을 효과적으로 필터링하여 중장기 트렌드를 고정합니다.
  • 트렌드 필터를 추가하여 불합리한 거래를 피하십시오.
  • 고정된 값이 아닌 파격적인 기준값을 사용하여 판단
  • 다양한 시장에 맞게 변수를 조정할 수 있습니다.
  • 10년 전으로 돌아가는 것은 매우 효과적이며, 구매/ 보유 전략보다 훨씬 높은 수익률을 나타냅니다.

전략적 위험과 개선

  • 전략은 단 하나의 지표에 기초하여 RSI를 축적하여 의사결정을 수행하고, 다른 판단 지표 또는 필터를 추가하여 종합적인 판단을 할 수 있습니다.
  • 고정 배수 레버리지가 높으며, 철수 상황에 따라 레버리지를 조정할 수 있습니다.
  • 다방면으로만 하면, 빈자리를 늘릴 수 있다.
  • 최적화 가능한 변수 모음, 다른 시장 조건에 따라 변수 설정이 큰 차이가 있습니다.
  • 평점 조건을 풍부하게 하고, 손해 중지 지점을 늘리고, 손해 중지 지점을 이동할 수 있는 방법
  • 다른 전략의 조합과 함께 고려할 수 있습니다.

요약하다

이 누적 RSI 돌파 전략은 전체적으로 원활하고 논리적으로 작동하며, 누적 RSI 지표를 통해 효율적으로 파동, 트렌드 판단을 증가시키고, 중·장선 트렌드를 정확하게 파악하고, 역사 재검토 성능이 우수합니다. 그러나 여전히 최적화 할 수있는 공간이 있습니다.

전략 소스 코드
/*backtest
start: 2023-09-26 00:00:00
end: 2023-10-26 00:00:00
period: 1h
basePeriod: 15m
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="Cumulative RSI Strategy", shorttitle="CRSI Strategy", process_orders_on_close=true, overlay=true, commission_type=strategy.commission.cash_per_contract, commission_value=.0035, slippage = 1, margin_long = 75, initial_capital = 25000, default_qty_type=strategy.percent_of_equity, default_qty_value=110)


// Cumulative RSI Indicator Calculations //
rlen  = input.int(title="RSI Length", defval=3, minval=1)
cumlen = input(3, "RSI Cumulation Length")
rsi = ta.rsi(close, rlen)
cumRSI = math.sum(rsi, cumlen)
ob = (100*cumlen*input(94, "Oversold Level")*.01)
os = (100*cumlen*input(20, "Overbought Level")*.01)


// Operational Function //
TrendFilterInput = input(false, "Only Trade When Price is Above EMA?")
ema = ta.ema(close, input(100, "EMA Length"))
TrendisLong = (close>ema)
plot(ema)


// Backtest Timeframe Inputs // 
startDate = input.int(title="Start Date", defval=1, minval=1, maxval=31)
startMonth = input.int(title="Start Month", defval=1, minval=1, maxval=12)
startYear = input.int(title="Start Year", defval=2010, minval=1950, maxval=2100)
endDate = input.int(title="End Date", defval=1, minval=1, maxval=31)
endMonth = input.int(title="End Month", defval=1, minval=1, maxval=12)
endYear = input.int(title="End Year", defval=2099, minval=1950, maxval=2100)
InDateRange = (time >= timestamp(syminfo.timezone, startYear, startMonth, startDate, 0, 0)) and (time < timestamp(syminfo.timezone, endYear, endMonth, endDate, 0, 0))


// Buy and Sell Functions //
if (InDateRange and TrendFilterInput==true)
    strategy.entry("Long", strategy.long, when = ta.crossover(cumRSI, os) and TrendisLong, comment="Buy", alert_message="buy")
    strategy.close("Long", when = ta.crossover(cumRSI, ob) , comment="Sell", alert_message="Sell")
if (InDateRange and TrendFilterInput==false)
    strategy.entry("Long", strategy.long, when = ta.crossover(cumRSI, os), comment="Buy", alert_message="buy")
    strategy.close("Long", when = ta.crossover(cumRSI, ob), comment="Sell", alert_message="sell")
if (not InDateRange)
    strategy.close_all()