Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add second instrument when loading indicator as a paramater

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

    Add second instrument when loading indicator as a paramater

    Hi,

    Is it possible to add an instrument as a parameter?

    For example in the code below the instrument is hard-coded I want to know if I can make it so a user can enter 6A 09-12 as a parameter when I load the indicator?

    I have searched on the forums for sometime and whilst I could find some that covered the topic I'm still not quite sure if it can be done or not?

    Code:
     
    #region Variables
            
            private Font myFont             = new Font("Arial", 8, FontStyle.Regular);
            
            #endregion
    
            /// <summary>
            /// This method is used to configure the indicator and is called once before any bar data is loaded.
            /// </summary>
            protected override void Initialize()
            {
                
                Add("6A 09-12", PeriodType.Minute, 1);
                
                Add(new Plot(new Pen(Color.White, 5), PlotStyle.TriangleUp, "Long"));
                
                CalculateOnBarClose                = false;
                Overlay                            = true;
            }
    Regards,
    suprsnipes

    #2
    Yes, this is possible. Take a look at the following indicator which uses an Instrument name as a string for a user defined input parameter:


    MatthewNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    559 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    546 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X