Orders

Broker differences

AngelOne does not support get_order(order_id) — use get_orders() and filter by ID instead. See operation notes for full per-broker behavior.

Core actions

  • place order
  • modify order
  • cancel order
  • list orders

Place order (market)

from tt_connect import TTConnect
from tt_connect.instruments import Equity
from tt_connect.enums import Exchange, Side, ProductType, OrderType

config = {"api_key": "...", "access_token": "..."}

with TTConnect("zerodha", config) as broker:
    order_id = broker.place_order(
        instrument=Equity(exchange=Exchange.NSE, symbol="RELIANCE"),
        side=Side.BUY,
        qty=1,
        order_type=OrderType.MARKET,
        product=ProductType.CNC,
    )
    print("placed:", order_id)

Place order (limit)

order_id = broker.place_order(
    instrument=Equity(exchange=Exchange.NSE, symbol="SBIN"),
    side=Side.BUY,
    qty=10,
    order_type=OrderType.LIMIT,
    product=ProductType.CNC,
    price=800.0,
)

Modify and cancel

broker.modify_order(order_id=order_id, price=801.0, qty=10)
broker.cancel_order(order_id)

Read orders

orders = broker.get_orders()
for o in orders:
    print(o.id, o.status, o.qty)

Order flow

PENDING -> OPEN -> COMPLETE or CANCELLED or REJECTED

Good patterns

  • save returned order id
  • check order state after placement
  • handle rejection and avoid blind retries

What's next?

See also