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

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 bmartz, 03-12-2024, 06:12 AM
                5 responses
                32 views
                0 likes
                Last Post NinjaTrader_Zachary  
                Started by Aviram Y, Today, 05:29 AM
                4 responses
                13 views
                0 likes
                Last Post Aviram Y  
                Started by algospoke, 04-17-2024, 06:40 PM
                3 responses
                28 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by gentlebenthebear, Today, 01:30 AM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by cls71, Today, 04:45 AM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X