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.