Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Dynamically changing parameters based on parameter value

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

    Dynamically changing parameters based on parameter value

    How can I dynamically change the parameter list, when one parameter (typically enum) have specific value?

    I am aware of C# 3.5 overloading options, where you can have a different parameters list (and different behaviors) for the same name method. But this addition is like adding a certain rule over the overloading.

    If I was not clear, please see the 2 attached images of example of an indicator that does this (by one of your echo-system partners). In the first one, you can see the list of params when Type=Price, and in the other you can see a different list of params when Type=Indicator.

    Can you add an example code of how this can be done?
    Attached Files

    #2
    Hello Shai Samuel,

    Thank you for writing in. You need to have your indicator implement the ICustomTypeDescriptor interface. Then each dynamic parameter must have the following code:
    Code:
    [RefreshProperties(RefreshProperties.All)]
    Please be aware that this is not officially supported but has been used by other customers in the past.

    I have attached an example of an indicator that implements the ICustomTypeDescriptor interface which you can use for reference.

    Please let me know if I may be of further assistance.
    Attached Files
    Michael M.NinjaTrader Quality Assurance

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    576 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 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
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X