Stock market crashes studied: what caused them, how deep they went and lessons for protecting capital next time.