Algo & Systematic Trading

    Build algorithmic trading systems — Python for finance, backtesting frameworks, strategy types (trend vs mean-reversion), risk management, and broker API deployment in India.

    20 topics20 ready to read4h 43m total Beginner Intermediate Advanced

    Explore the topics

    20 of 20 topics
    Foundations
    01 Beginner

    What is Algorithmic Trading?

    Algorithmic trading is the practice of handing a written, unambiguous trading rulebook to a computer, so that the computer — not you — decides when an order is sent. It is a change in who executes, not a change in what works. The rulebook still has to have an edge; the machine only removes hesitation, delay and the small improvisations a human makes under pressure. That is genuinely valuable, and it is also the entire claim. A program cannot make a losing rulebook profitable, and it will lose money faster and more consistently than you would have managed by hand.

    13 min
    02 Beginner

    SEBI’s Retail Algo Trading Framework

    Algorithmic trading by retail investors in India is a regulated activity, not a grey area and not a loophole. SEBI sets the framework, the exchanges translate it into operational requirements, and your broker is the entity that actually gives you access and answers for what you send through it. This page explains the shape of that structure — who is responsible for what, and which questions you must answer before you deploy anything. It deliberately quotes no circular numbers, thresholds or dates, because that detail is amended regularly and the only correct version is the one on sebi.gov.in and your exchange's website today.

    12 min
    03 Beginner

    Systematic Trading Without Writing Code

    Systematic trading means every decision you take was written down before the market opened. Automated trading means a machine places the order. They are two different things, and only the first one is compulsory. A rulebook on a single sheet of paper, executed by hand on the NSE cash market, is systematic trading in full — the code, if it ever arrives, only changes who presses the button. Start here, because the problem that ruins most traders is not that they could not program the idea. It is that they did not have one written down.

    13 min
    04 Intermediate

    The Systematic Research Workflow

    A system and a hunch can look identical on a chart. What separates them is not the idea — it is the process that produced it. A hunch is an observation you went looking for evidence to support. A system is a hypothesis you wrote down first, tested once, and were willing to throw away. The difference shows up nowhere in the rules themselves and everywhere in the record behind them, which is why the research log matters more than any single result it contains.

    14 min
    Data & Tooling
    05 Intermediate

    Python for Trading — Getting Started

    Python is the language most systematic traders end up in, and the reason is unglamorous: it has the best free tools for holding a table of prices, doing arithmetic on it, and drawing it. That is nearly the whole job. What Python does not do is supply the idea, clean the data, or make you sit still through a losing run — and those, not the syntax, are the parts that take years. This page covers the small handful of libraries that matter, the one habit that separates working code from subtly broken code, and the four programs a beginner should write before ever writing a strategy.

    13 min
    06 Intermediate

    Market Data, Corporate Actions & Bias

    Every backtest in the rest of this module is a claim about history. If the history is wrong, the claim is worthless — and the failure is silent. Bad market data does not throw an error or produce an obviously broken chart. It produces a clean, plausible, entirely fictional result, and the tidier that result looks the less likely anyone is to go back and check the input. This topic covers the four ways an Indian equity or futures data set is usually wrong: unadjusted corporate actions, survivorship in the universe, look-ahead in the timing, and unstitched futures contracts. None of them is exotic. All four are present by default in most free sources.

    15 min
    07 Intermediate

    Broker APIs in India — How Access Works

    A broker API is a permissioned doorway into the same account you already log into by hand. It does not give your program a faster exchange, a private order book or a special queue. It gives it the ability to read prices and send orders without a human touching a screen — under an authentication scheme that expires, a rate limit you can exhaust, and an order state machine that will hand you outcomes your code has to be written to expect. Most of what goes wrong in a live system goes wrong in that plumbing, not in the strategy.

    14 min
    Strategy Design
    08 Intermediate

    Trend Following vs Mean Reversion

    Almost every systematic strategy is one of two bets wearing different clothes. Trend following buys strength and sells weakness, betting that what has moved will keep moving. Mean reversion sells strength and buys weakness, betting that what has stretched will come back. They are not two answers to the same question — they are opposite answers, and each one is at its most confident exactly where the other is bleeding. Choosing between them is not a question about which is better. It is a question about which way of being wrong you can live with.

    14 min
    09 Advanced

    Pairs Trading & Statistical Arbitrage

    Pairs trading takes two instruments whose prices have historically moved in a stable relationship, sells the one that has become expensive relative to the other, buys the other, and waits for the gap to close. The appeal is obvious: if both legs are equally exposed to the market, the direction of the NIFTY stops mattering and only the relationship does. The danger is equally obvious once stated plainly — the entire position is a bet that a gap which has widened will stop widening, and nothing in the arithmetic tells you when it will not.

    16 min
    10 Advanced

    Building Your First Backtesting Engine

    A backtesting engine has one job: to answer what would have happened if this rule had been running, using only the information that existed at each moment. Almost every part of building one is about enforcing that second clause, because the data on your disk contains the future and nothing stops your code from reading it. A backtest that is fast, elegant and twenty lines long is usually wrong — not because the arithmetic is wrong, but because it quietly used prices that had not happened yet.

    17 min
    11 Advanced

    Overfitting & Walk-Forward Validation

    Overfitting is what happens when a strategy learns the accidents of one stretch of price history instead of any behaviour that will repeat. It is not a rare failure mode reserved for careless people — it is the default outcome of building a system on data you can see, and it gets worse every time you change a setting and re-run. Walk-forward validation is the discipline that fights it: you fix rules on one block of history, score them only on a block you have never looked at, and repeat that honestly enough that the number you end up with was never optimised.

    15 min
    Measurement & Risk
    12 Intermediate

    Reading a Backtest Report

    A backtest report is a set of claims dressed as a set of facts. Every headline statistic on it — compound growth, maximum drawdown, Sharpe, trade count, exposure — is a summary that throws away far more than it keeps, and each one can be technically correct while being deeply misleading. This page is about the second half of that sentence: what each number actually measures, what it deliberately hides, and the specific question that makes a weak report admit what it is.

    14 min
    13 Advanced

    Risk Management for Algo Traders

    A discretionary trader's worst day is usually a bad market. An automated trader's worst day is usually a bad piece of software. When a human places orders, every order passes through a person who can notice that something looks wrong; when a program places them, nothing does — a loop that misreads a fill can send a thousand orders while you are still reading the first alert. Risk management for a systematic book therefore has three layers, not one: the market risk you signed up for, the execution risk you inherit from the venue, and the operational risk you built yourself. Only the first of those appears in a backtest.

    14 min
    14 Advanced

    Position Sizing & Portfolio Construction

    Two systematic traders can run the identical rulebook on the identical instruments and end up in completely different places, because sizing — not signal generation — is where most of the variation in a book's behaviour comes from. Position sizing answers one question per trade: how many units, given the distance to the point where this idea is wrong. Portfolio construction answers the harder question above it: how much of the account each strategy gets, and whether the positions that are open right now are genuinely separate bets or one bet wearing several names.

    14 min
    15 Intermediate

    Costs, Slippage & Taxation

    A discretionary trader pays costs. A systematic trader pays costs repeatedly, mechanically, and at a frequency they chose without usually pricing that choice. That is the whole difference. The rate card is roughly the same for everyone; what separates a strategy that survives contact with the market from one that quietly bleeds is how many times a year it pays that card. This page names every line in the Indian cost stack, shows how the total scales with turnover, treats slippage and impact as the real costs they are, and then maps how a systematic trader's income gets classified — without quoting a single rate, because rates change and this page does not.

    14 min
    Execution & Operations
    16 Intermediate

    Order Types & Execution Quality

    A backtest is a sequence of claims about prices you could have got. Every one of those claims is an order-type decision in disguise. Choose a market order and you have claimed a fill at an unknown price; choose a limit and you have claimed a price but not a fill. Most retail systems never make the choice explicitly — they inherit whatever the first tutorial used, then measure the strategy as though execution were free and instantaneous. This page covers the four order types available on NSE and BSE, exactly which assumption each one forces your backtest to make, why the signal-bar close is a price the live market never promised you, and how to measure your own execution against a benchmark instead of by feel.

    13 min
    17 Advanced

    From Backtest to Live Trading

    A backtest that passes is not a strategy that works. It is a strategy that has not yet met the two things a historical simulation cannot contain: a real order queue and your own behaviour. The distance between a passing report and live capital is covered in stages, each of which answers exactly one question and is blind to the next — and the only honest way through is to refuse to skip one. This page is about that path: what paper trading proves, why forward testing on small real size is unskippable, how to reconcile live fills against what the backtest assumed, and why scaling size is a separate decision that proves nothing about the strategy at all.

    14 min
    18 Advanced

    Infrastructure, Monitoring & Kill Switch

    A strategy is the part everyone wants to talk about. The part that decides whether you survive is the layer underneath it: the machine it runs on, the signals it reports about itself, the log that lets you reconstruct any decision months later, the alert that reaches you when you are nowhere near a screen, and the switch that stops everything. None of that is glamorous and none of it improves a single trade. It exists for the session where the feed stalls at 09:34, or the position tracker and the broker disagree, or a rule you wrote at midnight starts sending orders you did not intend — and on that day the operational layer is the entire difference between an incident and a disaster.

    15 min
    19 Advanced

    Strategy Decay & When to Switch Off

    Every systematic edge has a shelf life, and none of them announces the expiry date. The code keeps running, the orders keep going to the exchange, the logs stay clean — and the results quietly get worse. The hard problem is not accepting that this happens. It is telling the difference between a bad run your own validated history already predicted and a real deterioration that will not come back, using a rule you wrote before you had any money at stake. Get that rule wrong in one direction and you abandon a working system at its worst moment. Get it wrong in the other and you keep feeding a dead one.

    14 min
    20 Advanced

    Machine Learning in Trading — A Reality Check

    Machine learning is a method for finding structure in features you chose, mapped to a label you defined. That is the whole of it. It is not a price oracle, it does not read charts, and it has no view on anything you did not put in the columns. Most retail machine-learning trading fails long before the model is fitted — not because the algorithm was weak, but because the problem was framed in a way that could not have worked: a label nobody thought about, features that quietly knew the future, a validation scheme borrowed from a domain where the rows are interchangeable, and costs left out of the arithmetic. This closing topic is about that framing, because the framing is where the outcome is decided.

    15 min
    Your privacy, your choice

    Essential storage keeps sign-in and preferences working. Optional analytics helps improve the website. Read our Privacy Policy.

    Privacy settings

    Essential sign-in storage and your saved preferences stay enabled. Analytics is optional, and you can change your choice anytime.

    Turning analytics off clears our analytics cookies and local assistant metrics. The page reloads to stop a previously loaded analytics service. Your account and learning progress stay saved.

    Read the Privacy Policy