@travishorn/financejs
    Preparing search index...

    Function calculateBondPrice

    • Calculates the price per $100 face value of a security that pays periodic interest.

      Remarks:

      • The settlement date is the date a buyer purchases a coupon, such as a bond. The maturity date is the date when a coupon expires. For example, suppose a 30-year bond is issued on January 1, 2008, and is purchased by a buyer six months later. The issue date would be January 1, 2008, the settlement date would be July 1, 2008, and the maturity date would be January 1, 2038, which is 30 years after the January 1, 2008, issue date.
      • settlement, maturity, frequency, and basis are truncated to integers.
      • If settlement or maturity is not a valid date, an error is thrown.
      • If yield < 0 or if rate < 0, an error is thrown.
      • If redemption <= 0, an error is thrown.
      • If frequency is any number other than 1, 2, or 4, an error is thrown.
      • If basis < 0 or if basis > 4 and error is thrown.
      • If settlement >= maturity, an error is thrown.
      • When N > 1 (N is the number of coupons payable between the settlement date and redemption date), the calculation is: PRICE =[redemption / (1 + yield/frequency)^(N-1 + DSC/E)] +[SUM(k=1 to N) (100 * rate/frequency) / (1 + yield/frequency)^(k-1 + DSC/E)] - (100 * rate/frequency * A/E), where:
        • DSC = number of days from settlement to next coupon date.
        • E = number of days in coupon period in which the settlement date falls.
        • A = number of days from beginning of coupon period to settlement date.
      • When N = 1, the calculation is: `DSR = E - A; T1 = 100 * (rate / frequency)
        • redemption; T2 = (yield / frequency) * (DSR / E) + 1; T3 = 100 * (rate / frequency) * (A / E); Price = (T1 / T2) - T3`.

      Parameters

      • options: BondPriceOptions

        The bond price calculation options.

      Returns number

      The price per $100 face value.

      calculateBondPrice({
      settlement: new Date("2008-02-15"),
      maturity: new Date("2017-11-15"),
      rate: 0.0575,
      yield: 0.065,
      redemption: 100,
      frequency: 2,
      basis: 0,
      }); // 94.63436162