• 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.


No announcement yet.

Partner 728x90


Opening Strategy Problem

  • Filter
  • Time
  • Show
Clear All
new posts

    Opening Strategy Problem

    I've been working on a custom strategy for over a week now and today when I try to open it with EDIT STRATEGY, it pulls some older version of the V1 script I saved instead of the V2 script. I've closed NT and reloaded it to see if it does the same thing and sure enough, every time I try to edit the script, I get a version that is 4+ days old.

    When I open a chart and apply the strategy to the chart, it shows that it is running the new V2 code.

    But why in the heck, or more accurately, HOW IN THE HECK do I get into the code editor to continue working with my V2 code?

    Every time I try to edit the script, the WIZARD pops up and I believe this is the problem? Can someone please try to assist me? There has to be a way of getting to my newest V2 code without having to recreate the damn code again. I must be missing something here, but I've tried everything I can think of and the funny thing is IT WORKED YESTERDAY. What the heck is going on??

    A little more information..

    My strategies are named similar.. Like...

    Bob V1
    Bob V2

    Because of this, I believe NT is pulling the V1 version when I'm clearly clicking on the V2 version.

    And why does it open in the Wizard all the time??


      Hello Bmatheny,

      Could you give me the steps that you are using to save the Strategy as a new version, or how you are updating your code?

      Also, When you go to Edit NinjaScript -> Strategy... do you see two different strategies one named BobV1 and the other BobV2?

      Happy to be of further assistance.
      JCNinjaTrader Customer Service


        What I did was first create a script, Bob V1, using the wizard. I created a series of inputs, then created some conditions I could use as a base of operations for my script. After that was done, I viewed the code and copied all of it into a text editor (as a backup).

        Next, I created another new script, with the wizard, but I named it Bob V2. This time, I simply unlocked the code and pasted the copy of the other code into the code editor. I modified the strategy description and name and began modifying the code to my needs. This, V2 version, became my working copy and the V1 version was a backup of the root template.

        yesterday, I shut down my pc and restarted the code and projects. When I opened the strategy, it opened just fine. I was able to work with the code and the strategy without any issue.

        Today, however, it appears to have lost the strategy, even though when I apply it to a chart, it shows my newest work is still in the V2 strategy.

        I hope this answers your questions?


          Sorry, yes. I see two different strategies listed.

          Bob V1 and Bob V2.

          When I try to open either of them, the wizard window appears and I click UNLOCK so I can begin working with the code directly.


            Hello Bmatheny,

            To create a new version of your strategy you may want to go to Edit NinjaScript -> Strategy then select your root/base strategy, Unlock the code, right-click inside the screen, select Save As, and name the Strategy a different name like BobV2 or BobV3. This will rename everything inside the Strategy so that you may work with a new strategy with the same code as the previous strategy.

            Note this will your original Strategy inside the wizard still since you saved the Unlocked Strategy as a different file name.

            Let us know if we can be of further assistance.
            JCNinjaTrader Customer Service


              No luck with your last suggestion.

              I tried to SAVE AS and then deleted Bob V1. When I load Bob V2, I still get Bob V1.

              When I load the strategy onto a chart and enable it, meaning Bob V2, I get the newest version of the code... not the original V1 version.

              Please tell me there is a way to get access to my project as I've spent 4+ days working with this and it all worked fine yesterday?? It would really SUCK if these scripts are prone to this type of problem and there was NO WAY to recover from this error.

              Are these scripts stored in some location that I can access?? Are they a text file of some sort??


                Hello Bmatheny,

                Are you able to view the code that you added/changed in either the BobV1 or BobV2 strategy?

                If so you may copy and paste the individual lines (not the entire strategy) that you added into your new strategy.

                We would not recommend copy/pasting the entire strategy to create a new version as there are many wrapper items that would need to be changed in order for it to function as a new NinjaScript item.

                You may view the following video that demonstrates how to save a NinjaScript item as a new name while keeping the original one in tact.

                The files will be located in the (My) Documents -> NinjaTrader 7 -> bin -> Custom -> Strategy folder by the name of the NinjaScript with a ".cs" at the end.
                JCNinjaTrader Customer Service


                  Great. I got my script back. Now, how come every time I open the script to edit it, it opens in the WIZARD?

                  I've made a backup copy of my script in case it screws up again, which it appears to be doing. I can't figure out why when I UNLOCK a script, then modify it and SAVE IT, then CLOSE IT. When I reopen the script, it always opens with the WIZARD?

                  I would think the editor would know that I unlocked it and open it up in an editor.. no?

                  Trying to figure this out. A little help would be great.



                    Hello Bmatheny,

                    Glad to hear that you were able to save your script.

                    Please view the video tutorial below that will demonstrate how to create a new indicator/strategy with the original code from the indicator/strategy.
                    Originally posted by NinjaTrader_JC View Post
                    Let us know if we can be of further assistance.
                    JCNinjaTrader Customer Service


                    Latest Posts


                    Topics Statistics Last Post
                    Started by kweiss, Today, 08:35 PM
                    0 responses
                    1 view
                    Last Post kweiss
                    by kweiss
                    Started by zulok, Today, 05:02 PM
                    0 responses
                    Last Post zulok
                    by zulok
                    Started by Andreas M., Today, 04:42 PM
                    0 responses
                    Last Post Andreas M.  
                    Started by sidlercom80, Today, 12:29 PM
                    2 responses
                    Last Post fx.practic  
                    Started by itrader46, Today, 02:49 PM
                    3 responses
                    Last Post NinjaTrader_ChelseaB