Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DMI (Directional Movement Index) supplied with NinjaTrader

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    DMI (Directional Movement Index) supplied with NinjaTrader

    I had a quick look at this indicator, which is provided as DMI (Directional Movement Index).
    I have checked it and found that it is a strange beast that has little in common with the DMI created by Welles Wilder.

    My personal impression is that it just miscalculates the DMI. First, it uses simple moving averages. Everybody who has read the work by Welles Wilder knows that he never used simple moving averages, because exponential moving averages are easier to calculate by hand. Also there is an omission in the code, as the DMI uses the absolute amount of the difference between diPlus and diMinus, and not the difference itself.

    The result is a strange oscillator that has little in common with the DMI. Where does this formula originate from, and what is it good for? How does it come that it shows negative values, where the original DMI uses a scale from 0 to 100? The DMI is a non-directional indicator, whereas the NinjaTrader version is a directional momentum indicator.

    Please see chart attached.
    Attached Files

    #2
    Hello Harry,

    Thanks for your post.

    Our Directional Moving Average is more similar to an RSI as noted in the indicator's source code, however, I will have to check with Product Management to find out more about the original study and why we have our approach vs. what you see with Wilder's DMI.

    I'll write back as I learn more on this matter.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hello Jim,


      Thank you for your quick response!

      I am really curious to understand what this DMI is about.

      The other default indicators of the Directional Movement family - ATR, DM, ADX and ADXR - are absolutely in line with Welles Wilder's concepts, which are also exposed in his famous book "New Concepts In Technical Trading Systems". It is just the DMI which seems to be a little off. I have not found anything similar in the trading literature and I would not know what to do with it.

      Comment


        #4
        Hello Harry,

        I am doing some research of my own on this matter and with the other Directional Movement indicators. Could you provide an export of your "Genuine DMI" indicator so I may review the differences on our end and discuss with others in the office?
        JimNinjaTrader Customer Service

        Comment


          #5
          Hello Jim,


          Basically, the directional movement index is just a preliminary stage to calculating the ADX. The ADX is the just the average directional movement index. Welles Wilder developed the ADX, because the DMI (Wilder called it DX) was not smooth enough.

          Please find attached my version of the DMI, which is entirely based on the ADX indicator supplied with NinjaTrader.

          I have further modified it to work with other input series than price (allowing for applying it to fast moving averages as well), but you may disgard that change. Please find my version attached.

          However, all you would need to do is to take the ADX and replace the last line that calculates the exponential moving average

          Code:
          Value[0]            = sum.ApproxCompare(0) == 0 ? 50 : ((Period - 1) * Value[1] + 100 * diff / sum) / Period;
          with a simpler line that simply calculates the ratio without applying the moving average

          Code:
          Value[0]    = sum.ApproxCompare(0) == 0 ? 0 :  100* diff / sum;
          and you will now obtain the Directional Movement Index by Welles Wilder.
          Attached Files
          Last edited by Harry; 05-02-2018, 03:47 PM.

          Comment


            #6
            Thanks Harry,

            Well, actually, Product Management let me know our source is linked within our DMI help guide page. Ours is based off of FM Labs, however it looks like the DMI does not follow spec to multiply by 100, and the scale not falling into the 0-100 range (negative numbers) can be attributed to the negative difference between these values since the absolute value is not taken.

            Since changing this indicator to follow spec would involve code breaking changes, we are currently tracking as a feature request with ticket ID SFT-3203. This will likely be addressed in a new major release of NinjaTrader instead of a minor release for that reason. (Ticket ID's can be referenced in the Release Notes page of the help guide when a new release addresses that ticket.)

            Specifically the feature request notes to address:
            a) consider using Wilders EMA type smoothing (compare across other platforms)
            b) multiply +/- DI components by 100
            c) crosscheck output range, likely should be between 0 and 100, so not using an absolute value on the difference that would result in negative values
            In the meantime, the recommendation would be to use the DM indicator or another indicator for DX.

            Thanks again!
            JimNinjaTrader Customer Service

            Comment


              #7
              Originally posted by Harry View Post
              I had a quick look at this indicator, which is provided as DMI (Directional Movement Index).
              I have checked it and found that it is a strange beast that has little in common with the DMI created by Welles Wilder.

              My personal impression is that it just miscalculates the DMI. First, it uses simple moving averages. Everybody who has read the work by Welles Wilder knows that he never used simple moving averages, because exponential moving averages are easier to calculate by hand. Also there is an omission in the code, as the DMI uses the absolute amount of the difference between diPlus and diMinus, and not the difference itself.

              The result is a strange oscillator that has little in common with the DMI. Where does this formula originate from, and what is it good for? How does it come that it shows negative values, where the original DMI uses a scale from 0 to 100? The DMI is a non-directional indicator, whereas the NinjaTrader version is a directional momentum indicator.

              Please see chart attached.
              Harry, Hi.

              You may want to also compare DMI to other vendors' or online charting services. I just checked TOS's DMI, it is certainly different from your DMI and Ninja DMI. But TOS's is consistent with the classic DMI based on Wilder's where the plot also includes the crossing DI+ and DI-.

              I assumed your chart was a 5-m of the May 2nd YM-06.

              Cheers!
              Last edited by aligator; 05-04-2018, 05:09 PM.

              Comment


                #8
                Hi Jim,

                I had expected this answer.

                I understand that code breaking changes need to be avoided, as any application that has used this indicator so far would become disfunct.

                Your reference to FM Labs is funny, as it relates to the other DMI, the Dynamic Momentum Index, which is available as NinjaTrader default indicator DMIndex.

                However, your DMI is a pure nonsense indicator which is good for nothing, and the description is just a flawed copy of the description of the DMIndex. Are you really sure you want to keep that one?

                Comment


                  #9
                  Hello Harry,

                  To clarify, our DMI indicator is modeled after the DX indicator on FMLabs. (However, incorrectly as noted in this thread.) This is linked in our help guide. For the thread's reference, I'll provide links below.

                  DMI help guide page - https://ninjatrader.com/support/help..._index_dmi.htm

                  FMLabs DX - http://www.fmlabs.com/reference/default.htm?url=DX.htm

                  I am confident that this will be replaced at the next major release. Until then, the recommendation would be to use another indicator.
                  JimNinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by aligator View Post
                    Harry, Hi.

                    You may want to also compare DMI to other vendors' or online charting services. I just checked TOS's DMI, it is certainly different from your DMI and Ninja DMI. But TOS's is consistent with the classic DMI based on Wilder's where the plot also includes the crossing DI+ and DI-.

                    I assumed your chart was a 5-m of the May 2nd YM-06.

                    Cheers!
                    The TOS DMI and my version basically use the same formula and should return identical results, when applied to the same price bars.

                    My formula simply avoids division by N in both numerator and denominator, but that difference should cancel out in the end.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by PaulMohn, Today, 12:36 PM
                    2 responses
                    16 views
                    0 likes
                    Last Post PaulMohn  
                    Started by Conceptzx, 10-11-2022, 06:38 AM
                    2 responses
                    53 views
                    0 likes
                    Last Post PhillT
                    by PhillT
                     
                    Started by Kaledus, Today, 01:29 PM
                    0 responses
                    3 views
                    0 likes
                    Last Post Kaledus
                    by Kaledus
                     
                    Started by yertle, Yesterday, 08:38 AM
                    8 responses
                    37 views
                    0 likes
                    Last Post ryjoga
                    by ryjoga
                     
                    Started by rdtdale, Today, 01:02 PM
                    1 response
                    6 views
                    0 likes
                    Last Post NinjaTrader_LuisH  
                    Working...
                    X