Mechanism to handle partially booked order — Tradetron Community
← Community

Mechanism to handle partially booked order

Keyword help 1,015 views

Learn

Let’s say I have purchased 2 lots at 100. And those are to be squared off as T1 (102) and T2 (104).

How do I specify partial exits? Is it using repair condition for T1 and a separate condition for T2?

Also how to handle scenario where T1 is booked and before reaching T2 price SL (say closing below 5ema) is triggered? I mean how to take care of quantity?

How universal exit should be coded to square off either both the lots or a single lot depending on whether t1 is booked or not? Also do we need to use the keyword multiplier in case of universal exit?

Tradetron Team Tradetron team

Yes, use one Repair Once per target and a Set Exit for the stop loss.

  1. Entry: buy 2 lots.
  2. Repair Once 1 (T1): condition LTP(Traded Instrument Name) >= Traded Instrument price + 2. Action: sell 1 lot of the same instrument.
  3. Repair Once 2 (T2): condition LTP(Traded Instrument Name) >= Traded Instrument price + 4. Action: sell 1 lot.
  4. Set Exit (SL): e.g. close below 5 EMA. A set exit squares off whatever is still open in the set, so it handles 2 lots or 1 lot automatically. You do not need to code the quantity.

Things to know

  • Each Repair Once fires once, then is not checked again until a set exit or universal exit.
  • If a repair squares off all positions, the set stops checking repairs and returns to checking Entry. Add an entry gate (runtime variable) if you do not want a fresh entry.
  • Use a Universal Exit for a time-based end-of-day exit.

Repair guide: Difference between Repair Once and Repair Continuous | Tradetron Helpdesk · Keywords: Keyword Documentation — Tradetron

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