RicardoSantos

[RS]coondawg71 DMI Index V0

DMI
637 views
71
637 7
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)
Hey, do you know why moves above zero "flatlines" on this indi? Moves below are all pointy an stuff. Anyway, nice work. Example:
Reply
RicardoSantos TheYangGuizi
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
Alright thx.
Reply
RicardoSantos...I just got back....

Great to see your still Crushing it....Tons of GREAT POSTS....Keep it up man...
Reply
no rest for the wicked :p, thx
Reply
Thanks Ricardo, very gracious of you!
Reply
:p np, thx
Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar Shows How It Works Chart Features Pricing House Rules Moderators Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Help Center Refer a friend Feature Request Blog & News FAQ Wiki Twitter
Profile Profile Settings Account and Billing Refer a friend My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out