Back to Community
Building a comprehensive downturn / Recession alert system. - Long term community help needed

In this thread I want to set the framework and open the discussion and joint work by different quant experts / statisticians with the goal of building a comprehensive downturn / Recession alert system.
In all our technical/Fund algorithms we mainly fear from "the" next upcoming recession that will surely come, because this can wipe out all our previous gains and incur loses without any warning.
For some time I am trying to build a recession indicator which will automatically alert and can either allow to shift open trades to safe (cash or other relevant assets), hedge or identify to change the algo used (as there is no one algo that fits all market conditions - e.g. last year’s we are mainly on bull market with lower rates)

I was thinking of a system combined of 3 level warnings, all working on the US stock index/ETF level:

A). Short term downturns - for this we can try using combination of Fundamental and technical indicators

1) Technical indicators such as MACD, RSI etc. The downside is that you never know when the market will stop going down or will go up again and tracings are costly. I couldn’t find the perfect system and threshold yet.

2) Macro Fundamental Indicators - Stock market downside in a large part can happen when corporations profits are going down. Macro fundamental data can track the US corporations’ profits trend. For that we can look at the % of profits of US corporations out of GDP, historically it ranges from 3% to 7% where we are now in record high ever ~%13 well above the STD of 50 years see chart here (this true both for % of corp profits to market cap see chart here ) , Looking at the charts, corporations profits are record high due to unique circumstances that won’t last for long, reverse to the mean profits is likely to happen. Morever, corporations total debt was increasing (debt increased from ($7 Trillion in 2007 to ~9.5 Trillion 2015 - Today U.S. non-financial corporations are carrying debts equal to 50% of their actual net worth. That is near record levels, and far above historic averages) and on the other hand commodities index is in its record low (see chart here, that means that in near future corporations will need to return their debts (that will increase with increasing interest rates) , as well as commodities price increase will increase corporates costs to produce - all together will lead to reduction in corporation profits and stock prices.

B). Long term "big" recession - It is proven that all big recessions in last 50 years (e.g. .1987, 2000, 2008) occurred after the yield curve become inverted, that is the short-term treasury rates above long-term rates. This is referred to as “inverting the yield curve.” The chart Yield Curve Inversions as Indicator for Stock Market Peaks and Recessions shows all historic yield curves and recessions. In normal times, longer-term treasury bonds will have higher yields because the investor must bear more risk (e.g. inflation, delayed interest rates, credit risk etc). When short term yields are higher than long term treasury rates that means that investors believe the short term is safer than long term, banks has no incentive to lend long term and projects and economy as a whole decreases. It is true that when interest rates are in record low, this situation is no to happen soon and there are other factors to look at like deflation risk (e.g. need to see Japan example which had few recessions for many years with very low interest rates). Nevertheless, there is a very good model that manage to predict successfully 100% of the recessions in the last 50+ years ahead of time, it uses the inverted yield curve data analysis with multivariate Markov switching bifactor mode. A Dynamic Factor Model of the Yield Curve as a Predictor of the economy

9 responses

Hi Joe, very interesting. I would add the mean reverting behaviour of the VIX index as well. In my algo VIX-WVF it's clear that the VIX and WVF are able to detect most mini crashes. Next step would be to look at the contango/backwardation of the vix complex but I haven't had time for that yet

Regarding the yield curve inversion, a phenomenon that I studied at length at INSEAD as I happened to be admitted in 2005/6 when the yield curve started to invert and I was amazed that my profs could give a reasonable accurate window where we would go into an recession (based on how long the inversion continued and how steep and which durations were involved), so I would love to see that in Quantopian. The question for me is how long the action of the fed will reverberate in this behaviour of the curve... Is the relationship broken now we have artificially low rates?.

hi Joe, just thought I add that a great way to estimate when an economy might experience a recession is to assess where that economy is in its short term debt cycle and its long term debt cycle.

For example, short term debt cycles occur when you have 1) spending growing faster than 2) the capacity to produce, which then leads to 3) increases in prices (inflation), and that continues until 4) spending is slowed by tightening monetary policy, and that is when a recession happens.

So, recessions typically arise from a contraction in private sector debt growth, which is typically the results of central banks tightening (increasing rates) to stave off inflation. If we work that backwards we see that increasing inflation will drive central banks to tighten, which will slow private sector debt growth and bring about a recession.

I go into more depth on cycles and debt on my blog, www.theeconomicmachine.tumblr.com. Please check it out. I would love any feedback.

