RicardoSantos

[RS]coondawg71 DMI Index V0

DMI
314 7 26
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:
snapshot
Reply
RicardoSantos PRO 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
United States
United Kingdom
India
Deutschland
España
France
Việt Nam
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
Malaysia
日本
한국
简体
繁體
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing Support Priority Support Report Issue Ideas Published Followers Following Private Messages Chat Sign Out