Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Timer CustomEvent error in strategy

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

    Timer CustomEvent error in strategy

    I am trying to trigger a custom event every 10 seconds from a strategy.
    I've created a test strategy which holds a timer object, just like the example you provided here: http://www.ninjatrader.com/support/f...ad.php?p=30463

    Now here's the problem; the timer in the strategy initially works fine, but after a while (100-120 prints to the ouput window) the timer stops, and I get the following error :
    "4/1/2011 18:59:47 Strategy Error on triggering custom event for strategy 'dummy2/28fe004900d0433391ec29eb47cb3b4b': More than 100 subsequent user events

    Why do I get this error from the strategy and not from the indicator ?
    What can be done to avoid this error ?

    Attached the test strategy which gives the error.

    Marco
    Attached Files

    #2
    Marco, please have a look at this thread where the same error message was discussed and clarified - http://www.ninjatrader.com/support/f...ad.php?t=29467

    Thanks,

    Comment


      #3
      wow that was a quick reply !

      thanks for the link. However I must confess It doesn't help me very much.
      I would like see a solution from NinjaTrader on this issue, since you also provided the reference example.

      I understand that the "unofficial" solution is to:

      A) to bypass the TriggerCustomEvent ? I don't like to do that
      because in the indicator example you provided there is a specific
      warning on that : " /* Important to use the TriggerCustomEvent() to ensure that
      NinjaScript indexes and pointers are correctly set."

      B) set MaxProcessedEvents to a higher number in Initialize.
      If I set it to 1000000, has this any adverse effects on NinjaTrader or memory usage ? Where does this limit of 100 come from, is it hardcoded in NinjaScript ? I guess there was a reason for this ? Is it safe to increase the MaxProcessedEvents ?

      -So basically which one should I use and why ? Is this workaround "approved" by Ninjatrader ?

      -Why do I get this error using the Timer in a strategy and NOT in an indicator ?

      Marco
      Last edited by marcow; 04-01-2011, 01:28 PM.

      Comment


        #4
        Originally posted by NinjaTrader_Bertrand View Post
        Marco, please have a look at this thread where the same error message was discussed and clarified - http://www.ninjatrader.com/support/f...ad.php?t=29467

        Thanks,
        I have the same issue, using your timer sample and got "more than 100 events" error.

        So, what exactly is the official answer to this??
        If the 'fix' is to bypass TimerEventProcessor call, then do it!
        Change the sample code.

        Or is it the official ninjatrader policy to let user go thru the pain, and search the forum, in order to 'graduate', like in the linux community??
        This is NOT a free, and open source community. People pay for your product!

        Comment


          #5
          Thanks for the post - there's two approaches generally here -

          a) use a higher .MaxProcessedEvents value in your script's Initialize()
          b) apply code changes to ensure you're not triggering those 100 successive user events / NS method calls before control would be given back to NT.

          I have also asked for this info to be clearer documented going forward.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          558 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          324 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          545 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          547 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X