Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Event queue execution order

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

    Event queue execution order

    Hi there,

    I've got a problem with the execution order of the event queue. I've developed a volume profile indicator which works on tick base (with tick replay). To determine if the bar has finished, I have to use the OnMarketData and the OnBarUpdate event.

    In a second indicator I'm using the volume profile indicator as data source. Unfortunately, the OnBarUpdate event handler of the main indicator is raised before the event handler of the referenced volume profile indicator. Therefor I get empty data for that actual bar.

    Is there a way to control the order of execution?

    BR
    Jan

    #2
    Hello Jan,

    There is not a way to change the order of OnBarUpdate and OnMarketUpdate.

    However, can the script be changed to only rely on market update events and not OnBarUpdate?

    TickReplay might need to be enabled.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi,

      I'm already using both OnBarUpdate and OnMarketData event in the underlying indicator. I also don't want to change the order of these events. I want to control the execution order on indicator level.

      Indicator A has
      • OnMarketData
      • OnBarUpdate
      Indicator B has
      • OnMarketData

      Indicator B is using an instance of Indicator A and is accessing its data. For performance reasons I calculate the volume profile (POC,VAH,VAL) only when the bar has finished (OnBarUpdate). Unfortunately, the OnBarUpdate event of the hosting Indicator B is called before Indicator A. Therefor the volume profile has not been calculated yet and Indicator A gets empty data.

      In my opinion, if an indicator is part of another one, their events should be processed first and in the end events of the main indicator should be called.

      What do you think? Is the problem clear?

      BR
      Jan

      Comment


        #4
        Hello Jan,

        If these are being saved in a series, these would be updated at the same time as OnBarUpdate in the host script.

        If these are not series, you may need to call <Indicator>.Update().
        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
        577 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 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