MLansky

StochDMI

For binary. Timeframe: 5 min.

Good binary broker: goo.gl/uGWMWb

P.S. thx ucsgears for idea
開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?
study(title="StohDMI", shorttitle="StohDMI", overlay=false)

wwma(l,p) =>
    wwma = (nz(wwma[1]) * (l - 1) + p) / l

DMIlength = input(10, title = "Длина DMI")
Stolength = input(6, title = "Длина DMI Stochastic")
os = input (10, title = "Перепроданность")
ob = input (90, title = "Перекупленность")

hiDiff = high - high[1]
loDiff = low[1] - low

plusDM = (hiDiff > loDiff) and (hiDiff > 0) ? hiDiff : 0
minusDM = (loDiff > hiDiff) and (loDiff > 0) ? loDiff : 0

ATR = wwma(DMIlength, tr)

PlusDI = 100 * wwma(DMIlength,plusDM) / ATR
MinusDI = 100 * wwma(DMIlength,minusDM) / ATR

osc = PlusDI - MinusDI

hi = highest(osc, Stolength)
lo = lowest(osc, Stolength)

Stoch = sum((osc-lo),Stolength) / sum((hi-lo),Stolength) *100
plot(Stoch, color = black, title = 'Stochastic', linewidth = 2, style = line)

crossUp = Stoch[1] < os and Stoch > os ? 1 : 0
crossDo = Stoch[1] > ob and Stoch < ob ? 1 : 0

plot (ob, color = gray, linewidth = 1, title = 'Купить')
plot (os, color = gray, linewidth = 1, title = 'Продать')

plotchar(crossUp, title="Вверх", char='⇑', location=location.bottom, color=green, transp=0)
plotchar(crossDo, title="Вниз",char='⇓', location=location.top, color=red, transp=0)

line2 = hline(90, linestyle=dotted, color=black)
line1 = hline(45, color=black)
line0 = hline(10, linestyle=dotted, color=black)
fill(line2, line0)