Historical patterns in market behavior: Opportunities and risks