discountPrice¶
Evaluates the price of a security sold for less than its face value.
Synopsis¶
discountPrice (settlement, maturity, discountRate, redemption, basis)
Required Arguments¶
- date
settlement
(Input) - The date on which payment is made to settle a trade. For a more detailed discussion on dates see the Usage Notes section of this chapter.
- date
maturity
(Input) - The date on which the bond comes due, and principal and accrued interest are paid. For a more detailed discussion on see the Usage Notes section of this chapter.
- float
discountRate
(Input) - The interest rate implied when a security is sold for less than its value at maturity in lieu of interest payments.
- float
redemption
(Input) - Redemption value per $100 face value of the security.
- int
basis
(Input) - The method for computing the number of days between two dates. It should
be one of
DAY_CNT_BASIS_ACTUALACTUAL
,DAY_CNT_BASIS_NASD
,DAY_CNT_BASIS_ACTUAL360
,DAY_CNT_BASIS_ACTUAL365
, orDAY_CNT_BASIS_30E360
. For a more detailed discussion see the Usage Notes section of this chapter.
Return Value¶
The price per face value for a discounted security. If no result can be computed, NaN is returned.
Description¶
Function discountPrice
computes the price per $100 face value of a
discounted security.
It is computed using the following:
\[\mathit{redemption} - (\mathit{discountRate})
\left[\mathit{redemption}\left(\frac{\mathit{DSM}}{B}\right)\right]\]
In the equation above, DSM represents the number of days starting at the settlement date and ending with the maturity date. B represents the number of days in a year based on the annual basis.
Example¶
In this example, discountPrice
computes the price of the discounted bond
with the settlement date of July 1, 2000, and maturity date of July 1, 2001,
at the discount rate of 5% using the US (NASD) 30/360 day count method.
from __future__ import print_function
from numpy import *
from datetime import date
from pyimsl.math.discountPrice import discountPrice, DAY_CNT_BASIS_NASD
discount = .05
redemption = 100.
basis = DAY_CNT_BASIS_NASD
settlement = date(2000, 7, 1)
maturity = date(2001, 7, 1)
price = discountPrice(settlement, maturity, discount,
redemption, basis)
print("The price of the discounted bond is $%.2f." % (price))
Output¶
The price of the discounted bond is $95.00.