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

Please Help With Script

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

    Please Help With Script

    Hello Ninjas,

    Sometime aga a Ninja compiled the Market Faciliation Index script.

    Up until recently I've been using the services of esignal. I'm now going back to Ninjatrader.

    I use the Market Facilitation Index extensively, but before I completely jump ship I compared the results from the Ninja script and Esignal and there is a big gap between the results.

    After much investigation I noticed the following line of code in Ninjas script:

    mfi[0]=(Math.Abs(Open[0]-Close[0]))/(Volume[0]*TickSize);

    This differs widely from esignals implementation, which is:

    if (Vol > 0) MFI = Range / Vol * 1000000000;

    I was wondering if someone could let me which one is correct.

    Cheers

    Attached is the full script
    Attached Files

    #2
    carlton, as we would unfortunately not be familiar with the custom codes used I'll leave this open for other commnunity members to share their feedback.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Bertrand.

      Thanks

      All I really want is for someone to verify it.

      Cheers

      Comment


        #4
        Originally posted by carlton View Post
        Hello Ninjas,

        Sometime aga a Ninja compiled the Market Faciliation Index script.

        Up until recently I've been using the services of esignal. I'm now going back to Ninjatrader.

        I use the Market Facilitation Index extensively, but before I completely jump ship I compared the results from the Ninja script and Esignal and there is a big gap between the results.

        After much investigation I noticed the following line of code in Ninjas script:

        mfi[0]=(Math.Abs(Open[0]-Close[0]))/(Volume[0]*TickSize);

        This differs widely from esignals implementation, which is:

        if (Vol > 0) MFI = Range / Vol * 1000000000;

        I was wondering if someone could let me which one is correct.

        Cheers

        Attached is the full script
        They are both correct !!!

        MFI is a relative indicator (as are many oscillators). The only difference in those formulae is the multiplicand of the divisor, which, I guess in each case is just an attempt to get a nicer printed absolute value showing on the chart. Regardless, the relative values, over any range of bars, will be exactly the same.

        Comment


          #5
          Koganam,

          Thanks for getting back to me mate.

          I was hoping you were going to say something like that, however, when I run the Ninjascripts alongside esignal there is a difference in the numbers.

          The reason why I'm running them together is because I moving over to Ninja and I want to make sure that the indicator with Ninja is ok. But, as I said, they aren't producing the same numbers.....

          Comment


            #6
            They will produce different numbers. However, take any range of bars, then compare the relative values of the MFI for the different charts. They should be the same. IOW assume that on NT the values are 1000 and 2000, (a ratio of 2). then on ESignal, they may be 15 and 30, still a ratio of 2. (I pulled the figures out of exactly nowhere, but I hope I have made the point).

            Another way to look at it is simply that on each chart the MFI's go up at the same time, and they go down at the same time, so they indicate the same thing, as their absolute values are unimportant. At least, as far as I remember the MFI indications are merely "MFI up" and "MFI down" in relation to "volume up" and "volume down".

            Comment


              #7
              Koganam,

              You're quite right. Also, I was using market data feeds from two different sources.

              Thanks man.

              Comment


                #8
                could you please post a link to the MFI for Ninjatrader 8

                Thanks a lot

                Comment


                  #9
                  Hello xamer,

                  Thank you for the post.

                  Here is the conversion to NinjaTrader 8:



                  Please let us know if we may be of any further assistance.
                  Chris L.NinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by NinjaTrader_ChrisL View Post
                    Hello xamer,

                    Thank you for the post.

                    Here is the conversion to NinjaTrader 8:



                    Please let us know if we may be of any further assistance.
                    thanks a lot...........

                    could you please explain to me why do you multiply by TickSize???

                    Comment


                      #11
                      Hello xamer,

                      Thanks for the follow-up.

                      This was a decision by the author to normalize the volume in terms of the price. The values of High-Low are so small, the solutions you would get out of (High-Low)/Volume would be too small. So multiplying the volume by the tick size creates values more relative to the price of the instrument. I have seen other formulations online where they multiply (High-Low) by Range(), this is to make the numerator larger with respect to the volume.

                      Please let us know if we may be of any further assistance.
                      Chris L.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by sidlercom80, 10-28-2023, 08:49 AM
                      168 responses
                      2,262 views
                      0 likes
                      Last Post sidlercom80  
                      Started by Barry Milan, Yesterday, 10:35 PM
                      3 responses
                      10 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Started by WeyldFalcon, 12-10-2020, 06:48 PM
                      14 responses
                      1,429 views
                      0 likes
                      Last Post Handclap0241  
                      Started by DJ888, 04-16-2024, 06:09 PM
                      2 responses
                      9 views
                      0 likes
                      Last Post DJ888
                      by DJ888
                       
                      Started by jeronymite, 04-12-2024, 04:26 PM
                      3 responses
                      41 views
                      0 likes
                      Last Post jeronymite  
                      Working...
                      X