Modify Order¶
modify_multi_order() modifies one existing Trading API V3 order when NubraTrader is initialized with TradingAPIVersion.V3 and the input is a single modification dictionary.
Use this page for:
- one single-instrument Trading API V3 order
- one item that was originally placed inside a multi-order request
- one flexi / multi-leg strategy order
All three cases are modified by the same Trading API V3 intentOrderId model. For flexi orders created with isMultiLeg=True, use the strategy-level intentOrderId returned by placement. Do not use basket_id, and do not resend legs, isMultiLeg, or basketParams.
LLM guidance
Use this page when modifying exactly one Trading API V3 intentOrderId. Generate modify_multi_order({...}) with one dictionary containing orderId and the fields being changed. For flexi strategy orders, use the strategy-level intentOrderId; do not generate basket_id, legs, isMultiLeg, top-level refId, top-level side, or basketParams in modify examples.
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)
trader = NubraTrader(nubra, version=TradingAPIVersion.V3)
result = trader.modify_multi_order({
"orderId": 987654,
"qty": 1,
"entryPrice": 24600,
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"executionMode": "ENTRY",
"echoFields": "modify_single_order_example"
})
print(result.message)
Order Type Scope¶
| Existing order type | Which ID to modify | Notes |
|---|---|---|
| Single order | orders[0].intentOrderId |
Standard one-order modify. |
| Multi-order item | that item's intentOrderId |
A multi-order placement creates independent order IDs. |
| Flexi / multi-leg strategy | strategy intentOrderId |
One ID represents the full strategy. Modify applies at strategy level. |
Flexi modification does not replace strategy legs. Leg composition, strikes, refId values, and unitQty are defined at placement time. To change the legs themselves, cancel or replace the strategy order.
Example Modify Patterns¶
These examples show the main one-order modification families.
- pass the target Trading API V3 order ID as
orderId - keep the request object scoped to the fields being changed
- use
entryConfigfor entry trigger or timed-entry changes - use
exitConfigfor stop-loss, target, trailing stop-loss, or timed-exit changes - use
multiplieronly for strategy-level flexi quantity changes
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)
trader = NubraTrader(nubra, version=TradingAPIVersion.V3)
result = trader.modify_multi_order({
"orderId": 987654,
"qty": 1,
"entryPrice": 24600,
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"executionMode": "ENTRY",
"echoFields": "modify_price_qty_example"
})
print(result.message)
Use this pattern when a standard single-instrument order needs a new quantity, entry price, delivery type, price type, or validity setting.
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)
trader = NubraTrader(nubra, version=TradingAPIVersion.V3)
result = trader.modify_multi_order({
"orderId": 987654,
"entryPrice": 24600,
"entryConfig": {
"triggers": [
{"kind": "AT_OR_ABOVE", "value": 24600}
]
},
"executionMode": "ENTRY",
"echoFields": "modify_entry_trigger_example"
})
print(result.message)
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)
trader = NubraTrader(nubra, version=TradingAPIVersion.V3)
result = trader.modify_multi_order({
"orderId": 987654,
"entryPrice": 24600,
"exitConfig": {
"stoplossParams": {
"stoplossTriggerPrice": {"value": 24250},
"stoplossLimitPrice": {"value": 24270}
},
"targetParams": {
"targetProfitTriggerPrice": {"value": 25000},
"targetProfitLimitPrice": {"value": 25020}
}
},
"executionMode": "ENTRY_AND_EXIT",
"echoFields": "modify_stoploss_target_example"
})
print(result.message)
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)
trader = NubraTrader(nubra, version=TradingAPIVersion.V3)
result = trader.modify_multi_order({
"orderId": 987654,
"exitConfig": {
"stoplossParams": {
"stoplossTriggerPrice": {"value": 24250},
"stoplossLimitPrice": {"value": 24270},
"stoplossTrailJump": 25
}
},
"executionMode": "EXIT",
"echoFields": "modify_trailing_stoploss_example"
})
print(result.message)
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)
trader = NubraTrader(nubra, version=TradingAPIVersion.V3)
result = trader.modify_multi_order({
"orderId": 987654,
"multiplier": 2,
"entryPrice": -36000,
"deliveryType": "CNC",
"priceType": "LIMIT",
"validityType": "DAY",
"executionMode": "ENTRY",
"echoFields": "modify_flexi_strategy_example"
})
print(result.message)
Use this pattern when one flexi / multi-leg strategy order needs a new strategy-level net entry price or multiplier.
Timed Entry / Exit¶
Use entryConfig.entryTime for timed entry and exitConfig.exitTime for timed exit.
result = trader.modify_multi_order({
"orderId": 987654,
"entryConfig": {
"entryTime": "2026-03-20T09:20:00.000Z"
},
"exitConfig": {
"exitTime": "2026-03-20T15:10:00.000Z"
},
"executionMode": "ENTRY_AND_EXIT",
"echoFields": "modify_timed_entry_exit_example"
})
GTE Modifications¶
Use validityType: "GTE" and goodTillDate when the order should remain valid until a specific date.
result = trader.modify_multi_order({
"orderId": 987654,
"validityType": "GTE",
"goodTillDate": "2026-03-25T15:20:00.000Z",
"executionMode": "ENTRY",
"echoFields": "modify_gte_example"
})
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¶
| Modified payload shape | executionMode |
Meaning |
|---|---|---|
The request modifies entryPrice and/or entryConfig, and has no exitConfig. |
ENTRY |
Entry-only order modification. |
The request has no entry fields and modifies only exitConfig. |
EXIT |
Exit-only order modification. |
The request modifies entry fields and also modifies exitConfig. |
ENTRY_AND_EXIT |
Entry order with attached exit modifications. |
Request Fields¶
| Field | Type | Required | Allowed values / shape | Meaning |
|---|---|---|---|---|
orderId |
int |
yes | Trading API V3 order ID | Trading API V3 intentOrderId to modify. |
refId |
int |
no | instrument ref ID | Replacement instrument reference ID when supported. Do not use for flexi strategy modification. |
qty |
int |
no | positive integer | Updated single-order quantity. For flexi strategy size, use multiplier. |
side |
str |
no | BUY, SELL |
Updated side when supported. Do not use for flexi strategy modification. |
multiplier |
int |
no | positive integer | Updated flexi strategy quantity multiplier. |
entryPrice |
int |
no | price integer | Updated entry price, or net strategy price for flexi orders. |
goodTillDate |
str |
no | date/time string | Updated GTE date/time. |
entryConfig |
object |
no | see below | Updated timed entry or trigger-based entry conditions. |
exitConfig |
object |
no | see below | Updated stop-loss, target, trailing stop-loss, or timed exit settings. |
deliveryType |
str |
no | IDAY, CNC |
Updated delivery type when supported by the order. |
priceType |
str |
no | LIMIT |
Updated price type. |
validityType |
str |
no | DAY, GTE |
Updated validity. |
executionMode |
str |
no | ENTRY, EXIT, ENTRY_AND_EXIT |
Execution mode that matches the 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. |
Condition Fields¶
| Field | Type | Required | Allowed values / shape | Meaning |
|---|---|---|---|---|
entryConfig.entryTime |
str |
no | date/time string | Updated timed entry. |
entryConfig.triggers |
list[object] |
no | trigger objects | Updated price-based entry triggers. |
entryConfig.triggers[].kind |
str |
yes for trigger | ABOVE, BELOW, AT_OR_ABOVE, AT_OR_BELOW |
Trigger comparison. |
entryConfig.triggers[].value |
int |
yes for trigger | price integer | Trigger threshold. |
exitConfig.stoplossParams.stoplossTriggerPrice |
object |
no | {"value": int} or {"disabled": true} |
Updated stop-loss trigger price wrapper. |
exitConfig.stoplossParams.stoplossLimitPrice |
object |
no | {"value": int} or {"disabled": true} |
Updated stop-loss limit price wrapper. |
exitConfig.stoplossParams.stoplossTrailJump |
float |
no | number | Updated trailing stop jump. |
exitConfig.targetParams.targetProfitTriggerPrice |
object |
no | {"value": int} or {"disabled": true} |
Updated target trigger price wrapper. |
exitConfig.targetParams.targetProfitLimitPrice |
object |
no | {"value": int} or {"disabled": true} |
Updated target limit price wrapper. |
exitConfig.exitTime |
str |
no | date/time string | Updated timed exit. |
Response Fields¶
modify_multi_order() returns NubraAckResponse.
| 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 flexi strategy leg state.
Important Rules¶
Important Rules
- Initialize
NubraTraderwithTradingAPIVersion.V3. - Use
modify_multi_order({...})with a single dictionary for one Trading API V3intentOrderId. - Pass the target Trading API V3
intentOrderIdasorderId. - For flexi / multi-leg strategies, pass the strategy-level
intentOrderId; do not passbasket_id. - Do not send
legs,isMultiLeg, orbasketParamsin modify requests. - Do not send top-level
refIdor top-levelsidewhen modifying a flexi strategy order. - Use Modify Multi Order when several order IDs should be modified in one request.
- Use Get Orders to inspect current order state before and after modification.