Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

public input

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

    public input

    How to I make an input available from my custom indicator?

    I have a simple indicator called myADX with only 1 input called period. How do I make myADX and period callable from other strategies and indicators?

    double = myADX( period )[0];

    Thank You - Westsider

    #2
    Hello Westsider,

    That looks good. To call your indicator you will just need to use the Class name and any overloads that it requires so since you only have 1 parameters then you would just need to pass it in one parameter like "period". You will just have to make sure that it is the same type like an "int".

    Here is an example of how to call an indicator from a strategy which would be the same way you may call it from another indicator as well from the following link.


    Note that if you have not created a strategy before using the Strategy Wizard will help you get started with this and may help you out with your Indicator as well. I'm proving a link to a recently recorded 'Automated Strategy Development Webinar' video for you to view at your own convenience: http://youtu.be/SpwGTr9kl9k
    JCNinjaTrader Customer Service

    Comment


      #3
      Hi JC,
      Thanks for the info. I have used the strategy wizard and its great. The problem I'm having is period does not show up when I call it from a strategy.

      I was creating the input "period" manually and it was not public. When I use the Indicator wizard and it creates the input "period". It is available when called from a strategy.

      The wizard must do something different in the background because I manually create the properties the same way.

      private int period = 5;

      [Description("")]
      [GridCategory("Parameters")]
      public int Period
      {
      get { return period; }
      set { period = Math.Max(1, value); }
      }

      Is that correct?

      Thanks - Westsider

      Comment


        #4
        Hello Westsider,

        That looks correct. Is that the code for the "Period" variable that you are defining inside of your Strategy or Indicator?
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

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