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 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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        11 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        10 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        11 views
        0 likes
        Last Post strategist007  
        Started by StockTrader88, 03-06-2021, 08:58 AM
        44 responses
        3,981 views
        3 likes
        Last Post jhudas88  
        Started by rbeckmann05, Yesterday, 06:48 PM
        0 responses
        9 views
        0 likes
        Last Post rbeckmann05  
        Working...
        X