Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 cre8able, Yesterday, 09:15 PM
    2 responses
    14 views
    0 likes
    Last Post cre8able  
    Started by Trader146, Today, 09:17 PM
    0 responses
    6 views
    0 likes
    Last Post Trader146  
    Started by ttrader23, 05-08-2024, 09:04 AM
    9 responses
    43 views
    0 likes
    Last Post ttrader23  
    Started by ZeroKuhl, Yesterday, 04:31 PM
    8 responses
    46 views
    0 likes
    Last Post ZeroKuhl  
    Started by reynoldsn, Today, 07:04 PM
    0 responses
    11 views
    0 likes
    Last Post reynoldsn  
    Working...
    X