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

Exporting compiled strategies - .cs file exists

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

    Exporting compiled strategies - .cs file exists

    What's the easiest way to incorporate .cs files into your strategy so that when compiled (as protected code) and then exported to another user they don't run into an error because they already have say the EMA.cs sitting on their machine and it can't be overwritten?

    Obviously it's not a problem if you can view the source code / unprotected.

    #2
    Hello darrentate,

    Thank you for your post.

    You would not run into this error with the system indicators like EMA. However, custom indicators will result in errors like the one you mentioned. You must remove the custom indicators from the installation before being able to import a protected assembly with those same indicators in it.

    Comment


      #3
      Hi there -

      The only indicators that are used (and that are requested by the system to be added on export) are:

      4x moving averages (EMA.cs, HMA.cs, WMA.cs, SMA.cs)
      Swing.cs
      MIN.cs
      MAX.cs

      However when I try to import it elsewhere I get:

      "Import failed. the NinjaScript Archive File may contain duplicate method names that already exist on your PC or there is a required file missing on either your PC or in the import archive".

      There are no other custom indicators referenced in the file. I also double checked that were no previous versions of the same strategy / indicator on the system.

      If I bring up references there are various ones that are listed specific to this machine but none of them are used in this strategy.
      Last edited by darrentate; 03-09-2015, 02:33 PM.

      Comment


        #4
        Hello darrentate,

        Is the strategy still in it's .cs source file form in the installation you are trying to import the protected assembly in?

        Comment


          #5
          Hi Patrick,

          Not that I can see (and I deleted the old versions). I've double checked NT7/bin/Custom/Strategy as well.

          Comment


            #6
            Hello darrentate,

            Would you mind sending the .zip to me to test on my end?
            You can send it to paltformsupport[at]ninjatrader[dot]com with this thread referenced in the body of the e-mail: "http://www.ninjatrader.com/support/forum/showthread.php?t=72450"

            Comment


              #7
              Sent thanks

              Comment


                #8
                Hello darrentate,

                Thank you for sending that file over.

                There is no issue with the export or import however, the issue is with the other assemblies in your installation. NinjaTrader will attach these to the exported assemblies in a means to ensure the next user who imports has the same assemblies in their installation.

                So the solution is to export your files from a "clean" installation, this just means an installation without other assemblies referenced.

                Comment


                  #9
                  Ah great thanks so that means delete the references and the indicators that reference them then export?

                  Comment


                    #10
                    Hello darrentate,

                    Thank you for your response.

                    You can remove the assemblies via File > Utilities > Remove NinjaScript Assembly.

                    However, another way to do this without losing your assemblies is to create a development installation that does not contain the assemblies. To do this, go to Help > License Key and copy and paste your License Key into a text document> then shut down NinjaTrader > uninstall NinjaTrader via Start > Control Panel > Programs and Features > once complete go to (My) Documents > rename the 'NinjaTrader 7' folder to 'NinjaTrader 7.Prev'.

                    Then re-install from the following link: http://www.ninjatrader.com/download-free.php

                    When you start NinjaTrader it will create a new directory in which you can move over any indicators or strategies you wish to export in this "clean" installation.

                    To switch between the two installs; shut down NinjaTrader > rename the new installation to 'NinjaTrader 7.Dev' under (My) Documents > then rename the 'NinjaTrader 7.Prev' to 'NinjaTrader 7'.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by mjbatts91, Yesterday, 04:48 PM
                    2 responses
                    23 views
                    0 likes
                    Last Post mjbatts91  
                    Started by pibrew, Today, 06:10 PM
                    1 response
                    17 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Started by actualfacts.2021, 07-25-2021, 03:11 PM
                    8 responses
                    1,184 views
                    0 likes
                    Last Post linkcou
                    by linkcou
                     
                    Started by reynoldsn, Today, 07:11 PM
                    0 responses
                    4 views
                    0 likes
                    Last Post reynoldsn  
                    Started by needsomehelp147, 04-29-2024, 06:43 AM
                    2 responses
                    20 views
                    0 likes
                    Last Post needsomehelp147  
                    Working...
                    X