Skip to content

TERMINAL ZERO · SYSTEMATIC DERIVATIVES, EXPLAINED

MARKETS. SYSTEMS. TESTING. RISK. SIZING. DEPLOYING. 

Six words, in the order the work actually happens. Systematic trading, explained from first principles. This is a teaching site, not a pitch: what a rule actually is, how an order really reaches an exchange, how size is decided, and the vocabulary a systematic trader uses to describe risk. No performance claims, no mystique — just the mechanics.

  • RULES, NOT OPINIONS
  • RISK BEFORE RETURN
  • EXECUTED BY API

Illustrative feed · generated client-side · not live market data

NIFTY 504,825.88 1.24%
BANKNIFTY19,851.33 0.57%
FINNIFTY10,738.59 0.48%
MIDCPNIFTY13,037.50 0.19%
RELIANCE13,456.12 0.17%
HDFCBANK16,253.05 1.24%
INFY11,323.09 0.42%
TCS5,260.02 1.19%
ICICIBANK13,965.21 1.71%
SBIN15,543.54 1.66%
AXISBANK5,180.13 1.16%
LT11,248.61 0.84%
ITC10,283.86 0.93%
MARUTI17,839.55 1.24%
TATASTEEL3,338.54 0.70%
INDIA VIX4,777.32 0.98%
01 · FIRST PRINCIPLES

What quant trading actually is

Three sentences, each one built only from the one before it. Nothing here requires you to believe anything about markets yet.

01

A rule is a decision written down so precisely a computer can execute it with no human judgement.

Not “buy when it looks strong” — that is a feeling. A rule names the instrument, the exact condition, the size, and the exit, in terms a machine can evaluate the same way at 09:16 and at 15:20.

02

A strategy is a set of rules with a defined edge — a reason it should make money more often than not.

The edge has to be a claim about the world: options decay, ranges that break tend to continue, related contracts converge. If you cannot state why it should work, you have a pattern, not an edge.

03

Quant / systematic trading is running those strategies mechanically, at scale, with statistics deciding when to trade — not emotion or opinion.

Any single trade is close to noise. The point is the thousandth repetition: a small, positive expectancy applied identically, often enough for the distribution — rather than your mood — to show up in the equity curve.

The whole loop, in four moves

  1. Dataprices, quotes, volume
  2. Rulea written condition
  3. Signalcondition is true
  4. Ordersent to the exchange

Everything else on this page — the Greeks, the sizing, the infrastructure — is detail hung on those four boxes.

02 · TWO WAYS TO DECIDE

Discretionary and systematic

Two honest ways to trade the same market. Systematic isn't better — it's different, and the difference is that you can measure it.

Discretionary

A human reads the chart, decides, and clicks.

Systematic

Rules read the data, decide, and an API clicks.

  • Consistency

    Depends on the day. The same setup can be taken twice and skipped once.

    Identical by construction. The same input produces the same action, always.

  • Emotion

    Present, and strongest exactly when it costs most — after a loss, or a run of wins.

    Removed from execution, but not from the human. It relocates to whether you leave the system running.

  • Speed

    Human reaction time: seconds at best, and only one screen at a time.

    Milliseconds, on every instrument you subscribe to, simultaneously.

  • Scalability

    Bounded by attention. Ten positions across three expiries is already a lot.

    Bounded by capital, liquidity and margin — not by how many charts you can watch.

  • Backtestability

    Hard to test honestly: the rules live partly in the trader's head and change with hindsight.

    Testable by definition, which is also the trap — a rule can be tuned until history flatters it.

A skilled discretionary trader can do things no rule set can: read a situation that has never happened before. A system can do one thing no human can: repeat itself ten thousand times without getting bored, scared, or clever. Pick the one whose failure mode you can live with.

03 · EXECUTION

Anatomy of a trade

A trade is not a moment. It is a pipeline: five stages that a machine walks in order, thousands of times, without ever wondering whether today feels different.

  1. 01 · Data — Every decision starts as a number.

    Prices, quotes and volumes arrive as a continuous stream of ticks. A systematic strategy consumes that stream and nothing else — no headlines, no gut feel. Before a rule can fire, the data has to be clean, timestamped, and shaped identically every single day.

    Bad data doesn't produce a bad trade. It produces a confident one.

  2. 02 · Signal — A rule fires when a condition is met.

    A signal is a comparison that evaluates to true — a level breaks, an indicator crosses, a spread strays from fair value. It carries no opinion and no hesitation. The same input always produces the same output, which is precisely what makes it testable.

    If you can't write the condition down, it isn't a rule yet.

  3. 03 · Risk check — The gate every order has to pass.

    Before anything leaves the machine it asks three questions: how many lots does this size to, does it breach exposure limits, and is there margin to hold it? A failed check isn't a delayed trade — it's no trade. Sizing for survival happens here, not afterwards.

    Position sizing is where most of the outcome is actually decided.

  4. 04 · Execution — Routed by API, filled on the book.

    The order goes to the broker's API and rests or crosses on the exchange's order book. What comes back is a fill — sometimes partial, often a shade worse than the price that triggered it. That gap is slippage, and it is a real, recurring cost of the edge.

    The price you signalled at is not the price you own.

  5. 05 · Monitor & exit — The trade isn't over once it's on.

    P&L is marked continuously, stop and target logic runs on every tick, and positions are reconciled against what the broker actually holds. A kill switch stands ready to flatten everything if the market — or the machine — misbehaves.

    Exits and reconciliation are the unglamorous half that keeps you solvent.

  1. 01 · Data

    Every decision starts as a number.

    Prices, quotes and volumes arrive as a continuous stream of ticks. A systematic strategy consumes that stream and nothing else — no headlines, no gut feel. Before a rule can fire, the data has to be clean, timestamped, and shaped identically every single day.

    Bad data doesn't produce a bad trade. It produces a confident one.

  2. 02 · Signal

    A rule fires when a condition is met.

    A signal is a comparison that evaluates to true — a level breaks, an indicator crosses, a spread strays from fair value. It carries no opinion and no hesitation. The same input always produces the same output, which is precisely what makes it testable.

    If you can't write the condition down, it isn't a rule yet.

  3. 03 · Risk check

    The gate every order has to pass.

    Before anything leaves the machine it asks three questions: how many lots does this size to, does it breach exposure limits, and is there margin to hold it? A failed check isn't a delayed trade — it's no trade. Sizing for survival happens here, not afterwards.

    Position sizing is where most of the outcome is actually decided.

  4. 04 · Execution

    Routed by API, filled on the book.

    The order goes to the broker's API and rests or crosses on the exchange's order book. What comes back is a fill — sometimes partial, often a shade worse than the price that triggered it. That gap is slippage, and it is a real, recurring cost of the edge.

    The price you signalled at is not the price you own.

  5. 05 · Monitor & exit

    The trade isn't over once it's on.

    P&L is marked continuously, stop and target logic runs on every tick, and positions are reconciled against what the broker actually holds. A kill switch stands ready to flatten everything if the market — or the machine — misbehaves.

    Exits and reconciliation are the unglamorous half that keeps you solvent.

