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

Problems exporting / importing a strategy

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

    Problems exporting / importing a strategy

    When I export a selected strategy the option "Export compiled Assembly of selected source files", I can not import it, the message "Import Failed, The NinjaScrip Archive may contain duplicate method names taht already exists on your PC" appears.

    If I export the same strategy without selecting the option "Export compiled Assembly of selected source files", I have no problems.

    Thanks for your help, Regards, Alejandro

    #2
    Hello ahrt|,

    Thank you for your note.

    This can happen when the .cs files containing the same method names already exist in your documents.

    Are you importing the protected assembly into a machine that already has the files in their open-source format (.cs files)? I would suggest removing the .cs files for the indicators that are in your protected assembly from the Indicators folder and then compile your NinjaScript files.

    NOTE: Be sure to not delete any files with the '@' symbol in front of them. You will only delete the custom indicators you have created that you now have in your protected assembly. Finally, open the NinjaScript Editor and compile.

    Please let us know if we may provide further assistance.

    Comment


      #3
      Thanks for your reply Chis, my problem is that I want to pass a strategy to a person but without sharing the open code, I can not ask the user to erase any of the indicators that I use.

      Is there any way to protect my strategy so that I can give it to this person, but not in open source?

      Thanks for your help, Regards, Alejandro

      Comment


        #4
        Hello ahrt|,

        Thank you for the reply.

        Are you including open source custom indicator(s) within the custom assembly package? If so, I would suggest that you rename these indicators to prevent the error from appearing upon import. For example, if your indicator that is being called is named "EMASlope" consider renaming it to another title such as "MyEMASlope".

        Please let me know if any additional questions come up.

        Comment


          #5
          Thank You for your help

          Comment


            #6
            Thanks for your reply Chis, I still have the same problem, to test, take an open code indicator HMAColourChange, save it with the name MyHMAColorChange, without modifying anything.

            If I export it as an open source, I can import it without problems, if I export it as a "compiled Assembly", it gives the message "Import Failed, The NinjaScrip Archive may contain duplicate method names taht already exists on your PC".

            Thank you very much for your help, Alejandro

            Comment


              #7
              Hello ahrt|,

              Thank you for the reply.

              Per your example, have you ensured that your current script is no longer calling HMAColorChange but the newly named MyHMAColorChange instead? If not, it would stand to reason that the script you are exporting is still containing HMAColorChange instead which would cause the error you have been seeing.

              I look forward to your reply.

              Comment


                #8
                Hi Chris,

                Thanks for your answer, I'm just exporting the MyHMAColorChange indicator, but I can only import it if I export it as an open source, if I select "Export compiled assembly .." the error appears when importing.

                Comment


                  #9
                  Hello ahrt|,

                  Thank you for the reply.

                  I would like to schedule a remote support call with you so that we may further assist.

                  Please write a note to platformsupport[AT]ninjatrader[DOT]com with "ATTN CHRIS S" in the subject line so that we can schedule a session.

                  I look forward to your reply.

                  Comment


                    #10
                    Thanks Chris, I sent you an email


                    Alejandro

                    Comment


                      #11
                      Originally posted by ahrt| View Post
                      Thanks for your reply Chis, I still have the same problem, to test, take an open code indicator HMAColourChange, save it with the name MyHMAColorChange, without modifying anything.
                      What?

                      You didn't modify anything inside that new file you saved?

                      Well, my friend, that's a problem right there.

                      You ain't done yet. Renaming a file is not enough.

                      Open up your new file in your trusty editor and use your handy
                      editor search-and-replace command to change all occurrences
                      of:

                      Code:
                      HMAColourChange
                      to

                      Code:
                      [COLOR=Red]My[/COLOR]HMAColourChange
                      Just because your filename is MyHMAColourChange.cs does not
                      guarantee a darn thing about the name of the indicator inside that
                      file.

                      Turns out the name of the file and the name of the indicator inside
                      that file
                      are the same name only due to human convention -- ie, it's
                      simply easier for us humans to keep things straight if we keep both
                      names the same -- but the compiler does not care.

                      After making this editing change, recompile, then export again and
                      send the .ZIP to your friend to retry the import.

                      Make sure your friend does not have MyHMAColourChange.cs on
                      their system. (They can have HMAColourChange.cs but the special
                      file with prefix "My" they must not have that).

                      Also, quick advice: do not use that stupid prefix "My" -- it's more a
                      placeholder, use your initials or something more familiar.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by adeelshahzad, Today, 03:54 AM
                      4 responses
                      22 views
                      0 likes
                      Last Post adeelshahzad  
                      Started by merzo, 06-25-2023, 02:19 AM
                      10 responses
                      823 views
                      1 like
                      Last Post NinjaTrader_ChristopherJ  
                      Started by frankthearm, Today, 09:08 AM
                      5 responses
                      15 views
                      0 likes
                      Last Post NinjaTrader_Clayton  
                      Started by jeronymite, 04-12-2024, 04:26 PM
                      3 responses
                      43 views
                      0 likes
                      Last Post jeronymite  
                      Started by yertle, Today, 08:38 AM
                      5 responses
                      16 views
                      0 likes
                      Last Post NinjaTrader_BrandonH  
                      Working...
                      X