Place Single Order¶
create_order() places one Trading API V3 order using NubraTrader(nubra) and the input is a single order dictionary.
Nubra Trading API place-order functions give users smart, easy-to-use order workflows based on their development needs. Triggers can be price based, time based, or both. Smart order types such as GTE and AMO are also available.
Trigger and iceberg order families help users add multiple conditions for how orders should be placed. The documentation and example code for each supported single-order pattern is below.
LLM guidance
Use this page only for one independent single-instrument order. A single order has refId, qty, side, deliveryType, isMultiLeg: False, and executionMode: "ENTRY"; it does not set isMultiLeg=True and does not send legs. For several independent single orders in one request, use Place Multiple Orders. For one FNO strategy order made from legs, use Place Strategy Order.
All examples on this page assume the SDK client is initialized with trading_version=TradingAPIVersion.V3. The account-side Sentinel/OMS flag must also be enabled before V3 trading requests will execute.
When a payload uses derived prices such as ltp + 5 or ltp - 30, round those values to the instrument's tick_size before sending the request. Otherwise the exchange may reject the order with The entered price is not a multiple of the tick size.
Basic Usage¶
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.refdata.instruments import InstrumentData
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
market_data = MarketData(nubra)
trader = NubraTrader(nubra)
ref_id = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE).ref_id
ltp = market_data.quote(ref_id=ref_id, levels=1).orderBook.last_traded_price
result = trader.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": False,
"executionMode": "ENTRY",
"entryPrice": ltp,
"stratTags": ["python-sdk-v3", "basic-usage"],
})
print(result)
Example Order Patterns¶
These are the main single-order families available in Trading API V3. Each family can be configured further using the detailed sections below.
- market order
- limit order
- AMO order
- trigger or stop-loss order (price based entry/exit)
- iceberg order
- good-till order
- timed entry or exit order (time based entry/exit)
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 ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
trade = NubraTrader(nubra)
ref_id = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE).ref_id
result = trade.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "MARKET",
"validityType": "IOC",
"isMultiLeg": False,
"executionMode": "ENTRY",
"stratTags": ["python-sdk-v3", "single-market"],
})
print(result)
Use this pattern when the order should execute as a market order. In the current SDK, MARKET orders should use validityType: "IOC" and should not send entryPrice.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": False,
"executionMode": "ENTRY",
"entryPrice": to_tick(ltp),
"stratTags": ["python-sdk-v3", "single-limit"],
})
print(result)
Use this pattern when you want to place a standard single-instrument limit order.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": False,
"executionMode": "ENTRY",
"entryPrice": to_tick(ltp),
"stratTags": ["python-sdk-v3", "amo-limit"],
})
print(result)
Use this pattern for a standard limit order placed after market hours. Trading API V3 treats eligible after-market submissions as AMO; there is no separate AMO payload field in this request.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": False,
"executionMode": "ENTRY_AND_EXIT",
"entryPrice": to_tick(ltp + 5),
"entryConfig": {
"triggers": {
"ltp": {
"atOrAbove": {"value": to_tick(ltp + 5)}
}
}
},
"exitConfig": {
"stoplossParams": {
"stoplossTriggerPrice": {"value": to_tick(ltp - 20)},
"stoplossLimitPrice": {"value": to_tick(ltp - 30)}
}
},
"stratTags": ["python-sdk-v3", "trigger-stoploss"],
})
print(result)
Use this family when the entry is trigger-based, when the order carries a stop-loss exit, or when both are required. For post-placement edits, continue with Modify Order.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1000,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": False,
"executionMode": "ENTRY",
"entryPrice": ltp,
"icebergInfo": {
"maxQtyPerLeg": 100
},
"stratTags": ["python-sdk-v3", "iceberg"],
})
print(result)
Use this family when the order quantity should be sliced using icebergInfo.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "CNC",
"priceType": "LIMIT",
"validityType": "GTE",
"isMultiLeg": False,
"executionMode": "ENTRY",
"goodTillDate": "2026-10-31T15:10:00.000Z",
"entryPrice": to_tick(ltp),
"stratTags": ["python-sdk-v3", "gte"],
})
print(result)
Use this family when the order should remain valid until the supplied goodTillDate.
For this validated flow, future-dated GTE should be paired with deliveryType: "CNC".
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": False,
"executionMode": "ENTRY_AND_EXIT",
"entryPrice": to_tick(ltp),
"entryConfig": {
"entryTime": "2026-06-17T09:20:00.000Z"
},
"exitConfig": {
"exitTime": "2026-06-17T09:21:00.000Z"
},
"stratTags": ["python-sdk-v3", "timed-entry-exit"],
})
print(result)
Use this family when the entry should activate at a specific time, the order should exit at a specific time, or both.
Replace the sample entryTime and exitTime values before running the code. They are illustrative placeholders and should be updated to valid times for your current trading session.
Iceberg Orders¶
Use icebergInfo when a larger order should be split into smaller visible slices. Choose either maxQtyPerLeg or numberOfLegs; do not send both in the same order.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1000,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": False,
"executionMode": "ENTRY",
"entryPrice": ltp,
"icebergInfo": {
"maxQtyPerLeg": 100
},
"stratTags": ["python-sdk-v3", "iceberg-max-qty"],
})
print(result)
Use this pattern when you want each visible iceberg slice to be capped at a fixed quantity.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1000,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": False,
"executionMode": "ENTRY",
"entryPrice": ltp,
"icebergInfo": {
"numberOfLegs": 10
},
"stratTags": ["python-sdk-v3", "iceberg-leg-count"],
})
print(result)
Use this pattern when you want Trading API V3 to split the total quantity across a fixed number of iceberg slices.
Trigger Order Patterns¶
These examples map directly to trigger-based single-order workflows:
- trailing stop-loss exit
- trigger entry above the current price
- trigger entry below the current price
- trigger entry with stop-loss exit
- target-only exit
- stop-loss and target exit
For direct SELL orders, stoplossLimitPrice.value must be less than or equal to stoplossTriggerPrice.value. For BUY orders with attached exit legs, Trading API V3 still validates the generated stop-loss exit like a SELL order, so keep stoplossLimitPrice.value less than or equal to stoplossTriggerPrice.value there as well. Trading API V3 rejects payloads where the stop-loss limit is on the wrong side of the stop-loss trigger for the resulting exit side.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": False,
"executionMode": "ENTRY_AND_EXIT",
"entryPrice": to_tick(ltp),
"exitConfig": {
"stoplossParams": {
"stoplossTriggerPrice": {"value": to_tick(ltp - 20)},
"stoplossLimitPrice": {"value": to_tick(ltp - 30)},
"stoplossTrailJump": 10
}
},
"stratTags": ["python-sdk-v3", "trailing-stoploss"],
})
print(result)
Use this pattern when the order should carry a stop-loss that trails after placement.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": False,
"executionMode": "ENTRY",
"entryPrice": to_tick(ltp + 5),
"entryConfig": {
"triggers": {
"ltp": {
"atOrAbove": {"value": to_tick(ltp + 5)}
}
}
},
"stratTags": ["python-sdk-v3", "trigger-above"],
})
print(result)
Use this pattern when the entry should become active only after LTP reaches or crosses the trigger price.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": False,
"executionMode": "ENTRY",
"entryPrice": to_tick(ltp - 5),
"entryConfig": {
"triggers": {
"ltp": {
"atOrBelow": {"value": to_tick(ltp - 5)}
}
}
},
"stratTags": ["python-sdk-v3", "trigger-below"],
})
print(result)
Use this pattern when the entry should become active only after LTP falls to or below the trigger price.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": False,
"executionMode": "ENTRY_AND_EXIT",
"entryPrice": to_tick(ltp + 5),
"entryConfig": {
"triggers": {
"ltp": {
"atOrAbove": {"value": to_tick(ltp + 5)}
}
}
},
"exitConfig": {
"stoplossParams": {
"stoplossTriggerPrice": {"value": to_tick(ltp - 20)},
"stoplossLimitPrice": {"value": to_tick(ltp - 30)}
}
},
"stratTags": ["python-sdk-v3", "trigger-stoploss"],
})
print(result)
Use this pattern when the entry is trigger-based and the created order should also carry a stop-loss exit.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": False,
"executionMode": "ENTRY_AND_EXIT",
"entryPrice": ltp,
"exitConfig": {
"targetParams": {
"targetProfitTriggerPrice": {"value": to_tick(ltp + 40)},
"targetProfitLimitPrice": {"value": to_tick(ltp + 30)}
}
},
"stratTags": ["python-sdk-v3", "target-only"],
})
print(result)
Use this pattern when the order should carry a target-profit exit without a stop-loss exit.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": False,
"executionMode": "ENTRY_AND_EXIT",
"entryPrice": to_tick(ltp),
"exitConfig": {
"stoplossParams": {
"stoplossTriggerPrice": {"value": to_tick(ltp - 20)},
"stoplossLimitPrice": {"value": to_tick(ltp - 30)}
},
"targetParams": {
"targetProfitTriggerPrice": {"value": to_tick(ltp + 40)},
"targetProfitLimitPrice": {"value": to_tick(ltp + 30)}
}
},
"stratTags": ["python-sdk-v3", "stoploss-target"],
})
print(result)
Use this pattern when the order should carry both stop-loss and target-profit exit triggers.
Timed Entry / Exit Patterns¶
These examples map directly to time-based single-order workflows:
- timed entry
- timed exit
- timed entry with timed exit
When both entryConfig.entryTime and exitConfig.exitTime are sent, exitTime must be at least 30 seconds after entryTime. Timed exits must also be inside the allowed Trading API V3 market-session window.
Replace the sample timestamps in these snippets before running them. Use times that are valid for the trading session in which you are testing.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": False,
"executionMode": "ENTRY",
"entryPrice": to_tick(ltp),
"entryConfig": {
"entryTime": "2026-06-17T09:20:00.000Z"
},
"stratTags": ["python-sdk-v3", "timed-entry"],
})
print(result)
Use this pattern when the order entry should become active at a specific time.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": False,
"executionMode": "ENTRY_AND_EXIT",
"entryPrice": to_tick(ltp),
"exitConfig": {
"exitTime": "2026-06-17T09:21:00.000Z"
},
"stratTags": ["python-sdk-v3", "timed-exit"],
})
print(result)
Use this pattern when the order should exit at a specific time.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "DAY",
"isMultiLeg": False,
"executionMode": "ENTRY_AND_EXIT",
"entryPrice": to_tick(ltp),
"entryConfig": {
"entryTime": "2026-06-17T09:20:00.000Z"
},
"exitConfig": {
"exitTime": "2026-06-17T09:21:00.000Z"
},
"stratTags": ["python-sdk-v3", "timed-entry-exit"],
})
print(result)
Use this pattern when both the order entry and exit should be time controlled.
GTE Patterns¶
These examples map directly to good-till single-order workflows using validityType: "GTE" and goodTillDate.
For futures and options, the goodTillDate must not be beyond the contract expiry; Trading API V3 rejects the order if the good-till date is later than the FNO expiry. For stocks, the good-till date can be up to a maximum of one year.
- good-till limit order
- good-till order with price-based entry trigger
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "GTE",
"isMultiLeg": False,
"executionMode": "ENTRY",
"goodTillDate": "2026-10-31T15:10:00.000Z",
"entryPrice": ltp,
"stratTags": ["python-sdk-v3", "gte-limit"],
})
print(result)
Use this pattern when the order should stay valid until the supplied good-till time.
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import ExchangeEnum, TradingAPIVersion
from nubra_python_sdk.refdata.instruments import InstrumentData
nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True, trading_version=TradingAPIVersion.V3)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra)
instrument = instruments.get_instrument_by_symbol("ICICIBANK", exchange=ExchangeEnum.NSE)
ref_id = instrument.ref_id
tick_size = float(instrument.tick_size)
def to_tick(price: float) -> float:
return round(round(price / tick_size) * tick_size, 8)
quote = md.quote(ref_id=ref_id, levels=5)
ltp = quote.orderBook.last_traded_price
result = trade.create_order({
"refId": ref_id,
"qty": 1,
"side": "BUY",
"deliveryType": "IDAY",
"priceType": "LIMIT",
"validityType": "GTE",
"isMultiLeg": False,
"executionMode": "ENTRY",
"goodTillDate": "2026-10-31T15:10:00.000Z",
"entryPrice": to_tick(ltp + 5),
"entryConfig": {
"triggers": {
"ltp": {
"atOrAbove": {"value": to_tick(ltp + 5)}
}
}
},
"stratTags": ["python-sdk-v3", "gte-trigger"],
})
print(result)
Use this pattern when the order should combine good-till validity with a price-based entry trigger.
Execution Modes¶
Use executionMode to match the part of the order lifecycle that the payload is defining.
| Payload shape | executionMode |
Meaning |
|---|---|---|
The order has entryPrice and/or entryConfig, and no exitConfig. |
ENTRY |
Entry-only order. Use this for a plain limit entry, a trigger entry, a timed entry, an iceberg entry, or a GTE entry. |
The order has no entryPrice or entryConfig, and has exitConfig based on an exit trigger. |
EXIT |
Exit-only order. Use this when the payload is only defining the exit side of an already existing/open order or position. |
The order has entryPrice and/or entryConfig, and also has exitConfig. |
ENTRY_AND_EXIT |
Entry order with attached exits. Use this when Trading API V3 should create the entry and also attach stop-loss, target, trailing stop-loss, or timed-exit conditions. |
Execution mode selection
The mode should describe the fields present in the same payload. If an order includes only entry fields, use ENTRY. If it includes only exit fields, use EXIT. If it includes both entry fields and exit fields, use ENTRY_AND_EXIT.
Single Order Fields¶
| Field | Type | Required | Allowed values / shape | Meaning |
|---|---|---|---|---|
refId |
int |
yes | instrument ref ID | Instrument to trade. |
qty |
int |
yes | positive integer | Quantity for this order. |
side |
str |
yes | BUY, SELL |
Order side. Required for every single-instrument order. |
deliveryType |
str |
yes | IDAY, CNC |
Product / delivery type. |
priceType |
str |
no | LIMIT, MARKET |
Price behavior. |
validityType |
str |
no | DAY, IOC, GTE |
Order validity. |
goodTillDate |
str |
no | date/time string | Good-till date for supported good-till workflows. |
executionMode |
str |
yes | ENTRY, EXIT, ENTRY_AND_EXIT |
Execution mode for single-order placement. Match this to the entry/exit fields in the payload. |
entryPrice |
int |
conditional | price integer | Limit entry price. Required for limit-price ENTRY and ENTRY_AND_EXIT payloads. Omit for MARKET orders and EXIT-only payloads. |
entryConfig |
object |
no | see below | Delayed or trigger-based entry conditions. |
exitConfig |
object |
no | see below | Stop-loss, target, trailing stop, or time exit settings. |
icebergInfo |
object |
no | see below | Iceberg slicing configuration. |
algoId |
str |
no | string | Algo identifier when applicable. |
stratTags |
list[str] |
no | strings | Strategy or tracking tags. |
echoFields |
str |
no | string | Free-form metadata echoed back by Trading API V3. |
orderId |
int |
no | integer | Present in the SDK model but not normally sent for new create requests. |
isMultiLeg |
bool |
yes | False |
Keep False for this page. |
legs |
list |
no | omit | Do not use on this page. Use the Strategy Order page instead. |
Order Condition Fields¶
| Field | Type | Required | Allowed values / shape | Meaning |
|---|---|---|---|---|
entryConfig.entryTime |
str |
no | date/time string | Time at which the entry can activate. |
entryConfig.triggers.ltp |
object |
no | one or more LTP comparisons | Container for LTP trigger comparisons. |
entryConfig.triggers.ltp.above.value |
int |
conditional | price integer | Trigger when the live price moves above the threshold. |
entryConfig.triggers.ltp.below.value |
int |
conditional | price integer | Trigger when the live price moves below the threshold. |
entryConfig.triggers.ltp.atOrAbove.value |
int |
conditional | price integer | Trigger when the live price reaches or exceeds the threshold. |
entryConfig.triggers.ltp.atOrBelow.value |
int |
conditional | price integer | Trigger when the live price reaches or falls below the threshold. |
exitConfig.stoplossParams.stoplossTriggerPrice |
object |
no | {"value": int} or {"disabled": true} |
Stop-loss trigger price wrapper. |
exitConfig.stoplossParams.stoplossLimitPrice |
object |
no | {"value": int} or {"disabled": true} |
Stop-loss limit price wrapper. |
exitConfig.stoplossParams.stoplossTrailJump |
float |
no | number | Trailing stop jump. |
exitConfig.targetParams.targetProfitTriggerPrice |
object |
no | {"value": int} or {"disabled": true} |
Target trigger price wrapper. |
exitConfig.targetParams.targetProfitLimitPrice |
object |
no | {"value": int} or {"disabled": true} |
Target limit price wrapper. |
exitConfig.exitTime |
str |
no | date/time string | Time-based exit. |
icebergInfo.numberOfLegs |
int |
conditional | integer | Number of iceberg slices. Mutually exclusive with maxQtyPerLeg. |
icebergInfo.maxQtyPerLeg |
int |
conditional | integer | Maximum quantity per iceberg slice. Mutually exclusive with numberOfLegs. |
Order Response Fields¶
| Field | Type | Meaning |
|---|---|---|
orders |
list[IntentOrderResponse] |
Created Trading API V3 intent orders. A single-order request normally returns one item. |
orders[].intentOrderId |
int |
Trading API V3 order identifier. |
orders[].status |
str |
Current order status. |
orders[].isMulti |
bool |
False for single-instrument orders. |
orders[].exchange |
str |
Exchange. |
orders[].refId |
int |
Instrument reference ID. |
orders[].refData |
RefDataWrapper |
Instrument metadata. |
orders[].filledQty |
int |
Filled quantity. |
orders[].orderQty |
int |
Order quantity. |
orders[].deliveryType |
str |
Delivery type. |
orders[].priceType |
str |
Price type. |
orders[].validityType |
str |
Validity type. |
orders[].executionMode |
str |
Execution mode. |
orders[].entryConfig |
IntentOrderEntryConfig |
Entry conditions as returned by Trading API V3. |
orders[].exitConfig |
list[IntentOrderExitTrigger] |
Exit triggers as returned by Trading API V3. |
orders[].stratTags |
list[str] |
Strategy tags. |
orders[].echoFields |
str |
Echo metadata. |
orders[].entryPrice |
int |
Entry price. |
orders[].icebergInfo |
IntentOrderIcebergParamsResp |
Iceberg response fields. |
orders[].filledAt |
str |
Fill timestamp. |
orders[].expiryTime |
str |
Expiry timestamp. |
orders[].ltp |
int |
Latest traded price. |
orders[].orderPrice |
int |
Order price. |
orders[].filledPrice |
int |
Fill price. |
orders[].rejectionMsg |
str |
Rejection reason when rejected. |
orders[].timestamps |
IntentOrderTimestamps |
Lifecycle timestamps. |
orders[].positionId |
str |
Position identifier when available. |
orders[].intentOrderType |
str |
Trading API V3 intent order type. |
Important Rules¶
Important Rules
- Use a valid
refIdfrom the instruments APIs before placing the order. sideis mandatory for this single-order shape.MARKETorders are supported in the latest SDK. UsepriceType: "MARKET"withvalidityType: "IOC"and omitentryPrice.- Do not send
legsorisMultiLeg=Trueon this page. - Do not set both
icebergInfo.numberOfLegsandicebergInfo.maxQtyPerLeg. - Review Rate Limits & API Usage before automating placement.