I am using NinjaTrader 7 with Kinetick, and the Market Replay functionality. I am trying to match up what comes in to the time & sales window with the trades that I receive in the OnMarketData() method of a NT strategy. In particular I am trying to decide whether a trade is a market sell (which trades at the bid price), or a market buy (which trades at the ask price). I compare the values of MarketDataEventArgs.price with GetCurrentBid/Ask() and make a decision.
What I am seeing is that although trades are indicated in the T&S window as being sells done at the low of the day (they have a red background), sometimes if I obtain the values of GetCurrentBid() and GetCurrentAsk() then the market appears to have already moved down a tick. Therefore in NT7 I am recording that trade as a BUY, when in fact it should be a sell.
I'm guessing that by the time I receive the OnMarketData event the market quote has already moved down. Is there a way to get a synchronised copy of what the bid/ask was when the trade happened?


Comment