Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Visual Studio NT8 Debug

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Visual Studio NT8 Debug

    getting a few errors thrown up when trying to debug strategy with Visual Studio (see attached) - is this my fault or should I find another debug method?
    Attached Files

    #2
    Hello delTik,

    Probabily, the exception is thrown because owner is null. You should check that "owner as Gui.NinjaScript.IChartBars" is not null before reference it.

    Comment


      #3
      Originally posted by cls71 View Post
      Hello delTik,

      Probabily, the exception is thrown because owner is null. You should check that "owner as Gui.NinjaScript.IChartBars" is not null before reference it.
      This is likely the case, or one of the objects in that line is null. Generally with Visual studio you can hover the mouse cursor over each object to see if it has a value or if it is null to determine what specifically is null.

      Otherwise checking each object that can be null if it is not null should also correct this.

      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment


        #4
        You should check that "owner as Gui.NinjaScript.IChartBars" is not null
        not sure how to do this?

        Comment


          #5
          Originally posted by delTik View Post
          not sure how to do this?
          You can include all code into this IF:

          if( owner is Gui.NinjaScript.IChartBars)
          {
          // all code
          }

          Comment


            #6
            thanks but what is "owner"?

            Comment


              #7
              "owner" is the variable appears in your code. It is a variable name.

              Comment


                #8
                ok I think the code shown in the attached image is NT code?

                Comment


                  #9
                  Hello,

                  If the error is coming from one of the internal or included scripts you should be able to see what the file name of the currently open file is in visual studio. This would at least tell you a general area of the error but would not help with why.

                  If this is a internal piece of code that is null, you may need to debug the strategy causing this to see what specific syntax is causing the scenario.

                  With the specific syntax found, you could provide that and if it is in error I can provide that to development for review. Otherwise this would help identify why that is becoming null in the case the logic in the strategy is not passing a value or something.

                  Its really hard to say anything more than general statements based on the image, if you can provide more detail on what the specific scenario is that would help greatly.

                  I look forward to being of further assistance.
                  JesseNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by pvincent, 06-23-2022, 12:53 PM
                  14 responses
                  238 views
                  0 likes
                  Last Post Nyman
                  by Nyman
                   
                  Started by TraderG23, 12-08-2023, 07:56 AM
                  9 responses
                  383 views
                  1 like
                  Last Post Gavini
                  by Gavini
                   
                  Started by oviejo, Today, 12:28 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post oviejo
                  by oviejo
                   
                  Started by pechtri, 06-22-2023, 02:31 AM
                  10 responses
                  125 views
                  0 likes
                  Last Post Leeroy_Jenkins  
                  Started by judysamnt7, 03-13-2023, 09:11 AM
                  4 responses
                  59 views
                  0 likes
                  Last Post DynamicTest  
                  Working...
                  X