The following outlines how the Market Replay works in syncing the Level I and Level II data together. The same concept applies to syncing events between different instruments being played back at the same time.
|•||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, NinjaTrader will gather all the L1 information that happened within 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.|
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. For this reason, L1 and L2 sequencing should not be relied on in Market Replay if that sequencing is needed at a more granular level than 1 second.