• 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

Renaming a tab and object references

Collapse
X
  • 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?

    #2
    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 8.0.18.1?
    Last edited by NinjaTrader_ChelseaB; 06-20-2019, 09:53 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      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.

      Comment


        #4
        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

        Comment


          #5
          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?

          Comment


            #6
            Hello NinjaCustomer,

            It is possible to attach the NinjaTrader process to Visual Studio.
            https://ninjatrader.com/support/help..._debugging.htm

            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

            Comment


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

              Comment


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

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by James108, Today, 06:09 PM
                0 responses
                1 view
                0 likes
                Last Post James108  
                Started by RandanAL, Today, 05:13 PM
                0 responses
                5 views
                0 likes
                Last Post RandanAL  
                Started by timko, Today, 05:06 PM
                0 responses
                5 views
                0 likes
                Last Post timko
                by timko
                 
                Started by ballboy11, Today, 01:04 PM
                1 response
                9 views
                0 likes
                Last Post NinjaTrader_PaulH  
                Started by Linda1507, Today, 01:22 PM
                2 responses
                15 views
                0 likes
                Last Post Linda1507  
                Working...
                X