• Home
  • Products
    • Login
    • Product Info
    • User Guide
    • Pricing
  • Services
    • Stock Brokers
    • Freelancers
  • Help
    • Documentation
    • Knowledge Base
    • FAQ
  • Company
    • About Us
    • Contact Us
    • Terms & Conditions
  • Home
  • Products
    • Login
    • Product Info
    • User Guide
    • Pricing
  • Services
    • Stock Brokers
    • Freelancers
  • Help
    • Documentation
    • Knowledge Base
    • FAQ
  • Company
    • About Us
    • Contact Us
    • Terms & Conditions

AutoTrader Web

home/Documentation/AutoTrader Web
Expand All Collapse All
  • Index
  • Getting Started
  • Portfolio Management System (PMS)
  •  Copy Trading (Master-Child Auto-Copy)
    • Master-Child Copy - Performance
  • PMS vs Master-Child
  • Trading View
  •  Supported Brokers
    • Symphony XTS
    • Zerodha
    • Angel Broking
    • Dhan
    • Aliceblue
    • Fyers
    • Nuvama
    • IIFL
    • Zebu
    • Finvasia
    • Motilal Oswal
    • Kotak
    • Mastertrust
    • Five Paisa
    • Choice Broking
    • FlatTrade
    • Tradejini
    • Upstox
    • SAS Online
    • Profitmart
  •  Client Setup
    • Desktop Client
    • AmiBroker Library
    • Excel Library or Tools
    • Java Library
    • MetaTrader Library
    • C# Library
    • Python Library
    • HTTP REST
  •  User Interface
    • User Registration
    •   Settings
      • General
      • Trading Accounts
      • Pseudo Accounts
      • Group Accounts
      • API Key
    •   AutoTrader
      • Activity
      • Instruments
    •   Trading
      • Summary
      • Positions
      • Orders
      • Margins
      • Holdings
      • Trade
    •   User
      • Account
      • Profile
  •  API (Application Programming Interface)
    • Place Regular Order
    • Place Cover Order
    • Place Bracket Order
    • Place Advanced Order
    • Cancel Order
    • Cancel Child Orders
    • Cancel All Orders
    • Modify Order
    • Modify Order Price
    • Modify Order Quantity
    • Square-off Position
    • Square-off Portfolio
    • Read Orders
    • Read Positions
    • Read Margins
    • Read Holdings
    • Read Portfolio Summary
    • Fetch All Trading Accounts
    • Create or Update Trading Account
    • Validate Trading Account Credentials
    • API Parameters
    • API Rate Limits
    • Email Limits
    • Postman
  • Pricing
  • Precautions
  •  Broker Independence
    • API Functions
    • Pseudo Account
    • Instruments (Trading Symbols)
  • Quantity Multiplier
  • Architecture

Cancel All Orders

1993 views August 12, 2021 Pritesh 4

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.

  • AmiBroker
  • MetaTrader
  • Java
  • C#
  • Python
  • HTTP
  • Excel
  • Postman

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.

Cancel Child Orders
Modify Order

Was this helpful?

4 Yes  No
Related Articles
  • Master-Child Copy – Performance
  • Tradejini
  • Dhan
  • FlatTrade
  • Supported Brokers
  • Symphony XTS

© 2025 Stocks Developer. All Rights Reserved.