A Chooser option gives the owner the choice at some fixed future date (before expiration) to pick either a vanilla call or put option. In a simple chooser option, the call and put have both the same strike and expiration date.
ThetaML implementation of a chooser option
The model 'chooser' computes the chooser option price. The underlying 'S' and the discount numeraire 'EUR' are processes simulated externally. For example, the process 'S' can be a stock price process that follows a Geometric Brownian Motion or a Heston Volatility process. The discount numeraire 'EUR' can be a constant discount curve as implemented in Discounting, or a stochastic process that has a dynamics as defined in the CIR model.
% The model chooser computes the value of the option to % choose a put or a call option at time t = 0.5 model chooser import S "Underlying stock prices" import EUR "Discount numeraire" import K "Option strike price" export V "Option value" %at current time, set the option value to have the same expected discounted %value 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 remain to be determined at a later instance when 'V' is assigned %some values P = E(V!) %the ThetaML command 'theta' passes time by '0.5' years theta 0.5 %chooser option, if the expected discounted values of 'V1!' is larger than that of 'V2!' if E(V1!) > E(V2!) V = V1! else V = V2! end %the ThetaML command 'theta' passes time by '0.5' years theta 0.5 %at option maturity time 1, set the option payoffs; %the option payoffs are discounted to time 0 by the discount numeraire 'EUR' V1 = max(K - S, 0) * EUR V2 = max(S - K, 0) * EUR end