counting buy oeders
rafal85: I am trying to close remaining pending orders when OP_BUY==0
- OP_BUY is defined as zero. OP_BUY==0 will always be true.
if (OrderType()==OP_BUY) OpenBuyOrders++ ; if (OpenBuyOrders==0){ if((OrderType()==OP_SELLLIMIT) || (OrderType()==OP_BUYSTOP))
You need to loop through all orders and then if there is an open buy, loop and close all pendings. Code as written only works when the buy is in the highest order position.
Hello everyone.
I am trying to close remaining pending orders when OP_BUY==0
using that code but it dose not work and closes orders when op buy is greater than 0. could someone help me on that.