Revista Brasileira de Finanças, v. 18, n. 3, pp. 52-79. Abstract: We propose a dynamic allocation strategy for an investor which considers three unobservable economic regimes, which we estimate using returns on five Brazilian asset classes. The strategy is based on an approximate analytical solution of a realistic configuration of the economy. The out-of-sample performance exceeds those of every benchmark we consider in 6 out of 10 years, with a weekly average return significantly higher than any benchmark at the usual confidence levels. From 2010 to 2019, our strategy achieves an average return of 21.6% per annum against, for example, 9.8% p.a. of the CDI and 4.7% p.a. of the Ibovespa. In particular, a comparative analysis makes clear how important it is to include multiple regimes in portfolio allocation.