빠른 RSI 돌파구 전략

저자:차오장, 날짜: 2023-10-24 11:51:56
태그:

img

전반적인 설명

이 전략은 RSI 지표와 촛불체 EMA를 기반으로 빠른 돌파구 거래를 구현합니다. RSI와 큰 촛불체의 빠른 형성을 사용하여 반전 신호를 식별합니다.

전략 논리

  1. RSI 지표를 7주기로 계산하고 가속을 위해 RMA를 사용합니다.

  2. 촛불체 크기의 EMA를 계산하여 시점 30을 체 크기의 기준으로 계산합니다.

  3. 만약 RSI가 한계선 (디폴트 30) 을 넘어서고 현재 촛불 몸집이 평균 몸집의 1/4보다 크다면, 긴 거리로 가십시오.

  4. 만약 RSI가 한계선 (디폴트 70) 아래로 넘어가고, 현재 촛불 몸집이 평균 몸집의 1/4보다 크다면, 단위로 가십시오.

  5. 이미 포지션에 있다면, RSI가 한계선을 넘어가면 닫습니다.

  6. RSI 길이, 한계, 기준 가격과 같은 매개 변수를 구성할 수 있습니다.

  7. 몸 EMA 기간, 오픈 포지션 chroot 곱셈과 같은 매개 변수를 구성할 수 있습니다.

  8. RSI 교차점의 수를 구성할 수 있습니다.

이점 분석

  1. RSI의 반전 속성을 활용하여 반전을 적시에 파악합니다.

  2. RMA는 더 민감한 반전을 위해 RSI 형성을 가속화합니다.

  3. 큰 촛불체로 작은 범위 통합을 필터.

  4. 충분한 백테스트 데이터가 신뢰성을 보장합니다.

  5. 사용자 정의 가능한 매개 변수는 다른 시장 환경에 적응합니다.

  6. 단순하고 명확한 논리

위험 분석

  1. RSI는 백테스트 편견을 가지고 있습니다. 실제 성능은 검증되어야 합니다.

  2. 큰 기업들은 불안한 시장을 완전히 필터링할 수 없습니다.

  3. 기본 매개 변수는 모든 제품에 적합하지 않을 수 있습니다. 최적화가 필요합니다.

  4. 승률이 높지 않을 수도 있고, 정신적으로 연속적인 패배를 견딜 필요가 있습니다.

  5. 실패한 돌파구 위험, 적절한 시간 정지 손실 필요.

최적화 방향

  1. 다른 기간과 상품에 대한 RSI 매개 변수를 최적화합니다.

  2. 몸의 EMA 기간을 최적화하여 몸의 크기를 매끄럽게 합니다.

  3. 입구 주파수를 제어하기 위해 오픈 포지션에 대한 보디 멀티플리커를 최적화해

  4. 승률을 보장하기 위해 이동 중지 손실을 추가합니다.

  5. 트렌드 필터를 추가하여 역 트렌드 거래를 피합니다.

  6. 리스크 통제를 위한 자금 관리 최적화

결론

요약하자면, 이것은 매우 간단하고 직접적인 반전 전략이다. 그것은 RSI의 반전 특성과 큰 촛불체의 추진력을 모두 활용하여 시장 반전 중에 빠르게 들어가게 한다. 백테스트 결과가 좋지만 실제 성능은 아직 검증되지 않았다. 이를 적용할 때 매개 변수 최적화와 위험 통제가 필요하다. 전반적으로 그것은 큰 가치를 가진 전략이며 라이브 트레이딩에서 적용하고 지속적으로 개선할 가치가 있다.


/*backtest
start: 2023-09-23 00:00:00
end: 2023-10-23 00:00:00
period: 3h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
strategy(title = "Noro's Fast RSI Strategy v1.2", shorttitle = "Fast RSI str 1.2", overlay = true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, pyramiding = 5)

//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
rsiperiod = input(7, defval = 7, minval = 2, maxval = 50, title = "RSI Period")
limit = input(30, defval = 30, minval = 1, maxval = 100, title = "RSI limit")
rsisrc = input(close, defval = close, title = "RSI Price")
rb = input(1, defval = 1, minval = 1, maxval = 5, title = "RSI Bars")
fromyear = input(2018, defval = 2018, minval = 1900, maxval = 2100, title = "From Year")
toyear = input(2100, defval = 2100, minval = 1900, maxval = 2100, title = "To Year")
frommonth = input(01, defval = 01, minval = 01, maxval = 12, title = "From Month")
tomonth = input(12, defval = 12, minval = 01, maxval = 12, title = "To Month")
fromday = input(01, defval = 01, minval = 01, maxval = 31, title = "From day")
today = input(31, defval = 31, minval = 01, maxval = 31, title = "To day")

//Fast RSI
fastup = rma(max(change(rsisrc), 0), rsiperiod)
fastdown = rma(-min(change(rsisrc), 0), rsiperiod)
fastrsi = fastdown == 0 ? 100 : fastup == 0 ? 0 : 100 - (100 / (1 + fastup / fastdown))
uplimit = 100 - limit
dnlimit = limit

//RSI Bars
ur = fastrsi > uplimit
dr = fastrsi < dnlimit
uprsi = rb == 1 and ur ? 1 : rb == 2 and ur and ur[1] ? 1 : rb == 3 and ur and ur[1] and ur[2] ? 1 : rb == 4 and ur and ur[1] and ur[2] and ur[3] ? 1 : rb == 5 and ur and ur[1] and ur[2] and ur[3] and ur[4] ? 1 : 0
dnrsi = rb == 1 and dr ? 1 : rb == 2 and dr and dr[1] ? 1 : rb == 3 and dr and dr[1] and dr[2] ? 1 : rb == 4 and dr and dr[1] and dr[2] and dr[3] ? 1 : rb == 5 and dr and dr[1] and dr[2] and dr[3] and dr[4] ? 1 : 0

//Body
body = abs(close - open)
emabody = ema(body, 30)

//Signals
bar = close > open ? 1 : close < open ? -1 : 0
up = bar == -1 and (strategy.position_size == 0 or close < strategy.position_avg_price) and dnrsi and body > emabody / 4
dn = bar == 1 and (strategy.position_size == 0 or close > strategy.position_avg_price) and uprsi and body > emabody / 4
exit = ((strategy.position_size > 0 and fastrsi > dnlimit and bar == 1) or (strategy.position_size < 0 and fastrsi < uplimit and bar == -1)) and body > emabody / 2

//Trading
if up
    strategy.entry("Long", strategy.long, needlong == false ? 0 : na, when=(time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 00, 00)))

if dn
    strategy.entry("Short", strategy.short, needshort == false ? 0 : na, when=(time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 00, 00)))
    
if time > timestamp(toyear, tomonth, today, 00, 00) or exit
    strategy.close_all()

더 많은