Hello Folks,
I'm trying to do my own custom function to show me open Orders (Buy+Sell). This code works, but lacks some things.
My Problem so far is that I work with global variables to get the results from the function (BuyOrdersOpen, SellOrdersOpen). I know I can somehow make the function return the values and have the values available, if I just call the function right. Don't know how to get there however...
Can anybody help me out?
I'm trying to do my own custom function to show me open Orders (Buy+Sell). This code works, but lacks some things.
Inserted Code
void OpenOrders () { BuyOrdersOpen = 0; SellOrdersOpen = 0; int TotalOrders; TotalOrders = OrdersTotal(); for(int iii=TotalOrders-1;iii>=0;iii--) { OrderSelect(iii, SELECT_BY_POS); if(OrderSymbol() != Symbol()) continue; if(OrderType() == OP_BUY) { BuyOrdersOpen = BuyOrdersOpen + 1; } if (OrderType() == OP_SELL) { SellOrdersOpen = SellOrdersOpen + 1; } } }
Can anybody help me out?