Test only at the open Time of the actual Bar

 

Hi,

I want to write an EA which checks my order conditions only at the open time of the actual bar = one time at each bar.

How can I do this?

if(iTime(NULL,0,0) == TimeCurrent()) doesn't work.

Thank you

 
int start(){
   static datetime Time0;
   if (Time0 == Time[0]) return(0); Time0 = Time[0];
...
 

Thank you, it works great!

Reason: