That is because you are acting on just one condition. Your original was all three.
bool condition=true; for(i = 1; i <= 3; i++) if(Open[i] > Close[i]) condition=false; // One or more are not less than. if(condition) { // All three are less than. Print("entryOutput=1"); }
William Roeder:
That is because you are acting on just one condition. Your original was all three.
I see. Make sense. Thank you William! Have a good day.
That is because you are acting on just one condition. Your original was all three.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello friends,
I'm new to MQL and fairly new to MQL5 community so I really hope I'm asking this question at the right place. I intend to upgrade this simple 3 bar entry criteria with a for loop so that I can give an extern variable later on how many bars to look for.
Original code:
The idea I had:
However it keeps printing without meeting the intended 3 bar closing above the open condition.
Could you please give me a hint on how to nest if and for loops together?
Thanks,
M