A simple algorithm based on cross sectional mean of a bunch of stocks and their covariance. It works great from 2003 until July 2008 but after that fails to work. I think it can be improved by using a different bunch of stocks and also possibly changing the hedge security. Please keep me posted if you manage to find a better composition or trick to get it working.