Monday, June 29, 2009

My interview, stop loss, and the Principle of Latest Information

You can find an interview of me in the July 2009 issue of Technical Analysis of Stocks & Commodities magazine. I mentioned in that interview and also in my book that I believe stop loss should only be applied to momentum strategies but not to mean-reverting strategies. I explained my reasoning better in my book than in the interview, and so I will paraphrase the explanation here.

In algorithmic trading, it is reasonable and intuitive that we should always make use of the latest information in determining whether we should enter into a position, whether that information is price, news, or some analysis. Let's call this the Principle of Latest Information. (If someone can think of a better or sexier name, let me know!)

So let's say we have a stock model based on price momentum, and we entered into a long position based on a recent positive return on price. A few minutes later, the price went down instead of up, causing a big loss on our position. If we now ran this momentum model again, very likely it would tell us to short the stock instead because of the recent negative return on price. If we did that, we would be exiting the previously long position and became flat. This is in effect a stop loss, and it follows strictly from adhering to our model and our Principle of Latest Information.

In contrast, suppose we now have a stock model based on mean-reversion, and we entered into a long position based on a recent drop in price. A few minutes later, the price went down further instead of up, again causing a big loss on our position. If we now ran this mean-reversion model again, it would definitely tell us to buy the stock again because of the ever cheaper price. The model would not ask you to exit this position and take a loss. Hence, adhering to the model and the Principle of Latest Information will not lead to a stop loss for a mean-reverting model.

(Now, if we hold this losing long position long enough, the model will incorporate new historical prices into determining its long or short signals as it retrain itself, as the Principle of Latest Information says it should! At that time, it may indeed recommend that we exit the previously held long position at a loss. But this adjustment takes place at a much longer time scale, and therefore cannot really be considered a stop-loss in its usual sense.)

More generally, I find that at every turn, and not only in the realm of stock trading, applying the Principle of Latest Information always help me to be disciplined and not be afraid to enter into new positions, take loss or endure a drawdown as the case may be.

36 comments:

Unknown said...

Hi Ernie,

What about the "principle of reaffirmation".

I always enjoy your posts

Stefan

Anonymous said...

Ernie,

I disagree with your assertion. A very famous economist/speculator once said: "The market can stay irrational longer than you can stay solvent." He (Keynes) has been right time and time again! Even if your model is ultimately correct 100% of the time, because as a speculator you are most likely path dependent you can still be bankrupt before you know it if you do not have a stop loss. We all know that there cannot be a perfectly prescient model. A very good model may be able to exploit a number of "known unknowns" extremely profitably. However, there may be some "unknown unknown" lurking out there that totally ruins your very good model. Taleb calls this a "black swan." A stop loss will guard against such ruin as long as there is still enough liquidity available.

As an aside, I suspect that mean reverting models without stop losses carry about the same magnitude of blow up risk as shorting out of the money options. If I were prevented from using stop losses on mean reverting models, I think I'd rather just short some vol and save myself the headache of trading every day.

Ernie Chan said...

Anonymous,
You made a good point about solvency and risk management. However, that issue can be handled by applying Kelly formula (which I talked about often on this blog and in my book) to your overall risk management. Applying Kelly's formula to a mean-reverting model may indeed results in exiting some positions at a loss, but it will not ask you to exit your entire holding at once. The goal of Kelly formula is NOT to prevent further losses, it is merely to prevent a catastrophic loss that will wipe out your equity. Hence I don't think it can be thought of as stop loss in the usual sense.
Ernie

GregK said...

Hi Ernie,

How about Latest Information Principle or LIP?

I agree with your comments about stop losses in theory, but still use a disaster stop of 20% with my mean reversion systems. In backtests the disaster stop decreases my return a few percent, but it does help me psychologically.

Greg

Anonymous said...

Ernie,

Using Kelly's formula to size your bets depends on your estimate of the amount of edge that you have. Presumably you would arrive at that estimate via your model. In card gambling (assuming that the dealer is not cheating) you only have known unknown (i.e. you don't know what's going to come up next, but you do know what is in the realm of possibilities), which makes computing your edge quite trivial. In finance and most other games in the real world, there will always be unknown unknowns which makes estimating your edge quite tricky. Because of unaccounted for states of the world, your model could be telling you that you have tremendous edge, when in fact you do not. Even if you heavily discount the edge that your model computes, you could still be way off in some states of world that occurs once in N years. Hence, I find stops are the best way for preservation. It's not elegant and quite kludgy. But very effective in the real world.

Ernie Chan said...

Hi Greg,
I like the acronym LIP, but doesn't much like the disaster stop. But whatever works for you psychologically!
Ernie

Ernie Chan said...

Anonymous,
Certainly a model cannot predict black swan events, and certainly the usual implementation of Kelly's formula does not incorporate such non-gaussian price movements. Nevertheless, you can venture a guess as to its possible magnitude, such as by looking back the long history of securities market, to see if we even come close to such an occurrence.

Apart from theoretical arguments, I can say that my mean-reverting models, which do not use stop loss, performed best when there are truly abnormal events such as those that occurred in 2007 and 2008. So stop loss has never helped me in actual trading.
Ernie

Anonymous said...

Ernie,

You are correct. You cannot model a black swan. However, you can hopefully dodge most of it with an appropriate stop, which is why I disagree with you regarding stops in mean reversion models; without stops I believe the blow up risks are about the same as shorting out the money options; both implicitly short black swans and extreme events. Personally, I prefer to let the discretionary traders (the Soros of the world) play the wings of the distribution than my models.

Regarding your experience, I think thus far either you've been purposely under levered (with respect to Kelly's formula), lucky or most likely some combination of both. Some amount of good fortune is always a nice thing to have ;)

Lastly, Kelly's formula does not assume any price, return, or payout distribution. I don't see why non-Gaussian price movement would affect it. It does assume that you have a realistic estimate of your edge and that your bets are independent. Can you please clarify what you mean?

DataWolf said...

I fully concur with your statements about stop losses. If you are trading mean reversion with stop losses, you are basically throwing your money away, just find another strategy you are comfortable with.

Ernie Chan said...

Anonymous,
Stop loss does not protect you against black swan catastrophes such as when airplanes were flown into buildings. When such events occur, the exchanges stopped trading, and when they re-open, a large drop in P&L would have already occurred. Actually those traders who buy large positions after the market re-opens typically earn out-size profits.

The version of Kelly formula when applied to finance is the continuous version, as detailed by Ed Thorp and described in my book. The version commonly adopted by traders is the discreet version which is inadequate. The continuous version, however, also has its limitations, since it relies on the Guassian assumption. Continuous Kelly formula that does not rely on Gaussian assumption does not have a closed-form mathematical solution and requires complex numerical computations to use.
Ernie

bwc2000 said...

Hi Ernie, I purchased your book and have to say you had nail this topic and the topic on changing regimes well esp most books never covered it. Can you please confirm if this is what you are saying though as I'm struggling a bit on when to get out on a mean-reversion method:

Basically if one is using a mean-reversion without stop-loss, they should "continously" reduce the original position as losses mount based on the kelly formula?

Then if the prices dropped further, one entered in another new position based on the model, while the original position is reduced even further?

Then again if prices continue to dropped further, one entered in a 3rd new position, while the 2nd position gets reduced, but the original position is basically reduced to a tiny amount or just exits?

But each of those trades entered above are treated as separate trades as oppose to 'catch up' trade (such as martingale betting scheme in 'hope' of break-even). So each one will exit at their own profit while one of them is still at a loss. (ie. 3rd position exits at a profit while original and 2nd one exits at a loss) ?

Thanks in advance.

Rob Ryley said...

Ernie,

Interesting post, but I'm going to argue this from a Bayesian Decision Theoretic POV, so I would have to disagree.

Whether we realize it or not, there is always some prior probability that our model is wrong--horribly wrong. Your argument assumes that your model is 100% correct, which we should never do.

A mean reversion model might recommend adding to losing trades, and that may be good advice. If the expected returns on the funds after adjusting for various risks (including model failure), then we should add to the position.

Indeed, these scenarios should be planned for before even putting on a position.

It may, however lead to ruinous losses when the model is trading in the wrong type of regime, as others have pointed out.

Ideally, we would need to use Bayes' Theorem, and a subjective, informative prior probability to figure out if the new data is consistent with our model (ie. we are in a mean reversion environment), or some other model (ie. a trending regime that goes against us).

With our priors, we could generate data to calculate the odds (ie. likelihood ratio) that our model of the market is still appropriate.

