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.
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
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.