Modify Multi Order¶
modify_orders_sentinel() modifies multiple existing Trading API V3 order IDs in one request.
Use this page when grouping modifications for:
- multiple independent single-instrument orders
- multiple items that were originally placed through
create_order([...]) - multiple strategy orders
- a mixed list of single orders and strategy order IDs
Every item in the list carries its own orderId and only the fields being changed for that target order.
For strategy orders created with isMultiLeg=True, use the strategy-level intentOrderId as orderId. Do not use basket_id, and do not resend legs, isMultiLeg, or basketParams.
LLM guidance
Use this page when the user wants to modify several Trading API V3 order IDs together. Generate trader.modify_orders_sentinel([...]), where each item includes orderId and only the fields being changed for that order. Strategy order IDs can be included in the same list, but do not generate basket_id, legs, isMultiLeg, top-level refId, top-level side, or basketParams for strategy order modifications.
Basic Usage¶
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import TradingAPIVersion
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
trader = NubraTrader(nubra)
result = trader.modify_orders_sentinel([
{
"orderId": 987654,
"qty": 1,
"entryPrice": 24600,
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"executionMode": "ENTRY",
},
{
"orderId": 987655,
"entryPrice": 18000,
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"executionMode": "ENTRY",
}
])
print(result)
Order Type Scope¶
| Existing order type | Which ID to use in each item | Notes |
|---|---|---|
| Single order | orderId: orders[i].intentOrderId |
Modify several independent single orders together. |
| Multi-order item | orderId: orders[i].intentOrderId |
Each item from a multi-order placement has its own ID. |
| Strategy order | orderId: strategy intentOrderId |
Each strategy order is one strategy-level order ID. |
Example Modify Patterns¶
These examples show common grouped modifications. Each item can have a different field set and a different executionMode.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import TradingAPIVersion
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
trader = NubraTrader(nubra)
result = trader.modify_orders_sentinel([
{
"orderId": 987654,
"qty": 1,
"entryPrice": 24600,
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"executionMode": "ENTRY",
},
{
"orderId": 987655,
"qty": 1,
"entryPrice": 18000,
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"executionMode": "ENTRY",
}
])
print(result)
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import TradingAPIVersion
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
trader = NubraTrader(nubra)
result = trader.modify_orders_sentinel([
{
"orderId": 987654,
"entryPrice": 24600,
"entryConfig": {
"triggers": {
"ltp": {
"atOrAbove": {"value": 24600}
}
}
},
"executionMode": "ENTRY",
},
{
"orderId": 987655,
"exitConfig": {
"targetParams": {
"targetProfitTriggerPrice": {"value": 18400},
"targetProfitLimitPrice": {"value": 18420}
}
},
"executionMode": "EXIT",
}
])
print(result)
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import TradingAPIVersion
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
trader = NubraTrader(nubra)
result = trader.modify_orders_sentinel([
{
"orderId": 987654,
"qty": 130,
"entryPrice": -36000,
"deliveryType": "CNC",
"priceType": "LIMIT",
"validityType": "DAY",
"executionMode": "ENTRY",
},
{
"orderId": 987655,
"exitConfig": {
"targetParams": {
"targetProfitTriggerPrice": {"value": -39000},
"targetProfitLimitPrice": {"value": -39050}
}
},
"executionMode": "EXIT",
}
])
print(result)
Use this pattern when several strategy orders need strategy-level updates. Each orderId is a strategy-level intentOrderId. For example, if one strategy unit uses base qty: 65, then qty: 130 represents two strategy units.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import TradingAPIVersion
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
trader = NubraTrader(nubra)
result = trader.modify_orders_sentinel([
{
"orderId": 987654,
"entryPrice": 24600,
"executionMode": "ENTRY",
},
{
"orderId": 987655,
"qty": 130,
"entryPrice": -36000,
"executionMode": "ENTRY",
}
])
print(result)
Timed And GTE Modifications¶
Timed entry, timed exit, and GTE validity can also be grouped inside modify_orders_sentinel(). Keep the execution mode aligned to the fields being changed in each item.
Replace the sample entryTime, exitTime, and goodTillDate values before running this example so they match the session and instrument you are testing.
result = trader.modify_orders_sentinel([
{
"orderId": 987654,
"entryConfig": {
"entryTime": "2026-06-17T09:20:00.000Z"
},
"exitConfig": {
"exitTime": "2026-06-17T15:10:00.000Z"
},
"executionMode": "ENTRY_AND_EXIT",
},
{
"orderId": 987655,
"validityType": "GTE",
"goodTillDate": "2026-10-30T15:20:00.000Z",
"executionMode": "ENTRY",
}
])
For futures and options, goodTillDate must not be beyond the contract expiry. For stocks, the date can be up to a maximum of one year.
Execution Modes¶
Each item inside the list has its own executionMode.
| Item payload shape | executionMode |
Meaning |
|---|---|---|
The item modifies entryPrice and/or entryConfig, and has no exitConfig. |
ENTRY |
Entry-only order modification. |
The item has no entry fields and modifies only exitConfig. |
EXIT |
Exit-only order modification. |
The item modifies entry fields and also modifies exitConfig. |
ENTRY_AND_EXIT |
Entry order with attached exit modifications. |
List Item Fields¶
| Field | Type | Required | Allowed values / shape | Meaning |
|---|---|---|---|---|
orderId |
int |
yes | Trading API V3 intentOrderId |
Target Trading API V3 order ID for this item. |
refId |
int |
no | instrument ref ID | Replacement instrument reference ID when supported. Do not use for strategy order modification. |
qty |
int |
no | positive integer | Updated single-order quantity. For strategy orders, send the updated common executable base quantity. To scale the full strategy, multiply the base quantity here. |
side |
str |
no | BUY, SELL |
Updated side when supported. Do not use for strategy order modification. |
entryPrice |
int |
no | price integer | Updated entry price, or net strategy price for strategy orders. |
goodTillDate |
str |
no | date/time string | Updated GTE date/time. |
entryConfig |
object |
no | timed entry or trigger objects | Updated entry conditions. |
exitConfig |
object |
no | stop-loss, target, or timed exit object | Updated exit conditions. |
deliveryType |
str |
no | IDAY, CNC |
Updated delivery type when supported by the order. |
priceType |
str |
no | LIMIT, MARKET |
Updated price type. |
validityType |
str |
no | DAY, IOC, GTE |
Updated validity. |
executionMode |
str |
no | ENTRY, EXIT, ENTRY_AND_EXIT |
Execution mode that matches this item's updated fields. |
icebergInfo |
object |
no | numberOfLegs or maxQtyPerLeg |
Updated iceberg slicing settings when supported. |
echoFields |
str |
no | string | Free-form metadata echoed back by Trading API V3. |
Response Fields¶
modify_orders_sentinel() returns a raw server acknowledgement dict.
| Field | Type | Meaning |
|---|---|---|
message |
str |
Acknowledgement message returned by Trading API V3. |
Fetch the latest order state with Get Orders after modification when control flow depends on final order status, fill state, rejection reason, or strategy order leg state.
Important Rules¶
Important Rules
- Initialize
NubraTrader(nubra). - Include
orderIdinside every list item. - Send only the fields being changed for each target order.
- Set
executionModeper item based on that item's entry and exit fields. - Strategy order IDs can be modified in the same grouped request as single-order IDs.
- For strategy orders, use the strategy-level
intentOrderIdasorderId; do not passbasket_id. - For strategy-order quantity changes, update
qtyusing the same base-quantity model used at placement time. - Do not send
legs,isMultiLeg, orbasketParamsin modify requests. - Do not send top-level
refIdor top-levelsidewhen modifying a strategy order. - Use Modify Order when modifying only one Trading API V3 order ID.
- Use Get Orders to inspect current order state before and after modification.