
양방향 RSI 평행선 응답 전략은 트렌드 추적 전략으로, 두 개의 다른 시간 주기의 RSI 지표를 사용하여 과매매와 과매매 상황을 식별한다. 이 전략은 과매매 후 더 많이 하고, 과매매 후 더 적은 것을 통해 수익을 창출하는 것을 목표로 한다. 이 전략은 평평한 이질적인 이동 평균, RSI 지표 및 포지션 개시 색 필터를 사용하여 거래 기회를 식별한다.
이 전략은 서로 다른 주기를 가진 두 개의 RSI 지표를 사용하여 5 분 차트와 1 시간 차트에서 하나를 니다. RSI 지표의 경우, 과매매 수준은 30 이하이며, 과매매 수준은 70 이상으로 확인됩니다.
RSI 값을 추적하여 RSI가 주기적으로 초과 판매 또는 초과 구매 영역에 있는 경우를 찾습니다. 이는 확장된 초과 판매 또는 초과 구매 상태가 있음을 나타냅니다.
또한, 그것은 평평한 이산화 이동 평균을 사용하여 거래에 진입하기 전에 특정 주기의 빨간색 또는 녹색 K 라인을 확인하여 트렌드 방향을 확인합니다. 포지션 개설 색상 필터는 가짜 신호를 피하는 데 도움이됩니다.
RSI와 미끄러진 변수 및 이동 평균 조건이 모두 충족되면, 이 전략은 과매매 후 더 많이 하고, 과매매 후 더 많이 하락하며, 베팅 가격은 다시 평행선으로 돌아온다.
하루의 끝에서 포지션을 풀고, 밤새 포지션을 유지하지 마십시오.
양방향 RSI 평행선 응답 전략은 정규화 방법을 사용하여 거래 동력을 니다. 두 시간 프레임, 오버 바이 오버 시드 지표, K-라인 형태 분석 및 포지션 필터를 조합하여 높은 확률의 평행선 복귀 기회를 식별하는 것이 목표입니다. 엄격한 위험 관리와 신중한 포지션 제어는 수익을 창출하면서 철수를 제어하는 데 도움이됩니다.
/*backtest
start: 2023-09-01 00:00:00
end: 2023-09-30 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//Gidra
//2018
//@version=2
strategy(title = "Gidra's Vchain Strategy v0.1", shorttitle = "Gidra's Vchain Strategy v0.1", overlay = false, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, pyramiding = 100)
//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
capital = input(100, defval = 100, minval = 1, maxval = 10000, title = "Lot, %")
rsiperiod = input(14, defval = 14, minval = 2, maxval = 100, title = "RSI period")
rsilimit = input(30, defval = 30, minval = 1, maxval = 50, title = "RSI limit")
rsibars = input(3, defval = 3, minval = 1, maxval = 20, title = "RSI signals")
useocf = input(true, defval = true, title = "Use Open Color Filter")
openbars = input(2, defval = 2, minval = 1, maxval = 20, title = "Open Color, Bars")
showrsi = input(true, defval = true, title = "Show indicator RSI")
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")
//Heikin Ashi Open/Close Price
o=open
c=close
h=high
l=low
haclose = (o+h+l+c)/4
haopen = na(haopen[1]) ? (o + c)/2 : (haopen[1] + haclose[1]) / 2
hahigh = max (h, max(haopen,haclose))
halow = min (l, min(haopen,haclose))
col=haopen>haclose ? red : lime
plotcandle(haopen, hahigh, halow, haclose, title="heikin", color=col)
//RSI
uprsi = rma(max(change(close), 0), rsiperiod)
dnrsi = rma(-min(change(close), 0), rsiperiod)
rsi = dnrsi == 0 ? 100 : uprsi == 0 ? 0 : 100 - (100 / (1 + uprsi / dnrsi))
uplimit = 100 - rsilimit
dnlimit = rsilimit
rsidn = rsi < dnlimit ? 1 : 0
rsiup = rsi > uplimit ? 1 : 0
//RSI condition
rsidnok = highest(rsidn, rsibars) == 1? 1 : 0
rsiupok = highest(rsiup, rsibars) == 1? 1 : 0
//Color Filter
bar = haclose > haopen ? 1 : haclose < haopen ? -1 : 0
gbar = bar == 1 ? 1 : 0
rbar = bar == -1 ? 1 : 0
openrbarok = sma(gbar, openbars) == 1 or useocf == false
opengbarok = sma(rbar, openbars) == 1 or useocf == false
//Signals
up = openrbarok and rsidnok
dn = opengbarok and rsiupok
lot = strategy.position_size == 0 ? strategy.equity / close * capital / 100 : lot[1]
//Indicator RSI
colbg = showrsi == false ? na : rsi > uplimit ? red : rsi < dnlimit ? lime : na
bgcolor(colbg, transp = 20)
//Trading
if up
strategy.entry("Long", strategy.long, needlong == false ? 0 : lot, when=(time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 23, 59)))
if dn
strategy.entry("Short", strategy.short, needshort == false ? 0 : lot, when=(time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 23, 59)))
if time > timestamp(toyear, tomonth, today, 23, 59)// or exit
strategy.close_all()