BlackPrice - Maple Help

Finance

 BlackPrice
 calculate the price of an interest rate instrument using the Black model

 Calling Sequence BlackPrice(instrument, discountrate, volatility)

Parameters

 instrument - cap, floor, collar or swaption; financial instrument discountrate - non-negative constant or a yield term structure; discount rate volatility - non-negative constant; volatility opts - equations of the form option = value where option is one of referencedate or daycounter; specify options for the BlackPrice command

Options

 • daycounter =  a string containing a date specification in a format recognized by ParseDate or a Date data structure -- This option specifies a day counter or day counting convention.
 • referencedate =  a string containing a date specification in a format recognized by ParseDate or a Date data structure -- This option specifies the reference date, that is, the date when the discount factor is 1. By default this is set to the global evaluation date.

Description

 • The BlackPrice command computes the price of an interest rate instrument (such as Cap, Floor, Collar or InterestRateSwap) using the Black model with the specified discount rate and volatility.

Examples

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

Set the global evaluation date. This date is taken as the reference date for all yield curves and benchmark rates unless another date is specified explicitly.

 > $\mathrm{SetEvaluationDate}\left("November 17, 2006"\right):$
 > $\mathrm{EvaluationDate}\left(\right)$
 ${"November 17, 2006"}$ (1)

The nominal amount is 100.

 > $\mathrm{nominalamt}≔100$
 ${\mathrm{nominalamt}}{≔}{100}$ (2)

Create a 6-month EURIBOR benchmark rate with a forecasted rate of 5%. No history is available for this rate.

 > $\mathrm{benchmark}≔\mathrm{BenchmarkRate}\left(6,\mathrm{Months},\mathrm{EURIBOR},0.05\right)$
 ${\mathrm{benchmark}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (3)

Construct a discount interest rate curve.

 > $\mathrm{discount_curve}≔\mathrm{ForwardCurve}\left(0.05,'\mathrm{daycounter}'=\mathrm{Actual360}\right)$
 ${\mathrm{discount_curve}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (4)

Construct floating-leg payments.

 > $\mathrm{start_date}≔\mathrm{AdvanceDate}\left(2,\mathrm{Days}\right)$
 ${\mathrm{start_date}}{≔}{"November 19, 2006"}$ (5)
 > $\mathrm{end_date}≔\mathrm{AdvanceDate}\left(\mathrm{start_date},20,\mathrm{Years},'\mathrm{convention}'=\mathrm{ModifiedFollowing}\right)$
 ${\mathrm{end_date}}{≔}{"November 19, 2026"}$ (6)
 > $\mathrm{coupon_dates}≔\left[\mathrm{seq}\left(\mathrm{AdvanceDate}\left(\mathrm{start_date},6i,\mathrm{Months}\right),i=0..40\right)\right]:$
 > $\mathrm{floating_leg}≔\left[\mathrm{seq}\left(\mathrm{ParCoupon}\left(\mathrm{nominalamt},\mathrm{discount_curve},\mathrm{coupon_dates}\left[i\right],\mathrm{coupon_dates}\left[i+1\right]\right),i=1..40\right)\right]:$

Construct an interest rate cap with a fixed cap rate of 7% for all payments in the floating leg.

 > $\mathrm{ir_cap}≔\mathrm{Cap}\left(\mathrm{floating_leg},0.07\right)$
 ${\mathrm{ir_cap}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (7)
 > $\mathrm{ir_floor}≔\mathrm{Floor}\left(\mathrm{floating_leg},0.03\right)$
 ${\mathrm{ir_floor}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (8)
 > $\mathrm{ir_collar}≔\mathrm{Collar}\left(\mathrm{floating_leg},0.07,0.03\right)$
 ${\mathrm{ir_collar}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (9)

Price these instruments using the Black model with a discount rate of 5% and a volatility of 20%, and verify that the price of the cap is equal to the sum of the prices of the other two instruments.

 > $\mathrm{cap_price}≔\mathrm{BlackPrice}\left(\mathrm{ir_cap},0.05,0.2\right)$
 ${\mathrm{cap_price}}{≔}{6.832847321}$ (10)
 > $\mathrm{floor_price}≔\mathrm{BlackPrice}\left(\mathrm{ir_floor},0.05,0.2\right)$
 ${\mathrm{floor_price}}{≔}{2.642595692}$ (11)
 > $\mathrm{collar_price}≔\mathrm{BlackPrice}\left(\mathrm{ir_collar},0.05,0.2\right)$
 ${\mathrm{collar_price}}{≔}{4.190251628}$ (12)
 > $\mathrm{cap_price}=\mathrm{floor_price}+\mathrm{collar_price}$
 ${6.832847321}{=}{6.832847320}$ (13)

Compatibility

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