• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

making a copy of strategy

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

    making a copy of strategy

    When I right click in the code window to do a save as to make a copy, the save as is grayed out. Any reason it does this or whats another quick way to make a copy.

    Thanks

    #2
    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

    Comment


      #3
      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


        #4
        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


          #5
          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 lavalampmj, Today, 06:07 PM
          1 response
          6 views
          0 likes
          Last Post bltdavid  
          Started by Sameer, Today, 04:40 PM
          1 response
          35 views
          0 likes
          Last Post NinjaTrader_EricB  
          Started by Teebone21, Today, 04:34 PM
          0 responses
          9 views
          0 likes
          Last Post Teebone21  
          Started by KarstenKafl, Today, 03:34 PM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by punkiy2111, Today, 03:29 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_BrendanC  
          Working...
          X