What a trading algorithm contains
Every algorithm, simple or complex, answers the same questions:
| Part | Question it answers | Example |
|---|---|---|
| Instrument | What does it trade? | Nifty weekly options |
| Entry | When does it open a position? | At 09:20, sell the at-the-money call and put |
| Size | How much? | 1 lot of 65 units |
| Exit | When does it close? | Stop loss 30% above each leg's price, or 15:15 |
| Risk limit | What 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
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.
Related terms
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.
