Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnStartUp event doesn't always finish before OnBarUpdate

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

    OnStartUp event doesn't always finish before OnBarUpdate

    I'm seeing a recurrence of my OnStartUp code not completing before Ninja fires the OnBarUpdate.

    Are there any circumstances that are known to cause this that I should be aware of?

    Thanks

    #2
    Hi Adamus,

    Thank you for the post.

    This should not be possible as the OnStartUp() is called before the OnBarUpdate() and will finish the logic inside the method before the other methods get called.

    What are you seeing with the script?
    Have you tried using Print Statements to confirm what you are seeing?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Its because I'm using Print statements that I know Ninja is doing this.

      This is only the third time it's happened in about a year but it definitively 'happened', which is why I have code in place to catch it when it does.

      I am using GetBars() in the OnStartUp event - synchronously I hasten to add - so this is probably the root of the problem.

      However I detect the situation quite simply - I set a flag to true as the last line of code in the OnStartUp event and I check that the flag is true before allowing the OnBarUpdate code to execute.

      While trying to isolate the cause of the issue today, the situation returned to normal and I can't get any further evidence for it now - unless it does it again tomorrow.

      Comment


        #4
        Adamus,

        Would you be willing to send me your script to support[at]ninjatrader[dot]com so that I may test out the code on my end as well?
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Hi Cal,

          I just emailed you.

          Comment


            #6
            Got it. Will review and follow up with you in email.

            Thank you
            Cal H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by sjsj2732, Yesterday, 04:31 AM
            0 responses
            36 views
            0 likes
            Last Post sjsj2732  
            Started by NullPointStrategies, 03-13-2026, 05:17 AM
            0 responses
            287 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            288 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            134 views
            1 like
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            95 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Working...
            X