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.

      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.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  670 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  379 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  111 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  575 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  582 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X