/** * Returns the price per $100 face value of a discounted bond * Excel equivalent: PRICEDISC * * @param int Settlement date (UNIX timestamp) * @param int Maturity date (UNIX timestamp) * @param float The bond's discount rate * @param float The bond's redemption value per $100 face value * @param int Type of day count basis: FINANCE_COUNT_NASD(default): US(NASD) 30/360 FINANCE_COUNT_ACTUAL_ACTUAL: Actual/actual FINANCE_COUNT_ACTUAL_360: Actual/360 FINANCE_COUNT_ACTUAL_365: Actual/365 FINANCE_COUNT_EUROPEAN: European 30/360 * @return float * @static * @access public */ function priceDiscount($settlement, $maturity, $discount, $redemption, $basis = 0) { $days_per_year = Math_Finance::daysPerYear(date('Y', $settlement), $basis); $dsm = Math_Finance::daysDifference($settlement, $maturity, $basis); return $redemption - $discount * $redemption * $dsm / $days_per_year; }