DMI indicator DI+ and DI-

Forums ProRealTime English forum ProBuilder support DMI indicator DI+ and DI-

Viewing 8 posts - 1 through 8 (of 8 total)
  • #8064

    Hi,

    I need to create the DI+ and DI- indicators manually because I need to use them in lower TF.

    I need to use DI based on daily candles on a hour time frame.

    Does anyone knows how to build manually the DI+ and DI-?

    (I can after this transform the indicator to work for lower TF)

    Thanks

    david

     

    #8079

    Hi David, you remember me that someone ask me the same question some days ago. Didn’t have time already to code it. Find the right formula on internet is quiet hard, but here is the metastock one, that can be easily converted:


    ADX Raw

    {MetaStock code written by Equis and published in the Oct99 TASC}

    Periods:= Input(“Enter time periods”,1,100,14);

    PlusDM:= If(HIGH>Ref(HIGH,-1) AND

    LOW>=Ref(LOW,-1), HIGH-Ref(HIGH,-1),

    If(HIGH>Ref(HIGH,-1) AND LOW<Ref(LOW,-1)

    AND HIGH-Ref(HIGH,-1)>Ref(LOW,-1)-LOW,

    HIGH-Ref(HIGH,-1), 0));

    DIPlus:= 100 * Wilders(PlusDM,Periods) /

    ATR(Periods);

    MinusDM:= If(LOW<Ref(LOW,-1) AND

    HIGH<=Ref(HIGH,-1), Ref(LOW,-1)-LOW,

    If(HIGH>Ref(HIGH,-1) AND LOW<Ref(LOW,-1)

    AND HIGH-Ref(HIGH,-1)<Ref(LOW,-1)-LOW,

    Ref(LOW,-1)-LOW, 0));

    DIMinus:= 100 * Wilders(MinusDM,Periods) /

    ATR(Periods);

    DIDif:= Abs(DIPlus – DIMinus);

    DISum:= DIPlus + DIMinus;

    ADXRaw:= 100 * Wilders(DIDif/DISum, Periods);


    That’s a good exercise for your ProBuilder knowledge 🙂

    #8093

    the DI+ and DI- can be calculated in this way:

     

     

    The problem is how to do the wilderavarage of the PlusDM. It work in daily TF but if I reduce the TF to 1 hours the wilderavarage is done on the previus n Hours and not days…

     

    To do so we have to create also the wilderavarage by ourself…

     

    I am tring but with big fails for the moment…

     

     

    #8101

    Because you use instruction of daily OHLC! 🙂

    You should replace your code with:

    So now you can use the wilderaverage instruction directly and not recode it all.

    Very nice work! BIG APPLAUSE!

     

    #8102

    Oh sorry, I realize you were looking for the daily values, not the actual timeframe one.

    The big problem here is that your wilderaverage on n period give your result of the n period of the current timeframe.

    #8105

    yes Nicolas… that’s my issue 🙂

     

    The big Applause go to another users… I copied a little from him. but… our work is 99% copy, fix and paste! 🙂

    #8114

    Ok, maybe a trick to calculate correctly the daily values is to only consider to do it only if the current bar is include in a day that is not the same as the previous bar:

    But something still wrong in the returned values…

     

    #14777

    bonjour

    j essais de modifié le di pour le faire fonctionné avec les valeur de williams R % mais je bloque en tant que débutant, monindicateur me sort bien quelque chose mais rien a voir avec le di de base.

    besoin d un peu d aide merci

Viewing 8 posts - 1 through 8 (of 8 total)
Similar topics:

Create your free account now and post your request to benefit from the help of the community
Register or Login