• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 :

    http://www.ninjatrader.com/support/f...ead.php?t=9825

    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..
          http://www.ninjatrader.com/support/f...ad.php?t=42032

          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
            BrettNinjaTrader Product Management

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by pstrusi, Today, 02:21 AM
            0 responses
            4 views
            0 likes
            Last Post pstrusi
            by pstrusi
             
            Started by indy73, Yesterday, 10:52 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_EricB  
            Started by priceisking, 05-13-2019, 08:30 AM
            6 responses
            37 views
            0 likes
            Last Post Harry
            by Harry
             
            Started by WgfhqDsdfg, Today, 12:56 AM
            0 responses
            6 views
            0 likes
            Last Post WgfhqDsdfg  
            Started by pjsmith, Today, 12:43 AM
            0 responses
            5 views
            0 likes
            Last Post pjsmith
            by pjsmith
             
            Working...
            X