Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem Import NT strategy script

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

    Problem Import NT strategy script

    I have 2 strategies. Both are using the same custom build indicator. I export both strategies seperately in order to import the strategies in my runtime environment for NT. The firts import succeeds. The second import gives an error message that the import failed, because duplicate methods exists. If I look at the NT trace file, I see that the problme comes from the fact that both uses the same custom build indicator.

    I don't want to export the strategies in the same export, because I probably want to distribute both strategies independently. How can I import the second strategies with using the same csutom build indicator?

    Kind regards,
    Rene

    #2
    Rene, I would suggest distributing the indicator and strategies then in separate files, or make the indicator calcs internal to the strategy for example. Yet another way would be naming the indicators individually per distribution so methods installed would not 'collide' as you had seen.

    Comment


      #3
      Originally posted by Renejm View Post
      I have 2 strategies. Both are using the same custom build indicator. I export both strategies seperately in order to import the strategies in my runtime environment for NT. The firts import succeeds. The second import gives an error message that the import failed, because duplicate methods exists. If I look at the NT trace file, I see that the problme comes from the fact that both uses the same custom build indicator.

      I don't want to export the strategies in the same export, because I probably want to distribute both strategies independently. How can I import the second strategies with using the same csutom build indicator?

      Kind regards,
      Rene
      Are you using a custom namespace in the indicator?

      Comment


        #4
        The namespace command used in the custom indicators are:

        namespace
        NinjaTrader.Indicator

        Within the indicator I use two custom functions. Both functions are also using

        namespace NinjaTrader.Indicator

        (You cannot export the UserDefinedMethods, therefore I stored them in an indicator as suggested by your helpdesk)

        Comment


          #5
          As far as I know distributing the indicators seperately from the strategies is not possible, because if I try to export the strategies I alsways have to include the custom designed indicators. othrewise the export will not succeed. So the problem is with two strategies using the same custom designed indicator that by importing the second indicator the custom designed indicator already exists and I get the error of duplicate methods and the import fails. I have already tried to import the indicators seperately first, but no success. The problem does not exists with the system designed indicators that I use with both strategies. Any other suggestion, becaues I will use the indicators multiple times and I only want to maintain the source code for the indicator once.

          Kind regards,
          Rene

          Comment


            #6
            Sorry for my late reply Rene, yes you are correct here. The indicators would be exported automatically from NT if referenced by your strategy. So if the exact same indicator already existed, you would see the duplicate method issue then if you attempted to import again a compiled assembly trying to add the same one.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            648 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            108 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            572 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            574 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X