new order only if bar is not older than 10 minutes

 

I want to prevent my EA from open new order if bar is older than 10 min ...

is there a simple function i can use which returns 0 if bar is older than 10 min?



 
fulltilt:

I want to prevent my EA from open new order if bar is older than 10 min ...

is there a simple function i can use which returns 0 if bar is older than 10 min?

Hi fulltilt,

Its called TimeCurrent() against Time[bar].

 
fulltilt: is there a simple function i can use which returns 0 if bar is older than 10 min?

bool isOldBar(int minutes=10){ return( (TimeCurrent() - Time[0]) > minutes*60 ); }
 
thanks guys, this is what I had been looking for
Reason: