Skip to content

    What Is Algo Trading in India? SEBI 2025 Rules and a Real Nifty Example

    Quick answer

    Algo trading explained for Indian traders with SEBI's 2025 retail framework, a worked Nifty crossover example in rupees, and how F&O profits are taxed.

    19 June 2026
    17 min read
    3,394 words

    Key Takeaways

    • 1.Algo trading means a computer places, modifies and cancels your orders automatically using rules you define in advance, removing the manual click from execution.
    • 2.SEBI's retail algo framework, finalised in 2025, lets ordinary retail traders use algos through their broker's exchange-approved APIs, but every algo above a low order frequency must be registered and tagged with a unique exchange ID.
    • 3.Brokers are now the principals responsible for your algo. Third party algo providers must empanel with the broker, and any algo crossing the static or dynamic order-per-second threshold needs exchange approval before it can run.
    • 4.A real Nifty 5-day and 20-day moving average crossover with a 75-lot Nifty future shows exactly how rules translate into rupees, including STT, brokerage and GST.
    • 5.F&O algo profits are taxed as business income at your slab rate, not as capital gains, so the 20 percent STCG and 12.5 percent LTCG rules do not apply to your futures and options trades.

    What Algo Trading Actually Means in Plain Terms

    Algorithmic trading, usually shortened to algo trading, is the practice of letting a computer program send your buy and sell orders to the exchange according to rules you fix in advance. Instead of you watching a chart and clicking buy when the Nifty crosses a level, you write the condition once, for example buy one lot of the Nifty current-month future when the 5-day moving average rises above the 20-day moving average, and the software does the watching and the clicking for you. The rule can include the entry trigger, the position size, the stop loss, the target and the exit time.

    The important thing to understand is that an algo does not predict the market. It simply executes a decision you have already made, without hesitation, without emotion and faster than any human hand. A good algo turns a tested edge into consistent execution. A bad algo turns a bad idea into consistent losses, just faster. In Indian markets the orders still route through the same NSE and BSE matching engines, settle through the same clearing corporations and attract the same taxes as a manual trade. The only thing that changes is who presses the button.

    Algo trading sits on a spectrum. At the simple end is a basic conditional order or a no-code strategy builder. In the middle are scripted strategies that a retail trader runs through a broker API in Python or through a platform like a strategy builder. At the far end is institutional high frequency trading that competes on microseconds and co-located servers. The SEBI rules described below were written precisely because retail participation has moved well past the simple end.

    SEBI's 2025 Retail Algo Trading Framework, Explained

    For years retail algo trading lived in a grey zone. Many traders ran unregulated third party bots through broker login credentials, with no oversight and no accountability if something broke. SEBI closed that gap. In its circular dated 4 February 2025, titled the safer participation of retail investors in algorithmic trading, SEBI created a formal framework, and the exchanges, NSE and BSE, followed with detailed operational guidelines through 2025. The framework was rolled out in phases so brokers and vendors could build the plumbing.

    The core idea is accountability through the broker. The stockbroker is now the principal who is responsible to the investor for every algo order, even if the strategy logic came from an outside vendor. Brokers must obtain approval from the exchange for the algos they offer, and every algo order carries a unique algo identifier assigned by the exchange so that orders can be traced back to a specific registered strategy. Unregistered, untagged automation through shared credentials is no longer permitted.

    • Two speed buckets. Algos are split by order frequency. A retail self-developed algo running below a threshold of orders per second is treated lightly, while anything above the threshold must be registered with the exchange and tagged.
    • Broker as principal. Your broker takes responsibility for algos provided to clients and must run them through exchange-approved, API-based access with proper authentication.
    • Vendor empanelment. Third party algo providers and platform vendors must empanel with the broker. They cannot deal with you directly behind the broker's back.
    • Unique algo ID tagging. Every order generated by an algo above the frequency threshold is stamped with a unique exchange identifier for surveillance and audit.
    • API security. Access is through secured APIs with static IP whitelisting and OAuth-style authentication, not by handing your password to a bot.
    • Self-developed retail algos. A retail investor who codes their own strategy can still use it, but above a defined order-per-second limit it must be registered through the broker with the exchange.

    What does this mean for you in practice? If you run a slow strategy that fires a handful of orders a day, such as a daily moving average crossover, you are in the light-touch bucket and can use your broker's official API or strategy tools with minimal friction. If you build something fast that machine-guns orders, you fall into the registered bucket and your broker must get it approved and tagged before it goes live. The days of buying a mystery bot off a Telegram channel and feeding it your Zerodha or Upstox password are over.

    Tip

    Before you sign up with any algo vendor in 2026, ask one question: are you empanelled with my broker and is this algo registered and tagged with the exchange? If the answer is vague, walk away. Under the SEBI framework, an unregistered algo using your credentials puts both your money and your account in jeopardy.

    A Real Worked Example: Nifty 5-20 Moving Average Crossover

    Let us replace the vague textbook example with real Indian numbers. We will run a classic 5-day and 20-day simple moving average crossover on the Nifty current-month future. The rule is simple. When the 5-day moving average crosses above the 20-day moving average, the algo buys one lot of the Nifty future. When the 5-day crosses back below the 20-day, it sells and squares off. The Nifty F&O lot size is 65. All figures below are illustrative and use realistic 2026 levels. Markets move, so treat these as a worked method, not a promise of profit.

    Assume the algo computes the averages on the daily close. On the entry day the 5-day average is 23,180 and the 20-day average is 23,120, so the fast line has just crossed above the slow line. The algo buys one lot of the Nifty future at a fill price of 23,200. The notional value of that one contract is 23,200 multiplied by 75, which is 17,40,000 rupees. You do not pay the full notional. You post SPAN plus exposure margin, which for one Nifty future is roughly 1.2 to 1.5 lakh rupees depending on volatility. Eleven trading days later the 5-day average crosses back below the 20-day average, and the algo exits at 23,560.

    The gross move is 23,560 minus 23,200, which is 360 points. Multiplied by the lot size of 65, the gross profit is 27,000 rupees on one lot. Now we subtract the real costs, because an algo that ignores costs is lying to you about its edge.

    Cost componentHow it is chargedAmount (illustrative)
    Gross profit360 points x 65 lot size+23,400.00
    BrokerageFlat 20 rupees per order, 2 orders (buy and sell)-40.00
    STT on futures sell0.05 percent on sell turnover of 23,560 x 65 = 15,31,400-765.70
    Exchange transaction chargesAround 0.0019 percent on both legs of turnover-57.75
    GST18 percent on brokerage plus transaction charges (40 + 57.75)-17.60
    SEBI plus stamp dutySEBI fee plus 0.002 percent stamp on buy turnover-33.20
    Net profit before taxAfter all charges+22,485.75

    So the headline gross of 27,000 rupees becomes roughly 26,485 rupees net of charges on one lot. Charges ate about 515 rupees, or roughly 1.9 percent of the gross. That is the discipline an algo forces on you. Notice that STT on futures is charged only on the sell side at 0.02 percent, which is why the single largest cost here is the 353 rupee STT, not the brokerage. If your strategy traded ten lots instead of one, every number above multiplies by ten, and so does the margin you must keep aside.

    Tip

    Run this same arithmetic on a strategy that takes thirty trades a month instead of one. At roughly 500 rupees of friction per round trip on a single Nifty lot, thirty round trips is around 15,000 rupees of costs you must overcome before you make a single rupee. High-frequency algos die on costs, not on bad signals. Always backtest with real charges baked in.

    Why the Same Strategy on an Option Behaves Differently

    Many retail algos do not trade the future at all. They trade weekly options, because the capital required is smaller and the moves are sharper. Suppose instead of buying the Nifty future your algo buys one lot of a weekly Nifty 23,200 call at a premium of 110 rupees when the crossover fires. The lot size is still 75, so the cost of one option lot is 110 multiplied by 75, which is 8,250 rupees, plus charges. That is your maximum loss as a buyer, which is the appeal of the structure.

    If the same 360-point favourable move plays out and the call premium rises to, say, 280 rupees by the exit, the gross gain is 280 minus 110, which is 170 points, times 75, equals 12,750 rupees on one lot. The premium did not move one for one with the index, because an option's value also depends on time decay and volatility. This is exactly why an algo trading options needs more than a price crossover. It needs to account for theta, the daily premium decay that accelerates into Nifty's weekly Tuesday expiry, otherwise a correct directional call can still lose money if it is held too long near expiry.

    • Nifty weekly options expire on Tuesday, and the monthly contract on the last Tuesday, so a weekly options algo must know exactly how many days of theta remain.
    • Bank Nifty and other weekly expiries were rationalised by SEBI to limit each exchange to one weekly expiry, so always confirm the live expiry calendar before deploying.
    • STT on options is charged at 0.1 percent on the sell-side premium, and crucially, if an in-the-money option is allowed to expire and gets exercised, STT is charged on the full settlement value, which can wipe out a thin profit.
    • An options algo must square off in-the-money long options before expiry unless you genuinely want physical-style settlement and the heavy STT that comes with it.

    How Algo Profits Are Taxed in India

    This is where many algo traders make expensive mistakes. Profits from futures and options are treated as business income in India, not as capital gains. That means your F&O algo profit is added to your other income and taxed at your applicable slab rate, and the 20 percent short-term capital gains rate and the 12.5 percent long-term capital gains rate simply do not apply to F&O. The 26,485 rupee net profit from the future example above is business income.

    If your algo instead trades the cash, or delivery, segment of equities, then capital gains rules do apply. A delivery position held for up to twelve months and sold for a profit attracts short-term capital gains tax at 20 percent. A delivery position held for more than twelve months attracts long-term capital gains tax at 12.5 percent, and the first 1.25 lakh rupees of long-term gains in a financial year is exempt. So the tax treatment of the very same crossover strategy depends entirely on whether your algo trades futures, options or delivery equity.

    What the algo tradesTax headRate
    Nifty or stock futuresBusiness incomeYour income tax slab rate
    Index or stock optionsBusiness incomeYour income tax slab rate
    Delivery equity held up to 12 monthsShort-term capital gains20 percent
    Delivery equity held over 12 monthsLong-term capital gains12.5 percent on gains above 1.25 lakh
    Intraday equity (no delivery)Speculative business incomeYour income tax slab rate

    Because F&O is business income, an active algo trader can usually claim genuine expenses against that income, such as data feed charges, broker API fees, server or VPS costs and a reasonable share of internet and electricity, subject to proper books. High turnover may also trigger a tax audit requirement, so an active algo trader should keep clean records and speak to a chartered accountant. None of this is tax advice. Confirm the current year's rules with a qualified professional before filing.

    Building and Backtesting a Strategy Without Fooling Yourself

    A trustworthy algo starts as a clearly written rule, not a vague feeling. Define the exact entry condition, the exit condition, the stop loss, the position size and the time window. Then test it against years of historical data, a process called backtesting. The single most common failure is curve fitting, also called over-optimisation, where you keep tweaking parameters until the strategy looks perfect on past data. Such a strategy memorised the past, it did not learn anything that survives into the future.

    Protect yourself by splitting your data. Develop the strategy on one period, then test it untouched on a later out-of-sample period it has never seen. If performance collapses out of sample, the edge was an illusion. Always include realistic charges, slippage and the actual lot size in the backtest, because as the worked example showed, costs change the picture materially. A strategy that looks profitable on raw prices can be a guaranteed loser once 500 rupees of round-trip friction per Nifty lot is included.

    • Write the rules in full before you touch code, so there is no room to improvise mid-trade.
    • Backtest across at least one bull phase, one bear phase and one sideways phase, because Indian markets do all three.
    • Keep parameters few. Two or three is robust, ten is curve fitting.
    • Always model slippage, the gap between the price you wanted and the price you got, especially around the Nifty open and around expiry.
    • Forward test the algo on paper or with a single lot of real money before scaling up size.

    Risk Management Built Into the Algo

    An algo with no risk controls is a machine that can lose money at the speed of light. The most important safety features are coded into the strategy itself. A hard stop loss on every position caps the loss per trade. A maximum daily loss limit, after which the algo stops trading for the day, prevents one bad session from becoming a disaster. Position sizing rules ensure a single Nifty lot is never so large that one stop-out hurts the account badly.

    Operational risk matters as much as market risk. A dropped internet connection, a frozen broker API, a power cut or a software bug can leave an open position unmanaged. Serious algo traders run on a reliable virtual private server, build automatic reconnection logic, and have a manual kill switch and broker phone number ready so they can square off by hand if the system fails. Under the SEBI framework the broker carries responsibility for the algo's behaviour, but the open position and the loss are still yours, so never assume the system will babysit itself.

    Tip

    Code a master kill switch that flattens every position and cancels every pending order with one command. The day your algo misbehaves, you will not have time to debug. You will only have time to stop the bleeding. Test that kill switch regularly, the same way you test a fire alarm.

    Choosing a Platform and API Under the New Rules

    Under the 2025 framework, the safe path is to use your broker's official, exchange-approved API or its in-house strategy builder, not a random external bot. Indian brokers offer a range of options, from no-code strategy builders aimed at beginners to full programmatic APIs aimed at coders. The right choice depends on whether you can write code, how fast your strategy needs to be, and whether the platform supports proper backtesting with real charges.

    Platform typeBest forKey point
    Broker no-code strategy builderBeginners, slow strategiesBuild crossover rules visually, no programming, runs within the light-touch bucket
    Broker programmatic APICoders running Python strategiesFull control, but you must respect order-per-second limits and registration above the threshold
    Empanelled third party platformTraders wanting pre-built strategiesMust be empanelled with your broker and the algo must be registered and tagged

    Whatever you choose, confirm three things. First, that access is through a secured, authenticated API and not through your raw login password. Second, that any algo above the frequency threshold is registered with the exchange and carries a unique tag. Third, that the platform's backtest engine lets you include brokerage, STT and slippage, because a backtest without costs is marketing, not analysis.

    Common Mistakes That Drain Algo Accounts

    • Ignoring costs in the backtest, then watching a profitable-looking strategy bleed out on STT and brokerage in live trading.
    • Curve fitting the strategy to past data so heavily that it falls apart on the first new market it meets.
    • Running a fast, high-frequency algo without registering it, which now breaches the SEBI framework and risks the account.
    • Holding in-the-money options into Nifty's Tuesday expiry and getting hit with STT on the full settlement value.
    • Treating F&O profit as capital gains at tax time, when it is business income at slab rate, leading to a wrong and risky return.
    • Having no kill switch, no daily loss limit and no backup plan for when the internet or the API drops mid-position.

    Sources and Further Reading

    For authoritative data and the current rules, refer to SEBI (Securities and Exchange Board of India) for the 2025 retail algo framework circular, NSE India for contract specifications, lot sizes and expiry calendars, and Zerodha Varsity for tutorials. Tax rates, STT, lot sizes and SEBI rules change. Always confirm the current numbers on the official source and consult a qualified professional before you trade. The numbers in this guide are illustrative and are not a promise of returns.

    Sources and Further Reading

    For authoritative data and further reading on this topic, refer to SEBI (Securities and Exchange Board of India), NSE India and Zerodha Varsity. Always confirm current rules, rates and contract specifications on the official source before you trade.

    Related Topics

    Algo TradingIndian MarketsNSEBSESEBIAlgorithmic TradingTrading Strategies

    Related Articles

    OneTradeJournal

    The trading journal built for Indian F&O traders. Track your trades, spot patterns, build discipline.

    • Log one trade a day by hand, on purpose
    • AI mentor finds your repeat mistakes
    • Behavioural analytics catch tilt early
    • Trading calendar with P&L heatmap
    • Pre-trade checklist flags risks
    Start journaling

    Yearly ₹2,499 · No broker credentials