Announcement

Collapse
No announcement yet.

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.

    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.

                  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.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      574 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      333 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      101 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      553 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      551 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X