Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how handle orders in MarketReplay

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

    how handle orders in MarketReplay

    in the docs ( https://ninjatrader.com/support/help...rderupdate.htm ), there is stated:


    When connected to the Market Replay Connection, calling market order based methods such as EnterLong() and EnterShort() will result in order state events being fired prior to the order method return an IOrder object. This is done to ensure that all events are in sync at high speed market replays.

    and there is example code given. I cant understand clearly, does that mean, that `entryOrder` object will be null in that example code:

    Code:
    protected override void OnOrderUpdate(IOrder order)
    {
      if (entryOrder != null && entryOrder == order)
    will here 🡹 be null , if we are in marketReplay ? (as doc says Event is fired before object is returned, so i thought entryOrder will be null there?)

    #2
    Hello TazoTodua,

    You are reading that correctly. It's possible that the IOrder variable will be null when OnOrderUpdate triggers. That said, I've never personally run into this issue with NinjaTrader 7. (But it is possible)

    This is definitely an issue with NinjaTrader 8 for any data feed. Order objects should always be assigned from the order argument supplied by OnOrderUpdate().

    I've got a few examples that describe this style of assigning Order objects for NT8 that would also be a workaround (should you be running into this issue) with IOrder objects for NT7.

    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    51 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    142 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    275 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X