Once an order has been submitted, you can subsequently change it by:
- Incrementing the requestId variable in the OrderProfile instance.
- Updating any order parameters in the OrderProfile instance.
- Calling the SendChange() method of the OrderPtr instance passing the updated OrderProfile instance.
The following code snippet demonstrates an example of this process.
void ChangeOrder(double newPrice)
{
profile_.request_id++;
profile_.price = newPrice;
order_->SendChange(profile_);
}
Once an order has been submitted, you can subsequently change it by:
- Incrementing the requestId variable in the OrderProfile instance.
- Calling the SendCancel() method of the OrderPtr instance passing the updated OrderProfile instance.
The following code snippet demonstrates an example of this process.
void CancelOrder()
{
profile_.request_id++;
order_->SendCancel(profile_);
}