04 · STRATEGY FAMILIES

The strategy playbook

Six families, each with a stated edge and a stated way of failing. If a strategy can't tell you how it loses, you don't understand it yet.

  • PREMIUM SELLING01 / 06

    Timed Option Selling — Theta Pocketing

    The edge
    Options carry time value (extrinsic value) that decays every day toward expiry. A net-short-option book collects that decay.
    How it works
    Sell options within chosen time windows, stay roughly delta-neutral, and let theta bleed into your favour as the clock runs.
    What can hurt it
    Sharp moves (gamma) and volatility spikes (vega). The risk is fat-tailed — small gains often, occasional large loss if unmanaged.
  • LONG VOLATILITY02 / 06

    Momentum Systems — Gamma Scalping

    The edge
    When the market actually moves more than options implied, being long gamma and re-hedging pays.
    How it works
    Hold long options (positive gamma), and as the underlying moves, mechanically buy dips / sell rips to flatten delta — banking the realized volatility.
    What can hurt it
    Quiet, range-bound days. You pay theta to hold the gamma; if realized vol < implied, the scalp doesn't cover the decay.
  • RELATIVE VALUE03 / 06

    Calendar Arbitrage in Futures

    The edge
    Near and far expiry futures on the same underlying are linked by cost-of-carry. When the spread strays from fair value, it tends to snap back.
    How it works
    Long one expiry, short another; trade the spread, not the direction. Largely market-neutral.
    What can hurt it
    Carry/rate shifts, dividends, liquidity gaps in the far leg, and execution risk on two legs at once.
  • TREND FOLLOWING04 / 06

    Momentum Breakouts in Equities

    The edge
    Ranges that break with force often continue as new participants pile in.
    How it works
    Define a level/range, enter on a confirmed break, ride the trend with a trailing exit. Pure trend-following.
    What can hurt it
    False breakouts and chop. Win rate can be low; the payoff comes from letting winners run.
  • RULE SYSTEMS05 / 06

    Indicator-Based Systems on Stock F&O

    The edge
    Mechanical, backtestable rules remove hesitation and hindsight bias.
    How it works
    Signals from indicators (RSI, CCI, SAR, moving averages, etc.) map to fixed entry/exit rules on stock futures and options — same input, same action, every time.
    What can hurt it
    Over-fitting to the past. A rule tuned too tightly to history breaks live.
  • THE EXECUTION LAYER06 / 06

    Automated API Execution

    The edge
    Machines don't get tired, greedy, or scared, and they act in milliseconds.
    How it works
    Signals flow straight to broker APIs — order routing, risk checks, and exits all run unattended on a server. The human writes and supervises the rules; the code trades them.
    What can hurt it
    Infra risk — latency, disconnects, bad fills, bugs. Hence hard risk limits and a kill switch.
  • // the common thread

    None of these are predictions.

    Each one is a claim about structure — decay, convergence, continuation — plus a rule that harvests it and a limit that survives being wrong. The skill is in the limit, not the claim.

swipe →

05 · THE GREEKS & VOLATILITY

The Greeks, by moving them

An option's price is a function of a handful of inputs. The Greeks are simply the slopes of that function — how much the price moves when one input moves. Drag something and watch.

Long call · strike 100 · 21d · IV 18%value nowat expiry
34261790K7085100115130
intrinsic 0.00extrinsic 1.91
Moneyness
ATM
Break-even at expiry
101.91
Time value share
100%
Inputs
100.0 · ATM
21d
18.0%

Illustrative Black–Scholes on a 100-point index. Values are per unit, not per lot.

Option value1.91
Delta
0.543Directional exposure. A delta of 0.50 means the option behaves, right now, like holding half a unit of the underlying.
Gamma
0.0919How fast delta changes underneath you. Largest at-the-money and near expiry — which is why a short book feels calm right up until it doesn't.
Theta / day
-0.050Rent on time. Every day the contract holds less extrinsic value than yesterday: the seller collects it, the buyer pays it.
Vega / 1 vol pt
0.095Exposure to the market's opinion about future movement, separate from the movement itself. It shrinks as expiry approaches.
ΔDelta
Directional exposure. A delta of 0.50 means the option behaves, right now, like holding half a unit of the underlying.
ΓGamma
How fast delta changes underneath you. Largest at-the-money and near expiry — which is why a short book feels calm right up until it doesn't.
ΘTheta
Rent on time. Every day the contract holds less extrinsic value than yesterday: the seller collects it, the buyer pays it.
νVega
Exposure to the market's opinion about future movement, separate from the movement itself. It shrinks as expiry approaches.
06 · PRICING & EFFICIENCY

What an option actually costs

An option price is not a prediction. It is the cost of transferring a defined risk to somebody else, assembled from five inputs — four of which you can look up.

The whole identity

price = intrinsic + extrinsic

Intrinsic is what the option would be worth if it expired right now — the in-the-money part, and nothing else. It is pure arithmetic on the spot and the strike.

Extrinsic is everything above that: the price of the time left and the movement expected within it. It is the entire argument. Theta erodes it, vega re-prices it, and at expiry it is exactly zero. A seller is selling extrinsic value; a buyer is renting it.

Put–call parity

C P = S K·e−rT

A call and a put on the same strike and expiry are locked together by arbitrage. Hold a call and sell a put and you have synthesised the underlying itself — so if the relationship breaks, the trade is free money and it gets closed in seconds.

This matters more than it looks. It means calls and puts are not separate opinions about direction; they are the same instrument rearranged. Any story that requires a call to be cheap and a put to be expensive at the same strike is not a story about volatility — it is a mispricing that does not exist.

// four you can look up, one you cannot

  • S

    Spot

    where the underlying is now

  • K

    Strike

    the price you have the right to trade at

  • T

    Time to expiry

    how long the optionality lasts

  • σ

    Volatility

    how much it is expected to move — the only unobservable

  • r

    Rate

    the cost of carrying the position

Spot, strike, time and rates are facts. Volatility is a forecast, and it is the only input anybody argues about — which is why option traders describe themselves as trading volatility rather than direction. Everything else in the price is bookkeeping.

// the model runs backwards

Implied volatility is not a forecast. It is a quote.

Nobody prices options by feeding a volatility number into Black–Scholes and accepting the answer. They observe the market price and solve backwards for the volatility that would justify it. Implied vol is the output of that inversion — a way of restating a price in units that can be compared across strikes and expiries.

Black–Scholes assumes volatility is a single constant. If that were true, every strike would imply the same number and the curve opposite would be flat. It never is. Out-of-the-money puts consistently imply more volatility than calls, because crashes are faster and deeper than rallies and everyone knows it. The shape is the market pricing in the fat tail the model leaves out.

Implied volatility by strike · illustrative equity index

what Black–Scholes assumes8090100110120ATM

Downside strikes cost more per unit of volatility. That is the skew, and it is the market's standing bid for crash protection.

// why any of this is hard

The efficient market hypothesis, and why it is useful even where it is wrong.

Eugene Fama's hypothesis comes in three strengths, each a claim about what is already in the price. Treat it not as a law but as the null hypothesis: the thing your strategy has to disprove before you are allowed to believe in it.

  1. Weak form

    Prices already reflect all past prices and volume.

    If true
    Pure chart-pattern trading should not work.
    What the evidence says
    Momentum and short-term reversal have survived decades of out-of-sample testing, so the weak form is not literally true — but the effects are small and cost-sensitive.
  2. Semi-strong form

    Prices reflect all publicly available information.

    If true
    Trading on published earnings or news should not pay.
    What the evidence says
    Post-earnings drift is one of the most replicated anomalies in finance. Still, the window is short and crowded, and it shrinks as it becomes known.
  3. Strong form

    Prices reflect all information, public and private.

    If true
    Even insiders could not profit.
    What the evidence says
    Plainly false — which is why insider dealing is illegal rather than merely futile.

The joint hypothesis problem

You can never test market efficiency on its own. Any test asks whether returns beat a model of what returns should be, so a rejection means either the market is inefficient or your model of fair return is wrong — and the data cannot tell you which. Fama pointed this out himself.

The Grossman–Stiglitz paradox

If prices already reflected everything, nobody would be paid to do research — and if nobody did research, prices would stop reflecting anything. Markets must therefore stay slightly inefficient, by exactly enough to pay the people making them efficient. That margin is where every edge on this site lives.

07 · JARGON DECODER

The jargon decoder

Every field builds a private vocabulary, and trading's is worse than most. Here is the whole working set in one sentence each — search it, or browse by family.

61 terms

Delta (Δ)
How much an option's price moves per 1-point move in the underlying.
Gamma (Γ)
How fast delta itself changes as the underlying moves; largest near-the-money.
Theta (Θ)
The value an option loses each day purely from time passing.
Vega (ν)
How much an option's price changes when implied volatility changes.
Rho (ρ)
Sensitivity of an option's price to interest-rate changes.
Implied Volatility (IV)
The volatility the market is pricing into an option right now.
Realized / Historical Volatility
How much the underlying actually moved.
IV Rank / IV Percentile
Where current IV sits versus its own recent range.
Skew / Smile
How IV differs across strikes.
Term Structure
How IV differs across expiries.
Intrinsic Value
The in-the-money portion of an option's price.
Extrinsic (Time) Value
Everything above intrinsic; what theta erodes.
Moneyness (ITM / ATM / OTM)
Where the strike sits relative to spot.
Assignment
Being obligated to deliver/receive on a short option.
Expiry
The date the contract settles.
Momentum / Trend
Bet that moves continue.
Mean Reversion
Bet that stretched prices snap back.
Arbitrage
Profit from a pricing gap between related instruments.
Market Making
Earn the bid-ask spread by quoting both sides.
Carry
Earn a yield/roll for holding a position.
Sharpe Ratio
Return per unit of total volatility.
Sortino Ratio
Return per unit of downside volatility.
Calmar Ratio
Return versus worst drawdown.
Max Drawdown
The largest peak-to-trough drop in equity.
CAGR
Compounded annual growth rate.
Expectancy
Average profit/loss you expect per trade.
Win Rate / Payoff Ratio
How often you win vs how big wins are relative to losses.
R-Multiple
A trade's result expressed in units of its initial risk.
Profit Factor
Gross profit divided by gross loss.
Position Sizing
How much capital/lots to put on a given trade.
Kelly Criterion
A formula for growth-optimal bet size given edge and odds.
Value at Risk (VaR)
An estimate of likely worst-case loss over a period.
Leverage / Margin
Trading larger than cash via borrowed exposure / posted collateral.
Exposure
Total risk on across positions.
Slippage
The gap between expected and actual fill price.
Latency
The delay between signal and order reaching the exchange.
Fill
An executed order (fully or partially).
Bid-Ask Spread
The gap between best buy and best sell price.
Order Book / Depth
Resting orders showing available liquidity.
Market Impact
How much your own order moves the price.
Order Types
Market, Limit, Stop-Loss (SL / SL-M), Bracket / Cover.
Backtest
Testing a rule on historical data.
Forward Test / Paper Trade
Testing live without real money.
In-Sample / Out-of-Sample
Data used to build vs data kept to validate.
Walk-Forward
Repeatedly re-fitting and testing forward through time.
Overfitting / Curve-Fitting
Tuning so tightly to the past that it fails live.
Robustness
A strategy's ability to survive across conditions.
Monte Carlo
Reshuffling results to stress-test outcomes.
Regime
The prevailing market state (trending, choppy, high/low vol).
Lot Size
The fixed contract quantity per derivative.
Weekly / Monthly Expiry
The settlement cycles for index and stock derivatives.
SPAN + Exposure Margin
The exchange's margin framework for F&O.
Mark-to-Market (MTM)
Daily settlement of gains/losses.
STT
Securities Transaction Tax on trades.
Physical Settlement
In-the-money stock derivatives settling in shares at expiry.
API
The interface that lets code place and manage orders with a broker.
Broker / Exchange
Where orders are sent and matched.
VPS / Co-location
An always-on server (near the exchange) running the bots.
Signal Engine
The code that turns data into trade decisions.
Reconciliation
Checking that intended positions match actual positions.
Kill Switch
An emergency stop that flattens/halts everything.
08 · INFRASTRUCTURE

