Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnMarketDepth

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

    #31
    Josh, I really can read my own code. Honestly ;-)

    If you look at that line, you'll see it doesn't even match the output above.

    I am using event time.

    Comment


      #32
      As seen in one of my prior posts, the events all line up chronologically as one would expect. This was played back at the exact time you posted with no issues, even at 500x replay speed. If you are seeing differently please provide your exact script and exact setup used for playback. It is meaningless to have us guess what you have code wise and setup wise especially since the most basic script and setup demonstrated in my earlier post is working. That output was generated simply by adding the script onto a chart and running past the 7:05 mark.
      Josh P.NinjaTrader Customer Service

      Comment


        #33
        Josh,

        The reason your events lined up properly is because you didn't even print the trades!!

        regards
        Dave

        Comment


          #34
          ? I am not filtering any events. The code prints every single event received from all methods.
          Josh P.NinjaTrader Customer Service

          Comment


            #35
            Josh,

            Try using FGBL 12-10 and see what that gives.

            thanks
            Dave

            Comment


              #36
              Which date would you like me to test? Earlier I tried 6S 12-10 on 10/21 in UK timezone as was used in your first post.
              Josh P.NinjaTrader Customer Service

              Comment


                #37
                21/10/2010 07:05:39 (GMT+1)

                Thanks Josh.

                Comment


                  #38
                  Thanks Dave for your patience and efforts in pointing us in the right direction. With this file I was able to see what you were saying with the syncing mismatch between OnMarketData() and OnMarketDepth(). I have forwarded this up to development for further analysis.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #39
                    That's great Josh, thanks.

                    By the way, it's the sync between on market depth and on bar update

                    Comment


                      #40
                      Dave,

                      Thank you for your patience. We have looked into this and have determined the behavior here.
                      • NinjaTrader's Market Replay feature uses two separate files for Level I and Level II data.
                      • When replaying, the Level I sequence is guaranteed to be in the correct sequence in relation to all Level I events for that instrument.
                      • The Level II sequence is also guaranteed to be in the correct sequence in relation to all Level II events for that instrument.
                      • When both Level I and Level II data streams are played in conjunction, the Level I and the Level II events are still guaranteed to be in the correct sequence in relation to their individual streams. So L1 is still correctly sequenced for all L1 and L2 is correctly sequenced for all L2s.
                      • What is not guaranteed though is the sequence of events between L1 and L2 greater than that of a one second granularity.
                      • What the NinjaTrader Market Replay does is increment the replay in seconds intervals (00:00:00 to 00:00:01) <-- HH:mm:ss
                      • When the second moves up by one NT will gather all the L1 information that happened between that second and then gather all the L2 information within that second. Then they are meshed together.
                      • There is no guarantee as to how the L1 and L2 data will mesh together at this point. What this means is that it is possible to have L1 events timestamped as seemingly after a L2 event yet still played first and the vice versa as well.

                      Ex:
                      L1 data between 00:00:00 and 00:00:01. We have a L1 event of 00:00:01:00 (HH:mm:ss:ff)
                      L2 data between 00:00:00 and 00:00:01. We have a L2 event of 00:00:00:90 (HH:mm:ss:ff)

                      Notice how both of these events with a seemingly 00:00:00 and 00:00:01 seconds granular timestamp were gathered together for replaying for the same 1 second time increment on the replay file. The meshing of these two events could result in the L1 event of 00:00:01 being shown first followed by the L2 event of 00:00:00:90.

                      This would appear to be out of chronological order, but because the meshing is simply not done with a granularity higher than 1 second this can occur. It is for this reason that L1 and L2 sequencing should never be relied on in Market Replay if that sequencing is needed at a more granular level than 1 second.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #41
                        Originally posted by NinjaTrader_Josh View Post
                        • When the second moves up by one NT will gather all the L1 information that happened between that second and then gather all the L2 information within that second. Then they are meshed together.
                        Thanks for the detailed reply. That all makes sense, and is expected, but my point was that the trades and level2 were out of order at a granularity greater than one second. If all the data is meshed for each second, as you say above, then how can I get trades timestamped at 07:05:41 followed by level2 timestamped at 07:05:40

                        Comment


                          #42
                          That is within the 1 second "tolerance". It grabs all events from within 7:05:41 to 7:05:42. Your actually event would have millisecond timestamps something like 7:05:41:911 and 7:05:42:00.

                          As the Market Replay rolls from the 7:05:41 second to the 7:05:42 second it includes every event from 7:05:41:001 to 7:05:42:000. When you actually see these printouts they are only done to the second granularity though so you only see it as :41 or :42.
                          Josh P.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

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