Need help about trade time control

 

I need some help:

If I closed a order in a bar, then I need no operation in this bar any more.

the next time for opening a position would be in the next bar.I wrote as fowling:

OrderSelect(ticket, SELECT_BY_TICKET);

if (OrderCloseTime()>Time[0]) return(0);

but it doesnot work at all in back test,

so ,I need some help, please help me

 

use this ... it works

bool openenable = true;

for(int hcnt=0;hcnt<HistoryTotal();hcnt++)

{

OrderSelect(hcnt, SELECT_BY_POS, MODE_HISTORY);

if(OrderSymbol()==Symbol()&& OrderMagicNumber()==MagicNo)

{

int lastclosetime = OrderCloseTime();

if(lastclosetime>iTime(Symbol(),0,0)) openenable = false;

}

}

Reason: