Position Status — Tradetron Community
← Community

Position Status

Uncategorized 927 views

Chandrahas

I want to know whether a position taken in a leg is still open or closed and use the same in my Exit condition builder…I could not find any keyword that can be used…

Lion Algos

You can try Net Quantity

Tradetron Team Tradetron team

Use the Net Quantity keyword. Point it at the leg you want (Set / Condition / Leg) and it returns that instrument’s open quantity in the strategy:

  • 0 = the position is closed.
  • Non-zero = still open (negative for a short, positive for a long).

Example in an exit

“Exit this leg only if the other leg (set 1, condition 1, leg 2) is already closed”:
Net Quantity(<set 1, condition 1, leg 2>) == Number(0)

“Do something while leg 1 is still open”:
Net Quantity(<set 1, condition 1, leg 1>) != Number(0)

Good to know

  • Net Quantity is strategy-level, not set-level. It takes the instrument of the leg you point at and adds up its open quantity across the whole strategy. If two sets trade the same strike, both count.
  • To count how many instruments are open in total, use Open Positions Detail with return field count.

Keyword reference: Keyword Documentation — Tradetron

:sparkles: Answer written with AI from Tradetron docs (Oct 2026). Original replies are kept above. Spot something wrong? Reply below.