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
making a copy of strategy
Collapse
X
-
Hello dedouglas,
The SaveAs should generally always be visible if you have a file open and have clicked in the text area of the file. Are you clicking in the window frame area or somewhere that is not specifically the text area of the file? In that case you would see the save as grayed out, otherwise, I would expect this to be visible.
Have you also noticed if this happens only in one script, or is this generally happening across all scripts?
An alternative, until this is figured out, would be to manually copy/paste the file and change its class name. You can open the folder: Documents\NinjaTrader 8\bin\Custom\Indicators, copy and paste the file in question to make a copy. An example is @SMA Copy.cs. Rename the file to MySma.cs. In the NinjaScript editor there will now be errors due to a naming conflict. Open the MySMA.cs and change it from public class SMA to public class MySMA. You additionally need to change the Name= in the State.SetDefaults and provide your own name.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
-
I am trying to follow instructions in the "NinjaScript Editor 401" YouTube video and am having the same Save As grayed-out problem dedouglas reported above. I tried the alternative solution to manually copy & paste the file that you gave him, but Documents\NinjaTrader 8\bin\Custom\Indicators does not contain a file named SimpleMACrossover.cs even though that file compiles in Strategy Builder and its name appears in and can be selected from the drop-down list on the Create a new Strategy panel in Strategy Builder. If I terminate and restart NinjaTrader the SimpleMACrossover file can still be viewed in Strategy Builder, so it is being saved somewhere, but it is not included with all the other files in the Documents\NinjaTrader 8\bin\Custom\Indicators folder.
Comment
-
Hello caveat_lector,
Based on the details it sounds like you have some duplicate strategy made in the builder with a similar name to SampleMACrossOver.
The SampleMACrossOver that comes with the platform is a manually coded strategy so this will not appear in the builder and cannot be duplicated from the builder. You would need to use the NinjaScript editor specifically to make a copy of this strategy. If you had used the builder to open a file, that would not be the correct process and that also would not be the correct strategy (the one being viewed in the builder). To open the correct strategy you will need to open the New -> NinjaScript editor window.
The SampleMACrossOver should appear under the strategies folder in the NinjaScript editor with a lock icon. You can double click it to open the code in the editor. In the code view you can then Right click to save as.
If you instead opened a strategy which was created with the builder to view its code in the Ninja Script editor you cannot use the SaveAs feature from the NinjaScript editor. Strategy builder created scripts can only be duplicated by using the strategy builder and its drop down menu by hovering the mouse over its name to show the save as button.
I look forward to being of further assistance.
JesseNinjaTrader Customer Service
Comment
-
That was the problem. I had opened the file in the Strategy Builder instead of the NinjaScript Editor.
Thanks for your quick help.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by volIQ, 03-27-2024, 04:28 PM
|
3 responses
21 views
0 likes
|
Last Post
by RJay
Today, 05:41 AM
|
||
Started by Nickgiaco, 02-26-2024, 10:23 AM
|
2 responses
72 views
0 likes
|
Last Post Today, 05:12 AM | ||
Started by Johndc, Today, 04:39 AM
|
0 responses
6 views
0 likes
|
Last Post
by Johndc
Today, 04:39 AM
|
||
Started by johntraderuser2, Today, 02:34 AM
|
0 responses
9 views
0 likes
|
Last Post Today, 02:34 AM | ||
Started by IanS00, 03-27-2024, 11:24 AM
|
2 responses
13 views
0 likes
|
Last Post Today, 02:00 AM |
Comment