39 $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
45 $basis = ($basis === null)
46 ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
57 return $e->getMessage();
61 if (!is_numeric($daysPerYear)) {
65 if (!is_numeric($daysBetweenSettlementAndMaturity)) {
67 return $daysBetweenSettlementAndMaturity;
69 $daysBetweenSettlementAndMaturity *= $daysPerYear;
71 return (($redemption - $price) / $price) * ($daysPerYear / $daysBetweenSettlementAndMaturity);
102 $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
109 $basis = ($basis === null)
110 ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
122 return $e->getMessage();
126 if (!is_numeric($daysPerYear)) {
130 if (!is_numeric($daysBetweenIssueAndSettlement)) {
132 return $daysBetweenIssueAndSettlement;
134 $daysBetweenIssueAndSettlement *= $daysPerYear;
136 if (!is_numeric($daysBetweenIssueAndMaturity)) {
138 return $daysBetweenIssueAndMaturity;
140 $daysBetweenIssueAndMaturity *= $daysPerYear;
142 if (!is_numeric($daysBetweenSettlementAndMaturity)) {
144 return $daysBetweenSettlementAndMaturity;
146 $daysBetweenSettlementAndMaturity *= $daysPerYear;
148 return ((1 + (($daysBetweenIssueAndMaturity / $daysPerYear) * $rate) -
149 (($price / 100) + (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate))) /
150 (($price / 100) + (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate))) *
151 ($daysPerYear / $daysBetweenSettlementAndMaturity);
static yieldAtMaturity( $settlement, $maturity, $issue, $rate, $price, $basis=FinancialConstants::BASIS_DAYS_PER_YEAR_NASD)
YIELDMAT.
static year($dateValue)
YEAR.
static validatePrice($price)
static validateSecurityPeriod($settlement, $maturity)
static validateIssueDate($issue)
static fraction($startDate, $endDate, $method=0)
YEARFRAC.
static validateMaturityDate($maturity)
static yieldDiscounted( $settlement, $maturity, $price, $redemption, $basis=FinancialConstants::BASIS_DAYS_PER_YEAR_NASD)
YIELDDISC.
static validateRedemption($redemption)
static validateRate($rate)
static validateSettlementDate($settlement)
static daysPerYear($year, $basis=0)
daysPerYear.
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.
static validateBasis($basis)