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

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 cmtjoancolmenero, Yesterday, 03:58 PM
            3 responses
            23 views
            0 likes
            Last Post cmtjoancolmenero  
            Started by Brevo, Today, 01:45 AM
            1 response
            14 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by rjbtrade1, 11-30-2023, 04:38 PM
            2 responses
            72 views
            0 likes
            Last Post DavidHP
            by DavidHP
             
            Started by suroot, 04-10-2017, 02:18 AM
            5 responses
            3,021 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by Stanfillirenfro, Today, 07:23 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Working...
            X