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

Multi timeframe: Data mismatch between Dialog Box to Print statement

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

    Multi timeframe: Data mismatch between Dialog Box to Print statement

    Hi there

    I am trying to compare 5 EMA values from a 10 min chart on a 3 min chart using

    EMA(BarsArray[1], period)[0];


    However, I notice that I am getting different values from the dialog box (when I right click) compared to when I use the print command. This does not happen when I compare say EMA(5)[0].

    I've experimented with COBC = false also tried FirstTickOfBar but there is definitely a discrepancy between the dialog box and the print command. So am I missing something with this multi?

    The indicator displays correctly for me its just a matter of comparing what I see visually...

    Attached is the code with a screenshot of the right click and below is a print out:

    I am comparing at 9:48 AM. You can see from the chart it should be 2769.63 not 2777.07 as indicated below.

    2782.48 09/10/2012 9:39:00 AM
    2777.07 09/10/2012 9:42:00 AM
    2777.07 09/10/2012 9:45:00 AM
    2777.07 09/10/2012 9:48:00 AM
    2769.63 09/10/2012 9:51:00 AM
    2769.63 09/10/2012 9:54:00 AM
    2769.63 09/10/2012 9:57:00 AM
    Attached Files
    Last edited by ij001; 10-11-2012, 10:45 AM.

    #2
    What is the "myEMA" you're using? Does it use the same methods you're using in the test you sent?

    If you add the standard EMA to the chart manually to a 10 minute chart, do you get the sames results as your test method? Do you get the same results if you take out the rounding?
    MatthewNinjaTrader Product Management

    Comment


      #3
      Hi Matthew

      Sorry for the long reply:

      myEMA is the standard EMA included in NT except I added colors when rising/falling. In my recent screenshot I removed it to avoid confusion because we are looking at multi's.

      Now, myEMAMulti is another standard EMA I created and it uses a 10 min 5 EMA. It is plotted using EMA(BarsArray[1], period)[0] as well. There is no other methods.

      Yes, I added the standard EMA(5) with no rounding on a 10 min chart and did get the same results below:

      2777.07156979909 09/10/2012 9:40:00 AM
      2769.63104653273 09/10/2012 9:50:00 AM

      I interpret it as: 9:48 would use the data from the 9:50 AM bar which is 2769.63.

      I also removed the rounding from MyMethodTest and got the same results:

      2777.07156979909 09/10/2012 9:42:00 AM
      2777.07156979909 09/10/2012 9:45:00 AM
      2777.07156979909 09/10/2012 9:48:00 AM
      2769.63104653273 09/10/2012 9:51:00 AM
      2769.63104653273 09/10/2012 9:54:00 AM

      Now since that didn't solve it, I added a plot so you can see both and notice the slight difference. Why? Both are based on EMA(BarsArray[1], period)[0]


      I attached the updated code with myEMAMulti and a screenshot.
      Attached Files

      Comment


        #4
        I figured it out.

        myEMAMulti does not have BIP == 0 but MyMethodTest does.

        I'm confused on the proper use. It appears from the previous tests I shouldn't include it?

        Comment


          #5
          BIP is just used for you to filter which bars object is called for your trading logic. Without using BIP, any event to BIP0 or BIP1 will be updated. If you're using just BIP0, you are filtering the updates to only update when the first object updates.
          MatthewNinjaTrader Product Management

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by r68cervera, Today, 05:29 AM
          0 responses
          2 views
          0 likes
          Last Post r68cervera  
          Started by geddyisodin, Today, 05:20 AM
          0 responses
          3 views
          0 likes
          Last Post geddyisodin  
          Started by JonesJoker, 04-22-2024, 12:23 PM
          6 responses
          33 views
          0 likes
          Last Post JonesJoker  
          Started by GussJ, 03-04-2020, 03:11 PM
          12 responses
          3,239 views
          0 likes
          Last Post Leafcutter  
          Started by AveryFlynn, Today, 04:57 AM
          0 responses
          6 views
          0 likes
          Last Post AveryFlynn  
          Working...
          X