
이 전략은 현금 거래 플랫폼 BitMEX를 대상으로 설계되었으며, 빠른 RSI 지표를 분석하여 여러 기술 지표와 결합하여 신호를 필터링하여 효율적인 트렌드 추적 거래를 달성합니다. 전략은 동시에 자금 관리, 손실 제도를 설정하여 거래 위험을 효과적으로 제어 할 수 있습니다.
급속한 RSI를 계산하고, 변수를 7일선, 초상도선 25, 초상도선 75으로 설정한다. RSI 상위에서 초상도선을 통과하면 초상도 신호가 되고, RSI 아래에서 초상도선을 통과하면 초상도 신호가 된다.
K선 엔티티에 대한 필터링 설치는 △ 디스크를 음선으로 설정하고, 엔티티의 길이는 어제의 평균 엔티티의 20%보다 작지 않도록 설정한다.
K선 색 설정 필터링. K선 색 설정 필터링. K선 색 설정 필터링. K선 색 설정 필터링
스톱 로직을 설정한다. 가격이 불리한 방향으로 움직일 때 평점 스톱한다.
반발 방지를 설정한다. 가격이 유리한 방향으로 움직일 때 스톱로즈 라인을 도달할 때 다시 신호를 발산하여 상장을 한다.
자본관리 설정. 고정자금의 비율로 창고, 손실 당 두 배의 포지션.
빠른 RSI 파라미터 설정이 합리적이고, 트렌드를 빠르게 포착할 수 있다. K선 엔티티와 색상의 판단을 결합하여, 가짜 돌파구를 효과적으로 필터링할 수 있다.
여러 층의 필터링 신호로 거래 횟수를 줄이고 승률을 높일 수 있다.
전략 내장 스톱 손실 메커니즘은 단독 손실을 효과적으로 제어 할 수 있습니다.
동적인 포지션 조정으로, 적당히 급진적인 자금 관리를 실현한다.
주요 사건의 충격에서 벗어나기 위해 거래 기간을 사용자 정의 할 수 있습니다.
너무 빠른 속도로 거래 기회를 놓칠 수 있다. 적절한 용도로 변수를 풀어주어 유연성을 높일 수 있다.
트렌드의 종말을 효과적으로 판단할 수 없다. 잠재적인 반전을 판단하기 위해 다른 지표와 함께 고려할 수 있다.
포지션 조정 방식이 너무 급진적이어서 포지션 잠금 방식을 도입할 수 있다.
다른 시장에 따라 파라미터를 조정할 수 있고, 더 좋은 파라미터 조합을 달성할 수 있다.
이 전략은 전체적으로 상당히 안정적이며, 빠른 RSI를 통해 트렌드 방향을 판단하고, 그 다음 여러 기술 지표 필터링 신호를 결합하여 트렌드에서 더 나은 수익을 얻을 수 있습니다. 동시에 전략은 특정 최적화 공간을 가지고 있으며, 변수 조합을 조정하여 다양한 시장 환경에 적응할 수 있으며, 강력한 실용성을 가지고 있습니다.
/*backtest
start: 2023-11-05 00:00:00
end: 2023-11-12 00:00:00
period: 5m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//Noro
//2018
//@version=2
strategy(title = "Robot BitMEX Fast RSI v1.0", shorttitle = "Robot BitMEX Fast RSI v1.0", overlay = false, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, pyramiding = 10)
//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
usemar = input(true, defval = true, title = "Use Martingale")
capital = input(100, defval = 100, minval = 1, maxval = 10000, title = "Capital, %")
rsiperiod = input(7, defval = 7, minval = 2, maxval = 100, title = "RSI Period")
rsilimit = input(25, defval = 25, minval = 1, maxval = 30, title = "RSI limit")
rsibars = input(1, defval = 1, minval = 1, maxval = 20, title = "RSI Bars")
useocf = input(true, defval = true, title = "Use Open Color Filter")
useccf = input(true, defval = true, title = "Use Close Color Filter")
openbars = input(4, defval = 4, minval = 1, maxval = 20, title = "Open Color Bars")
closebars = input(1, defval = 1, minval = 1, maxval = 20, title = "Close Color Bars")
useobf = input(true, defval = true, title = "Use Open Body Filter")
usecbf = input(true, defval = true, title = "Use Close Body Filter")
openbody = input(20, defval = 20, minval = 0, maxval = 1000, title = "Open Body Minimum, %")
closebody = input(50, defval = 50, minval = 0, maxval = 1000, title = "Close Body Minimum, %")
usecnf = input(true, defval = true, title = "Use Close Norma Filter")
fromyear = input(1900, defval = 1900, 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")
//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
rsidnok = sma(rsidn, rsibars) == 1
rsiupok = sma(rsiup, rsibars) == 1
//Body Filter
body = abs(close - open)
abody = sma(body, 10)
openbodyok = body >= abody / 100 * openbody or useobf == false
closebodyok = body >= abody / 100 * closebody or usecbf == false
//Color Filter
bar = close > open ? 1 : close < open ? -1 : 0
gbar = bar == 1 ? 1 : 0
rbar = bar == -1 ? 1 : 0
opengbarok = sma(gbar, openbars) == 1 or useocf == false
openrbarok = sma(rbar, openbars) == 1 or useocf == false
closebarok = (strategy.position_size > 0 and bar == 1) or (strategy.position_size < 0 and bar == -1) or useccf == false
//Norma Filter
norma = (rsi > dnlimit and rsi < uplimit) or usecnf == false
//Signals
up = openrbarok and rsidnok and openbodyok and (strategy.position_size == 0 or close < strategy.position_avg_price)
dn = opengbarok and rsiupok and openbodyok and (strategy.position_size == 0 or close > strategy.position_avg_price)
exit = ((strategy.position_size > 0 and closebarok and norma) or (strategy.position_size < 0 and closebarok and norma)) and closebodyok
//Indicator
plot(rsi, color = blue, linewidth = 3, title = "Double RSI")
plot(uplimit, color = black, title = "Upper Line")
plot(dnlimit, color = black, title = "Lower Line")
colbg = rsi > uplimit ? red : rsi < dnlimit ? lime : na
bgcolor(colbg, transp = 20)
//Trading
profit = exit ? ((strategy.position_size > 0 and close > strategy.position_avg_price) or (strategy.position_size < 0 and close < strategy.position_avg_price)) ? 1 : -1 : profit[1]
mult = usemar ? exit ? profit == -1 ? mult[1] * 2 : 1 : mult[1] : 1
lot = strategy.position_size == 0 ? strategy.equity / close * capital / 100 * mult : lot[1]
if up
if strategy.position_size < 0
strategy.close_all()
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
if strategy.position_size > 0
strategy.close_all()
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()