If after an analysis of all of the information, (info from our prior beliefs, and the new evidence) says our model is still probably correct, then add to the trade.

If we aren't sure, perhaps we should either do nothing, or possibly even get out.

Ernie Chan said...

Hi bwc2000,
Kelly formula need to be applied only when you only have one pair position in your account that threatens to wipe out your equity. Typically, a trader has multiple pairs in an account, so the loss in any one pair is not significant. In this case, there is no need to reduce the position in the face of loss. In fact, one should increase the position linearly proportional to the loss.
Ernie

Ernie Chan said...

Rob,
You are correct to say that we should update our positions with the latest analysis -- this is what I advocate with the Latest Information Principle (hat tip to Greg). However, in the absence of news, just because the trade goes the wrong way may not provide new information about your model. It could just be random fluctuation. I am not sure that a Bayesian model would incorporate short-term prices in updating the prior.
Ernie

Anonymous said...

Hi Ernie

I know this question isn't relevant to your interview article but I just bought your book and ran Example 7.2.

I downloaded the spatial-econometrics toolbox as the text says.

My critical values are:
1% Crit Value -3.902
5% Crit Value -3.327 10% Crit Value -3.037

yours are different -3.819,-3.343,-3.042, so our t-statistics are different.

Is that because the DF critical values are dependant on the number of samples and you must have run a different number of dates to what is on the website??

Thanks

Ernie Chan said...

Hi Anonymous,
The critical values are very much dependent on the data you used. I believe I included some historical data for use with this example, so if you use that, the critical values should be the same.
Ernie

Anonymous said...

Hi Ernie,

I am just wondering what will happen if the regime changes and prices would never revert to its previous mean. In this case, would the stop loss help.

Lofgee

Ernie Chan said...

Hi Lofgee,
What you described was answered in my paragraph: "(Now, if we hold this losing long position long enough, the model will incorporate new historical prices into determining its long or short signals as it retrain itself, as the Principle of Latest Information says it should! At that time, it may indeed recommend that we exit the previously held long position at a loss. But this adjustment takes place at a much longer time scale, and therefore cannot really be considered a stop-loss in its usual sense.)"

Ernie

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...

Hi Ernie

I know this isn't the right post to ask this question under but I wasn't sure if you see comments posted to old topics - I have never had a blog so I don't know.

I ran a modified version of your cointegration code (Example 7.2) over 500 stocks. Though only 163 are shortable via my broker.

This gave me about 2,000 that had tstats less than -3.08 (the approx DF value for 10% critical).

For the stocks the z=results.resid result was bounded by various ranges some +/- 0.4, others +/- 1 etc

Having got a good tstat and seeing a nice plot around z=0 what is the step to then determine the 'best' or better pair to trade.

I was thinking of a zscore as per example 3.6 in your book and then entering +/2 std deviations.

Am I on the right track?

Thanks

Michael

PS. Wish I could get to your UK course

Ernie Chan said...

Hi Michael,
You can select the best pairs with the lowest (most negative) t-stats.

Alternatively, you can select the pairs to trade based on the backtest Sharpe ratio of that pair, assuming you have constructed a mean-reverting strategy on them.

Otherwise, your procedure looks good.
Ernie

Vicky said...

Hi Ernie,

I am a day trader trading crude oil futures. My main area of interest in Mean Reverting Strategies. Could you please suggest me some book related to Mean Reverting Trading.

-Vivek

Anonymous said...

Hello, Ernie!

I first read your article about stop loss and found it refreshing. Now I read your "Principle of Latest Information" and thought it could be paraphrased as "if you use one model to enter, you should use the same model to exit." It all makes sense but...what happens if the model (or strategy) is NOT 100% correct? And we all know no strategy is 100% correct. Stop loss is a crude and yet elegant way that allows us to trade an imperfect but winning strategy day in and day out. It is elegant because with it we do not have to concern ourselves with knowing everything. We can either embrace stop loss or live in the hope that our model is always right. It appears that, while the Principle of Latest Information is an excellent guideline for exiting a position as expected, stop loss is foremost a tool for risk management. The confusion might come fom the fact traling stop are often used to exit a profitable position.

Thank you for the opportunity to exchange ideas!

Anonymous said...

You always trade with a stop loss - it is your account size if you do not choose one for yourself.

Ernie Chan said...

