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 TeamTradetron team
Yes, use one Repair Once per target and a Set Exit for the stop loss.
Entry: buy 2 lots.
Repair Once 1 (T1): condition LTP(Traded Instrument Name) >= Traded Instrument price + 2. Action: sell 1 lot of the same instrument.
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.