Finding the optimal exercise strategy for a swing option is a challenging task, even for simple payoff structures. In the absence of complicated time-integral constraints dynamic programming can be used to calculate the optimal exercise strategy. Linear programming applied ex post over the whole spot price path is capable to deal with more complicated time-integral constraints but the algorithm leads only to an upper bound of the real option price [1].
A basic payoff structure is e.g.: On the exercise dates
the decision variables
indicate whether to exercise
or not to exercise
the option at a given point
in time. Payoff is either
for a call or
for a put option. Here
is the strike price and
is the spot price . The number of exercise opportunities is constraint by
.
The price of a swing call option is then given by
![\text{npv} = \max_{\beta}\mathbb{E}^\mathbb{Q} \left[ \sum_{i=1}^N \beta_i \left( P(t_i) - K\right)e^{rt_i}\right]](https://s0.wp.com/latex.php?latex=%5Ctext%7Bnpv%7D+%3D+%5Cmax_%7B%5Cbeta%7D%5Cmathbb%7BE%7D%5E%5Cmathbb%7BQ%7D+%5Cleft%5B+%5Csum_%7Bi%3D1%7D%5EN+%5Cbeta_i+%5Cleft%28+P%28t_i%29+-+K%5Cright%29e%5E%7Brt_i%7D%5Cright%5D&bg=ffffff&fg=5e5e5e&s=0&c=20201002)
Let the dynamics of the spot price in the risk neutral measure
be given by the Kluge model [2]:

This model is composed of an Ornstein-Uhlenbeck (OU) process
, a deterministic period function
characterizing the seasonality and a mean reverting process
with jumps to incorporate spikes.
is a Poisson process with jump intensity
and the jump size itself is exponentially distributed. The random variables
and
are independent. The Monte-Carlo path simulation will be built on top of standard components for an OU process and a Poisson jump-diffusion process [3]. The dynamic programming approach can either be carried out using least squares Monte-Carlo ansatz (Longstaff Schwartz algorithm) or using finite difference methods. We prefer finite difference methods to avoid e.g. the problem of choosing an appropriate basis function set. The Feynman-Kac theorem leads to the corresponding partial integro differential equation (PIDE):

A Gauss-Laguerre quadrature is appropriate to calculate the integral part of the PIDE. Beside this two-dimensional PIDE an additional dimension is needed to keep track of the already consumed exercise rights. The three-dimensional formulation together with Bellman’s principle of optimality transforms the global optimization problem into a local optimization problem.
Target of the linear programming approach is the upper bound
![\text{npv} \le \mathbb{E}^\mathbb{Q}\left[ \max_{\beta} \sum_{i=1}^N \beta_i\left(P(t_i) - K \right) e^{rt_i}\right]](https://s0.wp.com/latex.php?latex=%5Ctext%7Bnpv%7D+%5Cle+%5Cmathbb%7BE%7D%5E%5Cmathbb%7BQ%7D%5Cleft%5B+%5Cmax_%7B%5Cbeta%7D+%5Csum_%7Bi%3D1%7D%5EN+%5Cbeta_i%5Cleft%28P%28t_i%29+-+K+%5Cright%29+e%5E%7Brt_i%7D%5Cright%5D&bg=ffffff&fg=5e5e5e&s=0&c=20201002)
The linear programming algorithm will calculate the optimal exercise strategy
on each Monte-Carlo path separately (perfect foresight) with respect to the given constraints. For this basic type of swing option linear programming is sort of over-engineering because a simple sort algorithm will also reproduce the optimal exercise strategy. But introducing linear programming and mixed integer programming now will enable us later on to deal with more complicated time-integral constraints. Libraries for this task are freely available, e.g. the GNU Linear Programming Kit.
The test parameterization of the model is
,
the example swing call option has maturity of one year, strike price is equal 40, one exercise opportunity per month and the minimum number of exercise rights is equal to the maximum number of exercise rights,
. Interest rates are at
.

As the diagram above shows for this set-up the upper bound for the swing option price calculated using linear programming differs significantly from the correct price calculated based on dynamic programming on a lattice. For twelve exercise rights both algorithms have to provide the same results because the constraint forces to always exercise on each exercise date. Next to come is to rerun the simulation with a more realistic forward curve and process parameters.
The code is available here. It depends on the GNU Linear Programming Kit, the Boost Thread library for parallelization and at the time of writing on the latest QuantLib version from the SVN trunk. If you want to generate the plot directly out of the C++ program you also need R, RCPP and RInside.
[1] M. Burger, B. Graeber, G. Schindlmayr, Managing Energy Risk, ISDN 978-0-470-ß2962-6
[2] T. Kluge, Pricing Swing Options and other Electricity Derivatives
[3] P. Glasserman, Monte Carlo Methods in Financial Engineering. ISBN-0387004513