The stack that does the clicking

Strategy code, a signal engine, a risk layer, a broker API — and a loop that brings reality back so the machine knows what it actually holds.

  1. 01Strategy coderules, in a repo
  2. 02Signal enginedata → decisions
  3. 03Risk layersize · limits · margin
  4. 04Broker APIorder routing
  5. 05Exchangematching engine
  6. 06Fills & positionswhat actually happened
  7. 07Reconciliationintended = actual
  8. 08Monitoring & logsevery decision, logged
  9. 09Kill switchflatten · halt · alert

No manual clicks anywhere in that loop. The human writes and supervises the rules; the machine trades them.

09 · THE HOUSE EDGE

The house edge

Systematic trading is not a novel idea. Two of the oldest, largest industries on earth run on exactly the same three parts: a small structural edge, an enormous number of repetitions, and a hard cap on what any single outcome can cost.

03215194212251734627133611308231052416331201431922182972812353262.70%HOUSE EDGE

// the wheel does not need to know

A casino cannot predict where the ball lands. It has never needed to.

A single-zero wheel has 37 pockets. A straight-up number pays 35 to 1, but the true odds against it are 36 to 1. That one-pocket gap — the green zero — is the entire business. It works out to 2.70% of every rupee staked, and it applies whether the ball lands on your number or not.

The house loses individual spins all night long. It is indifferent, because it is not playing your session. It is playing every session, forever.

37
pocketssingle-zero European wheel
35:1
payouttrue odds are 36:1
2.70%
house edge1 ÷ 37, on every stake

Realised house take vs number of spins

0%2.70% — the maths01,0002,0003,0004,000SPINS

Five simulated runs of four thousand spins. Early on the house is sometimes losing badly — that is variance, and it is why a short session tells a gambler nothing. Push the count high enough and every run is pinned to the same 2.70%. The casino is not lucky. It is patient, and it has a bigger sample than you do.

5+1
K-1
3+1
80
4+1
6+1
Hi-Lo running count+3

A positive count means the shoe is rich in tens and aces. The edge has moved to the player — which is the moment the casino changes the rules.

// the exception that proves the rule

Blackjack is the one game where the edge can invert.

Cards leave the shoe and do not come back, so the deck has a memory. Count the low cards going out and you know when what remains is rich in tens and aces — and in those moments the advantage genuinely belongs to the player.

The casino's response is instructive: more decks, earlier shuffles, and a polite escort to the door. An edge that becomes widely known gets competed away or shut down. Markets do the same thing, only faster and without the bouncer.

<1%
house edgeagainst basic strategy
Hi-Lo
counting system+1 low · 0 neutral · −1 high
flips
the edge can invertwhich is why counters get barred

// the same machine, wearing a suit

An insurer is a casino that lets you choose the stake.

A premium is expected loss, plus expenses, plus margin. Nobody at the underwriting desk believes they know whether you will crash your car. They know what a hundred thousand drivers like you do in aggregate, and they price the distribution. The measure of whether it worked is the combined ratio: claims plus expenses over premiums. Under 100% and the book made money on the risk itself.

The parallels run all the way down. Policy limits and deductibles are position sizing. Reserves are the capital buffer that keeps a bad year from being the last one. Reinsurance is a tail hedge — paying someone else to take the extreme. And a hurricane is the thing that breaks the whole model, because it turns a hundred thousand independent policies into one enormous correlated bet.

<100%
combined ratio(claims + expenses) ÷ premiums
reserves
capital buffersolvency before profit
reinsurance
tail hedgethe extreme risk is ceded on

One machine, three industries

  1. 01

    The edge is structural, not predictive

    None of these businesses forecasts the next outcome. The advantage is built into the rules of the game before anyone plays.

    CasinoA European wheel has 37 pockets. A straight-up number pays 35 to 1, but the true odds against it are 36 to 1. The house keeps that gap — 2.70% of everything staked — whatever the ball does.

  2. 02

    The sample size does the work

    A 2.70% edge is invisible in ten spins and inescapable in ten million. The law of large numbers is the entire business model.

    CasinoThe house loses hands constantly and does not care. It needs volume, not wins — enough spins for realised outcomes to converge on the maths.

  3. 03

    Limits cap the tail

    Edge only pays out if you are still solvent to collect it. Every one of these businesses puts a ceiling on single-event damage.

    CasinoTable maximums are position sizing. A bet cap limits how much variance one player can impose on one table in one night.

  4. 04

    Correlation is what actually kills you

    Diversification is the machine's load-bearing assumption. Everything breaks on the day every outcome becomes the same outcome.

    CasinoA table full of players betting the same number turns thousands of independent spins into one wager. Correlated action is the one thing a pit boss genuinely fears.

The uncomfortable half of this: the arithmetic that makes the house rich makes the player poor, by exactly the same mechanism.

A negative edge repeated ten thousand times is not bad luck — it is a calculation running to completion. Nothing about sitting on the other side of the table changes the maths; it only changes the sign. Which is the whole reason to be able to state what your edge is, why it should exist, and whether it is positive — before you put size on it. If you cannot, you are not the house. You are the sample the house is collecting.

10 · RUNS, RUIN & SIZING

Runs, ruin and how much to bet

A positive edge is necessary and nowhere near sufficient. What decides whether you collect it is how much you stake, and whether you are still solvent after the worst run the maths guarantees you will eventually see.

// the streak is not a malfunction

Losing runs are a property of the maths, not of your system.

