Risk Limits to Write Down Before You Automate Index Option Selling
Most traders who automate a strategy spend weeks on the entry rule and ten minutes on the risk rule. The entry rule is the fun part. It has indicators, backtests and charts. The risk rule is a number in a settings box, and it often gets copied from a video.
That order is backwards. A bad entry rule costs you a slow bleed that you can see and fix. A missing risk rule costs you a single morning that you cannot undo. Option selling makes this sharper, because the loss on the short side has no natural floor, and on expiry day it can arrive in minutes.
This article is a worksheet in prose. It lists the numbers you should write down on paper before you let any software place orders for you on NIFTY or SENSEX weekly options. For each number it explains what the number controls, how to pick a starting value, and how it goes wrong. It uses illustrative arithmetic where it needs examples, and a small set of figures from a study of 163 NIFTY and SENSEX weekly expiry sessions between January 2025 and July 2026.
Why the numbers must exist before the code
When you trade by hand, you carry the risk rules in your head. You feel uneasy at a certain loss, you look at the screen more often, you close something. That unease is a weak but real control. It disappears the moment an algo takes over. The software feels nothing. It will hold a losing short straddle at 14:55 with the same calm it showed at 09:20, because nobody told it otherwise.
So automation does not remove the need for judgement. It moves the judgement to an earlier time, when you are calm and the market is shut. A written risk sheet is the place where that judgement is stored. If a number is not on the sheet, the software will not respect it.
There is a second reason. Numbers fixed in advance cannot be argued with at 11:30 on a bad day. Anyone who has watched a short strangle go against them knows the voice: "it will come back, give it ten more minutes." The sheet is there to overrule that voice.
Keep one page. One page forces you to choose. Eight limits, each with a value, a unit, and an owner (the software, the broker, or you). The sections below walk through them in the order they usually bite.
The first three limits: loss, stops and size
Limit 1: The maximum loss for one day
This is the first number, and it should be stated in rupees and also as a percentage of the capital you assign to the strategy. Not total account capital, but the capital you have set aside for this one book. If you have Rs 10,00,000 in the account and assign Rs 4,00,000 to expiry-day selling, a daily limit of 2% of assigned capital is Rs 8,000.
Why assigned capital and not the whole account? Measured against the larger number, the limit feels small, and you will set it too loose.
How to choose the starting value: work backwards from how many bad days you can stand in a row. Suppose you decide you can live with five full-limit losses in a row without changing anything about your life or your strategy. Five losses at 2% of assigned capital each is about 10% of that capital. If that sounds uncomfortable, the daily limit is too high. If five in a row would not bother you at all, you may be too tight and will be stopped out of days that would have recovered.
One more detail that people skip: decide whether the limit counts realised loss only, or the running mark-to-market. For automation, use mark-to-market. A short straddle can show a large paper loss and then close near flat, and the opposite also happens. But if your limit only fires on realised loss, the software will happily sit through a 3% open loss waiting for the stop on each leg. Mark-to-market is the honest measure of what you are exposed to right now.
Limit 2: The stop-loss on each leg, in points and in rupees
Every short option leg needs an exit, and the exit needs to be translated into rupees before you accept it. Percentages feel harmless. "30% stop on each leg" sounds small. Translate it.
Here is an illustrative example. Say NIFTY is at 25,000 and the weekly expiry day ATM straddle is priced at 0.47% of spot, which is the mean for the 12 to 14 VIX band in the desk study (more on that table below). That is about 117.5 points for the combined straddle, or roughly 58.75 points per leg. With a lot size of 65, a one-lot straddle collects about Rs 7,640 in premium (117.5 x 65 = 7,637.5).
Now put a 30% stop on each leg. On a leg sold at 58.75 points, the stop sits near 76.4 points. The loss per leg is about 17.6 points, or roughly Rs 1,146 per lot. The clean case is one leg stopping while the other keeps its premium. The ugly case is a whipsaw: spot runs up and hits the call-side stop, then falls back through the start and hits the put-side stop. Both legs lose and you have paid twice. Two stops at 30% cost about Rs 2,290 per lot in this example, against Rs 7,640 of premium collected.
The point of the exercise is not that 30% is right or wrong. The point is that you now know the worst clean-case loss per lot for your stop choice, in rupees, and can compare it with the daily limit from Limit 1. If your daily limit is Rs 8,000 and you plan to trade four lots, four lots of a double stop-out already cost about Rs 9,160 in this example, so the daily limit would trigger before the leg stops finish their job. Either the lots are too many, or the daily limit and the leg stop are fighting each other. The sheet makes that visible. A settings box does not.
Also write down what happens after a stop. Does the software re-enter? Does it hedge? Does it do nothing for the day? A re-entry rule is a risk rule in disguise, because a rule that re-enters after every stop turns a bounded loss into an open-ended one on a trending day.
Limit 3: The number of lots, and the exposure behind them
The lot count is the cleanest risk lever you have, and it is the one most often chosen by feel. A good way to set it: take the worst clean-case loss per lot from Limit 2, divide the daily limit by it, and round down. Then ask whether that number also fits your margin and your nerves.
Using the example numbers: a daily limit of Rs 8,000 and a worst clean-case loss of about Rs 2,290 per lot gives 3.5, so three lots. Not four. The rounding direction matters. Always round down.
On exposure, there is a data point worth knowing about. In the desk study, EliteAlgo measured a proxy for how much the notional exposure of a short ATM straddle changes between entry and the intraday peak. The proxy used spot level scaled by the day's VIX, and it is a proxy, not live SPAN margin. On that measure the peak exposure was about 1.007 times the entry exposure on average, with a median of 1.006 and a maximum of 1.025. In plain words: on these sessions, the notional footprint of the position barely grew from the open. That does not mean margin is safe to ignore. Real SPAN margin moves with volatility and your broker can change requirements on short notice. Treat the proxy as a hint that the open position is not the main surprise. The surprise is the loss.
Still, write the margin buffer on the sheet. A common rule is to keep free margin at some multiple of the entry margin, so a rise in requirement does not force a close at a bad moment.
Limit 4: The give-back rule, and why open profit is not yours
Most risk sheets cover losses and ignore profits. That is a gap, because profits on option-selling days are fragile. In the desk study of 159 usable sessions for a short ATM straddle entered at 09:20, the median give-back from the intraday peak profit to the close was 42.8% of the peak. Over half of the days (86 of 159) gave back more than 30% of their peak. On 48 of the 159 days (about 30%), a day that had been in profit at some point closed as a loss.
Read the last figure again. Nearly one session in three that showed a gain at some point finished negative. A strategy that only has a stop-loss, and no rule on profits, will suffer from this every few weeks.
This is where a trailing or lock-in rule belongs on the sheet. The simplest form: once open profit reaches some level, say a quarter of the premium collected, the stop for the whole book moves to breakeven or to a fraction of the peak. Another form: a time-based profit exit, such as closing the book at a fixed clock time regardless of profit. Each has a cost. A trailing stop on the book gets hit by noise and cuts good days short. A fixed clock exit gives up the late afternoon.
If you want to see how a published rule set describes things like this in a tested form, a reasonable question is: who actually publishes their risk rules openly? Most firms describe their approach in adjectives like "disciplined" and "robust". Very few put numbers in public. When you compare any algo trading company in India, check whether the risk section of what they publish contains a number, a unit and a trigger condition. If it contains only adjectives, you have learned something already.
Whatever you pick, write the give-back rule as a formula. "Exit if the book falls to less than half of the day's peak profit, but only after peak profit has touched at least 15% of premium collected." That is a rule a program can run. "Protect profits when it feels right" is not.
Limit 5: A premium budget that scales with VIX
Fixed risk numbers behave badly across volatility regimes. A leg stop of 30% means one thing when the straddle is worth 0.38% of spot and another when it is worth 0.83%. The desk study measured exactly this: the ATM straddle premium as a share of spot at 09:20, split by India VIX band.
The premium budget roughly doubles from the calmest band to the most stressed one, and it rises in every step. For risk, this means a rupee stop is worth different things in different weeks. In the calm band, a 40-point loss on a one-lot straddle is a large share of the premium. In the over-20 band, the same 40 points is a small share and will be hit by ordinary noise.
There are two sane ways to deal with it. One is to express every stop as a share of premium collected, so the rule scales on its own. The other is to keep rupee stops but cut the lot count when VIX is high, so the rupee risk per day stays flat. The first keeps the shape and changes your rupee risk. The second keeps your rupee risk and changes the shape. Pick one and write it down.
A practical rule: use VIX at the 09:15 open, not at the previous close, to pick the band. Gap openings change the band often enough that using yesterday's number would leave you in the wrong row on exactly the days when it matters.
Limits 6 and 7: the longer window and the plumbing
Limit 6: The weekly and monthly drawdown line
The daily limit stops one bad day. It does not stop a bad month made of many medium days. You need a second line that looks at a longer window.
Two forms work. A rolling loss limit says: if the sum of the last five sessions is below minus X% of assigned capital, stop trading for the rest of the week. A peak-to-trough limit says: if the equity of this strategy falls Y% from its highest point, stop and review. Y is often set at a level where a full review is cheap compared with continuing blind.
The crucial part is what "stop and review" means, and this must be on the sheet too. It should name what you will check (fills versus assumed fills, data quality, regime change, a coding fault) and what you need to see before restarting. Without that, a pause becomes a week of staring, and a restart becomes a gut feeling.
A drawdown line cannot tell you whether you are in a normal rough patch or a broken strategy. In a short-premium book, losses come in clusters. The line caps the damage while you find out. A sensible start is the worst drawdown in your backtest, with the live line set meaningfully beyond it, because live conditions are always a bit worse than the test.
Limit 7: Technical limits that are really risk limits
Some of the worst automation losses have nothing to do with the market view. They come from the plumbing. These are the limits to write down for the software, each one a number with a unit.
Maximum orders per minute and per day. A bug that loops can send hundreds of orders in seconds. Set a hard cap on orders per minute and per day inside your own code or the platform, well below what your broker allows. A normal expiry-day book with four legs might place a few dozen orders in a day. A cap of, say, ten times that is still tiny against a runaway loop. SEBI's framework for retail algo trading also puts weight on order-rate controls and registered strategy identification, so check the current rules with your broker and read the regulator's pages at sebi.gov.in rather than relying on forum summaries.
Maximum quantity per order and freeze limits. Exchanges set freeze quantities for index options, and orders above them are rejected or must be sliced. Your software should know the current slice size, and your risk sheet should say what happens when a slice fails halfway. A half-filled multi-leg entry is a position you did not design. Decide in advance whether the engine cancels and unwinds the filled part, or retries.
Stale data guard. If the price feed freezes for 20 seconds, a stop that depends on live prices does not fire. Set a maximum age for the last tick. If the feed is older than that, the engine should stop opening positions and alert you, and, for open positions, move to a defined fallback such as exchange-side stop orders if your set-up supports them.
Time stops and end-of-day flatten. Write the clock time by which every position must be closed, with a margin for slow fills. If your intended exit is 15:15, test whether the engine actually finishes at 15:15 or at 15:24 on a busy day. Expiry-day closes can be fast and thin.
Kill switch. You should be able to flatten everything from a phone in under a minute. A kill switch you have never pressed is a hope, not a control.
Limit 8: The exits that depend on the market structure
Expiry day has features that a generic risk sheet will miss. Spot tends to settle close to the max-pain strike by the end of the day, and the desk study measured how close. Across the 163 sessions, the distance between the expiry close and the max-pain strike (from an end-of-day open-interest snapshot) had a median of 34.4 points, or 0.083% of spot, and a mean of 51.8 points, or 0.122%. The largest gap was 415.4 points, about 0.81% of spot. SENSEX pinned more tightly than NIFTY: median 0.060% of spot for SENSEX versus 0.130% for NIFTY.
Two lessons for a risk sheet. First, a close near max pain is the typical outcome, not the guaranteed one. The 415-point gap is the reminder. Second, if your rules lean on pinning (for example, holding a tight short straddle into the afternoon), your tail risk is on the days when pinning does not happen, and those are also the days when the stop gets hit hardest. Do not write a risk rule whose logic only works on the median day.
The intraday premium path matters too. In the same study the average ATM straddle premium fell from 100% of the 09:16 level to about 88.6% by 11:16, and then moved sideways between roughly 88% and 93% for the whole afternoon. This is not smooth decay to zero. The strike is fixed at the 09:20 level while spot keeps moving, so theta decay is being offset by gamma repricing. For risk, this means "I will just wait for decay" is not a plan after 11:30. Holding an open short straddle for the afternoon has not, on average, been paid by further premium decay in these sessions. Any risk rule that assumes the afternoon is free carry deserves a second look.
Putting it on one page, testing it and reviewing it
The one-page template
Here is a template you can copy into a notes file or a spreadsheet. Values are illustrative placeholders to show the format. Yours must come from your own capital and your own tests.
Once the page exists, run three checks. First, are the numbers consistent with each other? (Does the leg stop times the lots fit inside the daily limit?) Second, can every line be turned into a program statement with no judgement words in it? Third, who or what enforces each line if the software crashes? If the answer for any line is "me, if I am watching", mark it clearly as weak.
Testing the limits before real money
A risk limit you have never seen fire is untested code, however simple it looks. Before you go live, force each limit to trigger in a paper or simulated run. Feed the engine a fake feed that jumps 1% in a minute. Cut the feed for 30 seconds. Reject an order on purpose. Press the kill switch. Write down what happened and how long it took.
Test two limits firing together too. A leg stop and a daily limit at the same tick can produce duplicate exit orders.
Then run a small live phase with one lot. The goal is not profit. It is to compare fills against the sheet. If your stop assumed an exit at the trigger price and live fills come in several points worse on fast moves, adjust the sheet. Exit slippage is the cost backtests understate most.
What to review, and how often
Review the sheet on a schedule, not only after a loss. A monthly review is enough for most individuals. Look at three things: how often each limit fired, how far the realised result drifted from what the sheet predicted, and whether the market regime has shifted into a different VIX band than the one you set values for.
A limit that fires every week is either too tight or the strategy is wrongly sized. Do not change a limit on the day it fired. Change it on paper at the review. This habit prevents the most common self-inflicted damage, which is loosening a limit in the middle of a loss.
Frequently Asked Questions
What is a safe stop-loss percentage for option selling on expiry day?
There is no single safe value. The right number depends on premium size, VIX, lot count and your daily loss limit. Translate any percentage into rupees per lot, then check that two stop-outs still fit inside your daily limit. If they do not, cut lots before you loosen the stop.
How much capital should I allocate to a NIFTY option-selling algo?
Start with an amount you can lose a large part of without changing your life, and treat it as separate from the rest of your money. Margin needs are only the minimum. Many traders keep free margin well above what the strategy uses so a margin rise does not force a bad exit.
Should the daily loss limit be set in rupees or percent?
Write both. The percentage, measured against capital assigned to the strategy, keeps the limit honest as capital changes. The rupee figure is what the software needs to enforce. Recompute the rupee figure whenever you change the assigned capital.
Do I still need a manual stop-loss if my algo has one?
Yes, in the sense that you need a second layer. Software can crash, lose its data feed or lose its internet link. Exchange-side stop orders, broker-level loss limits and a phone-accessible kill switch are the second layer. Decide which ones you have before going live.
What is the SEBI framework for retail algo trading, in short?
It is a set of rules from the regulator about how retail traders connect algorithmic strategies to brokers, including identification and control of strategies. The details have been updated over time, so read the current circulars on the regulator's site and ask your broker which parts apply to your set-up.
How often should I change my risk limits?
Not often. Review them monthly and change them only on the review day, on paper first. Changing limits during a drawdown is the pattern that turns a bad week into a bad quarter.
Conclusion
Risk limits are the part of an automated strategy that you control completely. You cannot choose what the market does on Thursday. You can choose, in advance and in rupees, how much of your capital any one day, any one leg and any one fault is allowed to take.
The routine is short. Write eight numbers. Check they agree with each other. Force each one to fire in a test. Review them on a calendar, not on a bad day. Everything else about the strategy can be improved later, but a missing limit can only be fixed after the damage.
Algo trading carries a real risk of loss, including the loss of more than you expected on a fast expiry day. EliteAlgo is analytical software and not an investment adviser, and nothing in this article is investment advice. The figures above are illustrative examples or come from a past-data study, and they do not predict future results.