CNLMath : Special Functions : price_maturity
price_maturity
Evaluates the price, per $100 face value, of a security that pays interest at maturity.
Synopsis
#include <imsl.h>
float imsl_f_price_maturity (struct tm settlement, struct tm maturity, struct tm issue, float rate, float yield, int basis)
The type double function is imsl_d_price_maturity.
Required Arguments
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 see the Usage Notes section of this chapter.
struct tm issue (Input)
The date on which interest starts accruing. For a more detailed discussion on dates see the Usage Notes section of this chapter.
float rate (Input)
Annual interest rate set forth on the face of the security; the coupon rate.
float yield (Input)
Annual yield 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 on basis see the Usage Notes section of this chapter.
Return Value
The price per $100 face value of a security that pays interest at maturity. If no result can be computed, NaN is returned.
Description
Function imsl_f_price_maturity computes the price per $100 face value of a security that pays interest at maturity.
It is computed using the following:
In the equation above, B represents the number of days in a year based on the annual basis. DSM represents the number of days in the period starting with the settlement date and ending with the maturity date. DIM represents the number of days in the period starting with the issue date and ending with the maturity date. A represents the number of days in the period starting with the issue date and ending with the settlement date.
Example
In this example, imsl_f_price_maturity computes the price at maturity of a security with the settlement date of August 1, 2000, maturity date of July 1, 2001 and issue date of July 1, 2000, using the US (NASD) 30/360 day count method. The security has 5% annual yield and 5% interest rate at the date of issue.
 
#include <stdio.h>
#include <imsl.h>
 
#include <stdio.h>
#include <imsl.h>
 
int main()
{
struct tm settlement, maturity, issue;
float rate = .05;
float yield = .05;
int basis = IMSL_DAY_CNT_BASIS_NASD;
float pricemat;
 
settlement.tm_year = 100;
settlement.tm_mon = 7;
settlement.tm_mday = 1;
 
maturity.tm_year = 101;
maturity.tm_mon = 6;
maturity.tm_mday = 1;
 
issue.tm_year = 100;
issue.tm_mon = 6;
issue.tm_mday = 1;
 
pricemat = imsl_d_price_maturity (settlement, maturity, issue,
rate, yield, basis);
 
printf ("The price of the bond is $%.2f.\n", pricemat);
}
Output
The price of the bond is $99.98.