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