In this paper, we deal with the estimation of two widely used risk measures such as Value-at-Risk (VaR) and Expected Shortfall (ES) in a cryptocurrency context. To face the presence of regime switching in the cryptocurrency volatilities and the dynamic interconnection between them, we propose a Monte Carlo-based approach using heteroskedastic factor analysis and hidden Markov models (HMM) combined with a structured variational Expectation-Maximization (EM) learning approach. This composite approach allows the construction of a diversified portfolio and determines an optimal allocation strategy making it possible to minimize the conditional risk of the portfolio and maximize the return. The out-of-sample prediction experiments show that the composite factorial HMM approach performs better, in terms of prediction accuracy, than some other baseline methods presented in the literature. Moreover, our results show that the proposed methodology provides the best performing crypto-asset allocation strategies and it is also clearly superior to the existing methods in VaR and ES predictions.