Sequence of rule execution
3 replies
huangwh88
7 years ago #116400
Hello,
Suppose we have a source code in the usual format:
Rule 1
—————–
Rule 2
—————-
Rule 3
When the EA is running in MT4, are the rules evaluated in this sequence?
For example, rule 1 is to enter a buy stop order, and rule 2 is to cancel the stop order. If both rules are true, is it possible for a buy stop to be created?
tomas262
7 years ago #141821
Hello,
in such case the stop order will be created and cancelled immediately. You need to add additional conditions to avoid that situation
huangwh88
7 years ago #141836
Hello,
in such case the stop order will be created and cancelled immediately. You need to add additional conditions to avoid that situation
Thank you Tomas.
To clarify my understanding, when the EA is being read by MT4 from top to bottom,
Is every true condition executed immediately after being read?
Or does MT4 finish reading the entire EA, then all the true conditions are executed in one go?
tomas262
7 years ago #141843
Yes, once you drop it on a chart all conditions are evaluated
Viewing 3 replies - 1 through 3 (of 3 total)