 Finance - Maple Programming Help

Home : Support : Online Help : Mathematics : Finance : Financial Instruments : Finance/EuropeanOption

Finance

 EuropeanOption
 create a new European option

 Calling Sequence EuropeanOption(payoff, exercise, opts)

Parameters

 payoff - payoff function exercise - a non-negative constant, a string containing a date specification recognized in a format recognized by Finance[ParseDate], or a date data structure; the maturity time or date opts - (optional) equation(s) of the form option = value where option is one of referencedate or daycounter; specify options for the EuropeanOption command

Options

 • referencedate = a string containing a date specification in a format recognized by Finance[ParseDate] or a date data structure -- This option provides the evaluation date. It is set to the global evaluation date by default.
 • daycounter = a name representing a supported day counter (e.g. ISDA, Simple) or a day counter data structure created using the DayCounter constructor -- This option provides a day counter that will be used to convert the period between two dates to a fraction of the year. This option is used only if one of earliestexercise or latestexercise is specified as a date.

Description

 • The EuropeanOption command creates a new European-style option with the specified payoff and maturity. This option can be exercised only at the time or date specified by the exercise parameter. This is the opposite of an American-style option, which can be exercised at any time before the expiration.
 • The parameter payoff is the payoff function for the option. It can be either an algebraic expression or a procedure. A procedure defining a payoff function must accept one parameter (the value of the underlying) and return the corresponding payoff. This procedure will be called with floating-point arguments only and must return floating-point values. If payoff is given as an algebraic expression it must depend on a single variable. This expression will be converted to a Maple procedure using the unapply function.
 • The parameter exercise specifies the time or date when the option can be exercised. It can be given either as a non-negative constant or as a date in any of the formats recognized by the Finance[ParseDate] command.
 • The LatticePrice command can be used to price a European-style option using any given binomial or trinomial tree.

Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$

Set the global evaluation date to January 3, 2006.

 > $\mathrm{SetEvaluationDate}\left("January 3, 2006"\right):$
 > $\mathrm{Settings}\left(\mathrm{daycounter}=\mathrm{Thirty360European}\right)$
 ${\mathrm{Historical}}$ (1)
 > $\mathrm{Maturity}≔\mathrm{AdvanceDate}\left(\mathrm{EvaluationDate}\left(\right),6,\mathrm{Months},\mathrm{output}=\mathrm{formatted}\right)$
 ${\mathrm{Maturity}}{≔}{"July 3, 2006"}$ (2)

Construct a binomial tree approximating a Black-Scholes process with an initial value of 100, a risk-free rate of 10% and a constant volatility of 40%. We will assume that no dividend is paid. Build the tree by subdividing the time period 0..0.6 into 1000 equal time steps.

 > $T≔\mathrm{BlackScholesBinomialTree}\left(100,0.1,0.0,0.4,0.6,1000\right):$

Consider a European call option with a strike price of 90 that matures in 6 months.

 > $\mathrm{P1}≔S→\mathrm{max}\left(S-90,0\right)$
 ${\mathrm{P1}}{≔}{S}{↦}{\mathrm{max}}{}\left({S}{-}{90}{,}{0}\right)$ (3)
 > $\mathrm{plot}\left(\mathrm{P1},80..120,\mathrm{color}=\mathrm{blue},\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right)$ > $\mathrm{E1}≔\mathrm{EuropeanOption}\left(\mathrm{P1},0.5\right):$
 > $\mathrm{E2}≔\mathrm{EuropeanOption}\left(\mathrm{P1},\mathrm{Maturity}\right):$

Calculate the price of this option using the tree constructed above. Use the risk-free rate as the discount rate.

 > $\mathrm{LatticePrice}\left(\mathrm{E1},T,0.1\right)$
 ${19.16307346}$ (4)
 > $\mathrm{LatticePrice}\left(\mathrm{E2},T,0.1\right)$
 ${19.16307346}$ (5)

Consider a European call option with a strike price of 110 that matures in 6 months.

 > $\mathrm{P2}≔S→\mathrm{max}\left(S-110,0\right)$
 ${\mathrm{P2}}{≔}{S}{↦}{\mathrm{max}}{}\left({S}{-}{110}{,}{0}\right)$ (6)
 > $\mathrm{plot}\left(\mathrm{P2},80..120,\mathrm{color}=\mathrm{blue},\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right)$ > $\mathrm{E3}≔\mathrm{EuropeanOption}\left(\mathrm{P2},0.5\right):$
 > $\mathrm{E4}≔\mathrm{EuropeanOption}\left(\mathrm{P2},\mathrm{Maturity}\right):$

