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

How to distribute shared utility code?

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

    How to distribute shared utility code?

    Hi,

    I have 2 indicators that each use a set of shared helper classes.

    I want to distribute them in separate protected assemblies.

    When I create the 2 different protected assemblies, each one requires
    that I include the helper classes.

    Then if one user wants to import both indicators, they get an error that
    says something like this: 'you cannot import code that already exists',
    referring to the redundant helper classes in the protected assembly.

    Is there a way to package and distribute the code in 3 separate protected
    assemblies or in some way allow both imports?
    How do you get the export process to allow unresolved references to the
    helper classes so it does not require the inclusion of the helper classes
    when the indicator assemblies are exported?

    Thanks for any help,
    Gary

    #2
    Gary,

    Unfortunately this will not be possible. If you want separate assemblies you will need to just roll your helper functions directly into the script or rename the helper functions so each one uses separate ones.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      dll dependencies?

      I have not done this, but isn't there a way to specify 3rd party dlls that your code depends on and by doing this, the protect assembly step allows you to continue without actually resolving those references?

      Is there a way to create a dll of my helper code and then when I create the indicator assembly, I would specify it like I would a 3rd party dll?

      Gary

      Comment


        #4
        GaryAlbers,

        You could try using one of those "using _____" lines at the very top of your script to reference such a DLL.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Helper functions/indicators

          When an assembly requires another indicator, is there a way to have it included, but not appear in the list of indicators available for a chart on the users PC?

          Comment


            #6
            BradB,

            If you had helper functions and such you can try adding it to the UserDefinedMethods file instead of creating an indicator for it.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Thanks Josh, but if I need to include an indicator, is there a way to conceal it's presence?

              Comment


                #8
                Unfortunately not. You will not be able to hide it from the UI list.
                Josh P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by alifarahani, Today, 09:40 AM
                4 responses
                19 views
                0 likes
                Last Post alifarahani  
                Started by gentlebenthebear, Today, 01:30 AM
                3 responses
                15 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by PhillT, Today, 02:16 PM
                2 responses
                7 views
                0 likes
                Last Post PhillT
                by PhillT
                 
                Started by Kaledus, Today, 01:29 PM
                3 responses
                11 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by frankthearm, Yesterday, 09:08 AM
                14 responses
                47 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Working...
                X