calculate the dirty price of a bond - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Finance : Cash Flow Analysis : Finance/DirtyPrice

Finance[DirtyPrice] - calculate the dirty price of a bond

Calling Sequence

DirtyPrice(bond, yield, compounding, opts)

Parameters

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

Description

• 

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.

Examples

withFinance:

SetEvaluationDateNovember 25, 2006:

EvaluationDate

November 25, 2006

(1)

Settingsdaycounter=Historical,settlementdays=0,businessdayconvention=Unadjusted

daycounter=Historical,settlementdays=0,businessdayconvention=Unadjusted

(2)

Consider a zero-coupon bond with face value 100 maturing in one year.

bond1:=ZeroCouponBond100,5,Years:

price1:=DirtyPricebond1,0.05,Compounded

price1:=78.35261665

(3)

yield1:=YieldFromDirtyPricebond1,price1

yield1:=0.04879016417

(4)

EquivalentRateyield1,Continuous,Annual

0.05000000000

(5)

yield1:=YieldFromDirtyPricebond1,price1,Compounded

yield1:=0.05000000006

(6)

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:=DirtyPricebond1,0.05

price1:=77.88007831

(7)

price1:=NetPresentValuebond1,0.05

price1:=77.88007831

(8)

InternalRateOfReturnbond1,price1

0.04999999999

(9)

YieldFromDirtyPricebond1,price1

0.05000000001

(10)

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.

Settingsdaycounter=Thirty360European:

Settingsdaycounter

Thirty360European

(11)

bond2:=FixedCouponBondprincipal2,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.

DirtyPricebond2,rate2

99.44565692

(12)

discount2:=ForwardCurverate2:

NetPresentValuebond2,discount2

99.44565692

(13)

cashflows2:=CashFlowsbond2

cashflows2:=3. on 'March 15, 2007',3. on 'March 15, 2008',100. on 'March 15, 2008'

(14)

NetPresentValuecashflows2,discount2

99.44565692

(15)

3DiscountFactordiscount2,March 15, 2007+103DiscountFactordiscount2,March 15, 2008

99.44565692

(16)

3ⅇ0.05YearFractionMarch 15, 2007+103ⅇ0.05YearFractionMarch 15, 2008

99.44565692

(17)

Here is the same bond using a different business day convention and day counter.

bond3:=FixedCouponBondprincipal2,3,Years,coupon2,issuedate=March 15, 2005,convention=Following,daycounter=Historical:

discount3:=ForwardCurverate2,daycounter=Historical:

NetPresentValuebond3,discount3

99.46206804

(18)

Note that the NetPresentValue command will adjust the evaluation date according to the underlying business day convention.

discount4:=ForwardCurverate2,daycounter=Historical,referencedate=AdjustDateEvaluationDate,convention=Following

discount4:=moduleend module

(19)

DirtyPricebond3,rate2,evaluationdate=AdjustDateEvaluationDate,convention=Following

99.46206804

(20)

cashflows3:=CashFlowsbond3

cashflows3:=3. on 'March 15, 2007',3.006557377 on 'March 15, 2008',100. on 'March 15, 2008'

(21)

NetPresentValuecashflows3,discount4

99.46206804

(22)

addtamountDiscountFactordiscount4,tdate,t∈cashflows3

99.46206804

(23)

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

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam