Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Re: z-score based buy/sell -- wider portfolio removes beta but also alpha

In Grant's original z-score algorithm I noticed that there is a high correlation between the algo returns and the benchmark returns (i.e. high beta). This can increase the volatility of an investment strategy as we are at the whim of the benchmark. To try and leverage this effect I included a wider portfolio selection (semi-randomly hand-picked). I also fixed a minor bug that caused a problem when running a portfolio (the 2nd for-loop is removed).

As you can see, the beta is decreased here, but so is the alpha (i.e. risk-adjusted returns).

The question of course is why and how this could be improved. The z-score seems to be a momentum-based strategy at its core so it requires stocks with momentum in order to work. So I think a more carefully selected portfolio might do the trick here. Ultimately, it would be nice if we had a method to select momentum-based stocks from a large universe. The new universe selection and batch_transform that should be up soon will allow just that.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

3 responses

Thomas,

Good catch on removing the second for-loop.

Perhaps it's just wishful thinking, but I had the thought of figuring out how to add SH to SPY to reduce the downside risk. Any ideas?

@Grant: Do you mean in a pair-trading scheme? I'm curious, what made you pick those two in particular?

Thomas,

SPY seemed natural, since it follows (is?) the Quantopian canned benchmark. Also, it is representative of the whole market, so there won't be any specific company risk. My hunch is that it trades every minute the market is open and is very liquid, so my intuition was that it should behave in a sorta equilibrium fashion over short time scales. Regarding SH, it seeks to return the opposite of SPY, but I figure it can't be a perfect mirror. When I use the Quantopian logging function to output minutely z-scores for SPY & SH, they are nearly equal in magnitude and opposite in sign (too bad I can't download the log output for analysis or make some plots...hint, hint). Although Quantopian is kinda nifty (and free), not being able to do everyday analysis (e.g. MATLAB or similar) is a drag.