victorzhitkov

Scalping

73
working on
オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、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')