What is Algorithmic Trading?
Reviewed by Karthikeyan Anbarasan (Founder, TradeLyser) · Updated 19 Oct 2026 · Editorial policy
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.
- Data: the program reads live prices, usually from the broker’s market data feed.
- Signal: it checks the entry conditions on each new bar or tick.
- Size: it works out quantity from the stop distance and the rupee risk allowed per trade.
- Risk checks: it confirms the daily loss limit, maximum open positions and order count are not breached.
- Order: it sends the order through the broker’s API and places the stop and exit orders.
- 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.
Retail algo trading in India
| Route | What it is | What to check |
|---|---|---|
| Your own code on a broker API | You write and run the strategy; the broker routes the orders | API terms, order rate limits, static IP and registration rules |
| Broker or platform strategy builder | Rules set up in a no-code tool and run by the platform | Which conditions it supports and how it handles failed orders |
| Third-party algo provider | A ready-made strategy offered through your broker | Whether 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
High-frequency trading
Reference guide
| Context | Value | Reading |
|---|---|---|
| Rules written, backtested with costs, then run small live | Sound process | Compare live expectancy with the backtest every 20 to 30 trades |
| Parameters changed every week after losses | Curve fitting live | Each change is a new strategy; give it a new version tag and judge it separately |
| Algo left running with no loss limit or kill switch | Unbounded risk | A 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.