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 judysamnt7, 03-13-2023, 09:11 AM
              4 responses
              59 views
              0 likes
              Last Post DynamicTest  
              Started by ScottWalsh, Today, 06:52 PM
              4 responses
              36 views
              0 likes
              Last Post ScottWalsh  
              Started by olisav57, Today, 07:39 PM
              0 responses
              7 views
              0 likes
              Last Post olisav57  
              Started by trilliantrader, Today, 03:01 PM
              2 responses
              21 views
              0 likes
              Last Post helpwanted  
              Started by cre8able, Today, 07:24 PM
              0 responses
              10 views
              0 likes
              Last Post cre8able  
              Working...
              X