Solution (source code)

= Solution

Take the nondegenerate case $\sigma>0$ and an integer trading horizon $T$. For <exponential utility>, maximize the negative of the exponential loss, equivalently minimize its <expectation>. Conditional on past information, a <predictable> choice $\pi$ has
$$
\mathbb E[e^{-\gamma\pi\Delta S_t}\mid\mathcal F_{t-1}]=\exp\left(-\gamma\mu\pi+\tfrac12\gamma^2\sigma^2\pi^2\right).
$$
Complete the square:
$$
-\gamma\mu\pi+\tfrac12\gamma^2\sigma^2\pi^2=\tfrac12\gamma^2\sigma^2\left(\pi-\frac\mu{\gamma\sigma^2}\right)^2-\frac{\mu^2}{2\sigma^2}.
$$
Thus the minimum conditional multiplier is $e^{-\kappa}$ with $\kappa=\mu^2/(2\sigma^2)$. <Backward induction> starts with terminal loss $e^{-\gamma x}$ and gives the minimal continuation loss $e^{-\gamma x-\kappa(T-t)}$. <Independence> of the next increment justifies the same conditional minimization for every history, not just deterministic trading plans. Hence <exponential-utility trading with Gaussian increments> gives
$$
\boxed{\pi_t^*=\frac\mu{\gamma\sigma^2},\quad1\leq t\leq T,\qquad V_0(x)=-\exp\left(-\gamma x-\frac{T\mu^2}{2\sigma^2}\right).}
$$
These are constant numbers of shares, not constant wealth fractions. Strategies with infinite exponential loss have expected utility $-\infty$ and cannot improve this finite value. If $\sigma=0$, the usual formula is inapplicable: with $\mu=0$ trading has no effect, while a nonzero deterministic increment admits unbounded riskless gains and no finite maximizing position.