• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 wishing, Today, 03:21 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_Tyler  
            Started by crazyhorse2393, Today, 03:09 PM
            0 responses
            8 views
            0 likes
            Last Post crazyhorse2393  
            Started by forextrader2003, Today, 02:55 PM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_PatrickG  
            Started by Sank1, Today, 01:58 PM
            2 responses
            9 views
            0 likes
            Last Post Sank1
            by Sank1
             
            Started by GARZONJ, Today, 12:50 PM
            3 responses
            11 views
            0 likes
            Last Post NinjaTrader_Jim  
            Working...
            X