There is much evidence of regimes in financial markets and there have been studies about regime-dependent asset allocation strategies. This paper is to detect and estimate regimes with a statistical method, and hidden Markov models are introduced. It is assumed that stock and bond returns follow different multivariate normal distributions according to market regimes, and the traditional asset classes, which are stocks, bonds, and cash, are invested in. By adopting regime-switching models, dynamic asset allocation problems can be solved in the same way as static portfolio allocation problems. The mean-variance optimization and a mean-variance utility function are employed to determine the weights of three assets included in the portfolio. Not only the in-sample test results but the results of out-of-sample test show that the performance of portfolio can be improved by including the concept of market regimes. All the regime-dependent models dealt with in this research especially detect the periods of crisis adequately, which lead to more desirable returns than a non-regime-switching model.