Parameter's checkbox unchecked by default
            
                 02 Aug 2016, 00:05
            
                    
Hello,
is it possible to code a parameter, so it would be unselected by default?
Thank you.
Replies
                     kricka
                     20 Aug 2016, 15:50
                                    
True and False
If there are only two choices in the parameter setup you can use the true and false statement. Below is an example.
[Parameter("Indicator 1 = 1,  Indicator 2 = 2 ", DefaultValue = true)]
        public bool Indicators { get; set; }
Then you have to put the logic in the code.
protected override void OnTick()
        {
if (Indicators == true)
ChartObjects.DrawText("Show Indicator 1", "\n" + "\n" + "\n" + , StaticPosition.TopRight, Colors.Green);
if (Indicators == false)
ChartObjects.DrawText("Show Indicator 2", "\n" + "\n" + "\n" + , StaticPosition.TopRight, Colors.Red);
I am using ChartObjects.DrawText but you can use any method.
@kricka


Spotware
04 Aug 2016, 16:56
Dear Trader,
Please be advised that you can use the following statement:
[Parameter(DefaultValue = false)]
public bool Parameter { get; set; }
@Spotware