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

Getting errors trying to do a build in Visual Studio necessary to use the debugger?

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

    Getting errors trying to do a build in Visual Studio necessary to use the debugger?

    I want to use the Visual Studio debugger for strategy development. Any assistance, videos documentation, examples would be appreciated if available?

    I saw one short document on compiling with debug, starting the debugger, attaching to the ninjatrader.exe etc. Is there anymore documentation on using Visual Studio on Ninja Trader?

    Is it possible to use the Visual Studio debugger on strategies developed with the strategy builder without having to create a copy, unlock the program and compile with debug mode on?

    Can the strategy to be tested have to be compiled using the ninjascript editor with debug on or can it be compiled entirely on Visual Studio?

    I compiled a program with debug mode in the ninjascript editor and started to Debug in Visual Studio attaching to ninjatrader.exe.

    The debug step into of Step Over were not active (grayed out) and I'm assuming because a build was not run.

    At that point ninjatrader.exe crashed with no messsage, Visual Studio stayed up.

    I assuming I need to a build in Visual Studio before debugging is this correct?

    When running a build get many warning messages but 4 hard errors all referencing badstrategy.cs is referenced in the Ninjatrader Namespave but the assembly is not found?

    I had an issue in the past where a Ninja support person assisted me when I could not start the strategy builder and deleted the badstrategy.cs from the strategy folder.

    Now it appears I cannot run a build as there is an artifact that apparently is looking for that assembly how can I resolve this and successfully run a build?

    than you,

    glen

    #2
    Hello demarcog,

    Thank you for the post.

    To start off visual studio is used only as a text editor when using it with NinjaTrader, that means it cannot be used to compile or build as you will see errors. NinjaTrader needs to do the build from the NinjaScript editor, the same goes for any changes like adding files or adding references, those need to be done in the NinjaScript editor. Visual studio will ask you to update when changes occur, always press reload project.

    I saw one short document on compiling with debug, starting the debugger, attaching to the ninjatrader.exe etc. Is there anymore documentation on using Visual Studio on Ninja Trader?
    The following page contains the steps to attach the debugger, that is a complete guide and would be how to use visual studio for debugging NinjaScript files. https://ninjatrader.com/support/help...ightsub=visual

    Is it possible to use the Visual Studio debugger on strategies developed with the strategy builder without having to create a copy, unlock the program and compile with debug mode on?
    Yes you can open the code view in visual studio without unlocking it however you cannot make changes to the file in visual studio because its used with the builder.


    Can the strategy to be tested have to be compiled using the ninjascript editor with debug on or can it be compiled entirely on Visual Studio?
    You would always need to compile with the NinjaScript editor, as mentioned visual studio is just used for debugging/editing purposes in this use case. Addons can be created externally in a separate visual studio project which would compile a dll, that is noted in the addon education documentation. https://ninjatrader.com/support/help...t_overview.htm
    Strategies or indicators are best developed in the NinjaScript editor and if you want them as a dll file you can export them from the platform as a dll.

    I compiled a program with debug mode in the ninjascript editor and started to Debug in Visual Studio attaching to ninjatrader.exe.

    The debug step into of Step Over were not active (grayed out) and I'm assuming because a build was not run.

    At that point ninjatrader.exe crashed with no messsage, Visual Studio stayed up.
    I couldn't really say what happened from these steps. you would need to follow the help guide section for attaching visual studio to NinjaTrader and the compile would need to be done in NinjaTrader prior to attaching to the process.

    I assuming I need to a build in Visual Studio before debugging is this correct?
    No, you would need to compile from the NinjaScript editor. If you compile from visual studio that will generate errors.

    When running a build get many warning messages but 4 hard errors all referencing badstrategy.cs is referenced in the Ninjatrader Namespave but the assembly is not found?
    That would be correct, you can't build from VS. VS will also show a lot of warnings which are not relevant, you can turn off warnings. If this is from the NinjaScript editor I would need to see what the actual error is.


    I had an issue in the past where a Ninja support person assisted me when I could not start the strategy builder and deleted the badstrategy.cs from the strategy folder.
    Now it appears I cannot run a build as there is an artifact that apparently is looking for that assembly how can I resolve this and successfully run a build?
    If you are seeing an error please post either the whole error by left clicking it and then Control +C or take a screen shot. For NinjaScript concerns we generally try to handle those through email/forum and not through remote support. As we are on the forums currently you would need to provide any additional detail like errors or screenshots for me to help further with this question. If you require remote support you would need to email platform support[at]ninjatrader.com for further assistance.


    I look forward to being of further assistance.





    Last edited by NinjaTrader_Jesse; 02-02-2021, 08:22 AM.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Jesse,

      Wow, thank you for that amazing response you answered all my questions and more. I appreciate that as I was proceeding under the assumptions that were in effect for other products I've work

      As always greatly appreciate the typically mind blowing awesome responses I get from everyone at Ninja Support .

      I really just hope people reading this, realize that in 30 years working Ion Wall St. i all aspects of financial systems there is nothing that even comes close to the level of support provided by Ninja Trader .

      I don't know who or how the group developed and I'm certain it's also true for other departments . Somebody or some team put together the most competent group of people producing a product that is also the best product I've seen and stands alone in it's class .

      Ninja Trader is a model for any software product. I remember 10 years ago a Tech Manager at eSignal, his first name was Jason was hands down the best developer and technical mind I've ever encountered. He helped develop and enhance eSignal which is analogous to hand tools and may have played a role in creating the power tool version of a trading application in Ninja Trade. NT is that much better then anything out there and I've tried them all. .

      When Jason left eSignal I never got a chance to thank him for all the help he game me personally and the hundreds of forum users he mentored. If he had a role in what Ninja Trader is today then I owe him another heart felt thank you.

      Thank you,

      Glen
      Last edited by demarcog; 02-02-2021, 11:49 AM.

      Comment


        #4
        HI,


        Thank you very much for the quick and very helpful response.

        What strange is now I am getting compiler errors telling me the there already is a SimpleMACrossover in the Ninjascript.Strategies name space. I noticed when I did the manual copies that there were a few strategies already in the Strategy folder and this was one of them. What I don't understand is I didn't copy over the strategies that were already in the destintion new NT8 installtion directory so have no ideas where this is coming from.

        thank you
        Attached Files

        Comment


          #5
          Hello demarcog,

          The file you are looking at the error would be something custom, the standard strategy that comes with NinjaTrader is called SampleMACrossover.

          To correct this you will likely need to rename the class of the strategy mentioned in the error. If you double click the error that should take you to the location where you can edit the class name. You can otherwise open the file mentioned in the error to edit it. The alternative would be to remove the file mentioned in the error as there is some kind of duplication with that class name.

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

          Comment


            #6
            Jesse,

            Thank you thank you thank you. I did find a duplicate for the strategy and removed.

            You said something interesting that I did not know but would be very helpful. When I double click on the error code CSSXXXX for example it takes me to a documentation page link with a description of the error. Where exactly in the Ninjascript Editor panels should I double, I clicked around a bit and didn't see it?


            Thank you again, your help is very much appreciated.

            Comment


              #7
              Hello demarcog,

              The error code its self will take you to the documentation if available, if you otherwise double click in the row of the error in any other area it should bring you to the script in question.

              The color of the error also matters, if its darker orange then you are likely already in the file/cannot navigate to that location. If its bright orange you are in a different file and should be able to double click it to navigate.

              I look forward to being of further assistance.

              JesseNinjaTrader Customer Service

              Comment


                #8
                Jesse,

                Great thank you that is really helpful as I didn't see any doc but might have missed it.

                As always, appreciate very much all the help support provides me. I feel like I'm opening up to many items but new to the product and trying really hard to replace the COVID lost income so than you again.

                glen

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by fitspressoburnfat, Today, 04:25 AM
                0 responses
                2 views
                0 likes
                Last Post fitspressoburnfat  
                Started by Skifree, Today, 03:41 AM
                1 response
                4 views
                0 likes
                Last Post Skifree
                by Skifree
                 
                Started by usazencort, Today, 01:16 AM
                0 responses
                1 view
                0 likes
                Last Post usazencort  
                Started by kaywai, 09-01-2023, 08:44 PM
                5 responses
                604 views
                0 likes
                Last Post NinjaTrader_Jason  
                Started by xiinteractive, 04-09-2024, 08:08 AM
                6 responses
                23 views
                0 likes
                Last Post xiinteractive  
                Working...
                X