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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        64 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        35 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        59 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        51 views
        0 likes
        Last Post CarlTrading  
        Working...
        X