Level 1 Market Data Out of Order

Hello all, I’m back with some market data inconsistencies issues. I am subscribed to Ninjatrader Brokerage “Live” connection for level 1 futures CME data. I accidentally did some data checking and I noticed that some data events arrive out of order. My PC clock is in sync and CQG should timestamp by exchange.

Using this code:

protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
		{
			if(State == State.Historical){
				return;	
			}
			if (marketDataUpdate.MarketDataType != MarketDataType.Last && marketDataUpdate.MarketDataType != MarketDataType.Ask && marketDataUpdate.MarketDataType != MarketDataType.Bid){
	            return;
			}
			Print("LEVEL 1:" + marketDataUpdate.ToString() + " TIME: " + marketDataUpdate.Time.ToString("HH:mm:ss.fff") + " MACHINE TIME: " + DateTime.Now.ToString("HH:mm:ss.fff"));
			
		}

I get this output in my console:

LEVEL 1:instrument='ES 09-26 Globex' type=Ask price=7756.5 volume=22 time='9/3/2026 1:46:59 PM' bid=7756.25 ask=7756.5 isReset=False TIME: 13:46:59.413 MACHINE TIME: 13:46:59.476
LEVEL 1:instrument='ES 09-26 Globex' type=Bid price=7756.25 volume=69 time='9/3/2026 1:46:59 PM' bid=7756.25 ask=7756.5 isReset=False TIME: 13:46:59.413 MACHINE TIME: 13:46:59.476
LEVEL 1:instrument='ES 09-26 Globex' type=Ask price=7756.5 volume=31 time='9/3/2026 1:46:59 PM' bid=7756.25 ask=7756.5 isReset=False TIME: 13:46:59.412 MACHINE TIME: 13:46:59.476
LEVEL 1:instrument='ES 09-26 Globex' type=Bid price=7756.25 volume=65 time='9/3/2026 1:46:59 PM' bid=7756.25 ask=7756.5 isReset=False TIME: 13:46:59.412 MACHINE TIME: 13:46:59.476
LEVEL 1:instrument='ES 09-26 Globex' type=Last price=7756.5 volume=1 time='9/3/2026 1:46:59 PM' bid=7756.25 ask=7756.5 isReset=False TIME: 13:46:59.412 MACHINE TIME: 13:46:59.476
LEVEL 1:instrument='ES 09-26 Globex' type=Last price=7756.5 volume=1 time='9/3/2026 1:46:59 PM' bid=7756.25 ask=7756.5 isReset=False TIME: 13:46:59.412 MACHINE TIME: 13:46:59.476
LEVEL 1:instrument='ES 09-26 Globex' type=Last price=7756.5 volume=2 time='9/3/2026 1:46:59 PM' bid=7756.25 ask=7756.5 isReset=False TIME: 13:46:59.412 MACHINE TIME: 13:46:59.476
LEVEL 1:instrument='ES 09-26 Globex' type=Last price=7756.5 volume=1 time='9/3/2026 1:46:59 PM' bid=7756.25 ask=7756.5 isReset=False TIME: 13:46:59.412 MACHINE TIME: 13:46:59.476
LEVEL 1:instrument='ES 09-26 Globex' type=Last price=7756.5 volume=1 time='9/3/2026 1:46:59 PM' bid=7756.25 ask=7756.5 isReset=False TIME: 13:46:59.412 MACHINE TIME: 13:46:59.476
LEVEL 1:instrument='ES 09-26 Globex' type=Last price=7756.5 volume=1 time='9/3/2026 1:46:59 PM' bid=7756.25 ask=7756.5 isReset=False TIME: 13:46:59.412 MACHINE TIME: 13:46:59.476
LEVEL 1:instrument='ES 09-26 Globex' type=Last price=7756.5 volume=1 time='9/3/2026 1:46:59 PM' bid=7756.25 ask=7756.5 isReset=False TIME: 13:46:59.412 MACHINE TIME: 13:46:59.476
LEVEL 1:instrument='ES 09-26 Globex' type=Ask price=7756.5 volume=22 time='9/3/2026 1:46:59 PM' bid=7756.25 ask=7756.5 isReset=False TIME: 13:46:59.413 MACHINE TIME: 13:46:59.498
LEVEL 1:instrument='ES 09-26 Globex' type=Bid price=7756.25 volume=69 time='9/3/2026 1:46:59 PM' bid=7756.25 ask=7756.5 isReset=False TIME: 13:46:59.413 MACHINE TIME: 13:46:59.498

As you can see the exchange timestamp ticks down from 13:46:59.413
to 13:46:59.412 and then back up while machine time is strictly chronological. Is this some known market data issue I have to deal with manually?

Thanks.

This is a useful example because it shows why I would not use MarketDataEventArgs.Time itself as a sequence number.

The callbacks are clearly arriving to your code in one order, while the timestamps attached to those events are not strictly monotonic. That does not necessarily prove the callbacks were delivered to NinjaTrader out of exchange sequence — only that the timestamp field is not sufficient to reconstruct a total ordering.

I would extend your logger with a local monotonically increasing sequence number assigned as the very first operation inside OnMarketData(). Then record:

  • local sequence number
  • event type
  • event timestamp
  • local receive time
  • price / volume
  • current bid / ask

If your order-flow logic depends on event ordering, process the live stream in callback order rather than sorting it afterward by marketDataUpdate.Time.

The particularly interesting test would be to capture the same short period live and later compare it with historical/replay data. If the live callback sequence is deterministic but the reconstructed historical sequence differs, that would connect directly with the 4 ms historical-binning issue you found earlier.