 Finance - Maple Programming Help

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

Finance

 AmericanOption
 create a new American-style option

 Calling Sequence AmericanOption(payoff, earliestexercise, latestexercise, opts)

Parameters

 payoff - payoff function earliestexercise - a non-negative constant, a string containing a date specification in a format recognized by ParseDate, or a date data structure; the earliest date or time when the option can be exercised latestexercise - a non-negative constant, a string containing a date specification in a format recognized by 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 AmericanOption command

Options

 • referencedate = a string containing a date specification in a format recognized by ParseDate or a date data structure -- This option provides the evaluation date. It is set to the global evaluation date by default.
 • daycounter = Actual360, Actual365Fixed, AFB, Bond, Euro, Historical, ISDA, ISMA, OneDay, Simple, Thirty360BondBasis, Thirty360EuroBondBasis, Thirty360European, Thirty360Italian, Thirty360USA, 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. The default day count convention can be set using the Settings command. This option is used only if one of earliestexercise or latestexercise is specified as a date.

Description

 • The AmericanOption command creates a new American-style option with the specified payoff and maturity. This option can be exercised at any time between the earliestexercise and the latestexercise dates. This is the opposite of a European-style option, which can only be exercised on the date of 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 earliestexercise specifies the earliest 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 ParseDate command. If earliestexercise is given as a date, then the period between referencedate and earliestexercise will be converted to a fraction of the year according to the day count convention specified by daycounter. Typically the value of this option is $0$, which means that the option can be exercised at any time until the maturity. Note that the time of the earliest exercise must precede the maturity time.
 • The parameter latestexercise specifies the maturity time of the option. It can be given either as a non-negative constant or as a date in any of the formats recognized by the ParseDate command. If earliestexercise is given as a date, then the period between referencedate and latestexercise will be converted to a fraction of the year according to the day count convention specified by daycounter.
 • The LatticePrice command can be used to price an American-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)

Construct a binomial tree approximating a Black-Scholes process with initial value 100, risk-free rate of 10% and constant volatility of 40%. 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.4,0.6,1000\right):$

Consider an American put option with a strike price of 100 that matures in 6 months.

 > $P≔S↦\mathrm{max}\left(100-S,0\right)$
 ${P}{≔}{S}{↦}{\mathrm{max}}{}\left({100}{-}{S}{,}{0}\right)$ (2)
 > $\mathrm{A1}≔\mathrm{AmericanOption}\left(P,0,0.5\right):$
 > $\mathrm{Maturity}≔\mathrm{AdvanceDate}\left(\mathrm{EvaluationDate}\left(\right),6,\mathrm{Months},\mathrm{output}=\mathrm{formatted}\right)$
 ${\mathrm{Maturity}}{≔}{"July 3, 2006"}$ (3)
 > $\mathrm{YearFraction}\left(\mathrm{Maturity}\right)$
 ${0.5000000000}$ (4)
 > $\mathrm{A2}≔\mathrm{AmericanOption}\left(P,\mathrm{EvaluationDate}\left(\right),\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{A1},T,0.1\right)$
 ${9.220859736}$ (5)
 > $\mathrm{LatticePrice}\left(\mathrm{A2},T,0.1\right)$
 ${9.220859736}$ (6)

Consider an American call option with a strike price of 100 that matures in 6 months.

 > $P≔S↦\mathrm{max}\left(S-100,0\right)$
 ${P}{≔}{S}{↦}{\mathrm{max}}{}\left({S}{-}{100}{,}{0}\right)$ (7)
 > $\mathrm{A3}≔\mathrm{AmericanOption}\left(P,0,0.5\right):$
 > $\mathrm{Maturity}≔\mathrm{AdvanceDate}\left(\mathrm{EvaluationDate}\left(\right),6,\mathrm{Months},\mathrm{output}=\mathrm{formatted}\right)$
 ${\mathrm{Maturity}}{≔}{"July 3, 2006"}$ (8)
 > $\mathrm{A4}≔\mathrm{AmericanOption}\left(P,\mathrm{EvaluationDate}\left(\right),\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{A3},T,0.1\right)$
 ${13.58412136}$ (9)
 > $\mathrm{LatticePrice}\left(\mathrm{A4},T,0.1\right)$
 ${13.58412136}$ (10)

Consider a more complicated payoff function.

 > $P≔S↦\mathrm{piecewise}\left(S<90,0,S<100,S-90,S<110,100-S,0\right)$
 ${P}{≔}{S}{↦}\left\{\begin{array}{cc}{0}& {S}{<}{90}\\ {S}{-}{90}& {S}{<}{100}\\ {100}{-}{S}& {S}{<}{110}\\ {0}& {\mathrm{otherwise}}\end{array}\right\$ (11)
 > $\mathrm{A5}≔\mathrm{AmericanOption}\left(P,0,0.5\right):$
 > $\mathrm{Maturity}≔\mathrm{AdvanceDate}\left(\mathrm{EvaluationDate}\left(\right),6,\mathrm{Months},\mathrm{output}=\mathrm{formatted}\right)$
 ${\mathrm{Maturity}}{≔}{"July 3, 2006"}$ (12)
 > $\mathrm{A6}≔\mathrm{AmericanOption}\left(P,\mathrm{EvaluationDate}\left(\right),\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{A5},T,0.1\right)$
 ${8.753522621}$ (13)
 > $\mathrm{LatticePrice}\left(\mathrm{A6},T,0.1\right)$
 ${8.753522621}$ (14)

Move the earliest exercise date and observe how the price of an American-style option approaches the price of the corresponding European-style option.

 > $E≔\mathrm{EuropeanOption}\left(P,0.5\right):$
 > $A≔\left[\mathrm{seq}\left(\mathrm{AmericanOption}\left(P,0.1i,0.5\right),i=0..5\right)\right]:$
 > $\mathrm{LatticePrice}\left(E,T,0.1\right)$
 ${0.5572512626}$ (15)
 > $\mathrm{map}\left(\mathrm{LatticePrice},A,T,0.1\right)$
 $\left[{8.753522621}{,}{6.257560595}{,}{4.973121346}{,}{3.845201308}{,}{2.647126785}{,}{0.5572512626}\right]$ (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[AmericanOption] command was introduced in Maple 15.