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

Copy an Indicator

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

    Copy an Indicator

    I've got an indicator that is running as designed. I'd like to make a copy of it, change the name, and make some minor modifications to create a new indicator. I can't seem to figure out how to do that. Can anyone help?

    Thanks,
    Paul

    #2
    Hi Lambo,

    Open up the indicator in the NinjaScript Editor. Right click and then click "Save As". Type in a new name and it will make a new copy.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      When I do that and change all instances of the old name to the new name in the code and then compile, I get an error "The namespace NinjaTrader Indicator" already contains a definition for "Old Indicator Name".

      code CS0101

      Thanks,
      Lambo

      Comment


        #4
        You don't need to manually change anything. Just right click->Save As. Type in a new name and then everything is done.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          It doesn't work. I get the error message. I just don't know how to proceed now.

          Comment


            #6
            You got to delete that old one. Name it a different name now. You cant have multiple indicators with the same name.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Josh, I don't think you understand. First of all I copied the original one and changed the name to a new indicator. I edited out all the old references and changed them to the new indicator name. There should have been nothing left of the old indicator in the new one. The whole idea was to keep the old indicator and creating an entirely new one, which I believe I did.

              However, I get that irritating error message which makes no sense.

              Paul

              Comment


                #8
                Paul,

                The error means you have 2 definitions for the same name. You need to remove one of them before it will compile. Do this. Delete your "new indicator". Hit F5 to Compile. Your old indicator should have no problem compiling. Then open your old indicator and right click -> save as. Type in a new name. Do NOT edit anything. Just hit F5 to compile now. You do not need to change anything in your indicator to create a new copy.

                If you still have difficulties you can send me both the old and the new indicators to my email and I will take a look in fixing it up for you. I suspect it may be something you edit that may be causing conflicts.

                josh.peng [at] ninjatrader (dot] com.
                Last edited by NinjaTrader_JoshP; 09-07-2008, 01:08 PM.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Josh, I found the problem. Evidently copies of the original indicator were still in the NT directories. I got rid of all of them except for one which was stashed in ...\NinjaTrader 6.5\bin\Custom. I then went back and compiled the new indicator and it finally worked. The error message it was giving me had nothing to do with what I was currently compiling, but instead was stating that it was unhappy that there was an unresolved problem elsewhere. That doesn't seem very intuitive to me. Oh well, I'm glad I finally got it to work.

                  Thanks for your help and patience,

                  Paul

                  Comment


                    #10
                    Paul,

                    Great! Glad you got it fixed. Basically NinjaTrader needs all NinjaScript files to be free of error before it can compile.
                    Josh P.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by sidlercom80, 10-28-2023, 08:49 AM
                    168 responses
                    2,262 views
                    0 likes
                    Last Post sidlercom80  
                    Started by Barry Milan, Yesterday, 10:35 PM
                    3 responses
                    10 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Started by WeyldFalcon, 12-10-2020, 06:48 PM
                    14 responses
                    1,429 views
                    0 likes
                    Last Post Handclap0241  
                    Started by DJ888, 04-16-2024, 06:09 PM
                    2 responses
                    9 views
                    0 likes
                    Last Post DJ888
                    by DJ888
                     
                    Started by jeronymite, 04-12-2024, 04:26 PM
                    3 responses
                    41 views
                    0 likes
                    Last Post jeronymite  
                    Working...
                    X