Showcase: Connors' Alpha Formula

We thoroughly enjoyed The Alpha Formula, the latest publication from Chris Cain and Larry Connors. We wrote a lengthy book report here. In this post, we’d like to take a brief look at the source code.

Chris Cain & Larry Connors: The Alpha Formula

- Chart courtesy of www.TuringTrader.com

Rising Assets

This is a straightforward momentum strategy with an inverse-volatility weighting of the top-ranked assets. The strategy rebalances on a monthly basis. We are using the new NextSimTime feature here, to determine the last trading day of the month.

Weekly Mean Reversion

This is a mean-reversion strategy, similar to others published in previous Connors’ books. Unlike other strategies, this one runs on weekly bars. As our data source delivers daily bars, we create the weekly bars on the fly by pushing values into TimeSeries objects. Further, the strategy makes use of the Universe feature, to determine current and historic S&P 500 constituents.

Dynamic Treasuries

This is another momentum strategy, this time aiming to adjust the maturity of U.S. Treasuries. The implementation is straightforward.

ETF Avalanches

This strategy aims to profit from shorting assets during market meltdowns. To do so, it combines aspects from momentum and mean-reversion strategies.

Alpha Portfolio

Two versions of combining the previous 4 strategies into a portfolio. To implement this, we use LazyPortfolios, with SubclassableAlgorithms as their assets.

Once again, TuringTrader makes implementation of complex algorithms very simple, resulting in code that is concise and easy to understand. Check out the source code in our repository.

Happy Coding!