Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order management

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

    Order management

    Hello,

    1. With NT being multi-threading are all events like "OnOrderUpdate", "OnBarUpdate",OnExcution" are called and run from the same thread context?
    (is the OnBarUpdate" and "OnOrderUpdate" are running in the same thread context)

    2. Is it possible that "OnBarUpdate" will called and run while "OnOrderUpdate" are processed?

    3. Is there any particular logic sequence that these events are called and proccessed?

    sincerely,Kobi

    #2
    Hello levikNT,

    NinjaTrader 7 runs all NinjaScript, charts, and the main UI in a single thread and is not mult-threaded.

    However, these methods are event driven. Meaning they trigger when an event happens and do not happen sequentially.

    OnOrderUpdate can trigger at about the same time as OnBarUpdate but one will happen before the other as they are running in the same thread and which happens first depends on when things were triggered.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello ChelseaB,

      Thank you for your response but I don't understand
      In NT help document it says that NT is multi-Threaded application please refer to
      page 957 Under section 10.4.7.31 (OnMarketDepth()) from the Definition part it says and
      I quote "Ninja Trader is multi-threaded application and there for it is extremely important to understand ...."

      another reference
      page 746 section 10.4.3.56 (OnMarketData) under the Tips Paragraph number 4 I quote " With NT being multi-threading,......".

      so, what is means these references?

      Sincerely,Kobi

      Comment


        #4
        Hi levikNT,

        I understand the confusion. NinjaScripts such as strategies and indicators are run in a single thread and this is the same thread as the NinjaTrader UI which runs all the windows, charts, control center etc.

        The data is received by a different thread, and order submissions and receiving updates are handled by a different thread. These other threads that handle data and order submission and updates will trigger actions in the script such as OnMarketData and OnOrderUpdate, however, the methods in script that are being triggered are in the UI thread.

        This means that one method will be triggered in the script at a time, but it these methods are event driven and trigger when certain actions happen and not in a particular order.

        In other words, OnOrderUpdate is called when the order update is received. OnExecution will trigger when the execution update is received.

        OnBarUpdate triggers when the bar closes.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hi levikNT,

          I understand the confusion. NinjaScripts such as strategies and indicators are run in a single thread and this is the same thread as the NinjaTrader UI which runs all the windows, charts, control center etc.

          The data is received by a different thread, and order submissions and receiving updates are handled by a different thread. These other threads that handle data and order submission and updates will trigger actions in the script such as OnMarketData and OnOrderUpdate, however, the methods in script that are being triggered are in the UI thread.

          This means that one method will be triggered in the script at a time, but it these methods are event driven and trigger when certain actions happen and not in a particular order.

          In other words, OnOrderUpdate is called when the order update is received. OnExecution will trigger when the execution update is received.

          OnBarUpdate triggers when the bar closes.
          Hi ChelseaB,

          Thank you for your response,
          Is NT 8 will work in the same concept as you explained?

          Sincerely,Kobi

          Comment


            #6
            Hi levikNT,

            NinjaTrader 8 will be multi-threaded. This means that scripts will run in their own thread instead of running with the UI thread.

            While this does mean NinjaTrader will have better performance when running indicators, the methods in the scripts will still be event driven. So the behavior will be about the same.

            Below is a link to the major enhancements planned for NT8.
            http://www.ninjatrader.com/downloads...njaTrader8.pdf
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            649 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            370 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            109 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            574 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            576 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X