How to Start Algo Trading in India: The Six Decisions You Make Before You Write Any Code
Search “how to start algo trading in India” and you get two kinds of answer. The first is a tool tutorial: open a broker account, get an API key, install Python, here is a moving-average crossover. The second is a timeline: month one learn Python, month two learn backtesting, month three go live. Both are premature. They tell you how to operate machinery before you have decided what you are building.
Underneath every working retail algo setup there are six architecture decisions. Which instrument. Which direction your edge points. How often you decide. Where execution physically runs. What data you will trust. And how you will find out you are wrong. Make those six consciously and your tooling, your monthly cost and your realistic failure modes are already 90% determined. The Python is downstream. The platform choice is downstream. Even the strategy is largely downstream.
The problem is that almost nobody makes these six deliberately. They get made by accident, by following whichever tutorial came up first, and the result is a stack where the pieces quietly fight each other: a premium-selling idea tested on index candles, running on a laptop that sleeps, measured by a profit-and-loss number that nobody compares against anything. This piece walks the six decisions in the order they actually constrain each other, says what the real trade-off is at each one, and says what going wrong looks like.
Why the usual starting point fails
A tool tutorial answers “how do I place an order from code”. That is a two-afternoon problem, and it is not what stops people. What stops people is building something coherent-looking whose parts quietly assume different worlds: an option-selling idea tested on index candles, sized by feel, run on a machine that sleeps, and judged by whatever number the broker app shows at 3:30 pm. Each of those choices is defensible on its own. Together they produce a system that cannot tell you anything, because a bad month and a broken edge look identical through it.
The six decisions below are ordered because each one narrows the next. Instrument limits which edges exist. Edge direction decides what risk management even means. Frequency decides infrastructure. Infrastructure decides where you can run. All four decide what data you need. And only after all of that can you write a measurement plan that measures the right thing.
#DecisionWhat it mostly determinesCost of getting it wrong1Instrument and segmentLiquidity, margin, which edges are available at allYou spend months on an edge the market will not pay for2Direction of edgeRisk management, sizing, which metric mattersYou manage the wrong risk entirely3Decision frequencyInfrastructure, data granularity, slippage sensitivityBacktest edge is smaller than your execution gap4Where execution livesMonthly cost, uptime, broker authorisation pathApproval blockers and silent downtime5Data you trustWhether your backtest answers your questionA confident number about a different trade6Measurement and kill criteriaWhether you can ever learn from live resultsYou cannot tell bad luck from a broken edge
Decision 1: Which instrument, and which segment
Retail algo activity in India is far more concentrated than the beginner guides suggest. You have three broad choices, and they are not equal.
Cash equity. Widest universe, cleanest data, and the hardest place for a small retail algo to find a repeatable edge. You compete with institutional execution on the liquid names and with illiquidity on the rest. A fine place to learn code hygiene, a thin place to look for an edge.
Index futures. One instrument, deep liquidity, linear payoff, simple to model. Because the payoff is linear your only lever is direction, with no time component working for you. For a beginner this is honest and brutal: futures tell you very quickly whether your signal has any predictive content.
Index options. This is where most Indian retail algo volume now sits, and the reason is structural. After SEBI moved to one weekly expiry per exchange, the Bank Nifty weekly expiry was discontinued. NIFTY on NSE and SENSEX on BSE are the surviving weekly expiry contracts. That rule change did something important: it funnelled an enormous amount of short-dated option activity into a narrow set of instruments on a narrow set of days.
Why concentration matters more than choice
The good side: liquidity in near-the-money weekly strikes is very deep in the sessions that matter, spreads are tight, and your backtest assumptions about fills are less heroic. Because so many traders watch the same handful of contracts, the behavioural patterns in them are stable enough to study.
The bad side: you are in a crowded trade with everybody who read the same tutorials. When a short-dated option position goes wrong, it goes wrong for a large number of participants at the same moment, in the same strikes, in the same direction. Crowding does not remove edge. It changes the shape of your bad days from occasionally unpleasant to occasionally correlated and fast.
Pick deliberately. If you want to learn whether you can predict direction, use futures and find out cheaply. If you want to work on a structure-and-timing edge in the most liquid short-dated contracts India has, use index options on weekly expiry. If you do not know yet, that is a reason to paper trade both for a few weeks, not a reason to skip the decision. If you want the broader landscape of broker APIs, platform types and the mechanics underneath each segment, a fuller guide to algo trading in India covers the plumbing in more depth than this piece will.
Decision 2: Which direction your edge points
This is the decision that beginners make without noticing they made it, and it is the one with the largest downstream effect.
Are you selling premium, or buying moves? If you sell options, you are short gamma. Your returns are income-shaped: many small wins, occasional large losses, a comfortable win rate and an uncomfortable tail. If you buy options, you are long gamma. Your returns are the mirror image: many small losses, occasional large wins, a win rate that feels awful even when the system is working.
Selling premium (short gamma)Buying moves (long gamma)Return shapeFrequent small gains, rare big lossesFrequent small losses, rare big gainsWin rate feelHigh and reassuringLow and demoralisingMain enemyGive-back and margin expansionDrawdown length and hit rateSizing driverWorst-case adverse move, not averageSurvival through losing streaksWhat you must logPeak profit vs close, margin used vs peakStreak length, cost of entry, time in tradeHow it kills youOne sessionSix months of slow bleed
Notice the row that matters most: “main enemy”. If you sell premium, your problem is give-back and margin. If you buy moves, your problem is drawdown and hit rate. Those are not the same problem and they do not share a solution. A premium seller who spends all their energy on entry signals has optimised the wrong half of the system. A premium buyer who obsesses over exit targets has done the same in reverse.
The number that makes this concrete
If you choose to sell premium, you need to understand that the thing you are selling is not a fixed quantity. A study of 163 NIFTY and SENSEX weekly expiry sessions between January 2025 and July 2026, using one-minute option-chain data, measured the at-the-money straddle premium as a percentage of spot at the 09:20 snapshot, grouped by the India VIX level that day.
India VIX bandDaysMean ATM straddle premium (% of spot)MedianUnder 12460.38%0.38%12 to 14430.47%0.44%14 to 17350.58%0.51%17 to 20240.64%0.60%Over 20110.83%0.76%
The relationship is monotonic across all five bands, and the premium budget roughly doubles from the calmest band to the most stressed one. That single fact invalidates the most common beginner design choice in Indian option selling: the fixed-rupee profit target.
Work it through. Take an index at 25,000 for the arithmetic, and NIFTY’s lot size of 65. In the calmest band, 0.38% of spot is about 95 index points of straddle premium, or roughly Rs 6,175 per lot. In the most stressed band, 0.83% is about 207 points, or roughly Rs 13,490 per lot. Same instrument, same entry time, same structure. The amount you are selling has doubled.
Now bolt a fixed target of Rs 3,000 per lot onto that. On a calm day you are asking the market to hand you about 49% of the premium you sold. On a stressed day the same Rs 3,000 is about 22% of what you sold. One of those is a demanding target and the other is almost a scratch. You have written a strategy whose aggressiveness changes with the weather, and you did not choose that.
The fix is not complicated. Express targets, stops and sizing as a fraction of the premium collected or as a multiple of the day’s expected range, not as a rupee constant. But you can only think of that fix if you know the premium is regime-dependent in the first place, which is exactly the kind of thing that decision 2 forces you to confront before you write code.
Decision 3: How often you decide
Decision frequency sounds like a detail. It is the single biggest driver of what infrastructure you need and how fragile your edge is.
There are roughly three steps, and each step up multiplies your requirements.
FrequencyExampleData neededSlippage sensitivityTypical failure modeClock-triggered, once a dayEnter at 09:20, exit at 15:15 or on a stopMinute bars, option chain at a few timestampsLow to moderateThe one fixed time you chose was lucky in the test windowIndicator-triggered intradayEnter when an indicator condition fires, any time in the sessionFull minute series for every candidate strikeHighSignal timing drifts; fills cluster at the worst momentsTick-reactiveRespond to order-book or quote changesTick or depth data, stored and replayedSevereEdge is smaller than your latency and spread
Most retail traders should start at the top row. A once-a-day clock trigger has a real weakness: you are hard-coding a timestamp, and if you tried thirty timestamps and kept the best one, you fitted the clock rather than found an edge. Its strength is that it is testable, cheap to run, and its slippage profile is measurable in a week of paper trading.
The middle row is where most ambitious beginners land and most underestimate it. An indicator-triggered system needs the full minute-by-minute series for every contract it might touch, not just a snapshot. Your entries now happen at moments the market chose, which systematically means moments of movement, which means wider spreads exactly when you transact. The slippage you measured on calm clock entries does not transfer. And the bottom row is a different business entirely: if your edge lives in the order book, you are competing against colocation and engineering budgets that are not comparable to yours.
A test for whether you have earned the next step up
Before moving from a clock trigger to an indicator trigger, answer this: how large is your measured edge per trade, in rupees, after costs, and how large is your measured slippage per trade? If the edge is not several times the slippage, a higher decision frequency will eat the difference. Faster is not better. Faster is only better when the edge survives the extra friction, and you cannot know that until you have measured friction at the slower speed.
Decision 4: Where execution physically lives
This decision has three options and one constraint most guides skip.
Your own machine. Free, fully under your control, and the least reliable thing in the chain. Windows updates reboot it, the power goes, the Wi-Fi drops, the provider rotates your IP. For one entry and one exit a day, a home machine with a UPS and a wired connection is survivable if you are at the desk. For anything that must react mid-session, it is not.
A VPS. A rented virtual server, usually in or near Mumbai. A few thousand rupees a month at the small end buys a static IP and uptime you do not manage. The trade-off is that you now administer a server, and one you forget to patch or monitor is its own failure mode. Set up alerts that fire when your process has stopped, not only when it loses money.
A vendor-hosted engine. Someone else runs the execution layer and you configure strategies on top. Lowest operational burden, highest dependency: you inherit their uptime, their fill handling, their definition of a stop-loss, and their outages. Check what the vendor logs and whether you can export it. If you cannot get fill-level data out, you have outsourced decision 6 as well, which is a bad idea.
The authorisation constraint
Here is the part that turns this from preference into constraint. Broker API access for automated order placement in India is not a free-for-all. Brokers generally require you to register the application, and the regulatory framework that has developed around retail algo access brings in things like a static whitelisted IP address and an exchange-registered algo identifier attached to orders that come from an automated system. The practical consequences are immediate:
- A dynamic home IP address may simply not be allowed, which pushes you toward a VPS whether you wanted one or not.
- Your approval path differs depending on whether you wrote the strategy yourself or are running a vendor’s.
- Changing where your code runs is not just a deployment change. It can mean re-doing authorisation.
Check the current rules with your broker and with the regulator directly rather than with a forum post, because this area has moved repeatedly. The primary source is SEBI, and your broker will publish its own API terms. A plain-language summary of how India’s retail algo trading rules work in practice is a reasonable orientation before you talk to your broker, but treat the broker’s own document as the one that governs your account.
The ordering point: do not pick your execution location last. If authorisation forces you onto a static IP, that decision has a monthly cost, and that cost is part of whether your strategy is viable at your capital size. A strategy that makes Rs 4,000 a month and needs a Rs 2,000 VPS is not a strategy.
Decision 5: The data you will actually trust
Almost every disappointing live result traces back to this decision, and almost nobody makes it consciously.
Free and easy data in India means index OHLC. NIFTY and SENSEX minute candles: clean, available, cheap, and often adequate for a futures or directional system.
For an option-selling system, index candles are the wrong instrument. You can simulate “the index moved 80 points against me”. You cannot simulate what the option you sold was worth at that moment, because option prices are not a function of spot alone. They move with implied volatility, with time, and with the distance from your fixed strike. So a backtest of an option-selling idea built on index data answers a question you did not ask: what a spot-delta position would have done. You then read the result as if it described a premium position.
What real option-chain data shows that index data cannot
The clearest example is intraday premium behaviour. The folk model of expiry-day option selling is a smooth theta slide: premium decays steadily toward zero, so sit still and collect. Here is the mean path of the at-the-money straddle premium across those 163 expiry sessions, as a percentage of the 09:16 entry premium.
The premium does not slide to zero. It falls quickly in the first two hours, reaching about 88.6% of entry by 11:16, then chops sideways in an 88% to 93% band for the rest of the session. It is even higher at 15:16 than it was at 11:46.
The reason is mechanical. The strike is fixed at the 09:20 at-the-money level while spot keeps walking away from it, so the position nets time decay against gamma re-pricing as moneyness changes. It is not a pure theta curve, and a strategy built on the assumption that it is will sit through an afternoon where nothing is being earned. No amount of index OHLC would have told you that.
The cheap version of doing this right
You do not need years of tick data on day one. A workable progression:
- Record your own option-chain snapshots from your broker’s API, starting now, at whatever interval your strategy decides on. Thirty sessions of your own honest data beats a vendor file you do not understand.
- Use index data only where it is valid: range estimation, regime classification, direction research.
- When you do buy historical option data, spot-check a few days against your own recordings before trusting any of it.
- Store every live fill you ever get. That becomes your slippage dataset, and nobody can sell you a better one.
Decision 6: How you will know you are wrong
The last decision is the one almost always skipped, and it is the one that decides whether the previous five ever improve. You need a measurement plan written before you go live, because after you go live your judgement is compromised by having money on the line.
A measurement plan has three parts.
What you log
Per trade, at minimum: the signal timestamp, the order timestamp, the fill timestamp, the intended price, the actual fill price, the quantity, the exit reason in plain words, and the margin blocked at entry and at the worst point of the trade. Per session: the peak unrealised profit, the close, and the maximum adverse excursion. If you are not capturing peak unrealised profit, you cannot measure the thing that most often destroys premium sellers.
What you compare against
A live number alone means nothing. You need at least two comparisons. First, live fill versus backtest assumption, trade by trade, so you can see whether your slippage estimate was honest. Second, live result versus the backtest’s own distribution over the same number of days, so you can tell a normal bad patch from a broken edge.
For premium sellers there is a third comparison worth building in from day one, because the give-back numbers are stark. Across 159 usable sessions in that same desk study, a short at-the-money straddle entered at 09:20 gave back a median 42.8% of its peak profit by the close.
Peak-to-close give-back, short ATM straddle entered 09:20 (159 sessions)ValueMedian give-back as % of peak profit42.8%Mean give-back as % of peak (winsorized at 100%)50.0%Days giving back more than 30% of peak86 / 159 (54%)Days giving back more than 50% of peak78 / 159 (49%)Days where a positive peak closed as a loss48 / 159 (30%)
With those as the base rates, “did I capture my peak” is a more informative daily metric than “did I make money”. A system that closes flat after being well up is not having bad luck. It is leaving its edge on the table, and only a peak-versus-close log shows you that.
Your kill criteria
Write down, before the first live order, the numeric conditions under which you stop. Something like: if live slippage per trade exceeds twice my backtest assumption over 20 trades, I stop and re-measure. If live drawdown exceeds the worst backtest drawdown over a comparable window, I stop. If I have not logged fills for a week, I stop until logging is fixed. The reason to write these in advance is that the moment you need them is the moment you will least want to use them. A rule written while calm is the only one that works while losing.
What accidental defaults look like: a worked example
Consider a trader who never makes the six decisions explicitly. Each default is individually reasonable and jointly broken.
He picks index options, because that is what everyone discusses. Decision 1 made by crowd. He sells weekly straddles, because the win rate in the examples he saw looked high. Decision 2 made by comfort, not by understanding that give-back and margin are now his main problem. He uses a 09:20 entry and a Rs 3,000 per lot target, copied from a forum post. Decision 3 made by copying, and the fixed-rupee target now means he is aggressive on calm days and timid on stressed ones, as the VIX table showed. He backtests on free NIFTY minute candles, because option chain history costs money. Decision 5 made by budget, which means his test never measured premium at all. He runs it from his desktop, because a VPS seemed unnecessary. Decision 4 made by thrift, and he will discover the IP and authorisation constraints at the worst moment. And he judges it by the broker app’s end-of-day figure. Decision 6 not made.
What happens next is predictable. The first calm weeks look fine, because a 22-to-49% target on a short straddle hits often. Then a higher-volatility session arrives. The premium he sold was nearly double, so his position was effectively twice the size he intended at the same lot count. His stop, set in rupees, is now much closer in percentage terms to normal intraday noise, so it triggers on a move his backtest never flagged as dangerous. It could not have flagged it, because it was looking at the index, not at the option.
He concludes his strategy stopped working. It never worked. He measured something else, sized by accident, and had no logging that could tell the difference. Note what is not in that story: bad luck, a rogue platform, or a market that is unfair to retail. The stack failed on its own internal inconsistencies.
What the first 30 days should actually look like
Here is the honest version, and it is less exciting than a 90-day roadmap to profitability.
Paper trade first. Not as a formality, and not for three days. Run your system without real money for the full month, every session, logging everything you would log live. The purpose is not to prove the strategy works. Thirty sessions cannot prove that. The purpose is to find out whether your plumbing works, whether your logs capture what you need, and whether your slippage assumptions are anywhere near reality.
Constraints for the month: one strategy. One instrument. One decision frequency. No parameter changes mid-month. If you change three things and the result improves, you have learned nothing about which one mattered.
WeekFocusWhat success looks like1PlumbingThe process starts on schedule every day without you touching it, and the log file has one row per intended action2Fill realismYou can state your average slippage per leg in rupees, from your own data, not an estimate3Regime awarenessYou can classify each session by VIX band and see whether your results differ across bands4Peak-versus-closeYou know your median give-back from peak and whether your exit rule is actually capturing anything
Specific things to watch during the month, in order of how often they catch people out:
- Missed sessions. Count the days your system should have traded and did not. If it is more than zero, fix that before anything else. Reliability dominates cleverness.
- Signal-to-fill lag. If the gap between decision and fill widens through the month, something is wrong with your feed or your order path.
- Slippage versus assumption. Your own number, per leg, against what your backtest assumed. If the real figure is larger, your edge shrinks by that difference on every trade forever.
- Margin at the worst point, not at entry. Entry margin is what you planned for; the worst point is what actually caps your size. If you use a notional-exposure ratio as a stand-in, be clear it is a proxy and not live SPAN margin.
- Peak profit versus close, every day. Against a median give-back of 42.8%, this tells you whether your exit logic earns its keep.
- Your own behaviour. Note every time you wanted to override the system. Overriding costs nothing while on paper, which makes this the cheapest possible time to learn you have the urge.
At the end of 30 days you will not know whether your edge is real. You will know whether your system is capable of ever telling you. That is the real goal of month one.
Risk and positioning
Algo trading carries a real risk of losing money, including losing it faster than discretionary trading because automation removes the pause where you might have hesitated. Option selling in particular has a return shape that hides its risk behind a high win rate. Nothing in this article is investment advice, and no strategy described here is a recommendation. Tools such as EliteAlgo are analytical software, not investment advice, and are not a substitute for your own testing, your own risk limits, or where appropriate a conversation with a registered adviser. Trade your own money only with amounts you can afford to lose, and size on the worst case rather than the average one.
Frequently Asked Questions
How much money do I need to start algo trading in India?
It depends almost entirely on decision 1. Cash equity intraday can be started with small capital but offers thin edges. Index option selling requires margin per lot that varies with volatility and the exchange’s SPAN and exposure framework, and you should size for the worst-case margin during a trade, not the entry figure. The more useful question: what is the smallest capital at which my fixed monthly costs, including VPS and data, are a small fraction of my expected profit? If infrastructure eats a meaningful slice of your expected return, you are too small for that configuration yet.
Do I need to know Python to start algo trading in India?
Not to place automated orders, since vendor-hosted engines let you configure strategies without writing code. But you do need code or a spreadsheet discipline for decision 6, because the one thing no platform will do for you is build the measurement plan that proves your edge is real. If you cannot pull your own fills and compare them to your assumptions, you are flying on the vendor’s word. Learning enough Python to read a CSV and compute averages is a weekend and it pays for itself.
Is algo trading legal for retail traders in India?
Automated order placement by retail traders is permitted within the framework the regulator and the exchanges have set, which involves your broker’s API terms, registration of the automated system, and identifiers attached to algo orders. The rules here have been revised more than once, so verify the current position with your broker and with SEBI’s own circulars rather than a forum thread. Do not assume that because a platform offers a feature, your account is authorised to use it.
Can I backtest option selling using NIFTY spot data?
You can run the test, but it answers a different question. Index data tells you how spot moved. It does not tell you what the option you sold was worth at that moment, because option prices also depend on implied volatility, time remaining and distance from your fixed strike. The intraday premium table above, which chops sideways in an 88% to 93% band all afternoon instead of decaying smoothly, is the kind of behaviour that only shows up in real option-chain data. If your strategy sells premium, test it on premium.
Should I run my algo on my laptop or on a VPS?
Start on your own machine while paper trading, since you are only testing logic. Move to a VPS before any real money. First, uptime: a power cut or a forced reboot during a short option position is a risk event, not an inconvenience. Second, your broker may require a static whitelisted IP, which a typical home connection cannot reliably give you. Budget the monthly cost into your strategy’s viability at your capital size before you commit.
Which is better for a beginner, selling options or buying them?
Neither. They have mirror-image return shapes and mirror-image problems, so the real question is which problem you can manage. Selling gives a high win rate and a tail that can bite hard in one session, so your job is give-back control and margin discipline. Buying gives a low win rate and long losing stretches, so your job is surviving drawdown without abandoning a working system during a cold patch. Pick the failure mode you can live with, then build risk management around that specific enemy.
Conclusion: make the six decisions on paper first
The reason “how to start algo trading in India” guides disappoint is that they answer the easy half. Connecting to a broker API is a solved problem with good documentation. Building a system whose parts all assume the same world is not solved, and that is where the failures happen.
So before you install anything, write six lines on paper. The instrument and segment, and why. Whether you are selling premium or buying moves, and therefore which risk is your main enemy. How often you will decide, and whether your measured edge is several times your measured slippage at that speed. Where execution will run, and what the authorisation path costs monthly. What data you will trust, and whether it is the same instrument you intend to trade. And the exact numbers at which you will stop.
Those six lines take an hour and save a year. Everything else, the language, the platform, the indicator, is implementation, and implementation is easy to change later. The six decisions are the expensive ones, because by the time the cost shows up you have built everything else on top of them.