← Algo & Backtesting

Basket risk: stops and targets on the whole position

A straddle is one trade with two legs. Stopping each leg separately often closes the wrong side at the wrong time, while the number you actually care about is the total. Step 5 puts the stops, targets and trailing on that total.

What combined risk measures

Combined risk works on the basket’s MTM: the sum of every open leg’s P&L. It has the same tabs as a leg — Wait & Trade, Stoploss, Target, Trailing — plus Profit Lock.

Leg rules and basket rules run together, and the first to trigger wins. A sensible pattern is wide leg stops for disasters and a basket stop for the plan.

Combined Wait and Trade

After the entry condition fires, the engine adds up the legs’ premiums — SELL as plus, BUY as minus — into a combined credit or debit, and waits for that combined value to move by your trigger before placing any order. The trigger is an absolute ₹ level, points relative to the combined value when the wait began, or a percentage.

Per-leg waits take precedence: if any leg has its own wait set, the combined wait is skipped for the whole basket.

Stop, target and what happens on hit

A combined stop or target can be measured as ₹ MTM, % of total entry premium, average points per unit, an underlying move, the basket’s net delta, or an ATR multiple. Rungs let you scale out — a share of every leg, or N lots off every leg — instead of closing all at once. SL Wait works as on a leg: a breach must persist for N seconds. In a one-minute backtest, waits under 60 seconds fall inside the bar.

On hit, the default is close current strategy. Other actions include:

Step 5 Combined Stoploss tab: close the strategy when basket MTM falls to minus 4,000 rupees, with the scale-out ladder builder below.
Step 5 Combined Stoploss tab: close the strategy when basket MTM falls to minus 4,000 rupees, with the scale-out ladder builder below.

Combined trailing vs profit lock

These are two different ways to protect a profit, and the difference is who chooses where the floor sits.

Combined Trailing gives back a fixed amount from the peak. Once peak MTM reaches the trigger, the floor is trigger − lock, and every further step of peak raises it by the lock. A blank lock equals the step.

Profit Lock holds a floor you name. When MTM reaches ₹X, a floor of ₹Y is locked; every further ₹S of peak lifts it by ₹L. The floor can never exceed the peak. Falling back to the floor closes every leg.

Use Profit Lock when you can state the outcome: “once I am up ₹20,000, keep at least ₹18,000.” Arm one or the other, not both — they are checked on the same tick and the first to fire closes the basket. A combined target at or below the lock’s arm level will book the basket before the lock ever arms.

Worked examples

Trailing. Trigger ₹4,000, step ₹1,000, lock ₹1,000. Peak reaches ₹4,000: floor = 4,000 − 1,000 = ₹3,000. Peak reaches ₹6,500: two full steps, floor = 3,000 + 2 × 1,000 = ₹5,000. If MTM then falls to ₹5,000, everything closes.

Profit Lock. Reach ₹20,000, minimum ₹18,000, step ₹5,000, lift ₹2,000. At a ₹30,000 peak: 18,000 + floor(10,000 ÷ 5,000) × 2,000 = ₹22,000. At ₹40,000: 18,000 + 4 × 2,000 = ₹26,000. Notice the floor falls further behind as profit grows — ₹8,000 behind, then ₹14,000. Set lift equal to step for a constant give-back.

Common mistakes

Both trailing and profit lock can be edited on a running strategy from the forward-test or live position panel; if MTM is already below the new floor, you are warned with the floor, peak and current MTM before it applies. Leg-level rules are in per-leg stops.

Where to find it

  1. In Algo & Backtest, open Step 5.
  2. Pick a tab: Wait & Trade, Stoploss, Target, Trailing or Profit Lock.
  3. Set the measure, the trigger and the on-hit action.
  4. Backtest and compare the exit reasons across days.

Common questions

What is a combined stop loss in options trading?

A stop measured on the total P&L of all legs rather than any single leg. In Algo it can be set in rupees, as a percentage of entry premium, in points, on an underlying move, on net delta or on ATR.

What is the difference between trailing stop and profit lock?

Trailing gives back a fixed amount from the peak. Profit lock keeps a floor you specify once a profit level is reached, and lifts it in steps.

Can the strategy close and re-enter after a combined stop?

Yes. Choose close strategy and re-enter, set how many times it may repeat and an optional wait. It will not restart if any leg failed to exit.

Can I change profit lock on a running strategy?

Yes, from the forward-test or live position panel. If the new floor is already above current MTM you are warned before it applies, because it would close the position.

More on Algo & Backtesting

More in Algo & Backtesting · App: Algo & Backtest · Definitions: glossary · All: every article