Free trial
Menu
Glossary

What Is a Trading Algorithm?

A trading algorithm is a set of exact rules that decides when to buy or sell, how much and when to exit, carried out by software instead of by hand.

QuantPower Research · Updated 3 Nov 2026 · 2 min read

What a trading algorithm contains

Every algorithm, simple or complex, answers the same questions:

PartQuestion it answersExample
InstrumentWhat does it trade?Nifty weekly options
EntryWhen does it open a position?At 09:20, sell the at-the-money call and put
SizeHow much?1 lot of 65 units
ExitWhen does it close?Stop loss 30% above each leg's price, or 15:15
Risk limitWhat stops it for the day?Daily loss limit of ₹8,000

If any part depends on judgement ("exit if it looks weak"), it is not yet an algorithm. Rules must be exact enough for a computer to follow the same way every time.

An example

Example
A Nifty short straddle algorithm sells the 25,000 call at ₹280.50 and the 25,000 put at ₹227.10 at 09:20, with Nifty at 25,000. It places a stop loss on each leg 30% above its entry price and exits whatever is left at 15:15. The rules run identically every day, whatever the trader feels about the market.

Trading algorithms in India

Since 1 April 2026, SEBI's framework for retail algorithmic trading applies in full to all brokers:

  • Orders go through a registered broker, and algo orders carry an exchange-assigned Algo ID.
  • White-box algos disclose their logic. Black-box algos keep it hidden, and their providers need SEBI registration as research analysts.
  • Order rate: traders whose own code sends more than 10 orders per second must register their algo through the broker.

Our guide to SEBI's algo trading rules covers the framework.

Algorithms without code

Most retail algorithms do not need programming. A no-code strategy builder turns rules like the straddle above into settings: legs, times, stops and exits. Our guide to no-code strategy design shows how to write rules a builder can run.

Why traders use algorithms

  • Consistency: the same rules every time, without hesitation.
  • Speed: orders go out the moment a condition is met.
  • Testing: exact rules can be backtested on past data and paper traded before risking money.

Algorithms also bring risks: a wrong setting repeats itself on every trade, and fast markets can fill exits far from the planned price. Our guide to algorithmic trading risks covers them.

Learn more

Frequently asked questions

Is algo trading legal in India?

Yes, through SEBI-registered brokers and within SEBI's framework for retail algorithmic trading.

Do I need to know programming?

No. Strategy builders let you set rules without code. Programming helps if you want custom logic beyond what a builder offers.

Is a trading algorithm the same as a trading bot?

A bot is software that runs an algorithm. The algorithm is the rules; the bot carries them out.

Trading involves substantial risk. Examples on this page are hypothetical and are not investment advice.