The most important aspect of trading is managing your risk. It’s not sexy or exciting, but it’s absolutely critical to staying in the game.

Read one of Jack Schwager’s Market Wizards books where he interviews extraordinary traders. Every last one of them mentions a big loss that taught them to control their risk.

Read just about anything by Nassim Nicholas Taleb in his Incerto series. You’ll see that the idea of avoiding catastrophic losses — “blowing up” as he’s fond of putting it — is central to his thinking.

In short, if you don’t control your risk, you’re destined to go bust and hang up trading for good. Say “bye bye” to dreams of sitting on a beach sipping Mai Tai’s (or your favorite umbrella adorned beverage) and living off of your trading riches.

So how do you control your risk?

Position Sizing 101

There are multiple ways to reduce your risk, but one of the most basic is completely ignored by your average retail investor: position sizing.

Whether you call it money management, risk management, or something else, the idea is simple — don’t bet too big.

You can get complicated with your methods, using machine learning techniques, or complex optimization algorithms to find how much you should place on each trade, but there’s a tried-and-true technique traders go back to time and time again.

Calculating ATR

The Average True Range (ATR) is a classic position sizing metric used by traders of all varieties. It is designed to estimate the “true” volatility of an instrument so you know how much you can expect it to move on a day-to-day basis in a way that the standard deviation (i.e. price volatility) doesn’t.

ATR does this by taking the difference between the high, low, and close of an instrument, taking the largest value, and then computing a rolling average over a given period of time. In psuedo-code, we’d write:

TR[t] = max(abs(High[t]-Low[t]), abs(Close[t-1] - Low[t]), 
  abs(High[t] - Close[t-1]))
ATR[t] = mean(TR[t-P:])

First, we calculate the true range, then we take the moving average of our true range value for the average true range.

If we want to write this mathematically, we have:

$$TR_t = \textrm{max} \big( \left| High_t - Low_t \right|, \left| High_t - Close_{t-1} \right|, \left| Close_{t-1} - Low_t \right| \big)$$ $$ATR_t = \frac{1}{P} \sum_{t=1}^P TR_{t-P}$$

where P is the number of periods we use to smooth, and t indicates the time when we make our calculation.

It’s that simple.

So what’s the benefit of ATR over typical volatility measurements?

We call it “true range” because that’s what it’s actually getting at, how much a stock moves over the course of a day. Typical volatility measurements just look at the price from close to close, so you can miss out on how much change occurred during the day.

For example, let’s say you have 5 Open-High-Low-Close (OHLC) bars that look like this:

atr-vs-std-table1.png

Calculating the standard deviation yields a significantly lower value than ATR. This won’t always be the case, but is reliable as a general rule of thumb.

Proponents of ATR argue that this is a better (or at least, more relevant) measure of the volatility of your security.

Two Methods to Size your Positions

Wait, wasn’t this article supposed to be about controlling your risk? How do you actually trade with this?

Frequently, traders will risk a certain number of ATRs on a given trade. This is done one of two ways:

  1. Use ATR to set a stop loss based on a pre-determined percentage of capital (maximum loss). This leads to larger position sizes.
  • Shares = floor(% * capital / (N * ATR))
  • Stop = Price — N * ATR

2. Divide a pre-determined percentage of capital (maximum loss) by ATR to get the number of shares to purchase. This leads to smaller position sizes.

  • Shares = floor(% * capital / (N * ATR * Price))

Let’s look at an example using each of these approaches.

For the first, we’ve got a $10,000 account and we only want to risk 2% of capital on any trade. We’re going to size our positions by taking 2ATR (i.e. N = 2) and have a stock currently trading at $10 with an ATR of 5. We’re going to buy 50 shares, which will cost us $500 (or 5% of our capital):

  • Shares = floor(0.02 * 10,000) / (2 * 2)) = 50 shares -> $500 purchase

Now, we use the 2ATR stop loss to set our risk to be $4 below our position, so we’re going to lose a maximum of $200 ($4 stop X 50 shares, assuming our stop holds). With very expensive instruments, this can grow to a much larger proportion of your capital, which will limit the number of positions that you can hold. For example, instead of a $10 stock, let’s say we have a $100 stock, now (keeping all other parameters the same) our model says we need to buy $5,000 — which is half of our capital and will clearly limit the number of positions we can have simultaneously.

The second way is less common, but still applicable. With the same parameters, as used above, we’re going to calculate our position size as follows:

  • Shares = floor(0.02 * 10,000 / (2 * 2 * 10)) = 5 shares -> $50 purchase

This $50 outlay is quite small: 0.5% of your capital rather than the 2% target. In essence, we’re taking some instrument and scaling it by its volatility as measured by ATR. Every increase in ATR (or your multiplier, N) is going to reduce your position size, so more volatile positions become smaller. If you have a portfolio of positions like this, each one will have the same volatility-scaled risk associated with it (also, many traders will still implement an ATR-based stop loss as we did in the first case).

This approach allows you to take on a wide variety of positions, which is exactly what some strategies call for. Other systems are going to need more concentrated positions.

Again, for some systems, this is completely acceptable and preferable to the first approach. The only way you’re going to know how to use it is by testing it.

Why the difference?

The difference between these two approaches stems from their definition of risk.

The first approach looks at risk as the difference between your purchase price and your stop loss. In normal situations (i.e. outside of a market crash and with highly liquid instruments) your stop is going to be fulfilled at the set price, which is going to cap your losses at this level.

The second uses a more common risk definition: any capital in a non-cash instrument (e.g. stocks, bonds, crypto, commodities, etc.) is considered to be “risk.” Even if you’re trading with a stop loss, you could lose everything as these instruments go to zero in a crash you can’t get out of. This broader definition of risk leads the second method to be much more conservative.

What Should You Trade?

There is no “best” approach.

Many systems use the first method, others use the second method, and others just use ATR to set a stop loss while investing a flat percentage into each trade!

There are lots of ways to go about this and the only way to know what is right for you and your system is to test it.

Testing can be hard. You have to set up your parameters, check for bugs, get good data, and make sure your model is free from common biases. Just getting to this can be hard and time consuming!

At Raposa, we make this easy with a simple, no-code interface that allows you to select your stocks, parameters, position sizing, and other relevant parameters when you design your trading strategy. Get up and running in seconds with a professional backtest to test your ideas before deploying them to make money for you in the market. Sign up for our free demo here to learn more.