price
Evaluates the price, per $100 face value, of a security that pays periodic interest.
Synopsis
#include <imsl.h>
float imsl_f_price (struct tm settlement, struct tm maturity, float rate, float yield, float redemption, int frequency, int basis)
The type double function is imsl_d_price.
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 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.
float redemption (Input)
Redemption value per $100 face value of the security.
int frequency (Input)
Frequency of the interest payments. It should be one of IMSL_ANNUAL, IMSL_SEMIANNUAL or IMSL_QUARTERLY. For a more detailed discussion on frequency see the Usage Notes section of this chapter.
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 periodic interest. If no result can be computed, NaN is returned.
Description
Function imsl_f_price computes the price per $100 face value of a security that pays periodic interest.It is computed using the following:
In the above equation, DSC represents the number of days in the period starting with the settlement date and ending with the next coupon date. E represents the number of days within the coupon period. N represents the number of coupons payable in the timeframe from the settlement date to the redemption date. A represents the number of days in the timeframe starting with the beginning of coupon period and ending with the settlement date.
Example
In this example, imsl_f_price computes the price of a bond that pays coupon every six months with the settlement of July 1, 1995, the maturity date of July 1, 2005, a annual rate of 6%, annual yield of 7% and redemption value of $105 using the US (NASD) 30/360 day count method.
 
#include <stdio.h>
#include <imsl.h>
 
int main()
{
struct tm settlement, maturity;
float rate = .06;
float yield = .07;
float redemption = 105.;
int frequency = IMSL_SEMIANNUAL;
int basis = IMSL_DAY_CNT_BASIS_NASD;
float price;
 
settlement.tm_year = 95;
settlement.tm_mon = 6;
settlement.tm_mday = 1;
 
maturity.tm_year = 105;
maturity.tm_mon = 6;
maturity.tm_mday = 1;
 
price = imsl_f_price (settlement, maturity, rate, yield,
redemption, frequency, basis);
printf ("The price of the bond is $%.2f.\n", price);
}
Output
 
The price of the bond is $95.41.