We build a portfolio encompassing U.S. crude oil, natural gas and stocks to study the diversification power of energy commodities. Such diversification power depends on the joint dependence structure of the three types of assets. According to Gatfaoui (2016a), the dependence structure is time-varying because individual asset returns exhibit several variance regimes. We identify the corresponding regime-specific multivariate copulas, and incorporate them to well-chosen risk measures. Specifically, we minimize the portfolio's variance, semi-variance and tail risk, in the presence and the absence of constraints on the portfolio's expected return and/or stock investment. First, the return constraint reduces the performance of the optimal portfolio. Second, the regime-specific portfolio optimization implements an enhanced active management strategy over the whole sample period. Finally, the tail-risk optimal portfolio offers the most interesting risk-return tradeoff. However, variance and semi-variance optimal portfolios can also be considered in the absence of a return constraint.