RicardoSantos

[RS]coondawg71 DMI Index V0

dmi
273 7 21
dmi
Request for coondawg71: DMI             index
Remove from Favorite Scripts Add to Favorite Scripts
study(title="[RS]coondawg71 DMI Index V0", shorttitle="[RS]DMI.v0", overlay=false)

length = input(10)
hlcc4 = (high + low + (close*2))*0.25

maTR = atr(length)
avgVol = sma(volume, length)


WtCRatio = (hlcc4 - hlcc4[1]) / min(hlcc4,hlcc4[1])
VolRatio = volume / avgVol

Constant_arg1 = ((hlcc4 * 3) / maTR) * abs(WtCRatio)
Constant_arg2 = Constant_arg1 > 88 ? 88 : Constant_arg1
Constant = VolRatio / exp(Constant_arg2)

BuyP = WtCRatio > 0 ? VolRatio : Constant
SellP = WtCRatio > 0 ? Constant : VolRatio

BuyPres = (nz(BuyPres[1] * (length - 1)) + BuyP) / length
SellPres = (nz(SellPres[1] * (length - 1)) + SellP) / length

TempDI_arg0 = SellPres > BuyPres ? (
        SellPres != 0 ? BuyPres / SellPres :
        BuyPres != 0 ? SellPres / BuyPres : nz(TempDI_arg0[1]) ) : nz(TempDI_arg0[1])

Sign = SellPres > BuyPres ? -1 : 1
TempDI = TempDI_arg0 * Sign

DMIndx = TempDI < 0 ? -1 - TempDI : 1 - TempDI

plot(DMIndx, color=black, style=columns, transp=70)

//  ||---
hline(0, color=black)
useOverBSLines = input(false)
obpoint = input(0.5, type=float)
ospoint = input(-0.5, type=float)
plot(not useOverBSLines ? na : obpoint, color=black)
plot(not useOverBSLines ? na : ospoint, color=black)
//  ||---
useMa1 = input(false)
useMa2 = input(false)
ma1 = not useMa1 ? na : sma(DMIndx, input(50))
ma2 = not useMa2 ? na : sma(DMIndx, input(200))

plot(ma1, color=teal)
plot(ma2, color=blue)
Thanks Ricardo, very gracious of you!
Reply
RicardoSantos PRO coondawg71
2 years ago
:p np, thx
Reply
RicardoSantos...I just got back....

Great to see your still Crushing it....Tons of GREAT POSTS....Keep it up man...
Reply
RicardoSantos PRO ChrisMoody
2 years ago
no rest for the wicked :p, thx
Reply
TheYangGuizi
4 months ago
Hey, do you know why moves above zero "flatlines" on this indi? Moves below are all pointy an stuff. Anyway, nice work. Example:
snapshot
Reply
RicardoSantos PRO TheYangGuizi
4 months ago
i did this a while ago, dont remember source anymore :/, my guess without delving too much into deconstruction of the formula would be in the constant arguments.
Reply
TheYangGuizi RicardoSantos
4 months ago
Alright thx.
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out