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 ScottW, Today, 06:09 PM
              1 response
              4 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by ScottWalsh, Today, 06:52 PM
              0 responses
              3 views
              0 likes
              Last Post ScottWalsh  
              Started by ftsc2022, 10-25-2022, 12:03 PM
              5 responses
              256 views
              0 likes
              Last Post KeyonMatthews  
              Started by Board game geek, 10-29-2023, 12:00 PM
              14 responses
              244 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by Waxavi, 04-19-2024, 02:10 AM
              4 responses
              56 views
              0 likes
              Last Post sonia0101  
              Working...
              X