I would like to test for a workspace being open and switch to it if open, or open it if not open.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Testing for if Workspace open.
Collapse
X
-
Ryan M.NinjaTrader Customer Service
-
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
-
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
-
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.
VTAttached FilesLast edited by VTtrader; 09-16-2011, 10:52 AM.
Comment
-
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
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
578 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment