Delete Order

To delete an order, please fill the following values in the value map:

Parameter name

Datatype

Description

Command

const char *

The command. Must be DeleteOrder.

OrderID

const char *

The identifier of the order. The order must exist and must be in the waiting status.

AccountID

const char *

The identifier of the account the order should be placed for. The value must be obtained from the Accounts table, the AccountID column.

Please note that the account identifier may not necessarily be equal to the account name which is shown in the Trading Station application.

Example: Delete an order [hide]

  void CreateOrderSample::deleteOrder(const char* orderID, const char* accountID)
  {
      using namespace O2G2;
      O2G2Ptr<IO2GRequestFactory> factory = mSession->getRequestFactory();
      O2G2Ptr<IO2GValueMap> valuemap = factory->createValueMap();
      valuemap->setString(Command, Commands::DeleteOrder);
      valuemap->setString(OrderID, orderID);
      valuemap->setString(AccountID, accountID);
      O2G2Ptr<IO2GRequest> request = factory->createOrderRequest(valuemap);
      mSession->sendRequest(request);
  }

back