Ordering EA to wait until condition is fulfilled

 

Hello Guys,

I am new to MQL, so sorry if my question would seem stupid to you.

The question is as follow:

I want to program an EA that uses two conditions. 

Step 1: Check if the first condition is fulfilled

Step2: Wait for the second condition is fulfilled

Step3: If fulfilled during defined time or number of bars -> execute, else cancel condtion 1.

Would it be possible?

Thanks in advance.

Documentation on MQL5: Timeseries and Indicators Access / Bars
Documentation on MQL5: Timeseries and Indicators Access / Bars
  • www.mql5.com
If the start_time and stop_time parameters are defined, the function returns the number of bars in the specified time interval, otherwise it returns the total number of bars. If data for the timeseries with specified parameters are not formed in the terminal by the time of the Bars() function call, or data of the timeseries are not synchronized...
 
Igor Polushkin:

Hello Guys,

I am new to MQL, so sorry if my question would seem stupid for you.

The question is as follow:

I want to program an EA that uses two conditions. 

Step 1: Check if the first condition is fulfilled

Step2: Wait for the second condition is fulfilled

Step3: If fulfilled during defined time or number of bars -> execute, else cancel condtion 1.

Would it be possible?

Thanks in advance

code it and you will found out

 
Kenneth Parling:

code it and you will found out

I am not sure, how one can implement the wait condition, since we check each tick.

 
I think I got it. Block inside with check for true
Reason: