Showing posts with label stop loss. Show all posts
Showing posts with label stop loss. Show all posts

Friday, 4 December 2020

Dynamic trend following

As most of you know I have a regular(ish) gig talking on the Top Traders Unplugged systematic investor podcast, every month or so with Niels Kaastrup-Larsen and Moritz Seibert. 

Anyway on the most recent episode we got chatting about whether open or closed equity should matter when trading a position. More broadly, should your history of trading a position affect how you trade it now, or is it only what's happened in the market that matters?

Moritz and I had a bit of a debate about this; I'm a big fan of running my system on a 'stateless' basis where the only thing that matters is the market price. My logic is that the market does not know what my position is or has been, or how much profit I've made. That means if I'm using a stop loss, the size of the stop loss will remain the same regardless of what's happened to my p&l since I opened the trade.

Moritz on the other hand, seemed to imply that you should change your trading tactics depending on how the position has played out. The basic idea is that initially you should have pretty tight stops, and once you've made a decent profit you should increase the stop so that the position can 'breath'. Then you have a better chance of hitting a home run if the trade lasts a long time, without being stopped out early when you've just made a profit. These are dynamic stop losses, that adjust throughout the life of a trade.

I followed this up with a twitter thread where I clarified my thinking and got some interesting feedback. I also promised to do some more research. This blogpost is that research. But it's not just about that.

That's because this idea is closely related to another perpetual bone of contention  polite discussion between myself and Moritz, which is whether positions and stop losses should be adjusted as volatility changes. I like dynamic vol control: adjusting position sizes as vol changes. His preference is for no adjustment, for the same reason that if the market is getting riskier you've got a better chance of having a big up trade. 

What these two things have in common is that, intuitively at least, the 'purer' trend following tactic (no dynamic vol, but dynamic stop losses) should lead to more positive skew.

I would like to check that intution, and also see if this is an example of 'the no free lunch effect' (whereby you can only get better skew by giving up Sharpe Ratio). In plain english, what effect do these two changes have on Sharpe Ratio and skew? Then at least we can make an informed decision based on our preferences.

 


Discrete and continuous trading systems


Before we start, I need to make one thing clear. There is one significant characteristic of all trading systems: they are eithier discrete or continuous. A discrete trading system works like this:

  1. Something happens ('entry rule')
  2. We open a trade
  3. (Optionally) we make adjustments to the trade
  4. Something else happens ('exit rule'). A common exit rule is a stop loss.
  5. We close the trade
That's probably 99.9% of retail trading systems right there. Most of you will know systems like that. Some of you will recognise this as the 'Starter System' from my third book, 'Leveraged Trading' . 

What I actually use is a continuous system:

  1. We calculate an optimal position that we want to take
  2. We compare it to the position we currently have
  3. We adjust to get to our optimal position by trading 
There are no 'trades' here, just positions that vary in size. This is the system described in part four of 'Leveraged Trading', and it's also the 'Staunch Systems Trader' from my first book, 'Systematic Trading'.

Now the whole discussion about dynamic vol control and dynamic stop losses doesn't make any sense in the context of continuous systems: they automatically dynamically control vol, and they don't really have stop losses (but since optimal positions are based only on price movements they are definitely state-less). 

So for a like for like comparision, we're going to have to use a discrete benchmark system, and it won't be an astonishing surprise to hear I will be using the starter system from 'Leveraged Trading'. Briefly, the starter system uses a 16,64 moving average to open positions, and a 0.5x annual standard deviation stop loss to close them. So it doesn't do dynamic vol control (not because that's optimal, but because it's simpler and the starter system has to be as simple as possible), but it also has fixed stops: no dynamic stop loss eithier.

If you are too cheap to buy my books, then I describe the important elements of that system in the series of posts that begins here.

We can consider four variations of the Starter System:

- No dynamic vol control, no dynamic stop loss: Simple starter system as presented in the book Leveraged Trading
- Dynamic vol control, no dynamic stop loss: My preference
- No dynamic vol control, dynamic stop loss ('position breathing'): 'purest' form of trend following
- Dynamic vol control, dynamic stop loss: 'double dynamic'


Code for the starter system


