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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    82 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    43 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    68 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    56 views
    0 likes
    Last Post CarlTrading  
    Working...
    X