Flip a fair coin a thousand times and somewhere in there is a run of about ten tails. Nothing is broken when it happens; a thousand-flip sequence without such a run would be the anomaly. The expected longest losing run is ln(N) / ln(1/q) — where N is the number of trades and q the probability of a loss.

This is the single most useful number a systematic trader can hold in their head, because it converts “my system stopped working” into a testable claim. If your backtest says 45% win rate and you are eleven losses deep, you are exactly where you should be. Abandoning a strategy inside its expected run is how a positive edge gets thrown away.

Expected longest losing run · 1,000 trades

Win rateLongest run
60%7.5 losses
55%8.7 losses
50%10.0 losses
45%11.6 losses
40%13.5 losses
35%16.0 losses
30%19.4 losses

// the equity curve you got was one draw

Monte Carlo: the backtest is a single sample.

Your historical equity curve is one path the dice happened to take. Keep the same edge and reshuffle the order of the trades and you get a different curve — sometimes a much uglier one. Simulating thousands of those orderings turns a single number into a distribution, and the number you care about is not the average outcome but the bad tail: how deep does the drawdown get in the unlucky 5%, and could you sit through it?

24 orderings of the same 120 trades · 52% win rate · 1:1 · 2% risked

Worst drawdown in set
45.0%
Median ending equity
114.6

Kelly fraction · f* = (bp − q) / b

OddsWinFullHalf
1 : 152%4%2%
1 : 155%10%5%
1 : 160%20%10%
2 : 140%10%5%
3 : 135%13.3%6.7%

// the growth-optimal bet

Kelly tells you the largest bet that still compounds.

Kelly maximises the long-run growth rate of capital, and it is provably optimal in that specific sense — no other staking rule beats it asymptotically. It is also the only rule on this page that requires a positive edge as an input, which is exactly what makes it useful: you cannot apply it without first stating what your edge is.

The catch is variance. Full Kelly is violent — drawdowns of 50% are routine, and it assumes your estimate of the edge is exact, which it never is. Overestimate the edge and you are over-betting immediately. Because growth is flat near the optimum, half Kelly gives up only about a quarter of the growth for roughly half the volatility, which is why most people who use it at all use a half or a quarter.

// having an edge is not the same as surviving

Risk of ruin is set by bankroll units, not by the edge.

Betting one unit at a time with a genuine edge, the probability of losing everything is (q/p)^N, where N is how many units of bankroll you hold. The edge barely moves that number. The unit count moves it enormously.

At a 52% win rate with ten units you are close to a coin flip on total ruin — 45%. The same edge with fifty units puts it under 2%. Nothing about the strategy changed; only the size did. This is the entire argument for position sizing, and it is why the risk gate sits before the order goes out rather than after.

Probability of ruin · (q/p)^N

WinUnitsRuin
52%1044.91%
52%2020.17%
52%501.83%
55%1013.44%
55%201.81%
55%40<0.1%
60%101.73%
60%20<0.1%

// the asymmetry nobody plans for

A drawdown costs more to undo than it did to create.

Losses and gains are not symmetric, because the gain is computed on a smaller base. Down 50% you need to double just to get level. This one table is the reason experienced traders talk about risk before they talk about return — and the reason a strategy with a smaller edge and a shallower drawdown often compounds better than a flashier one.

Gain required to recover a drawdown · gain = loss / (1 − loss)

  • 5%+5.3%
  • 10%+11.1%
  • 15%+17.6%
  • 20%+25.0%
  • 25%+33.3%
  • 30%+42.9%
  • 40%+66.7%
  • 50%+100.0%
  • 60%+150.0%
  • 70%+233.3%
  • 80%+400.0%
  • 90%+900.0%

Bars are square-root scaled — at true scale the 90% row would be seventeen times the 20% row and the table would be unreadable, which is itself the point.

// what the players at the table are doing

Every staking system a gambler uses, and what it actually does.

Traders reinvent all of these, usually without knowing the names. They are worth knowing precisely because they are so tempting — and because the honest verdict on almost all of them is the same. A staking system reshapes the distribution of outcomes. It cannot touch the mean. No sequence of bet sizes turns a negative edge positive; it only decides whether you lose in many small pieces or one large one.

  • Flat betting

    The default everywhere

    neutral
    Rule
    Stake the same amount every time, win or lose.
    What it does to the distribution
    Leaves the distribution alone. P&L is a straight sum of outcomes.
    Verdict
    The honest baseline. It compounds nothing, but it also hides nothing — any other system should be judged against this one.
  • Martingale

    18th-century France

    escalates losses
    Rule
    Double the stake after every loss; reset after a win.
    What it does to the distribution
    Turns a broad distribution into many tiny wins and a rare catastrophic loss.
    Verdict
    The most seductive and most destructive. Ten losses in a row needs 1,024× the opening stake — and at a 45% win rate you should expect a run of about twelve in a thousand bets. Table limits and finite bankrolls exist precisely to make this fail.
  • Anti-Martingale (Paroli)

    The mirror of Martingale

    risks profit
    Rule
    Double after a win; reset after a loss.
    What it does to the distribution
    Many small losses, occasional large win. The opposite skew to Martingale.
    Verdict
    Risks profit rather than capital, which is the right way round. This is what a trend-follower's pyramiding really is.
  • D'Alembert

    Named for the French mathematician

    escalates losses
    Rule
    Raise the stake one unit after a loss, lower it one after a win.
    What it does to the distribution
    A gentler Martingale — arithmetic rather than geometric growth.
    Verdict
    Slower to blow up, and blows up the same way. Rests on the gambler's fallacy: that losses make a win 'due'.
  • Fibonacci

    The sequence, applied to stakes

    escalates losses
    Rule
    Move one step up the sequence after a loss, two steps back after a win.
    What it does to the distribution
    Between D'Alembert and Martingale in aggression.
    Verdict
    Dressed-up progression. The sequence has no bearing on the odds; it only sets how fast the hole deepens.
  • Labouchère (cancellation)

    19th-century England

    escalates losses
    Rule
    Write a list of numbers; stake first plus last, cross both off on a win, append the loss on a loss.
    What it does to the distribution
    Bookkeeping that hides an escalating progression.
    Verdict
    The list grows without bound on a losing run. Complexity is not an edge.
  • Oscar's Grind

    Documented by Allan Wilson, 1965

    risks profit
    Rule
    Aim for one unit of profit per cycle; raise the stake by one only after a win.
    What it does to the distribution
    Very high hit rate on cycles, long tail on the losers.
    Verdict
    The mildest progression here, and still a progression. It trades many small cycle wins for rare deep ones.
  • Proportional / fixed fractional

    Standard in money management

    mathematically sound
    Rule
    Stake a constant percentage of current capital.
    What it does to the distribution
    Multiplicative. Losses shrink the stake automatically, so the account decays rather than hits zero.
    Verdict
    Mathematically sound and the basis of nearly all real position sizing. Ruin becomes asymptotic instead of certain.
  • Kelly criterion

    John L. Kelly Jr., Bell Labs, 1956

    mathematically sound
    Rule
    Stake the fraction f* = (bp − q) / b of capital.
    What it does to the distribution
    Maximises the long-run growth rate of log capital. Nothing beats it asymptotically.
    Verdict
    The only system on this list that requires a positive edge to work at all — which is exactly why it is the only one worth having. Brutal drawdowns at full size; most practitioners run a half or a quarter.

Only two of the nine survive contact with arithmetic, and both of them start by asking a question none of the others do: what is your edge, and how sure are you?

11 · STATISTICAL TOOLKIT

The statistics that decide whether you have anything

Most of a quant's working life is not spent finding strategies. It is spent trying to prove that the one in front of them is not an accident — and these are the tools that do the disproving.

Before any model, know what the distribution actually looks like. Market returns are not normal, and every technique that assumes they are will understate your risk.

  • Skewness

    Is the distribution lopsided?

    long left tailsymmetric

    =γ₁ = E[(X − μ)³] ⁄ σ³

    Third moment. Negative skew means many small gains and rare large losses — the signature of short-option and carry strategies.

    The trap

    A strategy can post a beautiful Sharpe for years purely by hiding risk in negative skew.

  • Kurtosis / fat tails

    How often do extreme moves happen?

    fat tails

    =γ₂ = E[(X − μ)⁴] ⁄ σ⁴ − 3

    Fourth moment. Excess kurtosis above 0 means the tails are heavier than a normal distribution predicts.

    The trap

    Financial returns routinely show excess kurtosis of 5–10. A 'six-sigma' day is not once-a-millennium; it is roughly annual.

  • Jarque–Bera / QQ plot

    Are returns normally distributed?

    tails leave the line

    =JB = n⁄6 · (S² + (K − 3)² ⁄ 4)

    Tests skew and kurtosis jointly against the normal. The QQ plot shows you the same thing by eye.

    The trap

    They almost always reject normality. The useful question is not whether but how badly, and where.

None of these tools will find you a strategy. Every one of them exists to take one away — and a process that never kills anything is not a research process, it is a way of laundering hope into conviction.

12 · PROOF BEFORE CAPITAL

A backtest is a hypothesis, not a promise

Anybody can produce a rising equity curve from ten years of history — the data will happily confess to anything if you torture it long enough. The whole discipline is in the tests you run afterwards to find out whether the curve means anything, and in being willing to throw the system away when it does not.

The pipeline

Eleven steps, in this order

Skipping one does not save time. It moves the discovery of the problem to the point where it costs money.

  1. 01

    Write the hypothesis first

    One sentence, before any data: who is on the other side of this trade, and why do they keep taking it? An edge is somebody else's cost, constraint or hurry.

    What goes wrong

    If you cannot name the loser, you are not testing a hypothesis — you are searching for a coincidence.

  2. 02

    Get the data honest

    Adjusted for splits and dividends, corrected for expiry rolls, free of survivorship bias, timestamped in the exchange's clock, with the bad prints and the gaps marked rather than silently filled.

    What goes wrong

    A bad tick that never traded becomes a fill in a backtest. Most spectacular backtests are made of prices nobody could have got.

  3. 03

    Make the rules mechanical

    Entry, exit, stop, filter, position size and what happens when two signals collide — all of it written so that the same input can only ever produce one action.

    What goes wrong

    Any rule that still needs you to look at the chart is a discretionary system wearing a backtest as a costume.

  4. 04

    Charge yourself properly

    grossfeessliptaxnet

    Brokerage, exchange fees, STT and stamp duty, GST, the bid-ask spread you actually cross, slippage that scales with your size, and financing on anything you carry.

    What goes wrong

    Costs are the single most common reason a live system underperforms its backtest. Model them pessimistically or they will be modelled for you.

  5. 05

    Simulate bar by bar

    knownunseen

    The engine walks forward one bar at a time and may only use information that existed at that instant — including the fact that a bar's close is not known while the bar is forming.

    What goes wrong

    Look-ahead bias. Using a daily close to decide a trade you booked at that same close is the classic version, and it is worth several imaginary percent a year.

  6. 06

    Read the equity curve

    DD

    Plot cumulative P&L and, underneath it, the underwater curve — how far below the previous high-water mark you are, and for how long.

    What goes wrong

    Everyone looks at the line going up. The number that ends careers is how long the line went sideways.

  7. 07

    Turn the curve into numbers

    A handful of metrics you can compare across systems: return, drawdown, risk-adjusted return, expectancy per trade, and how much of it survives costs.

    What goes wrong

    One metric alone is always gameable. Sharpe hides tail risk, win rate hides payoff, CAGR hides the path.

  8. 08

    Test on data it has never seen

    in-sampleout

    Hold back a slice of history, build and tune on the rest, and look at the held-back slice exactly once.

    What goes wrong

    Look at it twice and it is in-sample. Every peek spends part of the only unbiased evidence you have.

  9. 09

    Attack it

    plateauspike

    Nudge every parameter. Shuffle the trades. Delete the best month. Split by regime — trending, choppy, high-volatility, low-volatility, pre- and post-2020.

    What goes wrong

    A system that only works with one exact parameter set, or only in one regime, has not been discovered. It has been drawn around the data.

  10. 10

    Forward test on live data

    today

    Run the finished rules on data as it arrives, without money, logging every signal, fill assumption and latency. Weeks to months, depending on how many trades it makes.

    What goes wrong

    This is the first test the data cannot have been fitted to, because the data did not exist when you built the rules.

  11. 11

    Deploy at minimum size

    Real money, smallest tradeable size, full monitoring, a kill switch, and a written rule for what would make you turn it off.

    What goes wrong

    The purpose of the first live months is not profit. It is to find the gap between your fill assumptions and your actual fills.

