Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator can't call a compiled protected indicator

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

    Indicator can't call a compiled protected indicator

    I am trying to use another indicator in my indicator. The other indicator is a compiled & protected indicator. I do something like this:

    ProtectedIndicator pi = ProtectedIndicator();

    This works when i use the source code of the protected indicator, so the syntax is valid. However when I try it on another PC with the protected compiled indicator, I get an error:

    Ninjatrader.Indicator.ProtectedIndicator is a type but is used like a variable.

    From what I understand, when we create an indicator Ninjatrader will create helper methods to allow one to just do EMA(20) for example. But if the indicator is protected, it seems these methods are not available.

    Am I doing something wrong? Is it possible for an indicator to use another protected indicator?

    #2
    Hi cunparis,

    Try calling the protected indicator creating a strategy in strategy analyzer. Then look at the code to see how the indicator is being called.

    RJay
    RJay
    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

    Comment


      #3
      If you want to call it without parameters, you will need to use the new keyword.

      Comment


        #4
        Originally posted by koganam View Post
        If you want to call it without parameters, you will need to use the new keyword.
        Thanks for your reply.

        I can call it with parameters but the indicator doesn't have any parameters.

        If I use the new keyword, the licensing code does not get called and it doesn't work.

        Comment


          #5
          Originally posted by cunparis View Post
          ... However when I try it on another PC with the protected compiled indicator, I get an error:
          How did you get the indicator onto the other PC? Manually by copying the dll or by using the standard zip export/import? In other words, do you have both a dll and a cs file for the indicator in the NT file tree?

          Comment


            #6
            I exported the protected into as a zip and imported it. The indicator that will use this one I copied the .cs file. it uses other frameworks so I can't export it as a zip without exporting the other frameworks which I don't want to do.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            607 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            353 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            560 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            561 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X