In this paper, we consider an optimal investment and reinsurance problem faced by an insurer. The insurer invests in a market consisting of a riskless asset and m risky assets. The mean returns and volatilities of the risky assets depend nonlinearly on economic factors. These factors are formulated as the solutions of nonlinear stochastic differential equations. The wealth of the insurer is described by the riskless asset, the risky assets, and a Cramér–Lundberg process for reinsurance. Moreover, the insurer’s preferences are described by an exponential utility function [i.e., CARA (Constant Absolute Risk Aversion) utility function]. By adapting the dynamic programming approach, we derive the Hamilton–Jacobi–Bellman (HJB) equation. We also prove the solvability of the HJB equation by approximating it with a sequence of related Dirichlet problems or by using the extended Feynman–Kac formula. Finally, by proving the verification theorem, we construct the optimal strategy. Additionally, the optimal reinsurance strategy, which is a deterministic function, is developed. The optimal strategy is further obtained using the stochastic maximum principle, coupled forward and backward stochastic differential equations (FBSDEs), and by proving the verification theorem.