  We study the optimal excess-of-loss reinsurance problem when both the
intensity of the claims arrival process and the claim size distribution are
influenced by an exogenous stochastic factor. We assume that the insurer's
surplus is governed by a marked point process with dual-predictable projection
affected by an environmental factor and that the insurance company can borrow
and invest money at a constant real-valued risk-free interest rate $r$. Our
model allows for stochastic risk premia, which take into account risk
fluctuations. Using stochastic control theory based on the
Hamilton-Jacobi-Bellman equation, we analyze the optimal reinsurance strategy
under the criterion of maximizing the expected exponential utility of the
terminal wealth. A verification theorem for the value function in terms of
classical solutions of a backward partial differential equation is provided.
Finally, some numerical results are discussed.
