@bocadeangu said in Help for Write custom block Mql Code: Condition + modify variables:
@miki Thanks a lot for the help.
In what I need to program, I don't need to confirm that the condition is false. If it is not true, you can move on to the next comparison.
If I write the way below is there a problem ???
if (Variable1> 0) {Variable1 = Variable1 * Constant;}
if (Variable2> 0) {Variable2 = Variable2 * Constant;}
if (Variable3> 0) {Variable3 = Variable3 * Constant;}
if (Variable4> 0) {Variable4 = Variable4 * Constant;}
If you use only "if" all variables are checked, if you use "else if" the next variable is checked if the previous is not true. However it would be faster to create an array and loop with a "for" but it would be difficult to explain