I am making an EFS that has 3 different conditions, similar to the following
1) if (high(0) > sma(5) & high(-1) > sma(5, -1) & high(-2) > sma(5, -2) etc)
condtion1 = true;
2) sma(3) > sma(5)
condition2= true
3) sma(5) > (sma(5 -10) + 4)
condtion3 = true
i wrote the code so that if a condtion is true, a bool variable = true
My questions are:
is there a better way to code
if (condtion1 =="true" & condtion2=="true" & condtion 3=="true")
{ make alert}
I know that with one bool you can just code : if(condition1), and it will only evaluate if the bool is true. can you do the same for more than 1 bool? when i test it doesnt seem to work
2) do I need to reset the bools after each bar? I think i do, or maybe I need to add an "else" statment to all my bools and make those false
3) is this way of coding the most efficient, and if not (probably) does anyone have any suggestions
Thanks in advance
1) if (high(0) > sma(5) & high(-1) > sma(5, -1) & high(-2) > sma(5, -2) etc)
condtion1 = true;
2) sma(3) > sma(5)
condition2= true
3) sma(5) > (sma(5 -10) + 4)
condtion3 = true
i wrote the code so that if a condtion is true, a bool variable = true
My questions are:
is there a better way to code
if (condtion1 =="true" & condtion2=="true" & condtion 3=="true")
{ make alert}
I know that with one bool you can just code : if(condition1), and it will only evaluate if the bool is true. can you do the same for more than 1 bool? when i test it doesnt seem to work
2) do I need to reset the bools after each bar? I think i do, or maybe I need to add an "else" statment to all my bools and make those false
3) is this way of coding the most efficient, and if not (probably) does anyone have any suggestions
Thanks in advance
Comment