Risk management

Max drawdown and position sizing for F&O backtests

How to measure maximum drawdown from an equity curve, why it understates risk, and how to size NIFTY options and MCX gold futures by capital at risk.

By
Veloce team
Published
Reading time
9 min read
On this page
  1. What maximum drawdown measures
  2. A worked example
  3. Rupees and percentages can disagree
  4. Recovery is harder than the fall
  5. Why a backtest’s maximum drawdown understates risk
  6. How losing streaks turn into drawdowns
  7. Four ways to size a position
  8. 1. A fixed number of lots
  9. 2. A share of equity per contract
  10. 3. Maximum loss at expiry
  11. 4. Futures margin
  12. Combining rules
  13. A daily loss limit as a kill switch
  14. A checklist for sizing a backtest
  15. Try it in Veloce

Maximum drawdown is the largest fall in account equity from a previous peak, measured in rupees and as a percentage of that peak. To calculate it, walk through the equity curve in order, track the highest value so far, and record the biggest gap between that peak and any later value. Position sizing is the decision that controls it. Instead of choosing a number of lots, decide what share of equity one position may lose, work out the worst loss of one lot, and divide. This article computes both with real numbers for NIFTY options and MCX gold futures, the same way Veloce does in a backtest.

What maximum drawdown measures

A strategy’s equity curve is its account value over time: cash plus open positions valued at current prices, after charges. Drawdown at any moment is how far the curve sits below its highest point so far. Maximum drawdown is the worst of those.

It answers a practical question: what is the most this strategy has lost, from a high point, before recovering? That is the loss you would have had to sit through without switching it off. Total return tells you where the strategy ended up. Drawdown tells you how bad the journey was.

A worked example

Here is an equity curve for a strategy that starts with ₹5,00,000. Each value is the equity at the close of a trading day.

Day Equity (₹) Running peak (₹) Drawdown (₹) Drawdown (%)
1 5,00,000 5,00,000 0 0.00
2 5,12,000 5,12,000 0 0.00
3 5,24,000 5,24,000 0 0.00
4 5,18,000 5,24,000 6,000 1.15
5 5,31,000 5,31,000 0 0.00
6 5,47,000 5,47,000 0 0.00
7 5,38,000 5,47,000 9,000 1.65
8 5,09,000 5,47,000 38,000 6.95
9 4,96,000 5,47,000 51,000 9.32
10 5,03,000 5,47,000 44,000 8.04
11 5,21,000 5,47,000 26,000 4.75
12 5,52,000 5,52,000 0 0.00
13 5,60,000 5,60,000 0 0.00
14 5,41,000 5,60,000 19,000 3.39

The maximum drawdown is ₹51,000, or 9.32%, from the day-6 peak of ₹5,47,000 to the day-9 low of ₹4,96,000. At that low the account was below its starting capital, even though it had been up 9.4% three days earlier. It took until day 12 to set a new high. The strategy ended at ₹5,41,000, a total return of 8.2%, and its return was 0.80 times its maximum drawdown.

Equity (₹ thousand) 500 550 −₹51,000 −9.32% Drawdown from peak 0% −10% 1471013
Top: equity (solid) and its running peak (dashed). Bottom: the drawdown from that peak, often called an underwater chart. The deepest point is day 9.

Rupees and percentages can disagree

The worst drawdown in rupees and the worst in percent do not have to happen at the same time. A ₹50,000 fall from ₹5,00,000 is 10%. A ₹60,000 fall later, from ₹8,00,000, is 7.5%. The largest rupee drawdown is the second one, and the largest percentage drawdown is the first. Veloce reports both maxima, each over the whole run, so neither hides the other.

Recovery is harder than the fall

A drawdown of d needs a gain of d ÷ (1 − d) to recover. The 9.32% drawdown above needed a 10.28% gain, from ₹4,96,000 back to ₹5,47,000. A 20% drawdown needs 25%, a 33% drawdown needs 50%, and a 50% drawdown needs 100%. This asymmetry is the main reason to size positions so that deep drawdowns cannot happen in the first place.

Why a backtest’s maximum drawdown understates risk

The maximum drawdown in a backtest is the worst thing that happened on one path through history. It is not the worst thing that can happen. Four reasons it understates live risk:

  1. One sample. The order of wins and losses in your test window is one possibility. Shuffle the same trades and the worst run of losses usually gets longer.
  2. Resolution. An equity curve sampled at day ends misses intraday lows. Veloce records equity at the close of every candle the strategy decides on. With one-minute data that includes intraday dips, which makes the drawdown larger and more honest than a daily figure.
  3. Costs and fills. A test without charges or slippage overstates every winner and understates every loser. See F&O charges explained and slippage in backtests.
  4. Overfitting. If you tuned parameters on the same period, the drawdown is optimistic by construction. Tune on one period and check on a later one. Veloce’s sweeps rank combinations on one window and rerun the best on a separate check period.

A useful habit is to plan for a live drawdown about one and a half to two times the backtest’s worst. That is a rule of thumb, not a statistic, so use it to size cautiously rather than to forecast.

How losing streaks turn into drawdowns

If every losing trade costs a fixed share r of current equity, n losses in a row produce a drawdown of 1 − (1 − r)n:

Risk per trade 5 losses 10 losses 20 losses
1% 4.90% 9.56% 18.21%
2% 9.61% 18.29% 33.24%
5% 22.62% 40.13% 64.15%

A strategy that wins 60% of the time still has about a 1-in-100 chance of five losses in a row on any given five trades (0.45 ≈ 1%). Over hundreds of trades, streaks like that become likely. At 5% risk per trade, ten losses take 40% of the account and need a 67% gain to recover. Position sizing is how you choose which row you live in.

Four ways to size a position

Veloce applies sizing as risk rules that can only cut a strategy’s target down, never push it up. Every rule computes the most lots it allows, and the smallest wins. A rule never forces an existing position to close; it only stops it from growing.

1. A fixed number of lots

The simplest rule: hold at most N lots of any contract. It is easy to reason about, but it does not adapt. Two lots of NIFTY were 150 units in 2025 and 130 in 2026 after the lot size changed (see expiry days and lot sizes), and two lots risk the same rupees whether the account is ₹3 lakh or ₹30 lakh. A cap on lots is best used as a safety ceiling on top of one of the rules below.

2. A share of equity per contract

Size each contract so its value stays within a fraction of equity:

lots = floor(equity × fraction ÷ (price × lot size))

Buying a NIFTY call at ₹120 with 65 units per lot costs ₹7,800 per lot. With ₹5,00,000 of equity and a 10% limit, the budget is ₹50,000, so the rule allows floor(50,000 ÷ 7,800) = 6 lots.

For a long option this is a true capital-at-risk rule, because the premium is the most you can lose. For a short option it is not. The premium received says nothing about the loss if the market moves through the strike. Use the next rule for anything sold.

3. Maximum loss at expiry

For option positions, Veloce can size so the worst loss at expiry stays within a share of equity. It values the position at expiry at every strike in the group (and at zero) and takes the worst. That gives a finite number for defined-risk spreads and an unlimited one for uncovered short calls.

Take the call side of a NIFTY iron condor:

  • Sell the 26,000 call at ₹60 and buy the 26,200 call at ₹22. Net credit: ₹38 per unit.
  • Worst case at expiry: NIFTY at or above 26,200, so the spread is worth its full 200-point width.
  • Maximum loss per unit: 200 − 38 = ₹162. Per lot of 65: ₹10,530.

With a limit of 2% of equity:

Equity Budget at 2% Lots allowed
₹5,00,000 ₹10,000 0
₹10,00,000 ₹20,000 1
₹20,00,000 ₹40,000 3

These are the numbers Veloce’s rule returns for this spread. Two properties are worth knowing:

  • Uncovered short calls get zero lots. Their loss at expiry has no upper bound, so no budget covers it. Uncovered short puts do have a bound, but it is large: a short 25,600 put at ₹55 can lose (25,600 − 55) × 65 = ₹16,60,425 per lot if NIFTY went to zero, so a 2% rule allows zero lots on any account below about ₹8.3 crore.
  • List the hedge before the short leg. The risk manager reviews targets in the order the strategy emits them. If it reviews the short call first, the long call that would cover it does not exist yet, so the short call is cut to zero. Emitting the long leg first gives the spread its correct size. Live trading works the same way: if the short leg fills before its hedge, the account briefly carries an uncovered short and needs the full margin for it.

4. Futures margin

Futures do not have a premium, so Veloce blocks a share of each lot’s contract value as margin out of equity:

lots = floor((equity − margin used by other futures) ÷ (price × units per lot × rate))

