• C#
  • Java
  • VB
  • C++
  • Python
Contact us
Cancelling Orders

An order can be cancelled from the API with the functions IBApi::EClient::cancelOrder and IBApi::EClient::reqGlobalCancel. cancelOrder can only be used to cancel an order that was placed originally by a client with the same client ID (or from TWS for client ID 0). It takes one argument, which is the original order ID.

  • client.cancelOrder(nextOrderId - 1, "");
  • client.cancelOrder(cancelID, Order.EMPTY_STR);
  • client.cancelOrder(nextOrderId - 1, "")
  • m_pClient->cancelOrder(m_orderId-1, "");
  • 1  self.cancelOrder(self.simplePlaceOid, "")

IBApi::EClient::reqGlobalCancel will cancel all open orders, regardless of how they were originally placed.

  • client.reqGlobalCancel();
  • client.reqGlobalCancel();
  • client.reqGlobalCancel()
  • m_pClient->reqGlobalCancel();
  • 1  self.reqGlobalCancel()