Skip to content

Trading Overview

NubraTrader is the Trading API V3 trading client when initialized with TradingAPIVersion.V3. 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 flexi / multi-leg strategy orders all return Trading API V3 intentOrderId values. For flexi 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, stratTags, and echoFields.

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)

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_multi_order({...}) Trading API V3 modify-order request modify one Trading API V3 order or flexi strategy
modify_multi_order([...]) Trading API V3 modify-order request modify multiple Trading API V3 orders or flexi strategies
cancel_orders_v3() 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 flexi strategy 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 Multi Order a list of single-order payloads in one create_order([...]) call
Place one flexi strategy Place Flexi 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 flexi 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
Flexi / multi-leg strategy 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 flexi strategy orders.

Trading API V3 Field Groups

Field group Fields
Core single order refId, qty, side, deliveryType, priceType, validityType, entryPrice, isMultiLeg
Flexi strategy isMultiLeg, qty, side, deliveryType, entryPrice, legs[].refId, legs[].unitQty
Entry conditions entryConfig.entryTime, entryConfig.triggers[].kind, entryConfig.triggers[].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, echoFields, goodTillDate, executionMode

Trading API V3 Enum Values

Field Values
side BUY, SELL
deliveryType IDAY, CNC
priceType LIMIT
validityType DAY, GTE
executionMode ENTRY, EXIT, ENTRY_AND_EXIT
entryConfig.triggers[].kind ABOVE, BELOW, AT_OR_ABOVE, AT_OR_BELOW
exitTriggerKind STOPLOSS, TARGET_PROFIT, TRAILING_STOP
orders(status=...) OPEN, EXECUTED, REJECTED, GTE, CANCELLED, EXPIRED

Important Rules

Important Rules

  • Initialize NubraTrader with TradingAPIVersion.V3 for Trading API V3 order workflows.
  • 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.
  • Single-leg orders require refId, qty, side, deliveryType, isMultiLeg: False, and executionMode.
  • Flexi / multi-leg strategy orders require isMultiLeg: True, a non-empty legs list, signed unitQty, and a strategy-level side.
  • Modify and cancel flexi strategies by the strategy-level intentOrderId; do not resend legs.
  • Use orders() for all Trading API V3 order retrieval, including flexi strategy leg inspection.
  • 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 Flexi Order
  3. Get Orders
  4. Get Margin
NEO Assistant