Strategies

What is Algorithmic Trading?

Reviewed by Karthikeyan Anbarasan (Founder, TradeLyser) · Updated 19 Oct 2026 · Editorial policy

DefinitionAlgorithmic trading is trading where software applies written rules to decide entries, exits and size, and sends the orders to the broker without a manual click for each one. An illustrative algo might buy one Nifty futures lot when price breaks the 9:15 to 9:30 range, risk 40 points (₹2,600 on a lot of 65) and exit at 15:15. In India, retail algos run through broker APIs under SEBI’s retail algo framework.

How an algo trade runs

An algorithm is a strategy written precisely enough for a computer to follow. The logic is the same as a manual trading plan; what changes is that every condition has to be exact. "Buy strength near the open" is not a rule a program can follow. "Buy one lot when a 1-minute candle closes above the 9:15 to 9:30 high, before 10:30" is.

  1. Data: the program reads live prices, usually from the broker’s market data feed.
  2. Signal: it checks the entry conditions on each new bar or tick.
  3. Size: it works out quantity from the stop distance and the rupee risk allowed per trade.
  4. Risk checks: it confirms the daily loss limit, maximum open positions and order count are not breached.
  5. Order: it sends the order through the broker’s API and places the stop and exit orders.
  6. Log: it records every signal, order, fill and rejection, so live results can be checked against the rules.

Worked example: a rules-based Nifty futures algo

Illustrative rules: after the 15-minute opening range forms, go long one Nifty futures lot above its high or short below its low, with the stop 40 points away, a target of 2R and a time exit at 15:15. One lot of 65 (check the current NSE circular) means 1R = 40 × 65 = ₹2,600. A backtest over 150 trades, with charges included, shows +0.30R a trade, which is ₹780 a trade or ₹1,17,000 in total.

The first 40 live trades come in at +0.12R, or ₹312 a trade and ₹12,480 in total. The fills explain most of the gap: live entries average 6 points worse than the backtest’s trigger prices, which is 6 × 65 = ₹390, or 0.15R a trade. The next step is to add that slippage to the backtest and see whether the edge is still worth running, not to tweak the entry rules.

Backtest, 150 trades
+0.30R
Live, first 40 trades
+0.12R
Extra slippage per trade
₹390 (0.15R)
1R on one lot
₹2,600
+0.4R0RTrade 20Trade 120Edge gone: review the setup
Figure 1. Illustrative rolling 20-trade expectancy of a live strategy, from trade 20 to trade 120. It starts near +0.4R, fades steadily and slips below zero after about trade 110. An algo keeps trading the same rules after the edge has gone, so this check has to be scheduled.

Retail algo trading in India

SEBI’s retail algo framework
SEBI’s framework for retail algo trading, issued in 2025 and phased in by exchanges and brokers, makes the broker responsible for algo orders sent through its APIs. Algo orders carry an exchange-issued identifier, strategies sold by third-party algo providers go through exchange empanelment, API access is tightened (for example with registered static IPs), and algos above a set orders-per-second threshold must be registered with the exchange. Thresholds and timelines have been revised, so check the current SEBI circular and your broker’s notice before running an algo.
RouteWhat it isWhat to check
Your own code on a broker APIYou write and run the strategy; the broker routes the ordersAPI terms, order rate limits, static IP and registration rules
Broker or platform strategy builderRules set up in a no-code tool and run by the platformWhich conditions it supports and how it handles failed orders
Third-party algo providerA ready-made strategy offered through your brokerWhether the provider is empanelled with the exchange, and what the strategy actually does

Running and reviewing an algo

  • Give every version a tag, such as ORB-algo v1.2, and change the tag whenever a rule or parameter changes. Mixing versions makes the statistics meaningless.
  • Journal the gap between signal price and fill price for every trade; it is the number backtests most often understate.
  • Paper trade or run one lot first, and compare at least 30 live trades with the backtest before adding size.
  • Keep a hard daily loss limit and maximum order count in the code, plus a manual way to flatten everything.
  • Review rejections and partial fills weekly. Silent failures, such as a stop order that was never placed, matter more than the strategy logic.

Algorithmic trading

Automates a strategy’s rules. Holding times range from minutes to weeks, and speed is rarely the edge.
Retail access: broker APIs

High-frequency trading

A subset of algo trading that relies on very fast order placement and cancellation, often from co-located servers at the exchange.
Not something retail APIs are built for

Reference guide

ContextValueReading
Rules written, backtested with costs, then run small liveSound processCompare live expectancy with the backtest every 20 to 30 trades
Parameters changed every week after lossesCurve fitting liveEach change is a new strategy; give it a new version tag and judge it separately
Algo left running with no loss limit or kill switchUnbounded riskA bug or a bad fill loop can place far more orders than intended; cap orders and daily loss in code

Questions

Is algo trading legal for retail traders in India?

Yes, through brokers under SEBI’s retail algo framework. Orders go through the broker’s API, carry an algo identifier, and some algos need exchange registration. Check the current SEBI circular and your broker’s rules for the details.

Do I need to know coding for algorithmic trading?

Not always. Some brokers and platforms offer rule builders, and exchange-empanelled providers offer ready strategies. Writing your own code gives more control but also makes you responsible for bugs and failed orders.

Is algorithmic trading profitable?

An algo is only as good as the strategy it runs. Automation removes hesitation and missed entries, but it does not create an edge, and live results are usually below the backtest once slippage and charges are counted.

How do I test an algo before going live?

Backtest it with realistic charges and slippage, test it on data it was not tuned on, then paper trade or run the smallest size. Compare at least 30 live trades with the backtest before adding size.

What is the difference between algo trading and HFT?

Algo trading means the rules are executed by software at any speed. HFT is the fastest end of it, where profits come from very short holding times and fast order handling, usually with exchange co-location.

Related terms