**Welcome to THETAWIKI**. If you like to create or edit a page please make sure to login or register an account. All registered users please make sure to provide a valid email address.

# Moving Window Asian Option

## Overview

A moving window Asian option (MWAO) is computationally challenging to evaluate. The description of a MWAO is simple: similar to an American option that pays the difference between the current underlying price and a fixed strike, the MWAO pays the difference between the current stock price and a moving average.

The computational difficulty of computing the price of a MWAO comes from the underlying strike being a discretely-sampled moving average of stock prices. This leads to very high dimensionality in the equation for the optimal early exercise strategy. Theta Suite can deal with this high-dimensional problem easily since it has a built-in function `E` that uses a sparse-grid technique that efficiently solves the "curse of dimensionality" problem.

## Implementation in ThetaML

The model `mwao` implemented in ThetaML efficiently prices a Moving Window Asian Option. The high-dimensionality problem of the early exercise strategy is solved with the ThetaML function `E`. The underlying stock price process 'S' is simulated externally in Geometric Brownian Motion, the discount factor process 'EUR' uses the constant discount curve simulated in Discounting.

model mwao import S "Stock prices" import EUR "Discount numeraire" import m "Window length" import n "Number of observations" import T "Option maturity time" export V "Option process" export P "Option prices" export A "Current average" %at current time, set the option prices to have the same distribution as the variable 'V' %the ThetaML future operator '!' accompanying the variable 'V' acts like a function on 'V, %such that the values of 'V' at current time remains to be determined at a later instance %when 'V' is assigned some values P = V! %assuming daily exercise interval deltaT = 1/252 %an array used to store the last m stock prices C = 0 %initialize the moving average to 0 A = 0 %computing the moving averages 'A' %the ThetaML command 'fork' virtually parallels the processes defined %inside the 'fork...end' statement and the processes defined outside it fork %initialize 'index' to 'm' index = m %loop 'n' times loop n %add the averages of stock prices in the moving window; %at the end of the window 'm', subtract the stock value %at the beginning of the window divided by 'm' A = A + S/m - C[index]/m %store the stock prices in the array 'C' C[index] = S %update the 'index' index= mod(index, m)+1 %the ThetaML command 'Theta' passes time by 'deltaT' time interval Theta deltaT end end %the ThetaML command 'Theta' passes time by 'deltaT*(m-1)' %since the window length is 'm', the first early-exercise evaluation is %at time 'deltaT*(m-1)' Theta deltaT*(m-1) %loop 'n - m + 1' times loop n - m + 1 %only compute values for in-the-money paths if (A > S) %compute optimal early exercise strategy if (A - S)*EUR > E(V!) %exercise option payoffs V = max( A - S, 0)*EUR end end %the ThetaML command 'Theta' passes time by 'deltaT' Theta deltaT end %option payoffs at maturity V = max(A - S,0)*EUR end

## Numerical Example

An option with the following parameters has a value of about 7.65.

Parameter | Symbol | Value |

Option type | Moving Window Asian Option | |

Maturity | T |
0.4 years |

Risk free rate | r |
5 % p.a. |

Volatility | sigma |
40 % p.a. |

Daily observations | Delta_t |
1/250 years |

Early exercise | at each observation with $ t\geq 10/250 $ years | |

Length of observation | m |
10 days |

Exercise value | $ P(S, t_i) =\max\left( \frac{1}{M} \left( \sum \limits_{j=i-M+1}^i S_{t_j} \right) - S_{t_i},0\right) $ |