Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

unhandled exception during backtesting

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

    unhandled exception during backtesting

    guys- if we get an unhandled exception during back testing which causes the backtester/optimizer to hang something like the below

    2011-12-21 11:19:40:951 in OnUnhandledThreadException
    2011-12-21 11:19:41:101 *************** unhandled exception trapped ***************
    2011-12-21 11:19:41:101 Collection was modified; enumeration operation may not execute.
    2011-12-21 11:19:41:101 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)

    Does that mean we have effectively "crashed" NT and the best practice will be to shut down NT and restart it?

    Thanks

    #2
    ag,

    It appears you may be changing the contents of a list during enumeration. I would suggest making liberal use of Try/Catch statements to see if you can isolate the section the issue is occurring in. It appears to be a programming error to me. NinjaTrader shouldn't be crashed.

    Here is a reference sample on try/catch :



    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Hi Adam,

      yep able to resolve the issue (a timing issue with some indicators) but after that I tried to refresh a chart which was running live data and nothing came back.. the only way I could get NT to keep working was to restart it and I am wondering if this is expected behaviour?

      Comment


        #4
        ag,

        Its possible it put NinjaTrader in a caught-exception state where it couldn't get back out of. Ill talk to development about it. They would have more information.

        Thanks for your note.
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          Thanks for looking into this... I think this is similar to the issue on the following thread..


          In both cases the problem ended up being in the code which was subsequently resolved but in the mean time NT has basically crashed with little notification (only thing is an error in the trace file but not in normal logging).
          Obviously becomes an issue if you are backtesting while trading (not a good idea in any case I know..).. worth either notifying people of having an error generate in the log (vs the trace file).

          Comment


            #6
            We simply do not have the ability to catch every misuse of NinjaScript. To do this we would need to limit what you could do which we would not want to do.

            We are always looking to improve the NinjaTrader platform however, thank you for your suggestion.

            I wish you a great rest of your holiday!

            -Brett

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Barry Milan, Today, 10:35 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by WeyldFalcon, 12-10-2020, 06:48 PM
            14 responses
            1,428 views
            0 likes
            Last Post Handclap0241  
            Started by DJ888, Yesterday, 06:09 PM
            2 responses
            9 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            40 views
            0 likes
            Last Post jeronymite  
            Started by bill2023, Today, 08:51 AM
            2 responses
            16 views
            0 likes
            Last Post bill2023  
            Working...
            X