No announcement yet.

Partner 728x90


NT8 Exception - Chart Panel Related

  • Filter
  • Time
  • Show
Clear All
new posts

    NT8 Exception - Chart Panel Related

    Just fyi, Hit an exception in the chart panel control code while refreshing a custom indicator.

    I probably refreshed it 30 times over the course of a few hours before it happened. I don't have much more information than that.


    Hello crokusek, and thank you for your report.

    You mentioned using a custom indicator. Is this an open source indicator? By this, I mean that there would be a C# file that matches your indicator's name in (My) Documents\NinjaTrader 8\bin\Custom\Indicators if it was open source.

    If it is open source, would it be possible to provide us with a stripped down copy of this indicator? If you would rather not share it publicly you can e-mail it to platformsupport[at]ninjatrader[dot]com with attn:ninjatrader_jessicap and 1581275 in the subject line.

    If it is closed source (you do not have a matching C# file) or you would rather not send us any code, could you try to reproduce this with a built-in indicator? It will make it easier to make the same thing happen on our end if you are.

    If your custom indicator came from one of our partner vendors, you may want to follow up with them as well as us. Messages such as "index out of range" are ones that could occur both inside NinjaTrader and in a partner vendor's NinjaScript.
    Jessica P.NinjaTrader Customer Service


      Yes that message is not useful without a context.

      The 2nd screenshot however shows the stack trace where it occurred and may be useful to your side. To me it appears it is accessing a chart panel or tab # that does not exist. Also at least to my eye the stack trace doesn't explicitly show the custom indicator being involved directly with the exception. Probably refreshing any indicator 100 times in a row with many windows and many tabs open might create it.

      Anyway, this issue is rare so far so feel free to close if you do not wish to followup the stack trace with one of your coders. if it continues I will try and create a repro as you suggest.


        I agree the context was useful, thanks again for providing both images. I did notice that the area that this occurred in - NinjaTrader.Gui.Chart.ChartControl.RefreshIndicato rs - is an area from which a lot of hook methods into custom NinjaScript code are dispatched. This creates a space that includes both our own, our partner's, and our customer's NinjaScript products. It is often helpful even if the ultimate cause is a partner vendor's or customer's product to isolate those components that are causing things like this, since it puts us in a better position to answer other customer's and partner's queries when they end up in similar situations.

        That said we appreciate our customers and respect their time. We are happy for any help improving NinjaTrader 8 that we can get from our terrific base here on the forums. If a code sample would be of any difficulty to come by, however, the following information should be enough for us to investigate this matter.

        Please send me your log and trace files, templates, and other files, so that I may look into what occurred.
        You can do this by going to the Control Center-> Help-> Email Support.
        Please reference the following ticket number in the body of the email: 1581352
        Please include Attn:NinjaTrader_JessicaP in the body of your e-mail.
        IMPORTANT: Please also tick all the boxes in the "Other Files" section.
        Jessica P.NinjaTrader Customer Service


          Get ChartControl.RefreshIndicators List() error.


          The error shown below was occurring consistently while rolling over expiration dates ( and I reported it awhile back here. Unfortunately it brings down the whole system so is very disruptive.

          Can I request that a try/catch/log be placed around get_item (its probably in brackets []) there as an interim solution? I cannot provide any more information at this time and it is not reproducible as I've completed the rollover. I think it is a race condition and not a programming logic error. Something about the multiple dialogs being open and closed while the chart started a refresh. As shown in the stack trace the custom indicator is not directly involved.


          2016-12-09 23:14:50:386 System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
          Parameter name: index
          at System.ThrowHelper.ThrowArgumentOutOfRangeExceptio n(ExceptionArgument argument, ExceptionResource resource)
          at System.Collections.Generic.List`1.get_Item(Int32 index)
          at NinjaTrader.Gui.Chart.ChartControl.<>c__DisplayCla ss537_2.<RefreshIndicators>b__9(Object o)
          at System.Threading.ExecutionContext.RunInternal(Exec utionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
          at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
          at System.Threading.QueueUserWorkItemCallback.System. Threading.IThreadPoolWorkItem.ExecuteWorkItem()
          at System.Threading.ThreadPoolWorkQueue.Dispatch()


            Hello Chris,

            As your new thread's post was on the same subject and same error message, I have moved your post into the existing thread on this topic.

            Are you able to reproduce the behavior without any 3rd party or custom scripts within the NinjaTrader folder within Documents?
            (This would indicate an issue with the platform we must report)

            If not, can you provide a stripped down sample script that only contains the code necessary to reproduce the behavior?

            If this is an open source script, you can add try and catches to the script. A note, that when adding a try and catch, you should print the error as this will prevent any errors from appearing in the Log.

            Below is a publicly available link to a 3rd party educational site that demonstrates using a try and catch.

            Please note, in the support department at NinjaTrader we do not create, debug, or modify code for our clients. This is so that we can maintain a high level of service for all of our clients as well as our partners.
            Chelsea B.NinjaTrader Customer Service


            Latest Posts


            Topics Statistics Last Post
            Started by ezrollin, Yesterday, 08:34 PM
            1 response
            Last Post NinjaTrader_ChrisL  
            Started by egar1234, Yesterday, 03:51 PM
            1 response
            Last Post NinjaTrader_PaulH  
            Started by derivtrader, Today, 05:59 AM
            2 responses
            Last Post derivtrader  
            Started by dgee949, Yesterday, 09:01 PM
            1 response
            Last Post NinjaTrader_ChrisSch  
            Started by uncavl, Today, 12:41 AM
            1 response
            Last Post NinjaTrader_Jason