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

Need details of import error

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

    Need details of import error

    I am using the 'Utilities->Export NinjaScript Assembly' to created a compiled NinjaScript assembly. I then try to import that NinjaScript archive into a brand new installation of NinjaTrader. I get an error saying that there are duplicate methods or a resource is missing.

    I then exported the exact same files but in their source code form.
    When I import that zip file it works.

    1) Where can I look to see details of what method or resource is the problem?
    2) Why does the source code import work but compiled assembly does not work?

    Thanks,
    Gary

    #2
    Hello,

    Thank you for the question.

    This could be due to the code you are currently using in your script or something that was referenced that does not need to be. You can locate the error in NinjaTrader. You will need to manually install the assembly in order to get NinjaTrader to print the errors, to do this do the following:

    Remove the original source from this installation or try this on a fresh installation of NinjaTrader (another pc).
    Open the zip file that was exported and you should see up to 3 files, a .cs file and possibly 2 dll files.
    Copy all 3 files to the Documents\NinjaTrader 7\bin\Custom folder.
    In a NinjaScript editor window, right click and click References.
    In the References menu, click Add and choose one of the dll files you just copied. Press open and then press OK.
    Now compile and you should see the errors listed.

    Once you have located what the error is, work through the above instructions in reverse to remove the assemblies and .cs file and make sure to compile after this to ensure the platform compiles and has no errors.

    If you are unsure of the error please let me know and I will be happy to assist.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Two current problems when exporting an assembly:

      (1) When you create a new assembly, please make sure that no assembly is installed on the machine that you use for creating the assembly.

      -> first remove all assemblies via File -> Utilities -> Remove NinjaScript Assembly
      -> only afterwards export your new assembly via File -> Utilities -> Export NinjaScript

      (2) In case that your exported assembly contains indicators or strategies that reference any non-system indicators, there will be a conflict if you try to install that assembly on a machine, that already has that same non-system indicator set up.

      Therefore before creating an assembly, you need to create copies of all external non-system files which are referenced by the indicators and strategies which you wish to export. The copies should bear different names to avoid any conflict with the original indicator.

      Best you include the code of all referenced indicators or files with your main indicator or strategy file. That way you minimize the likelihood of creating conflicts.
      Last edited by Harry; 02-11-2015, 01:26 PM.

      Comment


        #4
        Hello Harry,

        Thank you for providing these additional items, these are valuable recommendations.

        I wanted chime in to stress the importance of keeping a clean installation of NinjaTrader for your development. All of the points made about removing extra assemblies are absolutely true and will greatly aid in preventing extra debugging.

        I do recommend if you will be developing items that will be distributed it is really essential to have a testing machine or a testing user folder that is a completely clean install of the platform to test with.

        For users who do not have a extra machine to test with you can do the following to create a testing installation:

        Install NinjaTrader so that it is completely fresh.
        Open your Documents folder and make a complete copy of the folder "NinjaTrader 7" and rename it to something else like "NinjaTrader 7 Testing"

        Now when you want to test something on a clean installation, simply exit the platform and open your documents directory.
        Rename the existing NinjaTrader 7 folder to "NinjaTrader 7 Dev" and rename the clean installation folder from "NinjaTrader 7 Testing" to "NinjaTrader 7".

        When you start the platform only the stock items will be installed giving you the chance to test importing compiled assemblies as a brand new user would. If the import is successful this should work on pretty much any installation as long as the end user does not have another item installed that is a conflict.

        When you are done undo the renames you have done, so rename the "NinjaTrader 7" folder back to "NinjaTrader 7 Testing" and your dev folder back to "NinjaTrader 7"

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by TradeSaber, Today, 07:18 AM
        0 responses
        4 views
        0 likes
        Last Post TradeSaber  
        Started by PaulMohn, Today, 05:00 AM
        0 responses
        9 views
        0 likes
        Last Post PaulMohn  
        Started by ZenCortexAuCost, Today, 04:24 AM
        0 responses
        6 views
        0 likes
        Last Post ZenCortexAuCost  
        Started by ZenCortexAuCost, Today, 04:22 AM
        0 responses
        3 views
        0 likes
        Last Post ZenCortexAuCost  
        Started by SantoshXX, Today, 03:09 AM
        0 responses
        17 views
        0 likes
        Last Post SantoshXX  
        Working...
        X