Two decisions on every hit
When a leg’s stop or target rung fires, Algo asks two things: what happens to this leg, and what happens next.
For the leg itself you choose close this leg (the default), close this strategy (square off every open leg), or no action on this leg — the rung then acts purely as a trigger for the follow-up.
The follow-up is the on-hit action. Separating the two is what lets one stop both close a leg and wake a hedge.
The follow-up actions
| Action | What it does |
|---|---|
| re-execute leg | Places a fresh entry for the same leg, up to N times. From a ladder rung, only that rung’s quantity is re-entered. |
| re-enter at original price | Places a LIMIT order at the leg’s original entry price, so it fills only if price returns there. Capped at N times. |
| re-execute strategy | Squares off every leg and starts a fresh copy of the strategy at current market, capped at N times, with an optional wait. |
| execute other leg | Fires another leg of the strategy, usually one marked Idle, with an optional delay. |
| close all losing / profitable legs | Closes every other open leg that is currently in loss, or in profit. |
| close all CE buys / CE sells / PE buys / PE sells | Closes legs by option type and side. |
| move SL to cost on profitable legs | For every other leg in profit, collapses its stop ladder into a single breakeven stop. |
| execute other strategy | Starts a saved portfolio as a follow-up, with an optional delay. |
On a target rung you can also add quantity to the same leg. Treat that like averaging: it enlarges a position the market has already moved on, so pair it with a hard basket stop.

Idle legs and hedge legs
Two checkboxes on each leg row make the actions more useful.
Idle means the leg does not fire at entry. It sits dormant until another leg’s action executes it. The classic use: a short call with a bought call marked Idle; if the short call’s stop hits, the action fires the wing as an emergency hedge.
Hedge marks a protective BUY leg. Hedge legs are left out of move-to-cost and close last when the strategy flattens, so the short legs are never briefly naked during a square-off.
A worked example
A short strangle: sell the 24,800 PE and the 25,200 CE at ₹60 each, 1 lot of 75, 50% stops (₹90). The CE stop is set to close this leg then re-execute leg, N = 1. The PE target is set to close this leg then move SL to cost on profitable legs.
- NIFTY rallies; the CE hits ₹90. Loss on that leg: (90 − 60) × 75 = ₹2,250. A fresh CE entry is placed; the cap of one is now used.
- If the fresh CE also stops out, nothing re-enters — the cap prevents a loop.
- Meanwhile the PE decays to its target and closes; any other leg in profit at that moment has its stop pulled to its own entry.
(Hypothetical prices. The point is the sequence, not the outcome.)
Limits worth knowing
- Every repeat is capped. Re-execute, re-enter and re-execute-strategy all take an N times maximum, so a choppy day cannot burn through the account.
- Re-execute strategy waits for flat. If any leg fails to exit, the fresh copy is not started — re-entering on top of open legs would double the position.
- Chains are depth-limited. Strategies started by other strategies cannot cascade without end.
- Re-entry is not free. Each re-entry pays costs and slippage again. A backtest shows whether the re-entries earned that cost; see reading an options backtest.
Basket-level actions
The same kind of actions exist at basket level in Step 5, fired by a combined stop or target rather than one leg. That is where “close everything and start again” or “close only the short calls” is usually configured. See basket risk, and per-leg stops for what triggers the leg-level ones.
Where to find it
- In Algo & Backtest, open Step 4 and click ⚙ settings on a leg.
- In the Stoploss or Target tab, set the leg action and the follow-up action on a rung.
- Set N times and any wait for repeat actions.
- Tick Idle or Hedge on rows that should behave as described above.
Common questions
How do I re-enter a short straddle after a stop loss?
On the leg's stop rung choose close this leg and then re-execute leg, and set how many times it may repeat. To restart the whole basket instead, use re-execute strategy.
What is an idle leg?
A leg that does not enter with the strategy. It waits until another leg's on-hit action fires it, which is useful for a hedge that should exist only after a stop is hit.
What does move SL to cost do?
For every other open leg currently in profit, it replaces the stop ladder with a single stop at that leg's entry price, so a winning leg cannot turn into a loss.
Can re-entry loop forever on a choppy day?
No. Every repeat action has an N times cap, and chained strategies are depth-limited.
More on Algo & Backtesting
More in Algo & Backtesting · App: Algo & Backtest · Definitions: glossary · All: every article