Condition 1 completed then wait for execution of next condition
-
Hi all.
How to create a variable so that when the first condition becomes true to remember that (in a variable). Then, also on every tick checking the second condition if the variable is set to true ?
Because I want the EA to wait for the second condition to happen once the first is achieved.
For example
condition 1 : 50 ema to cross 200 ema
condition 2: Then candle close below 50 ema
-
@vsidaarth said in Time based execution of conditions:
Hi all.
How to create a variable so that when the first condition becomes true to remember that (in a variable). Then, also on every tick checking the second condition if the variable is set to true ?
Because I want the EA to wait for the second condition to happen once the first is achieved.
to be clear, logically, "time based" is not same thing as "not now, but later,....condition based" approaches. Time based would be, if X condition is true, set timer X, then pass.
Maybe that logically helps you find the answer you now seek?
-
True! I have changed the question to make it more accurate. I want it to wait till the next condition is executed
For example
condition 1 : 50 ema to cross 200 ema
condition 2: Then candle close below 50 ema
-
@vsidaarth You will need a variable controlling that. You can use a boolean one, for exmple. When the first one is true, then the second one can happen.
-
@l-andorrà Is there a nice video about this ? I checked your videos on variables and constants but it is quite basic. I couldn't find more advanced videos regarding this kind of an execution anywhere in youtube.
Atleast some documentation would be helpful

Thanks!
-
you could also use a flag type system. if condition is true set a flag. always check for that flag, and if it is true, then perform another condition.
-
@vsidaarth Here you have something to begin with:
https://fxdreema.com/shared/0rN9mbHGd
This is just for buys. You will need to create another variable for sells and mirror the structure.
-
@l-andorrà Thanks a lot! I will check it out!
-
@vsidaarth You're welcome.