API function to cancel ALL open orders for the given portfolio. APIs are available in AmiBroker, MetaTrader, Excel, Java, C#, Python, HTTP REST. One of the common use cases of this function is to cancel all orders before you start your intraday square-off.
Api function will cancel all open orders on Supports leading Indian Stock Brokers.
Signature
function cancelAllOrders(account)
Example
/* Cancel all open orders for the given pseudo account */
cancelAllOrders("XX1234");
Signature
/*
* Cancels all open orders for the given account. Returns true on success.
*/
bool cancelAllOrders(string account)
Example
// cancelAllOrders("XX1234");
cancelAllOrders(AT_ACCOUNT);
Signature
/**
* Cancels all open orders for the given account. For more information, please
* see
* <a href="https://stocksdeveloper.in/documentation/api/cancel-all-orders/">api
* docs</a>.
*
* @param pseudoAccount pseudo account
* @return <code>true</code> on success, <code>false</code> otherwise
*/
IOperationResponse<Boolean>
cancelAllOrders(String pseudoAccount);
Example
// Cancel all open orders for the given pseudo account
autotrader.cancelAllOrders("ACC_NAME");
Signature
/// <summary>
/// Cancels all open orders for the given account. For more information, please
/// see
/// <a href="https://stocksdeveloper.in/documentation/api/cancel-all-orders/">api
/// docs</a>.
/// </summary>
/// <param name="pseudoAccount"> pseudo account </param>
/// <returns> <code>true</code> on success, <code>false</code> otherwise </returns>
IOperationResponse<bool?>
CancelAllOrders(string pseudoAccount);
Example
// Cancel all open orders for the given pseudo account
IOperationResponse<bool?> response =
autoTrader.CancelAllOrders("XX1234");
Signature
def cancel_all_orders(self, pseudo_account):
Example
response = autotrader.cancel_all_orders('XX1234')
if response.success():
print("Result: {0}".format(response.result))
else:
print("Message: {0}".format(response.message))
Example
curl https://api.stocksdeveloper.in/trading/cancelAllOrders \
-H "api-key: <your_api_key>" \
-d "pseudoAccount=ACC_NAME"
Response
{
"result":true,
"error":null,
"message":null,
"status":true,
"commandId":"6d4b5124-c1aa-4623-b0c5-8df779e0f44d"
}
Signature
Public Function CancelAllOrders(PseudoAccount As String) As Boolean
Example
CancelAllOrders("ACC_NAME")
Postman is widely used tool for API testing. We have provided below a collection of all of our APIs in postman collection format. Click postman collection to know more about how to use it.
Parameters
- account – pseudo account
Return value
AmiBroker, Excel, MetaTrader
This function sends a cancel all open orders request to AutoTrader Desktop Client. On successful submission, it will return True, otherwise False
Java, HTTP, C#, Python
Returns a response object, with result being True on success, False otherwise.
The type of the return value is Boolean.