Modify Order Quantity

Change the quantity of an order you already placed, from any client language.

POST https://apix.stocksdeveloper.in/trading/modifyOrderQuantity
WriteReturns true on success3 languagesBroker independent
In short

The Modify Order Quantity call changes the quantity of an order you already placed. You pass the account, the order id returned by placeOrder, and the new quantity. It returns true on success and false on failure.

This call modifies the quantity of an open order. It is available in AmiBroker, Excel, and MetaTrader. To change the price of an open order instead, see Modify Order Price.

Code samples

Samples

Excel

Signature

Public Function ModifyOrderQuantity( _
    PseudoAccount As String, _
    OrderId As String, _
    Quantity As Integer) As Boolean

Example

orderId = PlaceOrder("ACC_NICK_NAME", 
    "<exchange>", "SBIN", "BUY", 
    "LIMIT", "INTRADAY", 10, 
    100.5, 0, True)
  
' Somewhere later in your code, 
' when you want to modify this order
  
' Modify the order
Call ModifyOrderQuantity("ACC_NICK_NAME", orderId, 20)

AmiBroker

Signature

function modifyOrderQuantity(account, orderId, quantity)

Example

orderId = placeOrder(AT_ACCOUNT, 
    AT_EXCHANGE, AT_SYMBOL, "BUY", 
    "LIMIT", AT_PRODUCT_TYPE, 10, 
    100.5, defaultTriggerPrice(), True);
  
// You can save this orderId in a static variable
saveStaticVariableText(AT_ACCOUNT, "ORDER_ID", orderId);
  
// Somewhere later in your code, 
// when you want to modify this order
  
// Read orderId from static variable
orderId = readStaticVariableText(AT_ACCOUNT, "ORDER_ID");
  
// Modify the order
modifyOrderQuantity(AT_ACCOUNT, orderId, 20);

MetaTrader

Signature

bool modifyOrderQuantity(string account, 
	string orderId, int quantity)

Example

orderId = placeOrder(AT_ACCOUNT, 
    AT_EXCHANGE, AT_SYMBOL, BUY, 
    LIMIT, INTRADAY, 10, 
    100.5, defaultTriggerPrice(), true);
   
// You can save this orderId in a static variable
   
// Somewhere later in your code, 
// when you want to modify this order
   
// Modify the order
modifyOrderQuantity(AT_ACCOUNT, orderId, 20);

In each example above, we change the quantity from 10 to 20.

Parameters

ParameterDescription
accountnickname of the broker account (also known as pseudo account)
orderIdpublisherId — the orderId given by a placeOrder*() function
quantityquantity

Note on quantity: For derivatives on Indian stock exchanges, the quantity must be a multiple of the lot size. For example, if a contract’s lot size is 15, then to buy or sell 1 lot you enter 15 quantity.

Return value

DirectExcel · AmiBroker · MetaTrader · Python · Java · C# · HTTP

The call returns the order id given by your broker. That is the same id you see in your broker order book, and the one you pass to modify and cancel.

Notes

This call sends the modify order quantity request to AutoTrader Web, which passes it on to your broker. It returns true when the change is confirmed, otherwise false.

See also Modify Order Price and Square-off Position.

Was this page helpful?

Last updated 6 September 2026