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 rhyminkevin, Today, 04:58 PM
        4 responses
        52 views
        0 likes
        Last Post dp8282
        by dp8282
         
        Started by iceman2018, Today, 05:07 PM
        0 responses
        5 views
        0 likes
        Last Post iceman2018  
        Started by lightsun47, Today, 03:51 PM
        0 responses
        7 views
        0 likes
        Last Post lightsun47  
        Started by 00nevest, Today, 02:27 PM
        1 response
        14 views
        0 likes
        Last Post 00nevest  
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        50 views
        0 likes
        Last Post futtrader  
        Working...
        X