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 Rapine Heihei, 04-23-2024, 07:51 PM
                  2 responses
                  30 views
                  0 likes
                  Last Post Max238
                  by Max238
                   
                  Started by Shansen, 08-30-2019, 10:18 PM
                  24 responses
                  943 views
                  0 likes
                  Last Post spwizard  
                  Started by Max238, Today, 01:28 AM
                  0 responses
                  9 views
                  0 likes
                  Last Post Max238
                  by Max238
                   
                  Started by rocketman7, Today, 01:00 AM
                  0 responses
                  7 views
                  0 likes
                  Last Post rocketman7  
                  Started by wzgy0920, 04-20-2024, 06:09 PM
                  2 responses
                  28 views
                  0 likes
                  Last Post wzgy0920  
                  Working...
                  X