TheLark: Directional Movement Index Oscillator

A modified DMI, This turns the standard DMI into an Oscillator. The DMI cross signal is the same, but as an OSC you get the added benefits or finding divergences, etc. The added WIlder's Average Line (blue) can help you see if a short term trend is getting less interesting.
Supprimer des scripts favoris Ajouter aux scripts favoris
study(title="TheLark: Directional Movement Index Oscillator", shorttitle="DMI-OSC_LK", overlay=false)

        //                                             //
        //        DMI OSCILLATOR  BY THELARK           //
        //                 ~ 8-3-14 ~                  //
        //                                             //
        //                     •/•                     //
        //                                             //
        //    //
        //                                             //

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

// Inputs
DMIlength = input(14)
Avglength = input(2)

// 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
col = osc >= 0 ? #99EF0E : #FF0064
// Plots
plot(osc,color=col, style=histogram, linewidth=2)
plot(wwma(Avglength,osc), color=#0EAAEF,title="DI+")


this is so much easier to "read" compared to the default DMI, thanks a lot!!!
Thank you so much for this!
very nice one bro, can u make histogram of yours like this one, would be awesome

TheLark Mlnklkm
@Mlnklkm, Hi, thanks for your comment. I'll look into it as I have time. Currently I am fairly busy but I strongly suggest you look into pine script yourself and give it a try! It's very rewarding to learn, and not too difficult if you are not doing anything tricky (this should be straight forward) ;)

Don't hesitate to private message me if you have any questions about pine!
Accueil Screener d'actions Screener Forex Screener Crypto Calendrier économique Comment ça marche Caractéristiques du graphique Prix Parrainer un ami Règles de conduite Centre d'aide Solutions site web & courtier Widgets Solutions de cartographie Bibliothèque de graphiques allégés Blog & News Twitter
Profil Paramètres du Profil Compte et Facturation Amis référés Coins Mes tickets au support Centre d'aide Idées Publiées Followers Suivi(e) Messages privés Chat Se Déconnecter