Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limit the Enums in Indicator Parameter

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

    Limit the Enums in Indicator Parameter

    Hi,
    lets say I have an Enum with values 0-100, so for example
    Code:
    public enum Test {
    T0 = 0,
    T1 = 1,
    ...
    }
    I would like to use this Enum as a Parameter of an indicator. However, I would like to add only specific Enums.
    My idea was to use
    Code:
    [Range(0, 10)]
    to limit the number of visible Enums in the dropdown. However, all Enums are shown. When I choose an Enum with a Value greater than 10, the indicator cannot be shown.

    Is this a bug?
    How do I limit the number of visible Enums?


    *** Edit: I also tried it with a custom ValidationAttribute annotation, without success.
    Last edited by Bobin; 11-13-2021, 01:49 PM.

    #2
    Hello Bobin,

    Below is a link to the reference sample in the help guide with an Enum input.


    For an input, when using an enum all values will be displayed.

    You might have a different enum with less

    You might use a customized string input with a custom type converter instead.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

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