Evaluates the price of a security sold for less than its face value.
#include <imsl.h>
float imsl_f_discount_price (struct tm settlement, struct tm maturity, float discount_rate, float redemption, int basis)
The type double function is imsl_d_discount_price.
struct tm
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.
struct tm 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
discount_rate (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 IMSL_DAY_CNT_BASIS_ACTUALACTUAL,
IMSL_DAY_CNT_BASIS_NASD,
IMSL_DAY_CNT_BASIS_ACTUAL360,
IMSL_DAY_CNT_BASIS_ACTUAL365,
or IMSL_DAY_CNT_BASIS_30E360.
For a more detailed discussion see the Usage Notes section of this
chapter.
The price per face value for a discounted security. If no result can be computed, NaN is returned.
Function imsl_f_discount_price computes the price per $100 face value of a discounted security.
It is computed using the following:

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.
In this example, imsl_f_discount_price 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.
#include <stdio.h>
#include "imsl.h"
void main()
{
struct tm settlement, maturity;
float discount = .05;
float redemption = 100.;
int basis = IMSL_DAY_CNT_BASIS_NASD;
float price;
settlement.tm_year = 100;
settlement.tm_mon = 6;
settlement.tm_mday = 1;
maturity.tm_year = 101;
maturity.tm_mon = 6;
maturity.tm_mday = 1;
price = imsl_f_discount_price (settlement, maturity, discount,
redemption, basis);
printf ("The price of the discounted bond is $%.2f.\n", price);
}
The price of the discounted bond is $95.00.
|
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |