A double obstacle problem in an optimal investment problem. (July 2023)