To implement the starter system (all code can be found in this gist) using pysystemtrade we do the following:

  • use a single MAV rule with a binary forecast
  • replace the positionSize stage with something that:
    • calculates a 'preliminary position' which is just the binary position scaled for vol
    • adjusts this preliminary position using the function stoploss to create discrete trades
Now, I'm not going to bore you with thousands of lines of python in this code, but it's worth looking at the function stoploss in some detail. 

def stoploss(price, vol, raw_position, dynamic_vol=False, dynamic_SL = False):

"""
assert all(vol.index == price.index)
assert all(price.index == raw_position.index)

# assume all lined up
simple_system_position = simpleSysystemPosition(
dynamic_vol=dynamic_vol,
dynamic_SL=dynamic_SL)
new_position_list = []

for iday in range(len(price)):
current_price = price[iday]
current_vol = vol[iday]

if simple_system_position.no_current_position:
# no position, check for signal
original_position_now = raw_position[iday]
new_position = simple_system_position.no_position_check_for_trade(original_position_now,
current_price, current_vol)
else:
new_position = simple_system_position.position_on_check_for_close(
current_price, current_vol)

new_position_list.append(new_position)

new_position_df = pd.DataFrame(new_position_list, raw_position.index)

return new_position_df
'raw_position' is the position we'd have if we were trading  continuously. It's the position that will be taken when a new trade is opened.

Let's have a look at the workhorse class simpleSysystemPosition.

If we haven't got a trade, we run this logic. Remember 'original position_now' is the unfiltered position; basically the sign of the forecast multiplied by a precalculated position size:

def no_position_check_for_trade(self, original_position_now, current_price, current_vol):
assert self.no_current_position
if np.isnan(original_position_now):
# no signal
return 0.0

if original_position_now ==0.0:
return 0.0

# potentially going long / short
# check last position to avoid whipsaw
if self.previous_position != 0.0:
# same way round avoid whipsaw
if sign(
original_position_now) == sign(self.previous_position):
return 0.0

self.initialise_trade(original_position_now, current_price, current_vol)
return original_position_now

The only point of interest is that we don't put a trade on if our previous trade was in the same direction. This is discussed in Leveraged Trading.

What if we have a position on already?

def position_on_check_for_close(self, current_price, current_vol):
assert not self.no_current_position

self.update_price_series(current_price)
new_position = self.vol_adjusted_position(current_vol)

time_to_close_trade =self.check_if_hit_stoploss(current_vol)

if time_to_close_trade:
self.close_trade()

return new_position
def check_if_hit_stoploss(self, current_vol):
stoploss_gap = self.stoploss_gap(current_vol)

sign_position = sign(self.current_position)
if sign_position == 1:
# long
time_to_close_trade = self.check_if_long_stop_hit(stoploss_gap)
else:
# short
time_to_close_trade = self.check_if_short_stop_hit(stoploss_gap)

return time_to_close_trade
def check_if_long_stop_hit(self, stoploss_gap):
threshold = self.hwm - stoploss_gap
time_to_close_trade = self.current_price < threshold

return time_to_close_trade

def check_if_short_stop_hit(self, stoploss_gap):
threshold = self.hwm + stoploss_gap
time_to_close_trade = self.current_price > threshold

return time_to_close_trade


I will delve a bit more into the calculations for stop loss gap and vol adjustment below, since these depend on what flavour of system we are running.


Dynamic vol control


So what is 'dynamic vol control'? Basically it's adjusting open positions as vol changes. 

(I'm assuming that we always set our initial position according to the vol when the trade is opened. I explore the consequences of not doing that here.)

World has got riskier? Then your position should be smaller. Things chilled out? Bigger position is called for.

Note, and this is really important, if you're going to adjust your vol you must also adjust your stop loss. Since I set stop loss initially at 0.5xannual standard deviation, if vol doubles then the stop loss gap will double (get wider), if it halves then the gap will also half (get tighter). 

Why is this so important? Well, suppose you halve your position, but don't widen your stop loss gap. Your risk on the trade is going to be too large; and you'll end up getting stopped out prematurely. Basically the stop loss and the postion size need to stay in synch, as I discussed in the series of posts that begins here.

Here's the relevant code from our uber-class, simpleSystemPosition:

def vol_adjusted_position(self, current_vol):
initial_position = self.initial_position
if self.dynamic_vol:
vol_adjusted_position = (self.initial_vol / current_vol) * initial_position
return vol_adjusted_position
else:
return initial_position
def stoploss_gap(self, current_vol):
xfactor = self.Xfactor

if self.dynamic_vol:
vol = current_vol
else:
vol = self.initial_vol

stoploss_gap = vol * xfactor

return stoploss_gap

Xfactor will be 8 here, because we use a 0.5x annual standard deviation stop loss to close positions and vol here is daily, so the multiple becomes 16 (square root of 256~approx # of trading days per year) multiplied by 0.5 = 8

(Of course we'll allow Xfactor to vary when we use dynamic stop losses)


Dynamically adjusting stop loss for p&l


Now what about the dynamic stop loss? Remember we want to have a smaller stop when we enter a trade, but if we make profits we need to increase the stop. I thought about this for five minutes and came up with the following:


The y-axis is the X-factor to use. The x-axis is a measure of vol normalised profitability: it's the profit or loss in price points divided by the initial vol when the trade was put on. As you can see from the excellent drawing, we use an X-factor of 2 when the trade is put on, or if we're losing money. If we make profits, the X-factor gradually increases to 8 (which is the default fixed setting) and goes no higher.

I haven't fitted this, all I did was plot the statistic for vol-normalised trade profit for one instrument (Eurodollar) to get a feel for what sort of values it has. And since I already had an 8 parameter, I thought I might as well have another one.

Here's simpleSystemPosition again:
@property
def Xfactor(self):
if self.dynamic_SL:
return self.dynamic_xfactor()
else:
return fixed_xfactor()

def dynamic_xfactor(self):
pandl_vol_units = self.vol_adjusted_profit_since_trade_points()
return dynamic_xfactor(pandl_vol_units)

# outside the class
def fixed_xfactor():
return 8.0

def dynamic_xfactor(pandl_vol_units):
MINIMUM_XFACTOR = 2.0
MAXIMUM_XFACTOR = 8.0
PANDL_UPPER_CUTOFF = 8.0
PANDL_LOWER_CUTOFF = 0.0
if pandl_vol_units<=PANDL_LOWER_CUTOFF:
return MINIMUM_XFACTOR
elif pandl_vol_units>PANDL_UPPER_CUTOFF:
return MAXIMUM_XFACTOR
else:
return MINIMUM_XFACTOR + (pandl_vol_units)*(MAXIMUM_XFACTOR - MINIMUM_XFACTOR)/(PANDL_UPPER_CUTOFF - PANDL_LOWER_CUTOFF)
Whilst this may not resemble what any real person actually does in their trading system, it does at least do what dynamic stop losses are supposed to do: let positions 'breath' once they're in profit.


PS: A stateless way of letting positions breath

Something that occured to me, but I didn't test, is that you can implement a dynamic stop without having to calculate previous p&l. For example you could measure the length or strength of a trend, thus creating something that was consistent with my conviction that 'the market doesn't know what my profit is, or when I put a trade on'. 

If you put a gun to my head and said I had to do a dynamic stop loss, then this is how I'd do it.


Evaluating the results

OK, so we're going to measure the Sharpe Ratio, and the skew of our p&l series. We're trying to see if going dynamic makes more money, or changes the skew, or both. Then depending on our preferences we can decide what suits us.

There are two ways of evaluating your p&l: by trade, or by time period. Retail investors usually use 'per trade', professionals use time periods 'per day', 'per month' or 'per year'. 

NB I nearly always use time period P&L, because I'm a bleedin' pro mate.

Does it matter? 

YES. In fact the skew of trades and returns is substantially different for trend following systems, as I shall now illustrate with Eurodollar and the base system (the exact system and instrument is irrelevant for the moment as I'm not comparing results; you'd see similar effects):

instrument_code = "EDOLLAR"
pandl_returns_capital = pandl_capital(instrument_code, system, method_used="returns")
pandl_trades_capital = pandl_capital(instrument_code, system, method_used="trades")

What I'm showing you here are the cumulated returns from returns (orange line) and trades (blue line), zoomed in. Obviously they line up at the point each trade is closed, but the blue line is more jagged since it only cumulates at the point when a trade is closed.

Now let's look at the distributions; first daily returns:
pandl_returns_capital.hist(bins=100)
(The plot has some extremes removed for both tails). 
As I discussed at some length in this post from last year, the skew of daily returns p&l will often be slightly negative except perhaps for very fast systems. Here the skew is -0.24. Now what about trades?

pandl_trades_capital.hist(bins=30)
Wow! That is some seriously positive skew: 2.84 (I've cutoff the plot at the right tail). That is what we'd expect, because we're trend followers. 

Clearly we need to consider both kinds of p&l here when considering skew, as they will probably give substantially different answers. And for return p&l skew we need to think about different time periods, as again they will give different results. Sharpe ratio we'll just measure on daily return p&l; Sharpe Ratio for trades doesn't make a lot of sense.

So our measures will be:
  • Sharpe Ratio (based on daily returns and annualised)
  • Skew (based on daily returns)
  • Skew (weekly returns)
  • Skew (monthly returns)
  • Skew (using trades)
For all these figures I'm going to use gross returns, with the statistics averaged across instruments, giving all equal weights. So don't be surprised to see quite low Sharpe Ratios, these are instrument SR not portfolio SR.

(The reason for not taking costs into account is that I'm not using the main pysystemtrade accounting functions here; they can't do trade by trade p&l, and I want to refactor them before I add that functionality. This will make dynamic vol control - which leads to more position adjustment trades - look a little better than it is, although in practice buffering will reduce the actual amount of extra trading by a considerable amount)


Results



        SR
Neithier 0.19
Dynamic vol 0.25
Dynamic SL 0.05
Both         0.07

So beginning with Sharpe Ratio we can see that dynamic vol adds value to the basic starter system: this confirms the result in my book 'Leveraged Trading'. However the dynamic stop loss is a big loser. Adding dynamic vol control in as well improves it slightly, but clearly a lot of positions are being closed before the dynamic vol does anything interesting or useful.


        Skew trades
Neithier 1.95
Dynamic vol 1.87
Dynamic SL 3.07
Both         4.00

Now looking at the skew for trade p&l, we can see that dynamic vol does indeed reduce the positive skew. Clearly it's cutting the position on too many big winners just as things are getting interesting. But the reduction isn't massive. In contrast dynamic stop loss massively increases the skew, as you might expect; from all those positions that start to lose being cut quickly. Interestingly the highest skew of all comes from doing both; there must be some weird interaction going on here.


        Daily return skew
Neithier 0
Dynamic vol    -0.11
Dynamic SL 0.4
Both        -0.02

Now let's consider the skew of return p&l, first for daily returns. There's basically no skew for the simplest system. Adding dynamic vol reduces the skew a little, as for trades. For dynamic stop loss the skew is boosted, as we'd probably expect. However the increase in skew is nowhere near as dramatic as it is for trades. Finally doing both results in the two dynamic effects pretty much offsetting each other.


        Weekly return skew
Neithier 0.34
Dynamic vol -0.02
Dynamic SL 0.35
Both         -0.01

        Monthly return skew
Neithier 0.73
Dynamic vol 0.08
Dynamic SL 0.77
Both         0.05

Considering weekly and monthly returns, we can see that a similar pattern emerges. The basic system has positive skew which increases as we go slower (as discussed in this post). Adding dynamic vol control reduces the skew, by a fair bit. Adding a dynamic stop loss increases it, although only by a very small amount. Doing both results in something pretty similar to dynamic vol control.


Summary

This post has confirmed my intuition:

  • Adding dynamic vol control reduces positive skew, but adds Sharpe. The effect is starkest for trade by trade p&l, and for monthly returns.
  • Adding dynamic stop losses increases positive skew, but drastically reduces SR. The skew bonus is very high for trade p&l, but relatively modest for weekly and monthly returns.

Now to be fair, I don't know exactly what other trend followers do in their trading system, since unlike me many of them don't have the freedom to open source it*. So I don't know if these tests accurately reflect what 'purer' trend followers are doing, especially when it comes to dynamic stop loss (dynamic vol control is less contentious since there is only really one way of doing it: you could change the measurement of vol, frequency of changes and the use of buffering; none of which will affect the results very much). 

* 'Yes I know I'm charging you 2 and 20 for my black box, and I know I put the entire thing on github, but information want's to be free dammn it!'

It's most likely that they are running a milder version of what I've used, something that doesn't affect the SR anywhere near as much as the dynamic stop loss I outlined here. However, this will also lead to a smaller skew bonus: the no free lunch hypothesis is confirmed again, you can't buy more skew without selling SR. You can probably test this by changing the parameters of the dynamic skew function.

But the point of this post isn't to say 'this is the perfect way'. It's to show you the possible trade offs. What you will do will depend on your preferences for SR and skew. You could whip out Occams' razor and say you should run the simplest system, which has very good skew properties at weekly and monthly returns. Or you could take the view (like moi) that the extra SR of dynamic vol control is worth the complexity and reduction in skew. Or you could go hell bent for skew, and do dynamic stop losses (but not dynamic vol). 

The only thing that doesn't make sense is doing both! That's ideologically inconsistent, over complicated, and also pretty crap.

Frankly, it's up to you. To me the most interesting thing for me about this exercise has been the contrast between the skew of trade p&l, and return p&l. You can be doing something that massively bumps up your positive skew on trade p&l (like very aggressive dynamic stop loss adjustment), and think you are being a 'purer' trend follower, and then when you look at your monthly return you see there is no meaningful skew effect :-(



Thursday, 6 February 2020

What is the right way to set stop losses?

Stop losses are the most common method used by traders to control risk. However, they're often used inappropriately. In this post I'll quickly bust some of the myths around them, and explain how to use them properly.

This is the first of three posts aimed at answering three fundamental questions in trading:


  • How should we control risk (this post)
  • How much risk should we take? (next post)
  • How fast should we trade? (final post)
If you find my approach interesting, you may want to read some more about it in my latest book, "Leveraged Trading".

(Note to regular readers of the blog or any of my books: you won't find much new here. But I'm writing these posts in the hope that they will start appearing in Google searches to stop people making silly mistakes. Think of these three posts as the 'gateway drug' to the world of trading professionally).



What is a stop loss?



To make sure we're all on the same page, I'm defining a stop loss in the following way. I use trailing stop losses. 

Assuming you have a long position, you should sell when the price has fallen by more than X below it's high watermark. The high watermark is the highest price that a stock (or future, or whatever) has reached since you purchased it. Of course if the thing turned out to be a complete lemon, then the high watermark will be the purchase price.

If you have a short position, then you should buy (closing your short) when the price has risen by more than X above the low watermark. The low watermark, as you've probably guessed, is the lowest price that the stock has reached since you bet on it going down. I'll mostly frame the examples here in terms of long positions, since they're easier to get your head around, but everything I say is applicable to shorts once you've flipped the language around (long->short, fallen-> risen, high watermarket-> low watermark, highest price->lowest price).

Here's a real example. I bought shares in Go-Ahead group (a UK bus company) in September 2017. Go-ahead group has the ticker GOOG, and everyone I know that isn't a finance geek assumes this is the ticker for Google. But as any fool knows, Google nowadays prefers to be identified as Alphabet and hence has the ticker.... GOOGL. So no danger at all of confusing a modestly sized UK bus company with a global tech titan.

Let's have a look at the chart:

https://www.hl.co.uk/shares/shares-search-results/g/go-ahead-group-ordinary-10p/share-charts

My acquisition price was £15.65 and I set my stop loss at 30% below that:

 (1-0.3)*15.65 = £10.96

(The whys and wherefores of where to set the stop loss will follow later in the post. For now, just take 30% as given).

If the price had subsequently fallen below £10.96 then I would have sold GOOG. But it didn't! In fact it went up, hitting a high water market (HWM) of just under £18 in November 2017. I would have adjusted my stop loss on every high, and it would have reached:


 (1-0.3)*17.89 = £12.52


Then some bad ju-ju hit GOOG and the price fell. Fell below £17, £16... kept falling until it was below the price I had acquired it at (£15.65, if you have a short attention span).

But it never reached my stop loss level of £12.52, so I hung on. In February 2018 the price bottomed out at £13.38. And then it rallied. And rallied some more. And by April it was making new highs, hitting a HWM of £18.10. So I adjusted my stop loss to:


 (1-0.3)*18.10 = £12.67

In fact it continued rallying some more all the way up to £19.64, which meant my stop loss was now £13.75.

I won't continue to bore you with the ups and downs of this stock, but to cut a long story short the most recent HWM was £22.78 set in November last year, and thus my current stop is £15.95. Notice that if the price falls to that level then, assuming I can sell exactly at my stop, I will 'lock in' a profit of £15.95 - £15.65 = £0.30. Not amazing after over 3 years, but better than nothing.


Some other kinds of stop losses



Notice some key features of the trailing stop loss:
  • The stop 'trails' the price, ratcheting upwards with every new HWM
  • Eventually, we're 'guaranteed'* not to lose more than our initial investment, and even to lock in a profit.
  • The most* we can lose at any time is 30% of our profits*
* Caveats! This assumes we can get out exactly at our stop

We can contrast this with a fixed stop loss, where I would have set the stop at £10.96 and left it there. A few scenarios can play out here. The price could plummet to £10.96, and you'd close: exactly the same as the trailing stop. If the price follows the path we've seen here, well it would still be holding the position, so again now change. 

But importantly, if the price now falls down to £10 then the trailing stop will prevent us losing more than 30% off the best price, whilst the fixed stop will mean we always lock in a loss on our initial investment when we close. 

Even if the price never gets down that far we could end up owning stocks forever when there are better opportunities out there; with a trailing stop set at the right level you will eventually close your position and have a chance to redeploy your capital.

A special case of a fixed stop is the breakeven stop. You initially set a stop below your purchase price, but once it's risen a bit your reset it permanently at your entry price. Guess what, there is nothing special about your entry level as far as the market is concerned. This is no better than any other kind of fixed stop.

Some people like to use stop profits eithier instead of, or in addition to, stop losses. A stop profit or profit target is a target price at which you will sell the stock. Clearly this doesn't provide you with any protection against losses, so you need to have a stop loss as well. Even then I have two issues with using profit targets. Firstly, they add unneccessary complexity to your trading. Secondly, I don't know where a stock might end up, so why set a target? 

Consider Intermediate Capital Group (ICP), which I bought at £4.26 in July 2016:

https://www.hl.co.uk/shares/shares-search-results/i/intermediate-capital-group-ord-gbp0.2625/share-charts
A typical setting for profit target is twice your stop loss, i.e. 60% of the purchase price or £6.82. ICP is now over £17, a rise of 300%! That's an awful lot of profit I would have missed out on. 

Note: For some kinds of mean reversion systems profit targets make sense, but they should be set using a proper analysis of the mean reversion process rather than a single figure. They make no sense at all if you're looking for trends.

Another stop loss strategy I am not keen on is the time based stop. You hold your position for 3 days or 3 months, and then close it if it hasn't reached some kind of profit target. Unless you're trading options where timing is inherent you shouldn't normally try and predict exactly when something is going up. It's hard enough predicting if it will go up. 

Of course any kind of stop loss is better than no stop at all. Without a stop loss I may well have sold GOOG at £18 to lock in my profits, missing out on the additional profits I've made subsequently. Or I could have panicked when it dropped below £13, and sold at a loss.


Where should we set our stop?


The figure of 30% above came out of thin air. But how in reality do we calculate this number? 

Here's an interesting quote:

"Each system has its unique and optimal betting percentage."

Is this really true? Do we have to risk calibrating/fitting the optimal percentage using a back-test? Or can we set the relevant figure with some simple rules? (Spoiler- the latter)

Let's review some facts:

Capital loss: A wider stop (more than 30%) means we'll lose more money. For example if we've invested half our account in a stock, then we're risking 30%*50% = 15% of our capital. Widening our stop will increase the likely damage to our account when the position is closed, and vice versa.

Time: The longer we hold a trade for, the more likely a stop will eventually be hit. GOOG is unusual; most of the trades I've done using this stop-loss last for about 6 months to a year.
The tighter a stop is, the quicker we'll hit it. For example if I set my stop for GOOG at 10% (i.e. initially at £14.09, then ratcheting up to 10% below £17.89=£16.10) I would have been stopped out in mid June 2018. Conversely, if I widen the stop enough then it might never be hit (a 99% stop will only be hit if a company is completely wiped out).

Volatility: If something is more volatile, it is more likely to hit a stop at a given level. Consider Bitcoin, here represented by an ETF:

https://www.hl.co.uk/shares/shares-search-results/x/xbt-provider-ab-bitcoin-tracker-eur/share-charts
It takes a few months -or even years - for most shares to move 30%, but 30% moves happen in a few days for this crazy POS asset.

Magic beans price level: We want to set our stop at the level where, if the price breaches it, it is guaranteed to keep falling. You may notice from the subheading that I am somewhat skeptical of this. Things like using fibbonaci numbers as 'key resistance' levels are pretty bogus. You may want to use a rule to tell you when the market is likely to fall, but it's better to drop the stop-loss entirely if you're going to use such a rule (this is discussed in chapter nine of "Leveraged Trading").

Let's start with the issue of capital loss. A common method for setting stops is to do so such that N% of your capital is at risk, eg N=1%. So for example if you bought 100 shares of Apple, that would be a position of $32,000 based on the current price of ~$320. If you had invested all your capital in Apple, then that would correspond to a 1% price move: $0.32. You're likely to be in the trade for less than a day.

This leads to traders saying stuff like this:

Yes, but I am trading low float stocks not something like forex where that 1% actually makes sense. If I put a stop loss at 1% on stocks 9/10 times it will probably just stop me out.

This trader appears to have a hobsons choice! They can set their stop appropriate to the volatility of the market at say 30% for low float stocks... but then they will be risking too much of their capital. Or they can set their stop appropriate to their capital, and risk being stopped out too quickly.

This makes no sense! Instead what you should do is:
  1. Set the size of your position according to your capital, and the ratio of your risk appetite and the risk of the underlying market.
  2.  Then set your stop according to volatility and time horizon.

Let's explore that. Suppose for example that you are happy to run your account at about the same level of risk as Apple shares, that you typically own two shares, and that you have $30,000 in capital. This implies that you should risk half your capital: $15,000 on your Apple stock position. At the current price of $320 that equates to 46 shares. 

Now you are free to set the stop-loss at a level which makes sense for the market. You should set the stop-loss at X * volatility of the market. Where does X come from? A larger X will mean wider stops, so you will hold positions for longer. A smaller value of X will result in holding positions for less time. You should set X according to how long you want to hold positions for.  I'll come back to that decision in in a future post. 

For now, let's use X=0.5, and assume we measure volatility as the annual standard deviation of the market which for Apple is around 20%.

Note: In subsequent posts I'll explain how you can use different measures of risk, such as the daily ATR, to calibrate your stop losses.

0.5 of 20% is 10%, so the stop loss for Apple should be set at 10% below your entry price. What proportion of our capital is at risk if we hit our stop loss? Well, it will be 10% of $15,000; $1500. Which is 5% of our capital.

Notice that the stop loss will have nothing to do with the size of your account. A small trader will have the same stop loss as a large trader, but a smaller position. A trader who has more appetite for risk will have a larger position, but the same stop loss. You can set your stop loss differently for FX and stocks without worrying about using too much capital. 

To see why this is a superior method, consider what will happen if you decide to invest in a Bitcoin ETF. Or maybe that should be 'invest'. Or to be accurate, invest in gamble on.

Suppose that Bitcoin is four times as volatile as Apple. We had a risk target for our account which was the same as Apple, 20% a year standard deviation of returns. But Bitcoin has four times the risk, 80% a year.

That means your position in Bitcoin will be a quarter of the size to compensate for the extra risk: $3,750. 

The stop loss will be set at 0.5 * 80% = 40% for Bitcoin. Much wider, to reflect the higher chance that Bitcoin will make a big move. 

How much of our capital is at risk? A 40% move on a $3750 position will cost us $1500. That's the same as for the Apple trade! Setting our position size and stop loss independently means we can target a particular % of our account at risk, whilst setting our stop differently according to market conditions.

Notice also that the same stop-loss can be used for different instruments, and it will adjust automatically if the volatlity of the market changes. A stop that made sense in the quiet days of 2006 would have been far too tight in the madness of late 2008!

Another benefit of this method is that you can switch to a trading system that doesn't have an explicit stop loss (like my automated futures trading account), and your risk will still be accurately sized.


Some unanswered questions


In this post we've learned that position size and stop levels should be set independently, and that stop levels should only depend on your expected holding period and the volatility of the market. 

But! There are hefty two elephants left in this particularly crowded room, namely:

  • How big should our positions be: how much risk should we take on our account?
  • What should the stop loss multiplier 'X' be: How fast should we trade
I will answer these questions in the next couple of posts (number two and number three).