UDAY_C_Santhakumar

DMI Stochastic Extereme - Version 2

Version 2 Includes
Custom setting for the Oversold and Overbought Levels
Replaced B and S with arrows
Cleaned up the code and finalized the indicator.

*Unless there is a real need, this indicator will not be revised further.

Uday C Santhakumar
סקריפט קוד פתוח

ברוח TradingView אמיתית, מחבר הסקריפט הזה פרסם אותו בקוד פתוח, כך שסוחרים יכולים להבין ולאמת אותו. כל הכבוד למחבר! אתה יכול להשתמש בו בחינם, אך שימוש חוזר בקוד זה בפרסום כפוף לכללי הבית. אתה יכול להכניס אותו למועדפים כדי להשתמש בו בגרף.

כתב ויתור

המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.

רוצה להשתמש בסקריפ זה בגרף?
study(title="UCS_DMI Stochastic Extreme_V2", shorttitle="DMI-Sto-E_V2", overlay=false)
// Wells Wilders MA
wwma(l,p) =>
    wwma = (nz(wwma[1]) * (l - 1) + p) / l

// Inputs
DMIlength = input(10, title = "DMI Length")
Stolength = input(3, title = "DMI Stochastic Length")
os = input (10, title = "Oversold")
ob = input (90, title = "Overbought")

// DMI Osc Calc
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

// DMI Stochastic Calc
hi = highest(osc, Stolength)
lo = lowest(osc, Stolength)

Stoch = sum((osc-lo),Stolength) / sum((hi-lo),Stolength) *100
plot(Stoch, color = blue, 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 = 'Over Bought')
plot (os, color = gray, linewidth = 1, title = 'Over Sold')

plotchar(crossUp, title="Crossing Up Signal", char='⇑', location=location.bottom, color=green, transp=0)
plotchar(crossDo, title="Crossing Down Signal",char='⇓', location=location.top, color=red, transp=0)