Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 junkone, Today, 11:37 AM
            0 responses
            1 view
            0 likes
            Last Post junkone
            by junkone
             
            Started by quantismo, 04-17-2024, 05:13 PM
            5 responses
            34 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by proptrade13, Today, 11:06 AM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by love2code2trade, 04-17-2024, 01:45 PM
            4 responses
            34 views
            0 likes
            Last Post love2code2trade  
            Started by cls71, Today, 04:45 AM
            2 responses
            10 views
            0 likes
            Last Post eDanny
            by eDanny
             
            Working...
            X