Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.


            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 MarianApalaghiei, Today, 10:49 PM
                3 responses
                9 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by XXtrader, Today, 11:30 PM
                0 responses
                3 views
                0 likes
                Last Post XXtrader  
                Started by love2code2trade, Yesterday, 01:45 PM
                4 responses
                28 views
                0 likes
                Last Post love2code2trade  
                Started by funk10101, Today, 09:43 PM
                0 responses
                9 views
                0 likes
                Last Post funk10101  
                Started by pkefal, 04-11-2024, 07:39 AM
                11 responses
                37 views
                0 likes
                Last Post jeronymite  
                Working...
                X