Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Debugging NT8 Indicator with Visual Studio 2008

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

    Debugging NT8 Indicator with Visual Studio 2008

    Has anybody managed to get this working?

    I attach to the ninjatrader.exe process and set a breakpoint in the code file but I get the
    "Breakpoint currently will not be hit .No symbols have been loaded for this document" message.

    I see there is a NinjaTrader.Custom.pdb symbol file created but VS2008 says the symbols don't match when I try and load the file manually.

    thanks

    #2
    Hello,

    Thank you for the post.

    I would not be certain if 2008 is capable of correctly debugging the NT8 custom project as I have no way to test 2008. I could suggest updating to a newer visual studio.

    I can confirm that NT8 has been successfully tested with 2012, 2015 and 2017.
    2015 and 2017 have free community editions in case you would like to test a newer version.

    In general you should only need to enable debug mode from the NinjaScript editor.
    Click the Visual Studio button in the editor to launch the solution.
    Using the solution browser, open the script to be debugged.
    Finally attach to the process and then reload the NinjaScript in the window it is running from to see breakpoints hit.



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

    Comment


      #3
      OK, thanks for that Jesse, I didn't know free versions were available.

      Comment


        #4
        Jesse,
        I opened as per your instructions below using Visual Studio 2013.
        I generated a build but then on exit I did not save the solution. Now on reopening VS from
        the editor it cannot find the solution. It seems like the first time it is run it forces it to generate
        the solution from the Ninja Files. How can I Regenerate it ?

        Thanks

        Comment


          #5
          Hello,

          Thank you for the reply.

          In the case that the NinjaScript editor button cannot open the custom project with VS2013 (again I have any way to test this version) you would instead need to manually open the file from Visual Studio: Documents\NinjaTrader 8\bin\Custom\NinjaTrader.Custom.csproj

          Can you confirm are you able to manually locate and open the project?


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

          Comment


            #6
            I am all set, for whatever reason when it opened the second time didn't open on the solutiosn tab so I was looking at a blank screen wondering where did it go?
            It seems to work although there are a ton of warnings. Do you understand these. is there a way to get rid of them. They are all similar. See attached.
            Attached Files

            Comment


              #7
              Hello,

              The warnings would be expected, the Custom solution for NinjaTrader is different than a standard C# project.

              You can just click the Warnings button you see in the image to hide them.

              Compiling from Visual Studio using Build Solution or Build project should still allow you to check syntax and see actual errors but please note that this is not the same as Compiling in NinajTrader.

              Just saving files from Visual Studio with the NinjaScript editor open is the suggested way to check that the code is valid, the NinjaScript editor will report compile errors or problems.

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

              Comment


                #8
                Please ignore, I found it in the Help Guide.
                thanks

                What is the proper Sequence to use breakpoints from VS.
                When you set a breakpoint from VS and click run does it reload the Indicator in ninjaTrader ?
                and then run like normal until the BP is Hit ?

                Comment


                  #9
                  Hello,

                  Thank you for the reply.

                  The BreakPoint process would rely on NinjaTrader to complete actions just like a normal application being debugged would. Visual Studio debugger is only listening to the application it is attached to, waiting for it to complete some action which relates to the source code that is open in the solution. Once the code in question is run, the break would occur.

                  This means you would need to reload a chart or F5 to reload NinjaScript to restart it from bar 0 and then reach your breakpoint.

                  You also need to ensure to Compile with debug mode prior to attaching to the process so the debug symbols are produced.

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

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Belfortbucks, Today, 09:29 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post Belfortbucks  
                  Started by zstheorist, Today, 07:52 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post zstheorist  
                  Started by pmachiraju, 11-01-2023, 04:46 AM
                  8 responses
                  150 views
                  0 likes
                  Last Post rehmans
                  by rehmans
                   
                  Started by mattbsea, Today, 05:44 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post mattbsea  
                  Started by RideMe, 04-07-2024, 04:54 PM
                  6 responses
                  33 views
                  0 likes
                  Last Post RideMe
                  by RideMe
                   
                  Working...
                  X