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 Hwop38, 05-04-2026, 07:02 PM
    0 responses
    160 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    307 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    244 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    348 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    178 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X