Every trader eventually works out that the entry signal is the least important part of the system. It takes most of them an expensive year.
Returns are not under your control. The market decides those. What is entirely under your control is how much you lose when you are wrong, how often you allow that to happen, and whether you are still solvent when a strategy that works finally gets its turn. That is the whole of risk management, and it is arithmetic rather than judgement.
Rule one: a fixed fraction, decided in advance
The foundational rule is that no single position may lose more than a fixed small percentage of your capital. One percent is the common figure; two is defensible; anything above that starts requiring you to be right unusually often.
Note carefully what is fixed. It is not the amount you invest — it is the amount you lose if the stop is hit. Those are completely different numbers and confusing them is the most common error in the whole subject. Putting a fifth of your capital into a position with a tight stop may risk far less than a small position with a distant one.
The percentage is chosen once, written down, and not revisited because last month went well. Its purpose is to guarantee that no individual decision can do serious damage, which means it has to hold on the trade you feel most confident about. That is precisely the trade on which people abandon it.
Position size is a formula, not a decision
Once the risk percentage is fixed, the quantity to buy is not something to think about. It falls out of three numbers:
Quantity = (Capital × Risk%) ÷ (Entry price − Stop price)
A worked example. Capital of 5,00,000, risk of 1% per position, so 5,000 rupees at risk. You want to buy a stock at 850 with a stop at 820, which is 30 rupees of risk per share. Quantity is 5,000 divided by 30, which is 166 shares. That is a position of roughly 1,41,000 — about 28% of capital deployed, risking 1% of it.
Change the stop to 800 and the arithmetic gives you 100 shares instead. A wider stop means a smaller position, automatically. This is the property that makes the formula worth having: it prevents the thing traders do instinctively, which is to widen the stop while keeping the quantity, and thereby quietly triple their risk.
def quantity(capital, risk_pct, entry, stop):
risk_amount = capital * risk_pct / 100
per_unit = abs(entry - stop)
if per_unit == 0:
return 0
return int(risk_amount // per_unit)
print(quantity(500000, 1, 850, 820)) # 166Three lines. Written into your system, it is not optional. Left in your head, it is negotiable, and it gets negotiated at exactly the wrong moments.
The stop has to exist before the entry does
You cannot compute a size without a stop, which is the quiet reason this rule matters: it forces the exit to be decided while you are still neutral.
A stop chosen after entry is chosen by somebody who now owns the position and wants it to work. That person moves it. Every trader who has blown up an account can describe the specific moment they widened a stop to avoid taking a loss that was, at the time, small.
Two practical points. Place the protective order at the exchange rather than holding it in your program's memory — a stop that exists only inside a running process disappears when the process does. And set it at a level the instrument's own behaviour justifies, not at a round number that happens to equal the loss you are willing to accept. Those are two different questions and only one of them is about the market.
Daily and weekly limits: the circuit breaker
Per-position risk does not protect you from a bad day. Five positions at 1% each, all wrong on the same morning, is 5% gone — and the danger is what happens next, because the instinct after a run of losses is to trade larger to recover.
So set a second layer. A daily loss limit, commonly around 3%, after which the system stops opening new positions until tomorrow. A weekly or monthly limit beneath that, after which it stops entirely and the strategy is reviewed rather than repeated.
The value is not the arithmetic, which is minor. It is that the decision to stop is made in advance by somebody calm, and enforced by code that has no opinion about whether today feels like it might turn around.
Correlation: the risk you thought you had spread
Six positions, each risking 1%, feels like a spread bet. It is not, if all six move together.
Buy six bank stocks and you have one position at 6% risk wearing six names. The same applies to a group of stocks that all depend on the same commodity, or on the same currency, or on rate decisions. Correlation is highest exactly when it hurts most: in a sharp fall, things that normally behave independently start moving as one.
Two rules worth writing in. Cap total risk by sector or theme, not only per position. And cap total open risk across everything — the sum of what you lose if every stop is hit on the same day — at a number you have decided in advance.
There is a version of this that catches business owners in particular. If your income already depends on a sector, holding that sector as well is doubling a bet you had already placed, and both halves fall in the same quarter.
Why drawdowns are worse than they look
The arithmetic of recovery is not symmetrical, and this table is the most useful thing in the article:
| Drawdown | Gain needed to get back to even |
|---|---|
| 5% | 5.3% |
| 10% | 11.1% |
| 20% | 25% |
| 33% | 50% |
| 50% | 100% |
| 75% | 300% |
A 50% loss requires a double simply to return to where you started. This is why capital preservation is not timidity — the losses compound against you far more steeply than the gains compound for you.
There is a human number underneath the mathematical one. Whatever drawdown your backtest shows, ask honestly whether you would still be running the system four months into it, watching the account fall every week. Most people would not, and a strategy you abandon halfway through its worst stretch delivers none of the return the backtest promised. The maximum drawdown you can actually tolerate is a design constraint, not an output.
Leverage does not raise returns, it raises variance
Leverage multiplies the outcome in both directions. That is the entire description, and it is worth resisting more elaborate ones.
What it changes in practice is how much room you have to be wrong before the position is closed for you. An unleveraged position can sit through a fall and recover. A leveraged one gets liquidated at a level that has nothing to do with whether your analysis was right — only with whether the margin held.
In derivatives this arrives built in, which is why per-position risk has to be computed against the notional exposure and not against the premium or margin paid. An option position costing a small premium can behave like a very large position in the underlying, and sizing it by what it cost you is how accounts disappear in a single session.
Making the rules non-optional
Every rule above is one you already agree with. That is not the problem. The problem is that all of them are abandoned under pressure, and pressure is guaranteed.
Which is the strongest practical argument for writing a system in code. A program checks the daily loss limit before every order because it was told to, without weighing whether today feels different. It computes the size from the formula, not from confidence. It places the stop at entry because that is what the sequence says. And it logs every one of these decisions, so that a quarter later you can see which rule was breached rather than reconstruct it from memory.
Write the risk rules first, before the entry logic. A system with an average signal and disciplined risk survives long enough to improve. A system with an excellent signal and no risk rules does not get the chance.
Protective orders need a live account
A stop held only in your program disappears when the program does. Account free to open
Position sizing, stop placement and loss limits are taught as code rather than as advice in our Algorithmic Trading with Python course at Rs 24,900 — one payment, lifetime access, with a free demo on WhatsApp first.
We sell no tips and no signal group, we manage nobody's money, and we promise no returns. Trading carries a real risk of loss, and no set of rules removes it.
Disclosure: the account-opening link on this page is under Atul Shrivastava's Zerodha Authorised Person registration (NSE AP Reg: AP2516003481; Zerodha Broking Ltd. SEBI Reg: INZ000031633) and earns a revenue share. TheFinBaba is not a SEBI-registered Investment Adviser — this content is educational, not investment advice.
Frequently Asked Questions
What is the 1% rule in trading?
No single position may lose more than 1% of total capital if its stop is hit. It limits the loss, not the amount invested - a large position with a tight stop can risk less than a small one with a distant stop.
How do I calculate position size?
Capital multiplied by your risk percentage, divided by the distance between entry and stop. On 5,00,000 with 1% risk and a 30-rupee stop distance, that is 5,000 divided by 30, which is 166 shares.
Where should I place my stop-loss?
At a level the instrument's own behaviour justifies, decided before entry, and placed as an order at the exchange rather than held in your program's memory. Choosing it after entry means choosing it as somebody who now wants the position to work.
What is a reasonable maximum drawdown to accept?
Whatever you would genuinely keep trading through. Recovery is asymmetric - a 50% fall needs a 100% gain to get back to even - and a strategy abandoned partway through its worst stretch delivers none of what the backtest showed.
Does diversification reduce risk if all my positions are in one sector?
No. Six correlated positions at 1% each behave as one position at 6%, and correlation rises sharply during a fall. Cap risk by sector and theme as well as per position, and cap total open risk across everything.
Why should risk rules be written in code?
Because they are all abandoned under pressure and pressure is guaranteed. A program checks the daily loss limit before every order, sizes from the formula rather than from confidence, and logs each decision so a breach is visible afterwards.
Related Reading
- How much capital do you need for algo trading?
- Backtesting a trading strategy in Python
- Order types: market, limit, SL and SL-M
- How to start algo trading in India
- Algorithmic Trading with Python - full syllabus
- All course fees, stated plainly
Disclaimer: TheFinBaba provides educational content only - this is not investment advice. Trading involves risk of loss.