Need help with code

 

Hi,


can someone help me out.


Input

I have an ea with 2 strategies. Now i want that i can enable/disable the strategy in the ea. How can i solve this. as you can see in the picture above i have add an input bool Str 2 = true;

How can i hide the inputs for the strategy when it is false? And when i switch on true than the input parameter will be shown?


How did i have to code it in the picture above? i tried an if statement but have my problems! Can anyone help me out ?

 
Raphael Schwietering: How can i hide the inputs for the strategy when it is false? And when i switch on true than the input parameter will be shown?

You can't.

 
and how did i have to do the if statement?? if ( Str1 == true)  ???????
 
Raphael Schwietering:
and how did i have to do the if statement?? if ( Str1 == true)  ???????

As previously stated, you can not use an input variable to hide variables.

See if this meets your needs.

https://www.mql5.com/en/docs/basis/preprosessor/conditional_compilation

 
You can make your own pop-up UI to suit your requirements. 
Reason: