Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 kevinenergy, 02-17-2023, 12:42 PM
    115 responses
    2,699 views
    1 like
    Last Post kevinenergy  
    Started by prdecast, Today, 06:07 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by Christopher_R, Today, 12:29 AM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by chartchart, 05-19-2021, 04:14 PM
    3 responses
    577 views
    1 like
    Last Post NinjaTrader_Gaby  
    Started by bsbisme, Yesterday, 02:08 PM
    1 response
    15 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X