I think you have a big problem with the synchronisation of the order book data in your L1 and L2 data streams.
Please run the attached indicator to see the problem. For each transaction it prints to the output window the following information:
Transaction Price
L1 Ask Price
L2 Ask Price
L1 Bid Price
L2 Bid Price
You will see lots of line such as the one below in the output:
1.6136,1.6137,1.6137,1.6136,1.6135
Notice how the final 2 numbers are out of synch. This means that the L1 and L2 bid prices did not agree at the time of the transaction. This is a significant problem if you are trying to classify transactions. In this case using the L1 data would result in the transaction being classified 'at bid', but using the L2 data it would be classified as 'between ask & bid'.
I'm using a Zen-Fire feed and have spent quite a lot of time looking at the R | API documentation from Rithmic. The R | API generates only a single market data message for an update to the order book so the synch problem must exist within the NinjaTrader core. The OnMarketData() and OnMarketDepth() method calls relating to a change in the best ask or bid quote should be happening almost simultaneously. Obviously they are not. I'm thinking that possibly the problem lies with the L1 and L2 data being processed on separate threads?
Could you please look into this as a matter of urgency. It's a fairly critical problem for me as I don't know which data stream to trust when classifying transactions.
Thanks
Comment