OrderSelect---Last closed order

 

How can I go back and check at what time my last order was closed and use that info on wheather I should proceed with my buy signal?

OrderSelect (cnt, SELECT_BY_POS,):

if(TimeCurrent() - OrderCloseTime() > timecheck)

{

Continue;

}

This doesn't seem to work, the orderclose time is printing as a consistent 1231783488 which is telling me its the same (first) order, how do I make it advance to the next closed order?

Thanks,

BB

 

OrderSelect(0,SELECT_BY_POS,MODE_HISTORY);


CB

 

It doesn't seem to be working, heres what I have

if(OrdersTotal() <1)
{
OrderSelect(0,SELECT_BY_POS,MODE_HISTORY);

t = OrderCloseTime();
t1 = TimeCurrent();
ttt = TimeCurrent()-OrderCloseTime();

if (ttt > ddtdelay)


{

BUY = Ordersend()....

Print("t ", t);
Print("t1", t1);
Print("ttt", ttt);

}

Journal:

2009.10.26 14:32:16 2009.10.15 19:59 TEST___EURUSD,H1: ttt23853290
2009.10.26 14:32:16 2009.10.15 19:59 TEST___ EURUSD,H1: t11255636778
2009.10.26 14:32:16 2009.10.15 19:59 TEST___EURUSD,H1: t 1231783488

I'm sure the loop is being activated because the Current time and ttt are being calculated but I can't figure out why it won't advance to the last closed order.

Any further help would be much appreciated.

Thanks,

BB

 

Not sure what you mean by "it won't advance to the last closed order".

The OrderSelect() call should bring the most recent order into context.

To check, why not print out some other stuff about the order in question (you'll know what price it was opened at for instance).


CB

Reason: