• 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.


No announcement yet.

Partner 728x90


Renaming a tab and object references

  • Filter
  • Time
  • Show
Clear All
new posts

    Renaming a tab and object references

    I'm not sure if my problem is because of custom indicator or custom strategy but probably one of those that exists on a chart.

    The problem I have is sometimes I get "object reference not set to an instance of an object" and I understand this has something to do with null values.

    It happens sometimes when I rename a tab for the chart.

    However, I would like to know what part of the ninjatrader code I should be looking at - probably one of the states in OnStateChange I'm guessing?

    Hello NinjaCustomer,

    Are you able to reproduce this behavior on a chart with no indicators applied?

    Is there a specific indicator that when only that indicator applied is able to reproduce the error?

    Does this indicator reference the window's MainTabControl?

    Are there any addons that are injecting code into charts?

    Are you using
    Last edited by NinjaTrader_ChelseaB; 06-20-2019, 09:53 AM.
    Chelsea B.NinjaTrader Customer Service


      well the problem is when it happens sometimes it happens on a few different tabs even... but then I restart the program and it doesn't happen for a long time.. there's not any way I know of to reproduce it at will.. That is why I want to understand where the best place to look in the code is.. there are many indicators on the chart, but i can't just remove them one by one for the reason just stated - i have no way to test it. And I have 2 strategies on the chart (same strategy with different params)

      So I'd really like to know just what events are most likely triggered by renaming, I assume it is the onstatechange but I have a lot of stuff going on in that event in most of my indicators, so if you could narrow it down to specific states of onstatechange that would give me a better idea of where to look

      I'm using .0 not .1 but unless this is something that was explicitly fixed by the version, my guess is it won't make a difference.

      I do not understand what chart code injection is but the only AddOn I'm running doesn't affect charts.

      I don't think any of the indicators reference MainTabControl, I could not find it by searching the source code. I do have one drawing tool that does do this however I haven't drawn anything with it.
      Last edited by NinjaCustomer; 06-21-2019, 03:48 AM.


        Hello NinjaCustomer,

        Without isolating the issue and running many scripts at the same time its like trying to find out which specific wave was made by a specific boat in the ocean.

        The error could be in OnStateChange, OnBarUpdate, OnMarketData, or OnMarketDepth..

        Or maybe its an internal NinjaTrader that occurs without 3rd party scripts and needs to be reported..
        Last edited by NinjaTrader_ChelseaB; 06-23-2019, 09:27 AM.
        Chelsea B.NinjaTrader Customer Service


          I understand that isolating is very useful, however, it's intermittent so it would take a lot of work and waiting to try and figure it out. Knowing these events make it much easier to proof-read the code and try to find it that way- unless:

          1) can I use VS to somehow trap the exception?
          2) would running NinjaTrader in debug mode under VS over long periods of time significantly impact the performance of NT8?


            Hello NinjaCustomer,

            It is possible to attach the NinjaTrader process to Visual Studio.

            However, any use of Visual Studio would be outside of what our support team is able to assist with.

            From my understanding there is a performance impact when attaching a process to Visual Studio. I'm not sure if it's significant.
            Chelsea B.NinjaTrader Customer Service


              Did you check the trace files for more information? I have found that it can sometimes include the actual exception thrown and a call stack. When it happens next, go to the trace folder in your NinjaTrader folder and look through the most recent file.


                thanks i'll keep that in mind the next time it happens


                Latest Posts


                Topics Statistics Last Post
                Started by cirzonorkecv, Yesterday, 11:52 PM
                0 responses
                Last Post cirzonorkecv  
                Started by rickyblah12, Yesterday, 01:01 PM
                1 response
                Last Post Erwin Beckers  
                Started by dadarara, Yesterday, 12:18 PM
                0 responses
                Last Post dadarara  
                Started by joemiller, Yesterday, 07:33 AM
                2 responses
                Last Post joemiller  
                Started by TheGameOfProbabilities, 07-18-2019, 06:56 AM
                7 responses
                Last Post DaveS
                by DaveS