Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator Parameter that defaults to same parameter used by another Indicator

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

    Indicator Parameter that defaults to same parameter used by another Indicator

    Hi

    I have a number of custom indicators, is it posible to on the Initialise method to set the default value of a parameter to the value used buy one of my other indicators if it is loaded?

    I have tried the following

    protected override void Initialize() {

    Overlay = true;
    if (strength == -1) {
    strength = 2;
    foreach (Indicator ind in Indicators) {
    if (ind.GetType() == typeof(HiLowSwing)) {
    strength = (ind as HiLowSwing).Strength;
    }
    }
    }
    }

    The Indicators collection is empty, can i reference the indicators collection loaded on the chart?

    Thanks

    Mike

    #2
    Hi upshon,

    You'll need to access one from the OBU() as seen in this sample:
    TimNinjaTrader Customer Service

    Comment


      #3
      Hi Tim

      I assume buy OBU() you are referring to OnBarUpdate()?

      What I want to do is to set the default in the Initialize() method so when the properties dialog for the indicator pops up when you add the indicator the default is set there, this gives the user the ability to override if required.

      So what I am asking is how would I access the already loaded Indicators from the Initialize() method.
      Thanks

      Mike

      Comment


        #4
        Hello,

        This would be unfortunately not possible.

        Let me know if I can be of further assistance.
        BrettNinjaTrader Product Management

        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
        157 views
        2 likes
        Last Post CaptainJack  
        Working...
        X