Quote:
Originally Posted by wisnuw
Perky and fxd01, thanks for your help.
I already add code like Perky suggest but did not solve the problem.
What I want is if EA already close previous order. EA cannot
make another open order at the same bar of close previous order.
For TF H1
If EA open pending BUY_STOP at 10.30 the bar will be close at 10.59
and the order open at 11.10 ( next bar of open order ) if at 11.30 EA close the order. at 11.40 EA still can make another order because previous pending order was make at 10.30 ( last bar ).
|
just add some code like this
int PrevOP;
int Order=OrdersHistoryTotal()
for(int i=Order-1;i>=0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==fals e) break;
if(OrderSymbol()!=Symbol() || OrderType()==OP_SELL || OrderType()==OP_BUY) continue;
//----
if(OrderCloseTime()>Time[0]) PrevOp++;
}
if (PrevOP>0) ===> don't trading..... OK
Thanks