This paper has potential implications for the management of the bank. We examine a bank capital structure with contingent convertible debt to improve financial stability. This type of debt converts to equity when the bank is facing financial difficulties and a conversion trigger occurs. We use a leverage ratio, which is introduced in Basel III to trigger conversion instead of traditional capital ratios. We formulate an optimization problem for a bank to choose an asset allocation strategy to maximize the expected utility of the bank's asset value. Our study presents an application of stochastic optimal control theory to a banking portfolio choice problem. By applying a dynamic programming principle to derive the HJB equation, we define and solve the optimization problem in the power utility case.The numerical results show that the evolution of the optimal asset allocation strategy is really affected by the realization of the stochastic variables characterizing the economy. We carried out a sensitivity analysis of risk aversion, time and volatility. We also reveal that the optimal asset allocation strategy is relatively sensitive to risk aversion as well as that the allocation in CoCo and equity decreases as the investment horizon increases. Finally, sensitivity analysis highlights the importance of dynamic considerations in optimal asset allocation based on the stochastic characteristics of investment opportunities.