Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Developing in VisualStudio

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

    Developing in VisualStudio

    I just clicked on that little icon on the very right of the editor and it actually opened VisualStudio. Not only that - I was even able to compile my indicator. That is brilliant!

    Now what is that project exactly? It's the basic main project of my NT8 installation? I take it I shouldn't change any of the settings, right? That could screw things up tremendously. I also take it that none of the auto stuff works this way. Meaning the work flow would be to build the basic construct and develop the basic indicator in the NT8 editor and move over to VS for more fine grained development?

    Question - does the debugger work as well somehow? I take it there is documentation on that topic? I would love to run a strategy or indicator and have it hit break points. Am I asking too much?

    Anyway, this is awesome.

    #2
    Originally posted by molecool View Post

    Question - does the debugger work as well somehow? I take it there is documentation on that topic? I would love to run a strategy or indicator and have it hit break points. Am I asking too much?

    Anyway, this is awesome.
    search on: Visual Studio Debugging

    Comment


      #3
      Originally posted by molecool View Post
      I just clicked on that little icon on the very right of the editor and it actually opened VisualStudio. Not only that - I was even able to compile my indicator. That is brilliant!

      Question - does the debugger work as well somehow? I take it there is documentation on that topic? I would love to run a strategy or indicator and have it hit break points. Am I asking too much?

      Anyway, this is awesome.
      Yep.. Loving the now seamless integration.. Not to mention the increased autosense capabilities of VS.. If your using an express edition of VS, I don't believe you could attach a process for the debugger before version 13.. And also believe at the moment that is the highest version NT will automatically recognize.. You can find it here..

      https://www.visualstudio.com/en-us/p...xpress-vs.aspx

      If you've opened VS thru NT's editor, simply clicking save in VS will both save and compile your file in NT.. I found for myself, that I also had to remove the f5 debug start shortcut key in VS, as I found myself continually hitting the f5 key out of habit. But I guess that could just be me..

      In VS.. Tools/Options/Environment/Keyboard/Debug.Start and either change or remove.. Just in case anyone else runs into this self induced problem..

      -=Edge=-
      NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

      Comment


        #4
        The custom project only applies to anything in your custom directory. You can feel free to update your local project file to include your own user installed scripts. However please keep in mind that your changes in this area could be overridden by the installer during software updates.

        As other users have pointed out, you can absolutely use this project to attach to the NinjaTrader.exe process for direct debugging in your custom NinjaScript code.
        MatthewNinjaTrader Product Management

        Comment


          #5
          Originally posted by NinjaTrader_Matthew View Post
          The custom project only applies to anything in your custom directory. You can feel free to update your local project file to include your own user installed scripts. However please keep in mind that your changes in this area could be overridden by the installer during software updates.

          As other users have pointed out, you can absolutely use this project to attach to the NinjaTrader.exe process for direct debugging in your custom NinjaScript code.
          Wouldn't it be better to use the NT8 editor for managing external resources? Anyway how do I launch the debugger? Do I launch NT8 via Visual Studio?

          Comment


            #6
            Originally posted by -=Edge=- View Post
            Yep.. Loving the now seamless integration.. Not to mention the increased autosense capabilities of VS.. If your using an express edition of VS, I don't believe you could attach a process for the debugger before version 13.. And also believe at the moment that is the highest version NT will automatically recognize.. You can find it here..

            https://www.visualstudio.com/en-us/p...xpress-vs.aspx

            If you've opened VS thru NT's editor, simply clicking save in VS will both save and compile your file in NT.. I found for myself, that I also had to remove the f5 debug start shortcut key in VS, as I found myself continually hitting the f5 key out of habit. But I guess that could just be me..

            In VS.. Tools/Options/Environment/Keyboard/Debug.Start and either change or remove.. Just in case anyone else runs into this self induced problem..

            Yes, I'm using the express version of VS and it worked just fine.

            Comment


              #7
              Those resources will always be loaded in the NinjaScript editor, yes. But we designed integration to where you can setup your own project in visual studio and access from there. I'm not aware of any reason using this approach would be any worse off than the NinjaScript editor. The only limitation is you cannot compile in Visual Studio, so you need use the NS editor compiler-> but as others have pointed out, just a quick CTRL + S in Visual Studio will save the file, changes will be detected by the NS editor and will compile.

              If you want to debug in Visual Studio, you just need to make sure the NinjaTrader.exe is running as per usual. From the Custom Project opened in Visual Studio, go to "Debug-> Attach to Process" and then select the NinjaTrader.exe. From there, you can set your own break points in visual studio with your .cs file open and they will be hit as your code executes.

              Note: In the NinjaScript editor, make sure you have right clicked and selected "Debug Mode" which will generate a debug dll of your custom project to be used for debugging.

              Documentation on this process is located here - http://www.ninjatrader.com/support/h..._debugging.htm
              MatthewNinjaTrader Product Management

              Comment


                #8
                Originally posted by NinjaTrader_Matthew View Post
                Those resources will always be loaded in the NinjaScript editor, yes. But we designed integration to where you can setup your own project in visual studio and access from there. I'm not aware of any reason using this approach would be any worse off than the NinjaScript editor. The only limitation is you cannot compile in Visual Studio, so you need use the NS editor compiler-> but as others have pointed out, just a quick CTRL + S in Visual Studio will save the file, changes will be detected by the NS editor and will compile.

                If you want to debug in Visual Studio, you just need to make sure the NinjaTrader.exe is running as per usual. From the Custom Project opened in Visual Studio, go to "Debug-> Attach to Process" and then select the NinjaTrader.exe. From there, you can set your own break points in visual studio with your .cs file open and they will be hit as your code executes.

                Note: In the NinjaScript editor, make sure you have right clicked and selected "Debug Mode" which will generate a debug dll of your custom project to be used for debugging.

                Documentation on this process is located here - http://www.ninjatrader.com/support/h..._debugging.htm
                Thanks Matt - crystal clear now. Great job guys - beta looking very promising thus far.

                Comment


                  #9
                  Originally posted by NinjaTrader_Matthew View Post
                  I'm not aware of any reason using this approach would be any worse off than the NinjaScript editor. The only limitation is you cannot compile in Visual Studio, so you need use the NS editor compiler-> but as others have pointed out, just a quick CTRL + S in Visual Studio will save the file, changes will be detected by the NS editor and will compile.
                  some reasons
                  NT8 - Code editor incorrect message regarding recursive properties
                  NT8 - Code editor does not understand the new keyword for NSWrappers
                  NT8- compiling is restrictive - no assembly properties - no real control over dlls, no code signing.... i could go on... but yes Code editor is probably 95% perfect for all... except commercial developers who need many other features not offered by NT vs VS - you would need to rewrite VS... umm why do that just use VS when you need to.... Personally for me compiling in the NT8 is coding with almost 2 hands behind my back compared to VS... but is ok i got a great way to get around any limitations....

                  Personally i dont want an auto compile feature when NT filewatcher detects a change...
                  can we toggle that on/off?
                  Last edited by MicroTrends; 05-12-2015, 04:39 AM.
                  MicroTrends
                  NinjaTrader Ecosystem Vendor - micro-trends.co.uk

                  Comment


                    #10
                    A big +1 for MicroTrend's idea to toggle off the file watcher. I really want to stay in visual studio, and there are many reasons. I can't imagine working in the NS editor. The NT DLL is just a bridge to other solutions and projects. Compiling can be slow even on a big machine. I live almost all day every day in my VS cocoon with resharper, source control and many other addins etc. I think it's nice for many that you have improved your editor, but please don't make me live there.

                    Comment


                      #11
                      Originally posted by dalebru View Post
                      A big +1 for MicroTrend's idea to toggle off the file watcher. I really want to stay in visual studio, and there are many reasons. I can't imagine working in the NS editor. The NT DLL is just a bridge to other solutions and projects. Compiling can be slow even on a big machine. I live almost all day every day in my VS cocoon with resharper, source control and many other addins etc. I think it's nice for many that you have improved your editor, but please don't make me live there.
                      Yes! yes! yes indeed same here all mapped to TFS or www.visualstudio.com via Team Explorer - perfecto... With resharper you got to load a real project AFAIK...so ti can walk the class/solution? Doesn't work with a collection of loose open source? interesting to know there are others out there working on cool stuff in cool ways too...
                      MicroTrends
                      NinjaTrader Ecosystem Vendor - micro-trends.co.uk

                      Comment


                        #12
                        Originally posted by MicroTrends View Post
                        Personally i dont want an auto compile feature when NT filewatcher detects a change...
                        can we toggle that on/off?
                        I see your point and added your votes in - SFT-350
                        MatthewNinjaTrader Product Management

                        Comment


                          #13
                          NT8 beta Help File....

                          Is it possible please to provide the NT8 beta Help file in its current state that ships with NT8 beta to those of us not in the beta, so we can familiarizes ourselves with it now... thx u kindly...
                          Ron

                          Comment


                            #14
                            Originally posted by Blash View Post
                            Is it possible please to provide the NT8 beta Help file in its current state that ships with NT8 beta to those of us not in the beta, so we can familiarizes ourselves with it now... thx u kindly...
                            Ron
                            We will not be able to provide the NT8 help guide until NT8 beta is public.
                            Last edited by NinjaTrader_Matthew; 05-14-2015, 07:09 AM.
                            MatthewNinjaTrader Product Management

                            Comment


                              #15
                              Change in Beta 3?

                              I see this in the Release notes for 8.0.0.3:
                              • Fixed 8353 NinjaScript Editor Moving Files To New Folder In NS Editor Would Not Be Reflected in Visual Studio

                              But I don't see an improvement. When I create an indicator in a folder (in NinjaScript Editor) it has the folder name as a suffix to the namespace and has the folder name as a prefix on the file name. But it doesn't go into a physical folder.
                              If I move the class or create one (or anything else I've tried) in a physical folder under the Indicators folder, it seems to compile but it is not listed as an indicator available to add in the Indicators window.
                              I could provide examples, but my question is: How is this supposed to work now? Perhaps it's now in the docs and I missed it.
                              I can limp along, conforming to the NinjaScript Editor's demands, but I'll end up with hundreds of files in the one Indicators folder, without the ability to organize them properly. So I thought I'd ask once again.
                              Thanks,
                              Dale

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by terkk, Today, 01:16 PM
                              2 responses
                              17 views
                              0 likes
                              Last Post desjaimz  
                              Started by TraderElegante, Today, 12:14 PM
                              1 response
                              18 views
                              0 likes
                              Last Post NinjaTrader_PaulH  
                              Started by dgee949, Today, 11:44 AM
                              1 response
                              14 views
                              0 likes
                              Last Post NinjaTrader_JustinD  
                              Started by NinjaTrader_Kate, Today, 12:01 PM
                              0 responses
                              20 views
                              0 likes
                              Last Post NinjaTrader_Kate  
                              Started by efeuvejota01, Today, 11:42 AM
                              3 responses
                              36 views
                              0 likes
                              Last Post NinjaTrader_ChrisL  
                              Working...
                              X