Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is it possible to use dictionary/list in user inputs?

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

    Is it possible to use dictionary/list in user inputs?

    for example, i have
    Code:
    		[NinjaScriptProperty]
    		[Display(Name = "Show Line1",  Order = 1, GroupName = "abc")]
    		public bool _showLine1	{ get; set; }	
    		 
    		[NinjaScriptProperty]
    		[Display(Name = "Show Line2", Order = 2, GroupName = "abc")]
    		public bool _showLine2	{ get; set; }
                    ........
                    etc, like 20-30 lines
    if something like this is possible:
    Code:
                   public Dictionary <string,bool> _Show = new Dictionary <string,bool>();
    
    		[NinjaScriptProperty]
    		[Display(Name = "Show Line1",  Order = 1, GroupName = "abc")]
    		public bool _Show["line1"] { get; set; }	
    		 
    		[NinjaScriptProperty]
    		[Display(Name = "Show Line2", Order = 2, GroupName = "abc")]
    		public bool _Show["line2"] 	{ get; set; }
    that later, in `OnStateChange` or in `OnBarUpdate` I can easily iterate within the dictionary..


    (p.s. if something like that is achievable, please add several words about how to do them with `brush` inputs, because they use serialization too of the input's variables names)

    #2
    Hello TazoTodua,

    It is possible to use a custom TypeConverter to open a collection with a collection editor.

    Below is a link to a reference sample that demonstrates.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    42 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    25 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    162 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    98 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    157 views
    2 likes
    Last Post CaptainJack  
    Working...
    X