Reading the result

The metrics, and what each one hides

Every metric on this list is a summary, and every summary throws information away. Read them as a set — the interesting information is usually in the disagreement between two of them.

Backtest metrics: what each measures, typical values, and how it can mislead
MetricWhat it saysWhere a real system landsHow it lies
CAGR(Vₑ ⁄ V₀)^(1⁄yrs) − 1The compound rate the equity curve actually grew at.Anything you would be happy to earn for a decade.Says nothing about the path. Two systems with the same CAGR can be unrecognisably different to live through.
Max drawdownmin(Vₜ ⁄ max V₍≤ₜ₎ − 1)The worst peak-to-trough fall on the whole curve.Assume the live one is 1.5× the backtested one.It is a single historical observation, not a limit. The worst drawdown in your future is almost always larger than the worst in your past.
Calmar / MARCAGR ⁄ |max DD|Return per unit of the worst pain. The most honest single number on this list.Above 0.5 is workable; above 1 is good; above 3 usually means a bug.Both inputs come from single extreme points, so it is noisy on short histories.
Sharpe ratio(E[r] − rբ) ⁄ σ(r)Excess return per unit of volatility.1 is respectable after costs; 2 is excellent; above 3 in retail-accessible markets deserves suspicion.Punishes upside volatility as much as downside, and assumes returns are roughly normal — which strategies that sell options are specifically designed not to be.
Sortino ratio(E[r] − rբ) ⁄ σ(downside)The same idea, but only downside deviation counts.Read alongside Sharpe, never instead of it.A large Sortino-to-Sharpe gap tells you the returns are skewed; it does not tell you which way the skew will resolve.
Expectancyp·avg win − (1 − p)·avg lossThe average rupee outcome of one trade, after costs.Must exceed your round-trip cost by a comfortable multiple.An expectancy driven by a handful of enormous winners is not repeatable. Check the median trade too.
Profit factorΣ wins ⁄ Σ |losses|Rupees won per rupee lost.1.3–1.8 after costs is a real, tradeable system.Above 2.5 on a few hundred trades usually means the sample is too small or the costs are too kind.
Win ratewins ⁄ tradesHow often you are right.Meaningless in isolation. 35% and 85% are both fine.The most seductive number in trading. Any system can push it to 90% by cutting winners early and letting losers run.
Payoff ratioavg win ⁄ avg lossThe other half of win rate. The pair is what matters.Win rate × payoff must clear 1 by enough to pay costs.Averages hide the one loss that was eight times the others.
Trade countnHow much evidence you actually have.Under 100 trades, you know almost nothing. Several hundred is a starting point.Ten years of daily data sounds like a lot. If the system trades monthly, that is 120 observations.
Longest flat periodmax gap between equity highsThe longest stretch you would have gone without a new high.However long it is, plan to sit through longer.Nothing lies here. This is the number that decides whether you can actually keep running the system.
Cost ratioΣ costs ⁄ Σ gross P&LHow much of the gross edge the market takes back.Under a third is healthy. Over a half is fragile.It is the metric that degrades fastest as you scale, because slippage grows with size while the edge does not.

Benchmarking

Good result, bad result — and how to tell without being told

These two curves finish at almost the same place. One is a business; the other is a story about a business.

A result worth deploying

CAGR
19%
Max DD
14%
Calmar
1.36
Trades
820
  • Gains arrive in small increments across hundreds of trades.
  • Every drawdown is recovered within a few months.
  • Out-of-sample return is 76% of in-sample — a haircut, not a collapse.
  • The worst Monte Carlo path still ends above zero.

A result that will not survive

CAGR
21%
Max DD
38%
Calmar
0.55
Trades
46
  • Most of the profit comes from one nine-week stretch in 2020.
  • The final decline lasts longer than the entire winning run.
  • Out-of-sample return is negative; the curve above is in-sample only.
  • Forty-six trades is not evidence. It is an anecdote with a chart.
  • Benchmark against

    Buy and hold

    If the index returned more with less drawdown, your system is an expensive way to underperform a SIP.

  • Benchmark against

    Random entry, same exits

    Replace your entry signal with a coin flip and keep everything else. If results barely change, your edge was in the exit or the sizing, not the signal you believe in.

  • Benchmark against

    The same rules on shuffled returns

    Destroy the time structure and re-run. Any performance left is what the rules extract from noise — and that is your false-positive baseline.

  • Benchmark against

    The strategy's own out-of-sample

    The only honest comparison is in-sample versus out-of-sample on the same rules. A fall of more than about a third is a warning; a fall to zero is an answer.

The system itself

What separates a good trading system from a bad one

Not the return. Two systems can post identical numbers and only one of them will still be working in three years.

Fragile

Durable

  • Nine parameters, each tuned to a specific value

    Two or three parameters, each working across a wide neighbourhood

  • The rationale was written after the backtest

    The rationale was written before, and the test could have refuted it

  • Profit concentrated in a handful of trades

    Profit spread across hundreds of trades and several years

  • Works in one regime and quietly loses in the others

    Positive or flat in every regime, best in the one it was designed for

  • Backtest and live results diverge and nobody knows why

    Live fills are reconciled against simulated fills every day

  • Costs modelled as a flat, optimistic number

    Costs modelled per-instrument, with slippage scaling in size

  • One equity curve, and it is beautiful

    A distribution of equity curves, and the bad tail is survivable

  • No stated condition for turning it off

    A written kill rule agreed before the first rupee is risked

Out-of-sample & forward testing

How the history gets carved up

The single most useful thing you can do to a backtest is refuse to look at part of the data until you have finished building.

Naive

Hold-out

Walk-forward

  • Fitted
  • Never seen
  • Forward / live

In-sample

The slice you build and tune on. Everything you learn here is contaminated by the fact that you learned it here.

Out-of-sample

A slice held back and untouched. It answers one question — does this generalise? — and it can only answer it once, because every look leaks information into the next revision.

Walk-forward

