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 cmoran13, 04-16-2026, 01:02 PM
            0 responses
            43 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            25 views
            0 likes
            Last Post PaulMohn  
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            162 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            98 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            158 views
            2 likes
            Last Post CaptainJack  
            Working...
            X