As well, I'd love to help you out in any way I can. Let me know.

Perhaps this will help you , the guys at iMakertsignal have a great Business Cycle "Indicator " / system

http://imarketsignals.com/bci/

Philip - I read and liked your blog. Please bear in mind the following regarding debt:

  1. The essense of the debt it important. Debt by itself is not bad if it goes to investements that will expand economic growth. Very high GDP tp debt ratio doesnt always as it seems, North Korea has 0.4 % GDP to debt ration ... Japan has the highest with ~220% but looking carefully on it discovers that most of it is in local currency, that means they borrow from thier citizens and hence wont get bankrupt by foriegn debtors so easily (read this article.

  2. I looked at the BCI indicator and it does seem to predict recent recessions, i wonder how real it is for future and if we can incorporate it in our algo with fetcher?

Joe,

You're right, debt is good if it goes to investments that expand growth. However, it doesn't always do that. Much of it goes into financial instruments, that don't necessarily expand the economy in a healthy way....it just inflates asset values...and when that debt can no longer be serviced you see recessions/deleveragings. At least, that's my simple way of seeing things. My overall thinking is regarding debt cycles. Many other factors are incorporated, such as government spending, gdp growth rates, consumer spending, capacity utilization, interest rates, money supply, sovereign bonds yields, stock market levels and industrial production.

However, watching debt cycles are not going to exactly predict everything about the global economy 100% of the time, as we see in the case of North Korea and Japan.

But debt cycles do occur, in the short term and the long term, and monitoring these debt levels has allowed some smart investors to side step recessions, and the recent 2008 economic meltdown.

I've been trying to write an algo to monitor global debt cycles at the individual country level....haven't figure it out yet though. But I would be very interested in a long term project to try and figure out a downturn/recession alert system. If you'd like my help just let me know. Have a good one!

attached my attempt help our cause ;) It's based on: http://www.federalreserve.gov/pubs/feds/2012/201232/201232pap.pdf

I feed macro data like Production, Houses for Sale, Houses sold, Unemployment, Claims, the Yield curve [pre-cursor of stress], slope and level[Yield inversion is stress in 6-12 months], the vix [stress], spy (plus volatility in 2 ways) and possibly their factors into a Gaussian model and ask the model to predict states... Due limitations of fetcher (only 5 files) we can only test 5 external factors and or core data at the same time, next to the SPY values. The model returns states (I took an arbitrary 5 states) , but I have no clue what the states mean. 4 seems to be a pre-stress indicator... most of time. 1 and 2 are good buying periods... but then again I might read too much in those states

By turning off and on fetcher values you can experiment with the model. Its a tremendous amount of useless code to make things repeatable and to make sure the fetcher data is handled correctly, some sources are weekly, monthly, monthly with lag etc

Anyway... does this help? Can we build on something like this or is it like sucking crap with a straw?

I think I need some help from people with experience in creating these state-prediction models.

PB

Sorry Philip, no debt levels in this one, can easily be added though to see if it makes the model better

Clone Algorithm
48
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 55a75e7cd920940c72111681
There was a runtime error.

My quick traders perspective:
Technical Indicators like RSI, MACD etc are useless for calling market tops. I have attached a quick and dirty backtest that goes short when the when RSI is above 70 (standard overbought) and turning down. Price action could be used to give better warning signals but technical trading is much more of an art than a science. Patterns are hard to quantify and you always need to wait for confirmation (front running markets only works in swing trading environments). All of the successful traders I have known have had fairly low win rates (im sure some people would be surprised to see someone make 30% in a year with only 25% winning trades)

I'm short China and think that extreme peaks in leverage is one the best sell signals you can get (classic buying mania followed by punters taking on way too much margin debt has always ended badly)
Falling EPS Momentum seems to work well too
I don't know what to think of unemployment figures (discouraged workers, cutting of hours etc numbers all seem to contradict one another). Havent had much time to explore quandl data....

Clone Algorithm
9
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 55a78c3ef528400c723441a5
There was a runtime error.

"I'm short China and think that extreme peaks in leverage is one the best sell signals you can get (classic buying mania followed by punters taking on way too much margin debt has always ended badly)"

couldn't agree more!!!...when leverage gets too expensive and they can't service that debt the whole thing comes crashing down in a deleveraging....how much further can this fall go?

Errors...
ValueError: startprob must sum to 1.0
There was a runtime error on line 73.