Fit on a window, trade the next window, roll forward, repeat. It produces a continuous out-of-sample track record and it mirrors how you would actually re-fit a live system, which is why it is the standard.

Forward test

Paper trading on data that did not exist when the rules were written. It is the only test that cannot be contaminated, and the only one that also tests your infrastructure.

Optimisation & curve fitting

The same activity, told apart only by what you do next

Searching a parameter space is not cheating; you have to pick numbers somehow. It becomes curve fitting the moment the number you picked is the only one that works.

Curve fitting

  • Adding a parameter every time the curve has a bad patch.
  • Picking the single best cell in a parameter grid.
  • Excluding a date range because 'that was an unusual market'.
  • Testing a thousand variants and reporting the best one as though it were the only one.
  • Re-tuning after every look at the out-of-sample slice.

With enough parameters you can fit any history perfectly, and the fit will contain exactly zero information about the future. The tell is always the same: performance falls off a cliff one step away from the chosen settings.

Honest optimisation

  • Fewer parameters than you think you need, each with a reason to exist.
  • Choosing the centre of the widest plateau, not the top of the tallest peak.
  • Checking that the neighbours of your chosen setting also work.
  • Counting how many variants you tested, and deflating your significance accordingly.
  • Re-fitting on a fixed schedule inside a walk-forward, never in response to a loss.

A useful rule: if moving a parameter by 20% in either direction destroys the result, you have not found a setting — you have found a fluke, and the setting is a memory of where it happened.

Monte Carlo

Your equity curve was one draw from a deck

History dealt your trades in one particular order. Nothing about the future guarantees a similar order — so shuffle them, thousands of times, and look at the range of businesses you might have been running.

same trades, different order

Twenty-two reorderings of one set of trades. The backtest you saw was a single line through this cone — and there is no reason it was the middle one.

Resample the trade order

Shuffle the sequence of realised trades and rebuild the curve. Same trades, same expectancy, wildly different drawdowns.

Resample with replacement

Bootstrap the trades, allowing repeats and omissions. This asks what happens if the future draws from the same distribution but not the same sample.

Randomise entry timing

Shift each entry by a bar or two. A system that only works on the exact bar is an execution fantasy.

Read the 5th percentile, not the median

The number that matters is the bad tail: the drawdown you would have suffered in the unlucky 1-in-20 ordering. Size the position from that, and the median takes care of itself.

Finalising

What has to be true before real money

Not a wish list. Any single line unticked is a reason to keep the system in paper.

  • 01

    The hypothesis was written before the test, and it could have been refuted.

  • 02

    Costs are modelled pessimistically and the system still clears them by a wide margin.

  • 03

    Out-of-sample results were looked at once, and they held.

  • 04

    Every parameter sits on a plateau, not a peak.

  • 05

    The Monte Carlo bad tail is a drawdown you could actually sit through at your intended size.

  • 06

    The forward test produced live signals that match the simulated ones.

  • 07

    Position size is set from the Monte Carlo tail, not from the backtested drawdown.

  • 08

    There is a written rule for when this system gets switched off.

After the analysis

What live trading actually gives you back

The backtest is the optimistic case by construction, because it was built by someone who already knew what happened. Here is the gap you should budget for.

What the backtest implies

What live data does

  • Fills at the price on the chart

    You cross the spread on entry and again on exit, and in illiquid strikes the spread is the whole edge.

  • Every signal gets executed

    Rate limits, rejected orders, margin shortfalls, frozen quantity limits and the odd exchange halt mean some do not.

  • Performance in line with the backtest

    A live system that delivers 60–70% of its backtested risk-adjusted return is doing well. Plan the position size around that number, not the backtest's.

  • Drawdown similar to the tested worst case

    Expect to exceed the backtested max drawdown eventually. It is a sample maximum, not a bound.

  • The edge persists

    Edges decay. Crowding, exchange rule changes, tick-size changes and regime shifts all end strategies. Track rolling expectancy, not lifetime expectancy.

  • Your job is done at deployment

    Roughly half the work of running systems is reconciliation, monitoring and knowing when to stop — which is the part nobody backtests.

The point of a backtest is not to find out how much money a system would have made. It is to find out how it fails — and if you cannot make it fail on paper, you have not tested it, you have admired it.

13 · THE SYSTEMATIC EDGE

Where the edge actually comes from

Not from a secret indicator. From doing one statistically sound thing thousands of times without flinching — and from surviving the stretches where it doesn't work.

1
rulewritten down once
10,000
executionsidentical, every time
0
emotional decisionsat the moment of the trade

Illustrative — a shape of work, not a track record

What a working system looks like← the part you have to sit through
startdrawdownlater

Backtest before you trust

A backtest is a hypothesis about the past. Keep data out of sample, walk it forward, and assume the live result will be worse than the test — because it always includes costs the test forgot.

Respect drawdowns

Every positive-expectancy system spends most of its life below its own high-water mark. The drawdown isn't the system breaking; it's the system working, in the part nobody screenshots.

Size for survival

Expectancy only pays out if you're still there to collect it. Sizing decides whether a normal losing streak is an inconvenience or the end of the account.

The entry is the easy part

Almost all the work is research, costs, sizing and risk. The entry rule is usually a single line of code — and rarely the reason a system succeeds or fails.

  • Systematic trading turns a market opinion into a testable, repeatable process.
  • The edge is small and statistical; the discipline to execute it identically every time is the real skill.
  • A backtest is a hypothesis, not a promise. Forward-test before you trust, and size so a bad streak can't end you.
14 · COLOPHON

Who wrote this, and why

Built by a non-discretionary quant trader working Indian equity derivatives entirely through automated API infrastructure.

Most trading education sells an outcome. This one tries to hand over a vocabulary and a mental model instead: what a rule is, where risk is actually decided, and what happens in the milliseconds between a condition turning true and an order resting on an exchange.

Nothing here is advice, a signal service, or a claim about returns. Every number and chart on this page is generated in your browser to illustrate a shape — decay, convergence, drawdown — not to report a result. Derivatives can lose more than you put in; understand the mechanics before you risk anything on them.

Built in public, one rule at a time.

// keep learning

One idea from the desk, when there's one worth sending.

Demo form · no backend, nothing is stored.