HELP tradereditor

 

Hi to all,

I need a little help with programming in MetaEditor 4...

so my problem is: I want to include a "wait function until my condition becommes true

if (condition1)

{

"wait until" (condition2 == true); // I want to check this condition again and again until it will be true

{

do2;

}

}

Is it possible to do?

thnx

 

The programs in MT4 run on ticks, this means that if you say

if(condition1){

if(condition2){

}

}

then the program is already waiting for the second condition and will no go ahead until both are true; all the ticks where it's false, will just go by, the program will "wait". You don't need any special "waiting" code for it.

Also if(condition1 && condition2){} does the job just as well.

 

Tomazzz:

so my problem is: I want to include a "wait function until my condition becommes true

check for the condition. If it's true do what ever. If it's currently false, just return from start(). Thus mt4 will wait for another tick and then call start().
 

Just as a Reminder:

You must set condition 1 and 2 BEFORE you test for both.

unless these conditions are set by events outside the start function loop(such as values in a global variable which can be set external to program logic)

your program will loop endlessly without doing anything..

To clarify your statement, the program will NOT return to start. It will exit your program. The next tick is the event that will cause it to enter start.

WHRoeder:
check for the condition. If it's true do what ever. If it's currently false, just return from start(). Thus mt4 will wait for another tick and then call start().
Reason: