Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Testing for if Workspace open.

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

    Testing for if Workspace open.

    How does one go about, in NinjaScript, testing to determine if a workspace is open?

    I would like to test for a workspace being open and switch to it if open, or open it if not open.

    #2
    Hi snaphook,

    Unfortunately there is no support for managing workspaces via NinjaScript. Will leave open for community to respond if they have discovered techniques for this. Some workspace management is discussed in this undocuments/unsupported thread:
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      OK. On another note. What .dlls or other files do I need to add to the Visual Studio reference list to be able to access NT specifics in VS? The filenames are not terribly intuitive.

      Comment


        #4
        Instructions for debugging NinjaScript in Visual Studio are available here:
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          I added NinjaTrader.Core.dll and WilsonORMapper.dll

          VT

          Comment


            #6
            Originally posted by VTtrader View Post
            I added NinjaTrader.Core.dll and WilsonORMapper.dll

            VT
            Does that allow you to compile from VS, or do you still have to compile from inside a NT script itself.

            Comment


              #7
              Koganam,

              No, you still have to compile in VS (I do anyway). What I do is have a file I keep open in the NT editor, and after I save in VS and then hit f5 in NT. I also made a copy of the NinjaTrader.Custom solution/project files, so that I can have all the files as part of the VS solution/project.

              If I want a new indicator I open a "template file" I have in the NT editor and "save as" then add it to the VS project, and edit it in there. That way the NT editor can add all the background code that it needs for an indicator.

              VT

              Comment


                #8
                Many thanks.

                VTrader,
                This is good stuff that is not well advertised.

                Do you add the indicator file as a link or no?
                Where did you put the NT proj/sln file copies? In the VS proj dir?

                Let me see if I understand.

                You open a template in NT, make appropriate changes to name and save as a name of your choice, With the editor still open in NT you make any changes to it in VS, save, then F5 in NT to add it to the NT cache.

                If I create a form to access an EventHandler in VS, how will that affect the NT indicator code when compiled. At present I am copy/pasting from VS into the NT file and F5ing it.

                Thanks for the info.

                Snap

                Comment


                  #9
                  Snap,

                  The "compile file" I use can be as simple as the one attached. I keep that open in an NT editor while working in VS. It's function is basically just to compile the changes I make (and save) in VS, into the NinjaTrader.Custom.dll.

                  When I make a new indicator I open a "template file" instead of using the wizard, although I originally created the template files with the wizard. One of the templates has a few inputs and a few DataSeries and a few plots, another just has the blank methods (Initialize(), OnStartUp() etc). I also have it set to read only, so I don't accidentally overwrite it. If I'm writing an indicator I will open the one with the variables and plots etc. and rename them or comment out the ones I don't use. But the process is basically I open one of them in the NT editor and "save as" a new file name, then I'll compile it and close that editor window.
                  In VS I will "show all files", and click the new indicator and add to project, then edit it in VS. when I'm ready I save in VS and recompile my "__Compile" file, which I keep open.

                  For setting up the project, I just opened the NinjaTrader.Custom.csproj, and since I'm using VS 2010, instead of converting the existing file to VS2010 format I saved it as NinjaTrader.Custom10.csproj (and the solution files are named that way also). Basically I just have a renamed copy of the NT project files. I open the renamed solution in VS and work on everything in there. That way you're able to still use the intellisense etc, and have VS "aware" of all the existing file structure.

                  Hope this helps and isn't to confusing.

                  VT
                  Attached Files
                  Last edited by VTtrader; 09-16-2011, 10:52 AM.

                  Comment


                    #10
                    One additional point, NT needs to have a lot of background code down in the "NinjaScript generated code" area, which is why I let the NT editor doo all that stuff during the rename process. But while I've never had it happen, I'm sure there are changes that can be made to the code in VS that will mess up that NS generated code, and cause it not to compile. So you want to be aware of changes that might make that happen, and let the NT editor make those changes.

                    VT

                    Comment


                      #11
                      Snap,

                      On your last question, I create new classes, forms etc right in VS and save them in the same indicator folder. Then just compile with the __Compile file (I named it that way so it appears at the top of the list).

                      VT

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      576 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      334 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      101 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      553 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      551 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X