In this paper, we study the investment models that have two risk processes. One is the risk process from the stock market and another is an external risk process. Also, we are only interested in the incomplete market model, that is, we cannot eliminate the external risk process by investing in the stock market. We will consider several optimization problems, including minimizing the ruin probability, minimizing the expected discounted penalty and maximizing the expected utility at terminal time. Our main approach is to solve the HJB equation to find an optimal strategy and the value function. In addition, we will use other approaches to find an optimal strategy when the HJB equation is hard to solve.