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

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,
    BertrandNinjaTrader Customer Service

    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.
          BertrandNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by kujista, Today, 06:23 AM
          5 responses
          15 views
          0 likes
          Last Post kujista
          by kujista
           
          Started by f.saeidi, Today, 10:19 AM
          0 responses
          4 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by traderqz, Yesterday, 09:06 AM
          2 responses
          16 views
          0 likes
          Last Post traderqz  
          Started by traderqz, Today, 12:06 AM
          3 responses
          6 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by RideMe, 04-07-2024, 04:54 PM
          5 responses
          28 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Working...
          X