Predicting trend in the next-day market by hierarchical hidden markov model