• 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 Leeroy_Jenkins, Today, 03:00 AM
            0 responses
            5 views
            0 likes
            Last Post Leeroy_Jenkins  
            Started by zergrush, Today, 12:17 AM
            2 responses
            10 views
            0 likes
            Last Post zergrush  
            Started by KhaosTrader, Yesterday, 11:04 PM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Marco  
            Started by rcsingleton, Today, 12:28 AM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_ChrisSch  
            Started by harjinderjit, Yesterday, 06:41 PM
            0 responses
            25 views
            0 likes
            Last Post harjinderjit  
            Working...
            X