Take MCX GOLD MINI at an illustrative ₹1,28,000 per 10 grams. A lot is 100 grams, so its value is ₹1,28,000 × 10 = ₹12,80,000.

Contract Lot value Margin rate Margin per lot Lots on ₹5,00,000
GOLD MINI ₹12,80,000 10% ₹1,28,000 3
GOLD MINI ₹12,80,000 20% ₹2,56,000 1
GOLD (1 kg) ₹1,28,00,000 10% ₹12,80,000 0

The margin rate here is a modelling choice, not MCX’s figure. The exchange sets initial margin from its risk model, and it changes with volatility. Brokers can ask for more. Margin also says how much you can trade, not how much you should. Three GOLD MINI lots on ₹5 lakh is ₹38.4 lakh of exposure: a 1% move in gold is ₹38,400, or 7.7% of the account. The gold futures article has the contract details.

Combining rules

Rules combine by taking the smallest limit. A typical set for an options seller is maximum loss at expiry at 2% of equity, a cap of 10 lots, and a cash rule so purchases never exceed available cash. For futures, a margin rule plus a gross exposure limit in rupees keeps leverage visible. Every time a rule cuts a target, Veloce records the cut with the time, instrument, lots wanted and lots allowed, so you can see how often sizing bound the strategy.

A daily loss limit as a kill switch

Sizing caps the risk of each position. A daily loss limit caps the day. Veloce’s version records equity at the first decision of each trading day. Once equity falls by the limit from that opening value, it trips. After that, only trades that reduce positions are allowed until the next day. It does not close positions on its own; pair it with exit rules for that.

On a ₹10,00,000 account, a ₹15,000 daily limit (1.5%) means a bad morning cannot become a bad week through revenge trades in the afternoon. In a backtest, count how many days it trips. If it trips often, the strategy is taking more risk per day than its sizing suggests.

A checklist for sizing a backtest

  1. Start from the loss you are willing to accept on one position, as a share of equity.
  2. Work out the worst loss of one lot: premium for long options, spread width minus credit for spreads, a stress move for futures.
  3. Size by dividing the two, rounding down.
  4. Add a lot cap and a daily loss limit as backstops.
  5. Run the backtest with real charges and slippage, read the maximum drawdown in rupees and percent, and plan for worse.
  6. Sweep the risk fraction (1%, 2%, 3%) and compare return against drawdown, not return alone.

The risk and exits page lists every rule Veloce supports, and the glossary defines the terms used here.

Try it in Veloce

Run a NIFTY iron condor or a GOLD MINI futures strategy with a maximum-loss or margin rule, then compare the drawdown at 1% and 3% risk per position. Create a free account to start.

Frequently asked questions

How do you calculate maximum drawdown?
Walk through the equity curve in time order, keeping the highest value seen so far. At each point, the drawdown is that running peak minus the current equity. The maximum drawdown is the largest such fall, in rupees, and the largest fall as a share of the peak it fell from.
What is a good maximum drawdown for a trading strategy?
There is no universal number. What matters is whether you could live through it with real money and whether the strategy's return justifies it. Compare return to drawdown, and expect the live drawdown to be larger than the worst one in a single backtest.
How many lots should I trade with Rs 5 lakh?
It depends on the risk per lot, not the capital alone. Decide what share of equity a single position may lose, work out the maximum loss of one lot, and divide. A NIFTY call spread 200 points wide with Rs 38 of credit can lose Rs 10,530 per lot of 65, so a 2% limit on Rs 5 lakh allows zero lots and on Rs 10 lakh allows one.
Why does my live drawdown exceed my backtest drawdown?
A single backtest is one path through history. Live trading adds slippage, missed fills and periods unlike the test window. The worst drawdown so far is a lower bound on the drawdowns a strategy can produce, not a forecast.
What is a daily loss limit in algo trading?
A rule that stops new risk for the rest of the day once equity has fallen by a set amount from the day's opening equity. In Veloce it allows only trades that reduce existing positions after it trips, and it resets the next trading day.

Sources

  1. SEBI circular SEBI/HO/MRD/TPD-1/P/CIR/2024/132: measures to strengthen the equity index derivatives frameworksebi.gov.in, accessed
  2. NSE circular FAOP70616: revision in market lot of index derivative contractsnsearchives.nseindia.com, accessed
  3. MCX: Gold Mini contract specificationsmcxindia.com, accessed
esc
↑↓Move↵Open