Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

More than 100 subsequent events?

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

    More than 100 subsequent events?

    Hi,

    I'm trying something a little kooky for more efficient back-testing purposes... it basically involves placing multiple orders within the same bar.

    As a result, I'm ending up with this:

    4/21/2009 11:16:06 PM Strategy Error on calling the 'OnOrderUpdate' method for strategy 'ProtectDownMulti': More than 100 subsequent user events

    ...? What's a user event? I should probably have about 20 stop orders queued up (on the same bar) at this point, not 100. What's the fundamental constraint here?

    #2
    User event = NinjaScript method call

    > 100 stacked NinjaScript method calls would be invoked. This is an indication, that there could be something wrong with your code, probably a infinite recursion.

    Comment


      #3
      Originally posted by NinjaTrader_Dierk View Post
      User event = NinjaScript method call

      > 100 stacked NinjaScript method calls would be invoked. This is an indication, that there could be something wrong with your code, probably a infinite recursion.
      Dierk,

      Thanks, I'll take a closer look at what I'm doing.

      But can you give me an idea of how I could generate a "stacked" call? Would it have to be within the OnOrderUpdate or OnExecution methods, like where I'm submitting additional orders?

      Comment


        #4
        Sample:
        - NT calls A
        - A triggers some order(s)
        - which then triggers B
        - B then triggers some order(s)
        - which then triggers A

        A, B = NinjaScript methods

        This is just a sample. Your scenario would be very different. Bottom line is: As NT calls a NinjaScript method, your logic in that method would trigger more than 100 additional direct NinjaScript method before actually control would be returned to NT.

        Comment


          #5
          Originally posted by heech View Post
          Dierk,

          Thanks, I'll take a closer look at what I'm doing.

          But can you give me an idea of how I could generate a "stacked" call? Would it have to be within the OnOrderUpdate or OnExecution methods, like where I'm submitting additional orders?
          Oh I bet I can guess what I'm doing.

          I have probably 30-60 orders sitting on the same BarsInProgress value. And of course, each order can generate multiple events for OnOrderUpdate (pendingsubmit, submitted, accepted, etc...). And it's probably this combination that can push me over the 100 limit.

          Does that sound reasonable as a possibility...?

          Comment


            #6
            I see. I'll change that limit to 1000. Pls fire me again a mail so I could provide you a custom build.

            Comment


              #7
              Actually even better: there is the undocumented .MaxProcessedEvents property which you could set in Initialize() to your liking.

              Comment


                #8
                Originally posted by NinjaTrader_Dierk View Post
                Actually even better: there is the undocumented .MaxProcessedEvents property which you could set in Initialize() to your liking.
                Beautiful, that did it.

                Now I can test probably 20x faster than I had been...

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                673 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                379 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                111 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                578 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                582 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X