Get positions (day + net)
"Positions" cover intraday (MIS) trades and open F&O positions — anything not yet settled into demat holdings.
positions = kite.positions()
print(positions["day"]) # opened and/or closed today
print(positions["net"]) # cumulative, carried-forward view
Per-position fields:
{
"tradingsymbol": "NIFTY24DEC24500CE",
"exchange": "NFO",
"product": "NRML",
"quantity": 50, # positive = net long, negative = net short
"average_price": 182.5,
"last_price": 195.3,
"pnl": 640.0, # unrealised, mark-to-market
"realised": 0.0,
"unrealised": 640.0,
"multiplier": 1,
"buy_quantity": 50,
"sell_quantity": 0,
}
day vs net — don't confuse them
dayresets every session — only reflects today's activity. Use this to check what your bot itself has done today (e.g. "have I already entered this position this session?").netis the actual current exposure, including F&O/MIS positions carried from a prior day under NRML. Use this for real risk calculations — total exposure, margin usage, what needs to be squared off.
def get_open_positions(kite) -> list[dict]:
return [p for p in kite.positions()["net"] if p["quantity"] != 0]
Common bug
Iterating positions()["net"] without filtering quantity != 0 — closed positions still appear in the list with quantity: 0 and stale pnl values from when they were open. Always filter before treating a position as "currently held."
Next: 017 — CNC vs MIS vs NRML