if (OrderType()==OP_BUY || OrderType()==OP_SELL){ //Order has been filled }
dennisne:
Does Anyone know how to determine when a pending order is filled, so that it is now an open order?
I want to develop an EA which places a pending buy order and a pending sell order, and then subsequently
cancels whichever one is still pending after one of them is filled.
int openTicket=0, pendTicket=0; for(int pos = OrdersTotal()-1; pos >= 0 ; pos--) if ( OrderSelect(pos, SELECT_BY_POS) // Only my orders w/ // && OrderMagicNumber() == magic.number // my magic number && OrderSymbol() == Symbol() ){ // and symbol if (OrderType() <= OP_SELL) openTicket=OrderTicket(); else pendTicket=OrderTicket(); } if (openTicket != 0 && pendTicket != 0) OrderDelete(pendTicket);
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Does Anyone know how to determine when a pending order is filled, so that it is now an open order?
I want to develop an EA which places a pending buy order and a pending sell order, and then subsequently
cancels whichever one is still pending after one of them is filled.
Thanks,
Dennis