47 $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
55 $basis = ($basis === null)
56 ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
69 return $e->getMessage();
77 $baseYF = 1.0 + ($yield / $frequency);
78 $rfp = 100 * ($rate / $frequency);
81 $result = $redemption / $baseYF ** (--
$n + $de);
82 for ($k = 0; $k <=
$n; ++$k) {
83 $result += $rfp / ($baseYF ** ($k + $de));
116 $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
122 $basis = ($basis === null)
123 ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
134 return $e->getMessage();
138 if (!is_numeric($daysBetweenSettlementAndMaturity)) {
140 return $daysBetweenSettlementAndMaturity;
143 return $redemption * (1 - $discount * $daysBetweenSettlementAndMaturity);
174 $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
181 $basis = ($basis === null)
182 ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
194 return $e->getMessage();
198 if (!is_numeric($daysPerYear)) {
202 if (!is_numeric($daysBetweenIssueAndSettlement)) {
204 return $daysBetweenIssueAndSettlement;
206 $daysBetweenIssueAndSettlement *= $daysPerYear;
208 if (!is_numeric($daysBetweenIssueAndMaturity)) {
210 return $daysBetweenIssueAndMaturity;
212 $daysBetweenIssueAndMaturity *= $daysPerYear;
214 if (!is_numeric($daysBetweenSettlementAndMaturity)) {
216 return $daysBetweenSettlementAndMaturity;
218 $daysBetweenSettlementAndMaturity *= $daysPerYear;
220 return (100 + (($daysBetweenIssueAndMaturity / $daysPerYear) * $rate * 100)) /
221 (1 + (($daysBetweenSettlementAndMaturity / $daysPerYear) * $yield)) -
222 (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate * 100);
251 $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
257 $basis = ($basis === null)
258 ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
269 return $e->getMessage();
272 if ($investment <= 0) {
276 if (!is_numeric($daysBetweenSettlementAndMaturity)) {
278 return $daysBetweenSettlementAndMaturity;
281 return $investment / (1 - ($discount * $daysBetweenSettlementAndMaturity));
static COUPDAYSNC( $settlement, $maturity, $frequency, $basis=FinancialConstants::BASIS_DAYS_PER_YEAR_NASD)
COUPDAYSNC.
static year($dateValue)
YEAR.
static validateYield($yield)
static COUPDAYS( $settlement, $maturity, $frequency, $basis=FinancialConstants::BASIS_DAYS_PER_YEAR_NASD)
COUPDAYS.
static validateSecurityPeriod($settlement, $maturity)
static validateIssueDate($issue)
static fraction($startDate, $endDate, $method=0)
YEARFRAC.
static validateMaturityDate($maturity)
static price( $settlement, $maturity, $rate, $yield, $redemption, $frequency, $basis=FinancialConstants::BASIS_DAYS_PER_YEAR_NASD)
PRICE.
static received( $settlement, $maturity, $investment, $discount, $basis=FinancialConstants::BASIS_DAYS_PER_YEAR_NASD)
RECEIVED.
static priceDiscounted( $settlement, $maturity, $discount, $redemption, $basis=FinancialConstants::BASIS_DAYS_PER_YEAR_NASD)
PRICEDISC.
static validateRedemption($redemption)
static validateRate($rate)
static validateSettlementDate($settlement)
static validateFloat($value)
static daysPerYear($year, $basis=0)
daysPerYear.
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.
static COUPNUM( $settlement, $maturity, $frequency, $basis=FinancialConstants::BASIS_DAYS_PER_YEAR_NASD)
COUPNUM.
static validateDiscount($discount)
static validateFrequency($frequency)
static COUPDAYBS( $settlement, $maturity, $frequency, $basis=FinancialConstants::BASIS_DAYS_PER_YEAR_NASD)
COUPDAYBS.
static validateBasis($basis)
static priceAtMaturity( $settlement, $maturity, $issue, $rate, $yield, $basis=FinancialConstants::BASIS_DAYS_PER_YEAR_NASD)
PRICEMAT.