In this paper we propose and analyze a method based on the Riccati transformation for solving the evolutionary Hamilton-Jacobi-Bellman equation arising from the stochastic dynamic optimal allocation problem. We show how the fully nonlinear HamiltonJacobi-Bellman equation can be transformed into a quasi-linear parabolic equation whose diffusion function is obtained as the value function of certain parametric convex optimization problem. Although the diffusion function need not be sufficiently smooth, we are able to prove existence, uniqueness and derive useful bounds of classical Hölder smooth solutions. We furthermore construct a fully implicit iterative numerical scheme based on finite volume approximation of the governing equation. A numerical solution is compared to a semi-explicit traveling wave solution by means of the convergence ratio of the method. We compute optimal strategies for a portfolio investment problem motivated by the German DAX 30 Index as an example of application of the method.2000 Mathematics subject classification: Primary: 35K55, Secondary: 34E05 70H20 91B70 90C15 91B16.