victorzhitkov

Scalping

73
working on
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?
//@version=2
study("Scalping")
//Boilinger
basis = sma(close, 20)
dev = 2.0 * stdev(close, 20)
upper2 = basis + dev
lower2 = basis - dev

//стохастик
st=stoch(close,high,low,25)

//MACD
[macdLine, signalLine, histLine]=macd(close,12,26,9)

//RSI
rsi=rsi(close,14)

//RVI
ReVI(lenght) =>
    length = 10, src = close
    len = 14
    stddev = stdev(src, length)
    upper = ema(change(src) <= 0 ? 0 : stddev, len)
    lower = ema(change(src) > 0 ? 0 : stddev, len)
    rvi = upper / (upper + lower) * 100
RVI=ReVI(10)

//Сделать DMI
DeMI (len, lensig)=>
    up = change(high)
    down = -change(low)
    trur = rma(tr, len)
    plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, len) / trur)
    minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, len) / trur)
    sum = plus + minus 
    adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), lensig)
DMI=DeMI(14,14)
up = change(high)
down = -change(low)
trur = rma(tr, 14)
plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, 14) / trur)
minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, 14) / trur)
sum = plus + minus 
adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), 14)
//перекупленность Стоха и РсИ
rsiUP = input(title="Высокий RSI", type=integer, defval=70,  minval=10, maxval=100)
stUP = input(title="Перекупленность стохастика", type=integer, defval=80,  minval=30, maxval=100)
rsiDown = input(title="Низкий RSI", type=integer, defval=30,  minval=10, maxval=100)
stDown = input(title="Перепроданность стохастика", type=integer, defval=20,  minval=0, maxval=100)
StochAndRSIup = rsi>rsiUP and st >stUP
StochAndRSIdown = rsi<rsiDown and st <stDown

//немного магии от какого-то Алексея из Интернета
smoothK = 1
smoothD = 3
lengthRSI = 14
lengthStoch = 8
src = close
rsi1 = rsi(src, lengthRSI)
k = sma(stoch(close, high, low, lengthRSI), smoothK)
d = sma(k, smoothD)

//формула 
up1 = (((plus[0]>plus[1] and minus[0]<minus[1] and plus[0]>minus[0]) and adx>20) and RVI>50 and RVI[0]>RVI[1] and k[0]>d[0] and k[0]<90 and d[0]<90 and volume>190 and close[0]-open[0]>0.015 and ((k[0]-d[0])>(k[1]-d[1])))
down1 = (((minus[0]>minus[1] and plus[0]<plus[1] and minus[0]>plus[0])and adx>20) and RVI[0]<RVI[1] and k[0]<d[0] and k[0]>10 and d[0]>10 and volume>190 and open[0]-close[0]>0.015 and ((k[0]-d[0])<(k[1]-d[1])))


barcolor( down1  ?  yellow : na)
barcolor(up1 ? lime : na )
alertcondition (up1 or down1, 'alert', 'mystrategy')