Finance
DirtyPrice
calculate the dirty price of a bond
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
DirtyPrice(bond, yield, compounding, opts)
bond
-
fixed- or floating-rate bond data structure; bond
yield
non-negative constant; desired yield
compounding
Simple, Continuous, Compounded, or SimpleThenCompounded; the underlying compounding type
opts
equations of the form option = value where option is evaluationdate; specify options for the DirtyPrice command
evaluationdate = a string containing a date specification in a format recognized by ParseDate or a Date data structure -- This option specifies the evaluation date. By default this is set to the global evaluation date (see EvaluationDate).
The DirtyPrice command computes the dirty price of a bond, given its yield. Dirty price does include any accrued interest that has accumulated since the last coupon payment. The dirty price of a bond is the same as the net present value of a bond (see NetPresentValue). See the CleanPrice command to calculate the clean price of a bond, which does not include any accrued interest.
The parameter bond is either a fixed coupon bond or floating rate bond. The parameter yield is the desired yield.
with⁡Finance:
SetEvaluationDate⁡November 25, 2006:
EvaluationDate⁡
November 25, 2006
Settings⁡daycounter=Historical,settlementdays=0,businessdayconvention=Unadjusted
daycounter=Historical,settlementdays=0,businessdayconvention=Unadjusted
Consider a zero-coupon bond with face value 100 maturing in one year.
bond1≔ZeroCouponBond⁡100,5,Years:
price1≔DirtyPrice⁡bond1,0.05,Compounded
price1≔78.35261665
yield1≔YieldFromDirtyPrice⁡bond1,price1
yield1≔0.04879016417
EquivalentRate⁡yield1,Continuous,Annual
0.05000000000
yield1≔YieldFromDirtyPrice⁡bond1,price1,Compounded
yield1≔0.05000000006
For bonds the DirtyPrice is equivalent to the NetPresentValue command when the discount rate is constant and equal to the yield. Similarly, the InternalRateOfReturn command is equivalent to the YieldFromDirtyPrice command.
price1≔DirtyPrice⁡bond1,0.05
price1≔77.88007831
price1≔NetPresentValue⁡bond1,0.05
InternalRateOfReturn⁡bond1,price1
0.04999999999
YieldFromDirtyPrice⁡bond1,price1
0.05000000001
Consider a 3-year bond with face value of 100 that pays a fixed coupon of 3 percent issued on March 15, 2005.
principal2≔100:
coupon2≔0.03:
rate2≔0.05:
Reset the default day counter to be Thirty360European.
Settings⁡daycounter=Thirty360European:
Settings⁡daycounter
Thirty360European
bond2≔FixedCouponBond⁡principal2,3,Years,coupon2,issuedate=March 15, 2005:
Calculate the purchase price of the bond using five different methods. Note that by default all rates are assumed to be based on continuous compounding.
DirtyPrice⁡bond2,rate2
99.44565692
discount2≔ForwardCurve⁡rate2:
NetPresentValue⁡bond2,discount2
cashflows2≔CashFlows⁡bond2
cashflows2≔3. on 'March 15, 2007',3. on 'March 15, 2008',100. on 'March 15, 2008'
NetPresentValue⁡cashflows2,discount2
3⁢DiscountFactor⁡discount2,March 15, 2007+103⁢DiscountFactor⁡discount2,March 15, 2008
3⁢exp⁡−0.05⁢YearFraction⁡March 15, 2007+103⁢exp⁡−0.05⁢YearFraction⁡March 15, 2008
Here is the same bond using a different business day convention and day counter.
bond3≔FixedCouponBond⁡principal2,3,Years,coupon2,issuedate=March 15, 2005,convention=Following,daycounter=Historical:
discount3≔ForwardCurve⁡rate2,daycounter=Historical:
NetPresentValue⁡bond3,discount3
99.46206804
Note that the NetPresentValue command will adjust the evaluation date according to the underlying business day convention.
discount4≔ForwardCurve⁡rate2,daycounter=Historical,referencedate=AdjustDate⁡EvaluationDate⁡,convention=Following
discount4≔moduleend module
DirtyPrice⁡bond3,rate2,evaluationdate=AdjustDate⁡EvaluationDate⁡,convention=Following
cashflows3≔CashFlows⁡bond3
cashflows3≔3. on 'March 15, 2007',3.006557377 on 'March 15, 2008',100. on 'March 15, 2008'
NetPresentValue⁡cashflows3,discount4
add⁡tamount⁢DiscountFactor⁡discount4,tdate,tincashflows3
The Finance[DirtyPrice] command was introduced in Maple 15.
For more information on Maple 15 changes, see Updates in Maple 15.
See Also
Finance[AccruedInterest]
Finance[DayCounter]
Finance[DirtyPrice]
Finance[FixedCouponBond]
Finance[FloatingRateBond]
Finance[FormatDate]
Finance[ParseDate]
Finance[YearFraction]
Finance[Yield]
Finance[ZeroCouponBond]
Download Help Document