Skip to content

Risk Management

Two accounts run the identical strategy over the identical period, on the identical symbols, taking the identical signals. One ends the decade richer. One is closed after eighteen months because its owner could not stand another day of it. Nothing about the entry rule explains the difference. The sizing rule explains all of it.

That is the argument of this part, and the lab at the end of it is designed to be as uncomfortable as possible: three formulas whose signal blocks are byte-identical, three sizing rules, and three reports that do not look like they came from the same idea.

By the time you reach this part you can specify a system, backtest it at portfolio level, read the report without flattering yourself, optimise a parameter without curve-fitting it and check whether the result survives out of sample. All of that answers one question: does this rule have anything in it?

Position sizing answers a different one: given that it has something in it, how much of your capital should be exposed to it at any moment, and what happens on the days the answer turns out to be wrong. The two questions are almost independent. A rule with a genuine edge, sized badly, produces an account that goes to zero before the edge arrives. A rule with a thin edge, sized carefully, produces something you can actually hold.

The first two lessons are about a single position: what “risk per trade” means once you write it down as arithmetic, where the stop distance comes from, how to convert a risk budget and a stop into a share count, and how to express all of that in AFL so that AmiBroker sizes each trade the way you intended rather than the way the Settings dialog happens to be configured. The second lesson does the same with volatility, which is the most common way of setting stop distance and the one with the most confidently held misconceptions attached to it.

The third lesson steps up to the account. Ten positions of one tenth of equity each are not ten bets if they all move together, and the arithmetic of correlation is unforgiving about this. Here you will find what gross and net exposure mean, which constraints AmiBroker can actually enforce and which it cannot, and why the diversification you carefully arranged tends to evaporate on precisely the days you were counting on it.

The fourth lesson translates the report’s drawdown statistics into a description of an experience. Max. system % drawdown is one number from one historical path. Living through it is eighteen months of watching an account decline while the rule keeps producing signals. There is a real decision hiding behind that, and it belongs to you rather than to the software.

The lab then puts identical signals through three sizing models and asks you to explain the difference.

It does not tell you what your risk per trade should be. No honest source can: the number depends on the capital you are prepared to lose, the length of drawdown you can sit through without interfering, and how much of your evidence you actually believe. What the part does is make the consequences of each choice explicit enough that you can pick one deliberately.

It also does not treat any sizing rule as a form of protection. A two per cent risk rule constrains the loss on one trade when the stop behaves. It says nothing about ten correlated positions stopping out together, nothing about an overnight gap through the stop, and nothing about the twentieth consecutive loss. Each of those gets its own treatment here.

Part 28 for the mechanics of the portfolio backtester, SetPositionSize() and ApplyStop(); Part 29 for the report metrics this part keeps referring to, in AmiBroker’s own vocabulary rather than a blog’s. Part 30’s lesson on sizing and portfolio errors is the diagnostic companion to this part: it catalogues the ways sizing goes wrong in a backtest, where this part is about choosing a sizing rule on purpose.

Everything here runs on end-of-day data in either edition of AmiBroker. No live feed, no subscription and no Professional-only feature is required.

Part34 of 36Level4 — Trading System ResearcherPages5Estimated time2.9 hours

0 / 5 lessons in this part completed