A quantitative trading model that can navigate bull and bear markets