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 kaywai, 09-01-2023, 08:44 PM
    5 responses
    602 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by xiinteractive, 04-09-2024, 08:08 AM
    6 responses
    22 views
    0 likes
    Last Post xiinteractive  
    Started by Pattontje, Yesterday, 02:10 PM
    2 responses
    20 views
    0 likes
    Last Post Pattontje  
    Started by flybuzz, 04-21-2024, 04:07 PM
    17 responses
    230 views
    0 likes
    Last Post TradingLoss  
    Started by agclub, 04-21-2024, 08:57 PM
    3 responses
    17 views
    0 likes
    Last Post TradingLoss  
    Working...
    X