Skip to content

Modify Order

modify_orders_sentinel() modifies one existing Trading API V3 order using NubraTrader(nubra) 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 strategy order

All three cases are modified by the same Trading API V3 intentOrderId model. For strategy 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_orders_sentinel({...}) with one dictionary containing orderId and the fields being changed. For 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, 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",
})

print(result)
Use this pattern when you already have the target Trading API V3 intentOrderId and only need to send the modify request payload.

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.
Strategy order strategy intentOrderId One ID represents the full strategy. Modify applies at strategy level.

Strategy order 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 entryConfig for entry trigger or timed-entry changes
  • use exitConfig for stop-loss, target, trailing stop-loss, or timed-exit changes
  • for strategy orders, use qty as the updated common executable base quantity
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",
})

print(result)

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, trading_version=TradingAPIVersion.V3)
trader = NubraTrader(nubra)

result = trader.modify_orders_sentinel({
    "orderId": 987654,
    "entryPrice": 24600,
    "entryConfig": {
        "triggers": {
            "ltp": {
                "atOrAbove": {"value": 24600}
            }
        }
    },
    "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,
    "exitConfig": {
        "stoplossParams": {
            "stoplossTriggerPrice": {"value": 24250},
            "stoplossLimitPrice": {"value": 24270}
        },
        "targetParams": {
            "targetProfitTriggerPrice": {"value": 25000},
            "targetProfitLimitPrice": {"value": 25020}
        }
    },
    "executionMode": "ENTRY_AND_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,
    "exitConfig": {
        "stoplossParams": {
            "stoplossTriggerPrice": {"value": 24250},
            "stoplossLimitPrice": {"value": 24270},
            "stoplossTrailJump": 25
        }
    },
    "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",
})

print(result)

Use this pattern when one strategy order needs a new strategy-level net entry price or a new scaled strategy quantity. For example, if one strategy unit uses base qty: 65, then qty: 130 represents two strategy units.

Timed Entry / Exit

Use entryConfig.entryTime for timed entry and exitConfig.exitTime for timed exit. Replace the sample entryTime and exitTime values before running this snippet. They are illustrative placeholders and should be updated to valid times for your current testing session.

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",
})

GTE Modifications

Use validityType: "GTE" and goodTillDate when the order should remain valid until a specific date.

result = trader.modify_orders_sentinel({
    "orderId": 987654,
    "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

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 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 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, MARKET Updated price type.
validityType str no DAY, IOC, 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.ltp object no one or more LTP comparisons Updated price-based entry trigger container.
entryConfig.triggers.ltp.above.value int conditional price integer Updated trigger when the live price moves above the threshold.
entryConfig.triggers.ltp.below.value int conditional price integer Updated trigger when the live price moves below the threshold.
entryConfig.triggers.ltp.atOrAbove.value int conditional price integer Updated trigger when the live price reaches or exceeds the threshold.
entryConfig.triggers.ltp.atOrBelow.value int conditional price integer Updated trigger when the live price reaches or falls below the 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_orders_sentinel() returns a raw server acknowledgement dict. Treat a successful modify as an acknowledgement and fetch latest state through Get Orders when control flow depends on current order details.

Field Type Meaning
message str Acknowledgement message when the server returns one.

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).
  • Use modify_orders_sentinel({...}) with a single dictionary for one Trading API V3 intentOrderId.
  • Pass the target Trading API V3 intentOrderId as orderId.
  • For strategy orders, pass the strategy-level intentOrderId; do not pass basket_id.
  • For strategy-order quantity changes, update qty using the same base-quantity model used at placement time.
  • When changing an order to priceType: "MARKET", switch validityType to IOC and omit the limit entryPrice.
  • Do not send legs, isMultiLeg, or basketParams in modify requests.
  • Do not send top-level refId or top-level side when modifying a 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.
  1. Modify Multi Order
  2. Get Orders
  3. Place Order
  4. Place Strategy Order
  5. Cancel Order
NEO Assistant