Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Race conditions - order submission

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

    Race conditions - order submission

    I'm wondering which method I should put my limit orders submissions in to that would avoid race conditions during a quickly moving market. I would have a List<LadderRow> of limit orders on the book and would want to remove/cancel limit orders as the market ticked in any direction. It would seem I'd want to put them in the OnBarUpdate() method. But what would happen if say the bid price moved up a tick and down a tick before my order confirmation could be received? I'd think a cancellation order might be sent before I received a order received packet.

    So I wonder if instead I should place my order logic in a custom timer event method like the one listed in the reference samples. That way it would only check every 1000ms to see the status of the market and make any order changes. Thanks for input.

    #2
    If you do it off of OnBarUpdate() and had CalculateOnBarClose = false then you would run into issues you suspected in your post. Using a custom event could be one way to go about this. You could also program it to not do anything till modification confirmation has been received.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the confirmation Josh. I'm going to test out utilizing the OnOrderUpdate method. Is this what you were referring to in your last sentence?

      Comment


        #4
        Correct. Off of OnOrderUpdate() you can check for the order state to be cancelled.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        52 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
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X