Vicky,
You can read my article on Larry Connor's book http://epchan.blogspot.com/2009/06/good-book-for-quantitative-traders.html

It contains several mean-reverting strategies worth investigating.
Ernie

Ernie Chan said...

Hi Anonymous,
Thanks for your comments... but I disagree that stop loss is an effective risk management tool. As I explained before, when a major news event occurred that cause a big discontinuous drop in stock prices, no stop loss can prevent you from losing a large amount of money.
Ernie

Unknown said...

Here’s the approach I use for “stop losses” in ETF pair trading ...

I am comfortable that the approach is A) faithful to LIP (“Latest Information Principle”), while B) also recognising that you can never KNOW with 100% certainty what is going to happen next in the market no matter how good your model is (thank you Mark Douglas, “Trading in the Zone”!).

BTW, I’m new to trading (“algo”, or otherwise) so this approach is simply me reading around the topic and applying what I, IMHO, think is common sense.

When I identify a good candidate pair of ETFs, I note the maximum z-score recorded for the spread over the backtested time period. In general, over several years of daily data I am comfortable if I see up to 3 short spikes up to a maximum z-score between 3 and 4 (if I see substantially more than, say, 3 spikes like this, I question the whole premise of whether this pair of ETFs is actually any good for the strategy!).

Having noted the maximum z-score attained in the backtest (and using the principle that “real life” will often push to, and a little beyond, whatever the backtest sample data suggested were the boundary parameters!) I add an extra 15% to determine a parameter “MAXIMUM ALLOWABLE Z-SCORE”.

If I am holding a position, I am relaxed for as long as the z-score remains below this value (as I believe the position is still behaving as it should do within the bounds of the backtest, i.e. this is faithful to LIP).

However, if it crosses across this threshold, I then close the position as a) the pair no longer seems to be behaving as I observed it did in the past, and b) it’s behaving in a manner that calls into doubt the whole validity of the z-score statistic itself (i.e. “N normalised standard deviations from the mean spread” ... how can this definition make sense if z-score has a value of over 4 for a sustained period of time?!).

Having my exit point defined in this way before I enter a position also helps me pick only the trades where the ratio of potential profit to potential loss is acceptable, and to ignore the rest. In practice, I end up taking the “deeper value” positions.

Ernie Chan said...

Benjamin,
Thank you for sharing your well-thought-out approach.

We all accept that real-life spreads do not really have a normal distribution. Thus 4 or 5 sigma events are abnormally frequent. And z-scores are just a convenient way to model part of the distribution.

Hence my opinion is that a 5-sigma event does not necessarily mean that the pair is no longer cointegrated. Only a persistent 5-sigma deviation would do that -- but then, the model would have told you to exit the losing position anyway, (by virtue of the un-cointegration), without resorting to an arbitrary stop-loss rule.
Ernie

Anonymous said...

Ernie,

What are your thoughts on applying this (or any other) principle to whether to leave overnight positions in momentum and reverse trades, profitable or not?

Ernie Chan said...

Anonymous,
This principle applies whether or not the position is held overnight. If the price at the market close suggests that you should continue to be in that position, then by all means do so.
Ernie

Regorlith said...

Ernie,

You said: " Continuous Kelly formula that does not rely on Gaussian assumption does not have a closed-form mathematical solution and requires complex numerical computations to use."

Do you have a reference for the implementation of this computation?

Ernie Chan said...

Captain Kena,
You can follow the derivation in www.edwardothorp.com, and plug in a non-Gaussian distribution. You will soon find that there is no analytical solution.

(Of course, you can always find approximate solution using renormalization group theory.)
Ernie

Regorlith said...

Ernie,

Is there any reference to code for the approximate solution? If someone else has published a description of the algorithm, it would shorten my development time considerably.

Ernie Chan said...

Captain Kena,
Unfortunately the calculations are in symbolic form only, not in software codes.
Ernie

Forex Fuel said...

I have written about content related to the Stop loss hunt topic with my experience. See more here https://forexfuel.blogspot.com/2021/05/stop-loss-hunt-avoiding-strategy.html Here is my way to place the stop loss. This works well.

Forex Fuel said...

I have written about content related to the Stop loss hunt topic with my experience. See more here https://forexfuel.blogspot.com/2021/05/stop-loss-hunt-avoiding-strategy.html Here is my way to place the stop loss. This works well.