Shares in both Shanghai and Shenzhen closed up on Friday despite a shaky opening hour, with sharp drops and rises within minutes of each other.