It is a simple but good class for orders management. I know there should have been management of magic numbers and so on, this is just a taste.
Usage:
COrdersManager Orders; Orders.DeleteAll();Â Â Â Â Â Â Â Â Â Â Â Â Â Â // Close and delete all orders (open and pending) Orders.CloseOpen()Â Â Â Â Â Â Â Â Â Â Â Â Â Â // Close all open orders Orders.CloseSell()Â Â Â Â Â Â Â Â Â Â Â Â Â Â // Close all SELL orders Orders.CloseBuy()Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // Close all BUY orders Orders.DeletePending()Â Â Â Â Â Â Â Â Â Â // Delete all pending orders Orders.CheckOpenOrders()Â Â Â Â Â Â Â Â // Returns amount of open orders Orders.CheckOpenBuyOrders()Â Â Â Â Â Â // Returns amount of buy orders open Orders.CheckOpenSellOrders()Â Â Â Â // Returns amount of sell orders open