Calculate the price of this option using the tree constructed above. Use the risk-free rate as the discount rate.

 > $\mathrm{LatticePrice}\left(\mathrm{E3},T,0.1\right)$
 ${9.341739175}$ (7)
 > $\mathrm{LatticePrice}\left(\mathrm{E4},T,0.1\right)$
 ${9.341739175}$ (8)

Finally, consider a call option with a strike price of 100 maturing in 6 months.

 > $\mathrm{P3}≔S→\mathrm{max}\left(S-100,0\right)$
 ${\mathrm{P3}}{≔}{S}{↦}{\mathrm{max}}{}\left({S}{-}{100}{,}{0}\right)$ (9)
 > $\mathrm{plot}\left(\mathrm{P3},80..120,\mathrm{color}=\mathrm{blue},\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right)$ > $\mathrm{E5}≔\mathrm{EuropeanOption}\left(\mathrm{P3},0.5\right):$
 > $\mathrm{E6}≔\mathrm{EuropeanOption}\left(\mathrm{P3},\mathrm{Maturity}\right):$

Calculate the price of this option using the tree constructed above. Use the risk-free rate as the discount rate.

 > $\mathrm{LatticePrice}\left(\mathrm{E5},T,0.1\right)$
 ${13.58412136}$ (10)
 > $\mathrm{LatticePrice}\left(\mathrm{E6},T,0.1\right)$
 ${13.58412136}$ (11)

Consider a more complicated payoff function.

 > $\mathrm{P4}≔S→\mathrm{piecewise}\left(S<90,0,S<100,S-90,S<110,110-S,0\right)$
 ${\mathrm{P4}}{≔}{S}{↦}\left\{\begin{array}{cc}{0}& {S}{<}{90}\\ {S}{-}{90}& {S}{<}{100}\\ {110}{-}{S}& {S}{<}{110}\\ {0}& {\mathrm{otherwise}}\end{array}\right\$ (12)
 > $\mathrm{plot}\left(\mathrm{P4},80..120,\mathrm{color}=\mathrm{blue},\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right)$ > $\mathrm{E7}≔\mathrm{EuropeanOption}\left(\mathrm{P4},0.5\right):$
 > $\mathrm{E8}≔\mathrm{EuropeanOption}\left(\mathrm{P4},\mathrm{Maturity}\right):$

Calculate the price of this option using the tree constructed above. Use the risk-free rate as the discount rate.

 > $\mathrm{LatticePrice}\left(\mathrm{E7},T,0.1\right)$
 ${1.336569904}$ (13)
 > $\mathrm{LatticePrice}\left(\mathrm{E8},T,0.1\right)$
 ${1.336569904}$ (14)

Note that the payoff of the options E8 and E7 can be replicated using the payoffs of the options E1, E2, E3, E4, E5, and E6.

 > $\mathrm{plot}\left(\left[\mathrm{P4},\mathrm{P1}+\mathrm{P2}-2\mathrm{P3}\right],80..120,\mathrm{color}=\left[\mathrm{blue},\mathrm{red}\right],\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right)$ This means that the prices should also match.

 > $\mathrm{LatticePrice}\left(\mathrm{E1},T,0.1\right)+\mathrm{LatticePrice}\left(\mathrm{E3},T,0.1\right)-2\mathrm{LatticePrice}\left(\mathrm{E5},T,0.1\right)=\mathrm{LatticePrice}\left(\mathrm{E7},T,0.1\right)$
 ${1.33656992}{=}{1.336569904}$ (15)
 > $\mathrm{LatticePrice}\left(\mathrm{E2},T,0.1\right)+\mathrm{LatticePrice}\left(\mathrm{E4},T,0.1\right)-2\mathrm{LatticePrice}\left(\mathrm{E6},T,0.1\right)=\mathrm{LatticePrice}\left(\mathrm{E8},T,0.1\right)$
 ${1.33656992}{=}{1.336569904}$ (16)

References

 Glasserman, P., Monte Carlo Methods in Financial Engineering, Springer-Verlag, 2004.
 Hull, J., Options, Futures and Other Derivatives, 5th. edition. Prentice Hall, 2003.
 Jackel, P., Monte Carlo Methods in Finance, John Wiley & Sons, 2002.
 Joshi, M., The Concepts and Practice of Mathematical Finance, Cambridge University Press, 2003.
 Wilmott, P., Paul Wilmott on Quantitative Finance, John Wiley and Sons Ltd, 2000.
 Wilmott, P., Howison, S., and Dewyne, J., The Mathematics of Financial Derivatives, New York: Cambridge University Press, 1995.

Compatibility

 • The Finance[EuropeanOption] command was introduced in Maple 15.