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!
See more
See less

Partner 728x90

Collapse

Opening Strategy Problem

Collapse
X
 
  • 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??

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

    Comment


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

      Comment


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

        Comment


          #5
          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.

          Comment


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

            Comment


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

              Comment


                #8
                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.
                http://screencast.com/t/AvZ8EA1np

                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

                Comment


                  #9
                  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.

                  B

                  Comment


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

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by DJ888, 04-16-2024, 06:09 PM
                    6 responses
                    18 views
                    0 likes
                    Last Post DJ888
                    by DJ888
                     
                    Started by Jon17, Today, 04:33 PM
                    0 responses
                    1 view
                    0 likes
                    Last Post Jon17
                    by Jon17
                     
                    Started by Javierw.ok, Today, 04:12 PM
                    0 responses
                    6 views
                    0 likes
                    Last Post Javierw.ok  
                    Started by timmbbo, Today, 08:59 AM
                    2 responses
                    10 views
                    0 likes
                    Last Post bltdavid  
                    Started by alifarahani, Today, 09:40 AM
                    6 responses
                    41 views
                    0 likes
                    Last Post alifarahani  
                    Working...
                    X