• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 GMiller64, Today, 01:13 PM
            3 responses
            5 views
            0 likes
            Last Post GMiller64  
            Started by itrader46, Today, 12:51 PM
            4 responses
            30 views
            0 likes
            Last Post itrader46  
            Started by hemlock, Today, 11:45 AM
            3 responses
            9 views
            0 likes
            Last Post NinjaTrader_PatrickG  
            Started by gbulle, Today, 11:31 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by JPPoulin, Today, 10:43 AM
            6 responses
            20 views
            0 likes
            Last Post JPPoulin  
            Working...
            X