Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Are calls OnBarUpdate synchronized ?

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

    Are calls OnBarUpdate synchronized ?

    I would like to ask, if the handler OnBarUpdate() is synchronized on the running
    instance of strategy, or there can run more invocations of this method paralelly?

    #2
    Hello misova,

    Thank you for your post.

    The OnBarUpdate() is called for the bar series that the strategy is applied to and the added bar series in the code. Any bar update will call the OnBarUpdate() method, any bar update from a bar series the strategy is applied to or added in the code.

    You would use BarsInProgress to determine the series calling the OnBarUpdate(). For information on BarsInProgress please visit the following link: http://www.ninjatrader.com/support/h...inprogress.htm

    Please let me know if I may be of further assistance.

    Comment


      #3
      Thankx, but my main question was,
      if some previous/or already running invocation of OnBarUpdate() is guaranteed to be finished before another one invocation of OnBarUpdate() can be started?
      Last edited by misova; 12-08-2014, 05:54 AM.

      Comment


        #4
        misova, the processing is done sequentially - so you would not have to concerned with the threading model here for NT7.

        Comment


          #5
          Thank you, that is what I needed.

          Just extreme example to confirm my understanding:

          Do I understand it correctly?, that if processing one OnBarUpdate() would take
          10 minutes (and trading 1-minute bars), then I would completely slowed down
          the whole processing like this:

          • 1st OnBarUpdate() -- called immediately, takes 10 mins to finish
          • 2nd OnBarUpdate() -- called after finishing previous, starts at T+10min, takes also 10 mins
          • 3rd OnBarUpdate() -- called after finishing 2nd, starts at T+20min
          • 4th OnBarUpdate -- called after finishing 3rd, starts at T+30min


          It is clear, that such extremely heavy processing is not expected, but just to confirm the understanding how things really work under the hood of NT7..
          Last edited by misova; 12-08-2014, 08:09 AM.

          Comment


            #6
            Correct, it would be queued then and processed in sequence.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            153 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            89 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            133 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            127 views
            1 like
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            107 views
            0 likes
            Last Post CarlTrading  
            Working...
            X