Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exporting --> Importing Scripts & Assemblies

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

    Exporting --> Importing Scripts & Assemblies

    Hello,

    I've been trying as of late to cobble together a bunch of scripts and strategies I created (and am currently using), compile them in a custom assembly, then use only that custom assembly and deleting the original scripts/strategies. I have not had much luck.

    Specifically, in which order must I export, delete, and re-import those scripts and strategies?

    #2
    Hello cgeorgan,

    Thanks for your post.

    The overall process sequence would be to create an assembly then remove the original files you exported, then import your assembly.

    To create a custom assembly:

    1) In the control center select File>Utilities>Export NinjaScript

    2) in the export Ninjascript Archive File window:

    a) Check the "export compiled assembly of selected source files" button

    b) Enter a FileName for the assembly to be known as.

    c) Select the NinjaScript files to include in the assembly on the left side and use the ">" to add them to the end assembly (Likewise use "<" to remove a file from end assembly)

    d) when done selecting the ninjascript files, click on the "export" button. A message box will usually pop-up advising what other indicators files will be included, click okay, the assembly file will be created in the location: Documents>NinjaTrader7>BIN>Custom>ExportNinjaScrip t.

    Here is a link to the help guide on this process: http://www.ninjatrader.com/support/h...tml?export.htm (Please refer to the line "Exporting NinjaScript Indicators or Strategies as assemblies".

    Please let me know if I can be of further assistance.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      So, that's the rub - I have all of that.

      The problem comes when I re-import my own compiled .dll. I can't re-import while the old scripts and strategies are installed - the old scripts will not compile because the new .dll is essentially a re-definition of all the old scripts and assemblies ("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.")

      I can delete the old scripts and strategies, then copy the new assembled .dll into the \Ninjatrader 7\bin\custom\indicator director. I can then create a new reference in the code to that .dll. I can get that to compile.

      HOWEVER, when I open up a workspace that had references to all the old indicators and strategies, they're all gone. In fact, I'm missing far more than those scripts - I end up missing a big chunk of the OEM indicators, even though they still exist in the indicator directory.

      Hence my question: What is the exact order I need to do this in order to export and re-import on the same machine and have NT continue as if nothing changed?

      Comment


        #4
        Hello cgeorgan,

        Thanks for your reply.

        To be clear, you need to Import the assembly. File>Utilities>Import

        You may wish to test this out on a clean (new) NinjaTrader. You can create that situation by simply renaming the NinjaTrader7 folder in the Documents Folder (Like NinjaTrader7OLD) and doing a new download of NinjaTrader which will effectively repair by placing all new Documents>Ninjatrader7 (and thus creating a new/clean version to test with) . Then you can import your assembly into the new system and verify it functions as expected. You can then rename that NinjaTrader7 folder (like NinjaTrader7Clean) and replace it by once again renaming your NinjaTrader7Old to NinjaTrader7 and you will once again have your original system to further test with.

        Please let me know if I can be of further assistance.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Ah, I was able to get that approach to work.

          One final question: Which configuration file do I need to change in order to re-direct NT to find the custom .dll assembly? Currently it's in \NinjaTrader 7\bin\Custom; I'd like to move it out to a thumb drive.

          Comment


            #6
            Hello cgeorgan,

            The DLL needs to reside in the NinjaTrader7>Bin>Custom folder as this is where NinjaTrader looks.

            Please let me know if you have further questions.
            Paul H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by elderan, Yesterday, 08:03 PM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by samish18, Yesterday, 08:57 AM
            8 responses
            25 views
            0 likes
            Last Post samish18  
            Started by DJ888, 04-16-2024, 06:09 PM
            3 responses
            10 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by RookieTrader, Today, 07:41 AM
            0 responses
            3 views
            0 likes
            Last Post RookieTrader  
            Started by maybeimnotrader, Yesterday, 05:46 PM
            1 response
            19 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X