From the June 2013 issue of Futures Magazine • Subscribe!

# Setting stops the Bayesian way

Stop loss levels are essential when you trade with leverage. Nonetheless, most traders put far more time into forecasting where prices will go and what type and size of position to take than determining stop levels. In fact, stop determination often is the last thing done prior to making a trade. This is a common mistake, and one that traders need to correct for long-term success.

There are a number of ways to set stops. Popular stop techniques include:

• A pure money management approach. The trader determines what he or she is willing to lose and the position size. The stop level comes out of the math.
• Using technical/chart points. A typical argument would be: “If it violates the recent breakout, the uptrend is negated, and I’m out.” This often is hard to reconcile with a fundamental approach where the upside becomes more attractive as the price goes down.

Here, we will describe a mathematical approach to setting stops, using the techniques of Bayesian statistics, a field of statistics that focuses on data distributions and probabilities. A Bayesian approach is useful in many trading decisions because:

It lets you combine your intuitive judgments with objective market data.

It provides a mathematically optimal way of changing your judgments as new market data comes in. This will allow us to move a trailing stop.

We’ll begin with the basic concepts of Bayesian statistics and then explain how it can be used to set stops. We also will show how to use an online tool to experiment with this technique further on your own.

Bayesian analysis

The statistics you took in college probably went something like this: You looked at some numerical data. You then calculated some statistics on the data, such as mean and standard deviation. From this you might have gone on to make forecasts of future data points.

Also, you do not just forecast a point. Instead, you allow for your uncertainty by forecasting a probability distribution. So, you might say that your expectation of the price of gold in two months would be distributed in a bell curve with a mean of 170 and a 50% probability of being between 163 and 177 (a standard deviation of about 10 points). Bayesians call this a “prior probability distribution” because it is made before any new market data are generated.

Now the second step. What if GLD goes down to 150 in the month? Would you still be willing to say that it is likely to go to 170 the month after? If you are a trader who listens to the market, you probably wouldn’t be as sure.

Bayesian analysis takes this into account by updating your prior distribution based on the likelihood of the new data point. In this case, because your old forecast pointed to a small likelihood of gold going down, your new forecast distribution of gold prices should be lower. This is called the “posterior distribution” by Bayesians because it is made after the arrival of new data.

“Shifting distributions” (below) shows the two distributions in the GLD example. Note that the middle of the range of the posterior is slightly lower than that of the prior, and that the probability of the upside has been reduced significantly.

Some traders have shied away from Bayesian techniques because of their complexity. If you want to delve further into this, and know college math, the Wikipedia article on “Bayesian Inference” is a good place to start. Otherwise, just keep reading; the spreadsheet will do the math for you.

One more thing: In actual trading, you may find that the simple practice of putting a prior distribution on paper will improve your results. By making your views explicit, you may find it easier to overcome some behavioral biases.

Setting stops

To determine an effective stop, you have to make some more forecasts. When you set a stop, you really are forecasting the path of prices from now until your trade horizon. There’s no glory in being right three months from now if you get wiped out in the meantime. By setting a GLD stop at say, 160, you are forecasting that the price path is unlikely ever to go below that level.

Forecasting price paths can be challenging. Keep it simple. Assume that if your forecast is right, then the market should gradually move up to your forecasted level. This gives you a time series of gold forecasts from trade initiation until the trade end date. Each week’s forecast is a little higher than the previous one.

That said, you have to use common sense. For example, if you are making a bet on the outcome of a market-moving number, you may want to use a level path until the number comes out.

In practice, any reasonably straight path will work. In our gold example, we think that GLD will rise by five points in eight trading weeks. So the simple path is a gain of five-eighths, or about 0.625 per week. You could use any frequency to adjust your stop, but weekly is a practical default number.

The stop process works like this. On week zero, we determine our prior distribution and initiate the trade. On week one, we assume that GLD should have gone up to 165.00 + 0.625 = 165.63. Instead, it actually fell to 164.13. We use this new price to update our posterior probability distribution. On week two we assume that gold should have gone up to 165 + 2 x 0.625 = 166.25 and update our posterior again.

The last part of the analysis is a decision rule. This will tell us when to take action and exit the position. There are many possible rules, but this one works for me: When the mean of the posterior distribution is below the originally forecasted price path, get out. This could happen over a period of many small weekly declines or in one big crash. In fact, we would be stopped out even if gold moved sideways for long enough because the posterior mean eventually would fall below the path.

Another rule might be that if you wanted to be more conservative, you could use a rule that got you stopped out when the mean fell only halfway between the current and forecasted prices, or you could recalculate the stop daily.

If GLD fell to 162.5 in week two, we would have the table in “Evolution of the trade” (below). As GLD fell from 165.00 to 160.33 in week two, the mean of our posterior probability falls to 166.43. Because our week two stop was at 166.25, we would do nothing. Then in week three it recovered to 162.02, but we get stopped out. The reason is that our week three stop is 165.00 + 3 x 0.625 = 166.88. The mean of the week three posterior is 164.72.

Before we move on to these calculations, there is one important pitfall to note. Numerous studies of probability assessments show that most people think they know more than they do. In other words, most people assess a prior that is too “skinny.” You may think that GLD is highly likely to be between 155 and 175. In reality, a world event might cause it to go to 300. You should take these fat-tailed scenarios into account when assessing your prior.

Editor’s Note: The interactive Excel spreadsheet for this exercise can be found at futuresmag.com/Bayesian. Please go to our website and walk through the Excel spreadsheet to get the most out of this discussion on how best to set stops.

• The fundamental news appeared positive. Many central banks around the world had joined the Fed in printing money, most recently the Bank of Japan.
• The market had fallen to near the lower part of the previous year’s trading range. Momentum indicators were starting to turn up, and other “risk-on” markets were breaking out.

Refer to the spreadsheet. Using the left-hand side of the worksheet “GoldETF,” the initial setup and progress of the trade is in “Input data” (below). Many traders have a hard time assessing purely statistical concepts such as standard deviation. So instead, forecast the point you think gold is most likely to go to (which I call the mean) and a 50% range to this forecast. In other words, assume you thought GLD had a 50/50 chance of winding up between (170 + 7) = 177 and (170 – 7) = 163. The spreadsheet uses this to calculate what it needs.

This forecast was wrong. Instead, the downward momentum re-accelerated. The trade was stopped out in week three as the mean of that week’s posterior was below the assumed path. The stop even was triggered on an up week. This is because, unlike conventional stops, the analysis doesn’t just look at the last price, but at the path of prices since trade inception.

Now, let’s show how this framework could be used for a longer-term value trade. Say that you believe that the insurance company AIG stock price will likely rise by 50% over the next year and a half. Like all large financial stocks, it is suffering both from wariness over the 2008 shock and its perceived opacity. AIG is especially tarred by its government bailout. It is trading at about half of tangible book value, and operating profits are strong. Because this is a value play, we do not want the spreadsheet to set a stop too close to the market; in fact, we want to scale down. (Of course, if AIG goes down, at some point we will have to admit we were wrong and get out.) “AIG assumptions” (below) shows the input spreadsheet for this trade on a monthly basis.

In this case, the trade is positive, although still below the price path. Because of this, the decision point is slowly dropping. The slowness was forced by the assumption that prices will rise by 50%. If you experiment with the spreadsheet, you will see that even prices of \$25  would not stop us out this early in the trade. However, as time passes, the stop becomes more sensitive to lower prices.

Bayesian inference currently is used by a number of hedge funds and prop desks as a forecasting tool. Here, we learned how the principles can be used in an intuitive way. It is hoped this will encourage readers to incorporate these tools into their own thinking. Using the spreadsheet will provide a better feel for how the stop levels work and how much risk various decision rules let you take.

Burton Rothberg is a professional trader and a consultant to hedge funds. He can be reached at br@banachcapital.com.

Page 4 of 5