DirtyPrice - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Finance

  

DirtyPrice

  

calculate the dirty price of a bond

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

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

Options

• 

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).

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.

bond1ZeroCouponBond100,5,Years:

price1DirtyPricebond1,0.05,Compounded

price178.35261665

(3)

yield1YieldFromDirtyPricebond1,price1

yield10.04879016417

(4)

EquivalentRateyield1,Continuous,Annual

0.05000000000

(5)

yield1YieldFromDirtyPricebond1,price1,Compounded

yield10.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.

price1DirtyPricebond1,0.05

price177.88007831

(7)

price1NetPresentValuebond1,0.05

price177.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.

principal2100:

coupon20.03:

rate20.05:

Reset the default day counter to be Thirty360European.

Settingsdaycounter=Thirty360European:

Settingsdaycounter

Thirty360European

(11)

bond2FixedCouponBondprincipal2,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)

discount2ForwardCurverate2:

NetPresentValuebond2,discount2

99.44565692

(13)

cashflows2CashFlowsbond2

cashflows23. 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)

3exp0.05YearFractionMarch 15, 2007+103exp0.05YearFractionMarch 15, 2008

99.44565692

(17)

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

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

discount3ForwardCurverate2,daycounter=Historical:

NetPresentValuebond3,discount3

99.46206804

(18)

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

discount4ForwardCurverate2,daycounter=Historical,referencedate=AdjustDateEvaluationDate,convention=Following

discount4moduleend module

(19)

DirtyPricebond3,rate2,evaluationdate=AdjustDateEvaluationDate,convention=Following

99.46206804

(20)

cashflows3CashFlowsbond3

cashflows33. on 'March 15, 2007',3.006557377 on 'March 15, 2008',100. on 'March 15, 2008'

(21)

NetPresentValuecashflows3,discount4

99.46206804

(22)

addtamountDiscountFactordiscount4,tdate,tincashflows3

99.46206804

(23)

Compatibility

• 

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]