Cancels a set of orders.
The selection of the orders to be cancelled is performed based on the passed arguments. If no argument is passed all currently existing orders are cancelled.
Visual Basic |
---|
Public Sub CancelAllOrders( _ Optional ByVal cqg_account As CQGAccount = 0, _ Optional ByVal cqg_instrument As CQGInstrument = 0, _ Optional ByVal from_all_traders As Boolean = False, _ Optional ByVal parked_ As Boolean = False, _ Optional ByVal order_side As eOrderSide = osdUndefined _ ) |
- cqg_account
An optional CQGAccount object representing the account orders of which to cancel.
- cqg_instrument
An optional CQGInstrument object representing the instrument on which the order should have been placed in order to be cancelled by this method call.
- from_all_traders
An optional flag identifying whether the orders from all traders should be cancelled.
- parked_
An optional flag identifying which orders should be cancelled:
- if True, the parked orders will be cancelled
- if False, all orders except the parked ones will be cancelled- order_side
Identifies the side of the orders to be cancelled. The parameter is optionalValue Description osdBuy Side properties return this value if CQGAPIConfig.UseOrderSide is set to True. Depending on the owner, osdBuy value is returned in case of:
- the object is a CQGTrade referring to a buy trade
- the object is a CQGPosition referring to a long position.
- the object is a CQGOrder referring to an order of buy type.
- the object is a CQGFill referring to a fill of buy type.
osdSell Side properties return this value if CQGAPIConfig.UseOrderSide is set to True. Depending on the owner, osdSell value is returned in case of:
- the object is a CQGTrade referring to a sell trade
- the object is a CQGPosition referring to a short position.
- the object is a CQGOrder referring to an order of sell type.
- the object is a CQGFill referring to a fill of sell type.
osdUndefined Side properties return this value if CQGAPIConfig.UseOrderSide is set to False.
This method works in asynchronous mode, which means that it returns after the request is sent, but without waiting for its results.
This method triggers several order status changes. The final status is osCancelled. Each status change will be reported via OrderChanged event.
See the usage of CQGCEL methods in the OrderChanged event's example section.