Thanks
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!
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
NinjaTrader
Can not lauch VS2019 form NinjaTrader Script Editor
Collapse
X
-
Can not lauch VS2019 form NinjaTrader Script Editor
I try to use Visual Studio to edit NinjaScropt. So I clicked the Visual Studio icon on UI of NinjaTrader Script Editor. Then show me a message that means can not find Visual Studio. But I installed VS2019 and version is 16.11.1. How to solve this problem?
ThanksTags: None
-
Hello UMLer,
Thank you for your post.
What is the full text of the error message you receive when attempting to launch Visual Studio from the NinjaScript Editor? Can you confirm that it's Visual Studio and not Visual Studio Code that you have installed?
Thanks in advance; I look forward to assisting you further.
Kate W.NinjaTrader Customer Service
-
Hello UMLer,
Thank you for your reply.
NinjaTrader uses vswhere.exe to find Visual Studio. NinjaTrader expects this file to be located in the following folder: %ProgramFiles(x86)%\Microsoft Visual Studio\Installer. You can open your Windows command prompt and cd to this directory and run the application to check the path assigned.
cd C:\Program Files (x86)\Microsoft Visual Studio\Installer\
vswhere.exe
This will show where Visual Studio is installed. For example:
productPath: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe
Issues that could cause Visual Studio not to come up would include:
a) vswhere is not in the proper location
b) the IDE is not located in the designated folder.
You can take a look at the following resource for further direction on customizing Visual Studio's location. This resource is publicly available.
https://docs.microsoft.com/en-us/vis...s?view=vs-2019
Please let us know if we can be of further assistance.Kate W.NinjaTrader Customer Service
Comment
-
Hi
Thanks for your reply.
vswhere.exe is at the proper folder that is as same as you mentioned. i do believe it is the default directory.
the productPath is not the default directory. because when i installed my VS 2019, i choosed a specific directory that is better to me.
so now it looks NT8 did not find the vswhere.exe at default directory? or did not get the information from vswhere.exe?
is there an option to set the value of where VS installation directory is manually?
Comment
-
Hello UMLer,
Thank you for your reply.
NinjaTrader checks for 'Microsoft Visual Studio' - you've got it in a folder just called "Visual Studio" If you rename the folder to 'Microsoft Visual Studio' and then move everything inside under a new folder '2019' within that Microsoft Visual Studio folder I believe it should work.
Please let us know if we may be of further assistance to you.Kate W.NinjaTrader Customer Service
Comment
-
Hello UMLer,
Thank you for your reply.
We do not officially support VIsual Studio, so I am limited on what I can offer here. What I would recommend at this point is uninstalling Visual Studio and reinstalling in the default directory and then trying again to launch it as it may be an issue with having it installed in the custom location on the D drive.
Please let us know if we may be of further assistance to you.Kate W.NinjaTrader Customer Service
Comment
-
OK.
1. Is it possible to open ninja script file manually?
2. Is there project template to create a Ninja Script project in VS 2019 ? and any Add-ins for VS 2019?
3. how debug ninja script code? such as set a break point, watch value of a variable
4. How to do unit test in Ninja Script Editor or in VS 2019?
Thanks
Comment
-
Hello UMLer,
Thank you for your reply.
Yes, you may open NinjaScript files manually. They are just .cs files and may be opened in any text editor you like.
Generally for NinjaScript items you would create the initial file within NinjaTrader using the NinjaScript Editor and then you can edit and debug within Visual Studio if you so wish. If you are creating an external program to interface with NinjaTrader via the DLL interface, an example project may be found on this forum post:
A basic overview of debugging using Visual Studio may be found in our help guide here:
For further information on debugging using Visual Studio please refer to their documentation.
We do not have any examples of unit testing NinjaScript files. From my knowledge of unit testing, it would likely be possible to access NinjaScript objects from the test. However, in contrast to how unit testing works, it may not be directly possible to recreate accurately what the platform does with the objects you would be testing (indicator, strategy). There are many steps required in correctly instantiating a NinajScript object that happens internally so that portion of this concept would not easily be recreated in a test.
Please let us know if we may be of further assistance to you.Kate W.NinjaTrader Customer Service
Comment
-
Thanks
Finally I found this Custom project in "..Documents\NinjaTrader 8\bin\Custom" folder. So i just use VS open it directly by myself.
looks it works then:
Q1:
I read this webpage at https://ninjatrader.com/support/help..._debugging.htm
there is a step 5 paragraph:
5. Run your NinjaScript object in NinjaTrader and it should stop at your break points and all the debugging tools and information should be available to inspect the current state of the code.
I do not understand "Run your NinjaScript object in NinjaTrader". what i do is
a. right click on a chart
b. click "indicators" menu item
c. choose my indicaot and add to chart
but it did not stop at my break points. did i do something wrong?
Q2:
After opne the Custom project, i notice i can compile it in VS. but there are some warnings, please open attachement.
Is it possible to eliminate those warnings? lt looks ugly
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Mariawilcoxi, Today, 01:32 AM
|
0 responses
1 view
0 likes
|
Last Post
by Mariawilcoxi
Today, 01:32 AM
|
||
Started by gleichnerany, Today, 01:17 AM
|
0 responses
4 views
0 likes
|
Last Post
by gleichnerany
Today, 01:17 AM
|
||
Started by WHICKED, 03-27-2024, 12:33 PM
|
4 responses
45 views
0 likes
|
Last Post Today, 12:28 AM | ||
Started by f.saeidi, Today, 12:12 AM
|
0 responses
6 views
0 likes
|
Last Post
by f.saeidi
Today, 12:12 AM
|
||
Started by Conall, Today, 12:06 AM
|
0 responses
9 views
0 likes
|
Last Post
by Conall
Today, 12:06 AM
|
Comment