search Nothing found
Main Algotrading documentation Trade operations Pending orders

PendingOrders.Modify

We send a request to change a pending order. 

There are two options for calling a method:

int PendingOrders.Modify(orderId, volume, price, takeProfit, stopLoss, isJustCheck = false, isAsync = false)

Input parameters

Parameter
Type
Description
orderId
Int
 
Unique identifier of a pending order
volume
double
Position volume in lots
price
double
The price in quoted currency at which a pending order is placed
takeProfit
double
 
Take profit. Price level in quoted currency for profit fixing.
stopLoss
double
 
Stoploss. Price level in quoted currency for fixing losses.
isJustCheck
bool
Check mode (enabled or disabled). When the mode is enabled, a request to open a position is not sent, but only the possibility of opening with such parameters is checked. 
Disabled by default = false
isAsync
bool
Asynchronous mode (enabled or disabled).
Disabled by default = false


int PendingOrders.Modify(ref operation, isJustCheck = false, isAsync = false)

Input parameters

Parameter
Type
Description
operation
An object that contains all operation parameters for changing a pending order
isJustCheck
bool
Check mode (enabled or disabled). When the mode is enabled, a request to open a position is not sent, but only the possibility of opening with such parameters is checked. 
Disabled by default = false
isAsync
bool
Asynchronous mode (enabled or disabled).
Disabled by default = false


Return value:

If isJustCheck = true, it returns the code of the operation execution result:

0
Check for the possibility of changing an order was successful. Check occurs on the client side
-1
Check failed


If isAsync = false (synchronous mode by default), it returns the code of the operation execution result:

0
Pending order has been successfully modified
If an error occurs, it returns the server error code


If isAsync = true (Asynchronous mode)

0
The request for changing a pending order was successfully sent to the server. It does not mean that the pending order has already been modified or will definitely be modified.
If an error occurs, it returns the error code received on the client. The codes match the server error codes.