Skip to content

Trading Overview

Trading API V3 New

This is the Python SDK V3 trading guide for SDK 0.4.5.

Use these pages with trading_version=TradingAPIVersion.V3 when you want to place and manage orders through the newer V3 payload structure.

NubraTrader(nubra) is the Trading API V3 trading client. Use these pages for Trading API V3 order placement, modification, cancellation, retrieval, and pre-trade funds estimation.

Trading API V3 order workflows are order-ID based. Single orders, independent multi-order items, and strategy orders all return Trading API V3 intentOrderId values. For strategy orders, one strategy-level intentOrderId represents the full strategy and legs[] are details under that order.

LLM guidance

Use these pages for Trading API V3 intent-order workflows. Generate payload fields such as refId, qty, side, deliveryType, priceType, validityType, entryPrice, entryConfig, exitConfig, isMultiLeg, legs, and stratTags.

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)

Main Methods

Method Trading API V3 action Purpose
create_order() Trading API V3 create-order request create one or more Trading API V3 intent orders
modify_orders_sentinel({...}) Trading API V3 modify-order request modify one Trading API V3 order or strategy order
modify_orders_sentinel([...]) Trading API V3 modify-order request modify multiple Trading API V3 orders or strategy orders
cancel_orders_sentinel() Trading API V3 cancel-order request cancel full orders or selected exit triggers
orders() Trading API V3 order retrieval fetch grouped Trading API V3 orders and strategy order legs
get_margin() Trading API V3 funds-required request estimate Trading API V3 funds and margin requirement

Page Map

Workflow Page Use when
Place one order Place Order one single-instrument order with isMultiLeg: False
Place multiple independent orders Place Multiple Orders a list of single-order payloads in one create_order([...]) call
Place one strategy order Place Strategy Order one multi-leg FNO strategy with isMultiLeg: True and legs[]
Modify one order or strategy Modify Order one Trading API V3 intentOrderId
Modify multiple orders or strategies Modify Multi Order several orderId items in one modify request
Cancel order or trigger Cancel Order full cancellation or selected exit trigger cancellation
Retrieve orders Get Orders single, multi-order, and strategy order snapshots
Estimate funds and margin Get Margin pre-trade funds requirement for the same payload shape as placement

Order ID Model

Order kind Placement input Returned ID model
Single order one dict with isMultiLeg: False one intentOrderId
Multi order list of single-order dicts one intentOrderId per item
Strategy order one dict with isMultiLeg: True and legs[] one strategy-level intentOrderId; legs[] are details

Use the returned intentOrderId for get, modify, cancel, and status-check workflows. Do not use basket_id for Trading API V3 strategy orders.

Trading API V3 Field Groups

Field group Fields
Core single order refId, qty, side, deliveryType, priceType, validityType, entryPrice, isMultiLeg
Strategy order isMultiLeg, qty, side, deliveryType, entryPrice, legs[].refId, legs[].unitQty
Entry conditions entryConfig.entryTime, entryConfig.triggers.ltp.above.value, entryConfig.triggers.ltp.below.value, entryConfig.triggers.ltp.atOrAbove.value, entryConfig.triggers.ltp.atOrBelow.value
Stop-loss exit exitConfig.stoplossParams.stoplossTriggerPrice.value, exitConfig.stoplossParams.stoplossLimitPrice.value, exitConfig.stoplossParams.stoplossTrailJump
Target exit exitConfig.targetParams.targetProfitTriggerPrice.value, exitConfig.targetParams.targetProfitLimitPrice.value
Timed exit exitConfig.exitTime
Iceberg icebergInfo.numberOfLegs or icebergInfo.maxQtyPerLeg
Metadata algoId, stratTags, goodTillDate, executionMode

Trading API V3 Enum Values

Field Values
side BUY, SELL
deliveryType IDAY, CNC
priceType LIMIT, MARKET
validityType DAY, IOC, GTE
executionMode ENTRY, EXIT, ENTRY_AND_EXIT
entryConfig.triggers.ltp above, below, atOrAbove, atOrBelow
exitTriggerKind STOPLOSS, TARGET_PROFIT, TRAILING_STOP
orders(status=...) OPEN, EXECUTED, REJECTED, GTE, CANCELLED, EXPIRED
orders(exchange=...) NSE, BSE, MCX

Important Rules

Important Rules

  • Initialize NubraTrader(nubra) for Trading API V3 order workflows.
  • On SDK 0.4.5, use trading_version=TradingAPIVersion.V3 when creating the SDK client for V3 payloads.
  • Trading API V3 methods require the account-side Sentinel/OMS flag to be enabled.
  • create_order() accepts a single dict, a list of dicts, or a dict with an orders key in the V3 flow.
  • Resolve environment-correct refId values before sending trading or margin requests.
  • Use the documented Trading API V3 field names in placement, modify, cancel, get-margin, and response examples.
  • Prices are typically passed in exchange-native integer units such as paise for NSE instruments.
  • MARKET orders are supported. In the current SDK flow, pair priceType: "MARKET" with validityType: "IOC" and omit the limit entry price.
  • Single-leg orders require refId, qty, side, deliveryType, isMultiLeg: False, and executionMode.
  • Strategy orders require isMultiLeg: True, a non-empty legs list, signed unitQty, and a strategy-level side.
  • Modify and cancel strategy orders by the strategy-level intentOrderId; do not resend legs.
  • Use orders() for all Trading API V3 order retrieval, including strategy order leg inspection.
  • In V3, live, executed, and tag parameters are ignored by orders().
  • Use get_margin() before placement when funds requirement matters.
  • Review Rate Limits & API Usage before building high-throughput trading logic.
  1. Place Order
  2. Place Strategy Order
  3. Get Orders
  4. Get Margin
NEO Assistant