Launchpad

One leg filled, the other rejected

Our bot sold the first leg of a two-leg options position. The broker rejected the second for lack of margin. Because the bot was built to undo a half-done entry, the unwanted position lasted seconds. With only an alert, it could have lasted until someone noticed.

What went wrong

A strategy of ours enters by selling two index options together: a call and a put. On 5 November 2026 the bot sold the call. The broker then rejected the put: not enough margin. The account was less than 1% short of what the full position needed.

For a moment the bot held something it was never meant to hold. A short call on its own is not “half a straddle”; it is a different and much riskier position, with unlimited loss if the market rises.

What it cost, or could have cost

It cost almost nothing, because the bot was built for exactly this. Within seconds it bought the call back and returned to a flat, balanced book. It tried twice more over the next minute, each time with the same result and the same immediate undo. After the third failure it halted the strategy for the day and sent an urgent alert. The unwanted position never lasted longer than 21 seconds. The three round trips cost about 2½ points per unit plus the charges on six orders.

Now picture the same day with a bot that only sends an alert: “order rejected”. The short call stays open until a person reads the message, understands it and acts. That might be minutes, or hours if the alert arrives during a meeting. On an index, a 1% rise in that time can turn a ₹205 call into something like ₹800: a loss of about 600 points per unit on a position nobody wanted.

Root cause

  • Legs are separate orders. Brokers execute each leg on its own. Nothing ties a strangle or a spread together, so one leg can fill while another is rejected, for margin, a price band, a freeze limit or a broker hiccup.
  • Margin is checked one order at a time. The first leg passed. The second needed more margin than was left.
  • An alert is not a fix. Telling a human about a broken position still leaves the position broken until the human acts.

The fix

We already had 1, 2 and 5, which is why this cost almost nothing. Number 4 is the gap this incident exposed, and we are adding it now.

  1. Treat a multi-leg entry as one unit. The bot records the intended whole position before placing anything, then checks after every leg whether the book still matches a balanced state.
  2. Undo a half-done entry automatically. If any leg fails, the bot immediately reverses the legs that did fill (or, where it can, completes them in a proportion that is still balanced). The goal is “flat or whole”, never “partly in”.
  3. Order the legs to fail safe. Where a position has protective legs, buy those first and sell last, so a rejection leaves you over-hedged rather than naked.
  4. Check margin before the first leg. Ask the broker’s margin calculator for the whole basket. If the account can’t carry all of it, place nothing.
  5. Stop retrying into the same wall. Retry a small number of times, then halt the strategy and raise an urgent alert. Every retry costs a spread, and a margin shortfall doesn’t fix itself in seconds.
filled = []
for leg in legs:                                   # protective (buy) legs first
    res = place_and_confirm(leg)                   # waits for the broker's final status
    if res.ok:
        filled.append(res)
    else:
        unwind(filled)                             # reverse what filled: flat, not half-in
        alert_urgent(f"{strategy}: entry undone, {leg} rejected ({res.reason})")
        failures_today[strategy] += 1
        if failures_today[strategy] >= 3:
            halt(strategy)                         # stop retrying into the same wall
        break

Checklist item

  • For every multi-leg strategy, your bot checks margin for the whole basket before the first order, and if any leg fails it automatically reverses the legs that filled, then halts after a few failed attempts. An alert alone is not enough.

Was this useful?

More to say, or spotted a mistake? Write to [email protected]. We read everything.

Topics