Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnPositionUpdate() Vs OnBarUpdate for fast Position State

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

    OnPositionUpdate() Vs OnBarUpdate for fast Position State

    Hi,

    I know that either of these methods will give us the most current position almost at the same time for practical terms, however, I'd like to know which will it update first in milliseconds since I'm not sure about internals logic with asynchronous procedures.

    Thanks in advance

    #2
    Hello pstrusi,

    OnBarUpdate updates when a bar closes.


    If you have a 1 minute bar, and your position updates just after the bar opens, you wouldn't know until almost a full minute.

    OnPositionUpdate updates when the position updates. This would immediately when the positions updates.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I was having in mind, more tick by tick...would it still be the same? I apologize for not to tell that as previous detail.

      Thanks Chelsea
      Last edited by pstrusi; 03-27-2017, 06:05 AM.

      Comment


        #4
        Hello pstrusi,

        Thanks for your reply.

        In the tick by tick processing of OnBarUpdate, it is possible there could be multiple ticks processed before the OnPositionUpdate occurs as this is dependent upon communications and order processing times with the exchanges/brokers.

        To give you an example, go to Tools>Options>Simulator and note the built-in simulation values for delay of communications to broker is 75 mS and exchange is 150 mS. Again these are times for the simulator account only. A real account would likely have different values which would be dependent upon dynamic real time conditions of the internet connections and broker/exchanges. In any case, you can see why OnBarUpdate and OnPositionUpdate are necessarily asynchronous.

        Comment

        Latest Posts

        Collapse

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