Losing one leg of a two-leg structure is not half a problem — it is a different position. This page documents what the engine does about that, and shows measured evidence that the answer is not always protective.
The Advanced panel, where move-SL-to-cost sits alongside trailing and re-entry. All three fire off a leg's own rule, never the position stop.
The problem it addresses
Take a short strangle in a backtest. The call spikes and hits its stop. That leg closes.
You are no longer short a strangle. You are short a naked put, in a market that has just moved, with the leg that was hedging your other side gone. The position you are holding is not the position you tested.
The analogy: a two-person job where one person walks off. The remaining person is not doing half the work — they are doing a different, more dangerous job.
Move SL to cost answers that by pulling the surviving leg's stop in to its own entry premium, so that leg cannot turn the trade into a loss.
The rules it follows
- Only on a leg stop, including a trailed one. A leg taken off at its target does not trigger it — a leg closed at a profit has not left you exposed the way a cut leg has.
- Two-leg structures only. With three or more there is no unambiguous "other leg", and the toggle is disabled with that reason rather than guessing.
- It needs an SL% on at least one leg. Without a leg stop nothing can trigger it.
- Tighter of the two, never looser. If a trail has already ratcheted the survivor's stop past entry, that tighter level stands.
That last rule is worth dwelling on, because it was wrong until recently.
A correction worth stating plainly
Until August 2026 the comparison was inverted. A short leg's stop sits above its entry and fires when the premium rises into it, so the lower level is the tighter one — and the code was taking the higher.
Two consequences, both measured:
- With a plain 30% leg stop, the level never changed. The toggle was a complete no-op — zero fires, byte-identical results. That is the default configuration most people would click.
- Where a trail had ratcheted the stop below entry, it fired and pushed the stop back out to entry, handing back exactly what the trail had protected.
Both are fixed. Every one of 268 observed fires across four configurations now tightens the surviving leg's stop; none loosens it. The movedToCost count in the run's assumptions was added at the same time, because a rule that fires zero times is indistinguishable from a rule that is switched off — which is precisely how this stayed invisible.
What it actually costs, measured
NIFTY short strangle (ATM±2), 1 lot, 81 sessions, 2025-01-01 to 2025-04-30, entry 09:20 exit 15:15 IST, 30% per-leg stop, costs on. Projected, not advice.
Lot size: every trade is sized at today's lot size, whatever its date. Premiums are per unit, so rupee figures are comparable across a window that crosses a lot-size change.
Without a trailing stop:
| Off | On | |
|---|---|---|
| Net P&L | +₹23,243 | +₹4,363 |
| Win rate | 59.3% | 43.2% |
| Max drawdown | -₹18,544 | -₹20,535 |
| Profit factor | 1.28 | 1.05 |
| Times fired | 0 | 71 |
With a 20/10 trailing stop running:
| Off | On | |
|---|---|---|
| Net P&L | -₹13,896 | -₹8,324 |
| Max drawdown | -₹20,485 | -₹16,670 |
| Profit factor | 0.80 | 0.86 |
| Times fired | 0 | 57 |
Read those two tables together, because they point opposite ways.
Without a trail it cost ₹18,880 — about 81% of the run's profit — and dropped the win rate sixteen points, and it deepened the drawdown. With a trail it gained ₹5,572 and made drawdown about ₹3,800 shallower. Both runs lost money with the trail on, so read "helped" as "lost less".
Why it hurts on its own
The stop is placed at exactly the entry premium. That is the definition of the rule, not a setting — "cost" means the price that leg was filled at, and there is no buffer around it by design. And in this sample, the entry premium was frequently revisited.
So it is a hair-trigger. It fired 71 times across 81 sessions — on nearly every session. A short strangle's surviving leg routinely oscillates back through its own sale price during the day before decaying into the close, and every one of those ordinary wobbles now closes the leg for nothing.
The protection is real. It is just being bought at a price that, on this strategy, exceeded what it saved.
Why it helps alongside a trail
With a trail running, the survivor's stop has usually already ratcheted past entry into profit by the time the other leg is cut. Move-to-cost then takes the tighter of the two — which is the trail's level — so it does not fire on the wobble. It only binds on the legs the trail had not yet protected.
The common misconception. "A breakeven stop is free — worst case I get out at my entry price." It is not free and it is not breakeven. Exit slippage and both sides' charges still apply, so a leg stopped "at cost" books a small loss. And the real cost is not that loss; it is the profitable trades it ends early.
How to check it on your own run
Read movedToCost in the run's assumptions. If it is zero, the toggle is doing nothing on your configuration — almost always because you set a position stop rather than a per-leg one, and this rule only fires off a leg's own stop.
If it is a large number relative to your trade count, it is firing on nearly every trade, which is the pattern above. Compare against the same run with it off before keeping it.
What mistakes do traders make?
Enabling it as obvious risk management. Measured, it cost about 69% of the run's profit on a strategy with no trail.
Reading it as a break-even guarantee. Exit slippage and charges still apply, so "at cost" books a small loss.
Using it with a position stop instead of a per-leg stop. It cannot fire. Check movedToCost.
Assuming it overrides a trail. It takes the tighter level, so a trail that has ratcheted into profit keeps its own.
Generalising from one window. The direction of the effect flipped entirely depending on whether a trail was running. Sweep it at /backtest/walk-forward before trusting it.
Next step
Open /backtest, put a per-leg SL% on both legs of a two-leg structure, and run it with the toggle off and on. Then run the same pair again with a trail enabled — on this strategy the two comparisons pointed in opposite directions, and yours may too. Read trailing stops next, since the interaction between the two is where this rule earns its keep.