Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exception in Running Strategy Analyzer

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

    Exception in Running Strategy Analyzer

    I am using Ninjatrader 7.0. When I run the Strategy Analyzer, I get the following C# exception (which is retrieved in the Trace file).

    What I found out is that when the Strategy Analyzer was started, it loaded the price data for an instrument in the timeframe of 1 min. For my test, I set the timeframe to a different one, say, 5 seconds. Then I clicked the Run Backtest button to start the Analyzer (which set the button disabled). After a while (a few minutes), nothing happened and the Run Backtest button became enabled again. Then I checked the trace file and found many exceptions like the following:

    ================================================== ============

    2012-01-04 03:26:56:241 ERROR: Failed to call 'Add' method for period type 'Second': Collection was modified; enumeration operation may not execute.
    2012-01-04 03:26:56:243 in OnUnhandledThreadException
    2012-01-04 03:26:56:247 *************** unhandled exception trapped ***************
    2012-01-04 03:26:56:247 Collection was modified; enumeration operation may not execute.
    2012-01-04 03:26:56:247 at System.Collections.ArrayList.ArrayListEnumeratorSi mple.MoveNext()
    at NinjaTrader.Data.MarketDataEventArgs.Process()
    at NinjaTrader.Cbi.Connection.OnRealtimeDataTimerTick (Object sender, EventArgs e)
    at System.Windows.Forms.Timer.OnTick(EventArgs e)
    at System.Windows.Forms.Timer.TimerNativeWindow.WndPr oc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    ================================================== ============

    Any idea about this exception?

    #2
    Hi trador,

    Thanks for the post. What is the add statement you are using that causes this exception?
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      In my strategy, there is no Add() method directly used (Some Add() methods are used in the referred custom indicators). So I don't know how this Add() error is generated (I guess this Add() is some internal method in NinjaTrader?).

      I have run the same strategy before (a few days ago) and there was no issue. I have no idea what has caused this internal exception recently.

      Comment


        #4
        OK, I would just restart NinjaTrader and see if it's still reproducible. If so, please send us the latest version of your trace file.

        You will find the trace file in the Documents > NinjaTrader 7 > Trace folder.
        *The trace file will be named "trace.YYYYMMDD.txt"
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          How do I send you the trace file (what is the email address)?

          Comment


            #6
            My apologies - Please send to support 'at' ninjatrader 'dot' com and include a link to this thread.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              The trace file has been sent. Thanks.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by pmachiraju, 11-01-2023, 04:46 AM
              8 responses
              149 views
              0 likes
              Last Post rehmans
              by rehmans
               
              Started by mattbsea, Today, 05:44 PM
              0 responses
              5 views
              0 likes
              Last Post mattbsea  
              Started by RideMe, 04-07-2024, 04:54 PM
              6 responses
              33 views
              0 likes
              Last Post RideMe
              by RideMe
               
              Started by tkaboris, Today, 05:13 PM
              0 responses
              5 views
              0 likes
              Last Post tkaboris  
              Started by GussJ, 03-04-2020, 03:11 PM
              16 responses
              3,283 views
              0 likes
              Last Post Leafcutter  
              Working...
              X