빠른 RSI 전략 분석


생성 날짜: 2023-12-04 14:40:02 마지막으로 수정됨: 2023-12-04 14:40:02
복사: 0 클릭수: 605
avatar of ChaoZhang ChaoZhang
1
집중하다
1619
수행원

빠른 RSI 전략 분석

전략 이름

급격한 쌍방향 RSI 트렌드 전략

개요

이 전략은 RSI 지표를 사용하여 가격 추세를 판단하는 빠른 전략이다. 그것은 동시에 더 많은 것을 할 수 있고 더 적은 것을 할 수 있으며 더 빠른 단선 가격을 잡을 수 있다.

전략 원칙

이 전략은 개량된 RSI 지표를 사용하여 가격의 오버 바이 오버 시트를 판단하고, K선 엔티티 필터링 소음과 함께한다. RSI가 오버 바이 또는 오버 시트 영역에 있고, K선 엔티티의 부피가 평균 부피의 1/3보다 크면, 오버 또는 비어있다. 거래 신호가 발생 한 후 K선 반전을 기다리고 RSI가 안전 영역으로 회귀 할 때 평지.

우위 분석

이 전략은 빠르게 반응하여 더 빠른 단선 트렌드를 포착할 수 있다. 동시에 실체 필터는 소음을 제거하고 가짜 돌파구에 의해 오해되는 것을 피하는데 도움이 된다. 이 전략은 높은 변동률의 품종에 적용되어 더 높은 수익을 얻을 수 있다.

위험 분석

이 전략은 가격 변화에 대한 반응에 민감하며 시장의 잘못된 신호에 의해 오해받을 수 있습니다. 또한, 높은 변동률의 시장 중단 손실이 더 자주 유발 될 수 있습니다. 적절한 중단 손실을 완화하고 잘못된 신호의 가능성을 줄이기 위해 RSI 파라미터를 최적화 할 수 있습니다.

최적화 방향

전략 최적화를 위해 다양한 주기적 지표 변수를 테스트하여 최적의 변수 조합을 찾을 수 있습니다. 또한 해파리 거래 규칙과 같은 다른 지표가 필터링 신호를 보조하는 것을 고려할 수 있습니다. 기계 학습 방법과 결합하여 더 나은 RSI 값을 훈련하는 것도 좋은 시도 일 수 있습니다.

요약하다

이 전략은 전체적으로 고효율의 민감한 단선 전략이다. 몇 가지 변수와 모델을 최적화함으로써 안정성과 수익성을 더욱 강화할 전망이다. 이 전략은 양적 거래자가 계속 연구하고 추적할 가치가 있다.

전략 소스 코드
/*backtest
start: 2023-11-03 00:00:00
end: 2023-12-03 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
strategy(title = "Noro's Fast RSI Strategy v1.1", shorttitle = "Fast RSI str 1.1", 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 Source")
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

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

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

//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()