Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Directional Movement Index Dilemma

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

    Directional Movement Index Dilemma

    I have a dilemma. Several traders in our group use Strategy Runner for their charting service because it has a DX (which they call a directional movement index) that apparently is not available elsewhere.

    According to Guy, at Strategy Runner, the formula for their DX is: (diPlus - diMinus) / (diPlus + diMinus). There is only one variable in the indicator settings for the SR DX, which is set at "8".

    Attached are two example of the vast difference I see when comparing the SR DX to NT DMIndex, which appears to have the same formula. The examples are NQ, 2min, Jul 29, 2010 data, same session times (8:30-3:15 CDT).

    My goal has been to avoid using SR charting service for this single indicator. Hoping I could get it on NT.

    Thanks all,
    Attached Files
    Last edited by nelsonnelson; 08-01-2010, 09:38 AM.

    #2
    Unfortunately we would not know how Strategy Runner actually calculates theirs. Slight differences in algorithms can lead to different results.

    What I can say though is it sounds like you want "Directional Movement Index" and not "Directional Momentum Index".

    In NT,
    DMIndex = Directional Momentum Index
    DMI = Directional Movement Index
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thank you, Josh,

      Attached is the equation the Strategy Runner developer, Guy, sent me. A member of this forum tells me that this is the same formula used on the NT DMIndex.

      I hope I have not misunderstood, just trying to figure out how to get the same, or very similar, result in NT.

      Thanks,
      Attached Files

      Comment


        #4
        The formula NT uses for DMIndex is as follows:

        RSI((int)(14 / (StdDev(5)[0] / SMA(StdDev(5), 10)[0])), Smooth)[0]

        It is basically just the RSI on a very specific period. I believe you should try the DM or DMI indicator.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Ok,

          I think I tried all the indicators in the NT chart menu that had anything to do with Directional anything. Nothing I've tried yet has given the same reading as the SR DX. I wil try again, though, as you have suggested it, and will submit charts showing results here later.

          Thanks

          Comment


            #6
            nelsonnelson,

            Ultimately, all of the logic is freely available for you to see what we are using for ours. You can go to Tools > Edit NinjaScript and select whichever one you want to view to see the exact logic. Our indicators follow the logic outlined here: http://tadoc.com/ and are what we believe are the generally accepted algorithms for them. Unfortunately we just cannot speak to whether or not that would be comparable to Strategy Runner or not.

            Please also note that different data feeds resulting in different data will impact your indicator results too.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              NT DM and DMI

              Here are two charts showing the DM and DMI on the same data used in earlier example today.

              What do you think?
              Attached Files

              Comment


                #8
                Here is what the code for DMI is exactly.

                Code:
                Value.Set((diPlus + diMinus == 0) ? 0 : (diPlus - diMinus) / (diPlus + diMinus));
                This is exactly what is shown in your screenshot for the code. Unfortunately we will not be able to comment on how Strategy Runner actually calculates di+ and di-.

                How NT does it is as follows:
                Code:
                double diPlus    = (SMA(tr, Period)[0] == 0) ? 0 : SMA(dmPlus, Period)[0] / SMA(tr, Period)[0];
                double diMinus    = (SMA(tr, Period)[0] == 0) ? 0 : SMA(dmMinus, Period)[0] / SMA(tr, Period)[0];
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Josh, apparently the SR DX is set to period 14, and their developer observes that NT DMIndex is set to 3. I am in the template for that indicator, but don't see a way to change the period.

                  Thanks,

                  Comment


                    #10
                    nelsonnelson,

                    DMIndex is the incorrect indicator. You should be using the DMI one. DMIndex is not using the same math as what you are looking for as it is a completely different indicator. I am not sure why they think DMIndex is using a period of 3. None of our indicators are hard coded to use any periods. It will use whatever period the user chooses to use. The default just happens to be 3 for DMIndex.

                    Likewise, DMI is not hard coded to use a period of 3 either. Whatever period you choose to add the indicator as will be the period used by the indicator.

                    In my previous post I showed you what exactly the code was for the DMI indicator. It is exactly the correct DX math. What you would want to look into is how exactly they choose their DI+ and DI- values for calculation. We follow the generally accepted approach as outlined in tadoc.com. Unfortunately if they use a different approach then it would not match. As discussed earlier as well, different data will yield different indicator results so you should expect some differences if you have different data between the two platforms.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Thanks, Josh

                      In looking at the DMI, set for 14 to compare with the SR DX, right hand axis range is from -1 to +1, and bears no obvious relation to the SR DX, which ranges from 0 up, typically traveling between 10-70 many times a day.

                      Additionally, the highest peak of the SR DX today was at 11:48, while at that time the DMI showed a negative reading. Likewise, one of the low points on the SR DX at 13:22, is contrasted with a relative high in the DMI. It's just hard to see what relation they have to each other, they seem so different

                      Are you certain the DMI is the NT equivalent of the SR DX?

                      Thanks, and I do appreciate your your attention to this matter.

                      Comment


                        #12
                        nelsonnelson, from your prior posts and looking into our code I believe those should be equivalents yes, but comparing indicators across platforms can be a tricky task especially as you also have to consider the raw data just not being 100% the same. Perhaps you can print each formala's components in NT and SR to determine where the cals are not working as you would expect.
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          Yes, Bertrand,

                          But when it comes to that, not being a programmer, the task is daunting. I guess I will have to have adopt the additional Strategy Runner charting service, which, and I mean no offense, I find clumsy to use. Much prefer NT.

                          Too bad.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by cre8able, 02-11-2023, 05:43 PM
                          3 responses
                          236 views
                          0 likes
                          Last Post rhubear
                          by rhubear
                           
                          Started by frslvr, 04-11-2024, 07:26 AM
                          8 responses
                          113 views
                          1 like
                          Last Post NinjaTrader_BrandonH  
                          Started by stafe, 04-15-2024, 08:34 PM
                          10 responses
                          46 views
                          0 likes
                          Last Post stafe
                          by stafe
                           
                          Started by rocketman7, Today, 09:41 AM
                          3 responses
                          11 views
                          0 likes
                          Last Post NinjaTrader_Jesse  
                          Started by traderqz, Today, 09:44 AM
                          2 responses
                          10 views
                          0 likes
                          Last Post NinjaTrader_Gaby  
                          Working...
                          X