Entry wise max profit & max loss — Tradetron Community
← Community

Entry wise max profit & max loss

Strategy 1,647 views

Vasanth Ravi

Is there any option to check max profit and loss
traded instrument wise function in code?

I have been using max profit and max loss which is calculated at strategy wise.

sanket koli

Do you got answer ? I also looking for same solution

Tradetron Team Tradetron team

Short answer: not with a built-in keyword. Max Profit and Max Loss work at strategy level (per run counter). The docs do not list a per-instrument or per-leg version.

What you can use per leg

  • Traded Instrument with field pnl: the current P&L of one leg, addressed by cond type, Set, Condition and Leg.
  • Open Positions Detail with field pnl: the P&L of instruments that are still open, filtered by Long/Short, CE/PE and underlying.
  • Leg TSL in a Repair Once: a trailing stop for one leg, which covers the most common reason people want a per-leg max profit.

Example: per-leg stop and target

In a Repair Once for leg 1: Traded Instrument ( Entry, pnl, NIFTY 50, 1, 1, 1 ) <= Number ( -1500 ) OR >= Number ( 3000 ), with a Leg Exit for that leg.

A true “highest P&L this leg reached”

That needs Python (Python Editor in the strategy builder). Runtime variables are written only when a leg is taken, so they cannot track a running peak on their own.

Test in Live Offline first. 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.