37 return $e->getMessage();
44 $daysBetweenSettlementAndMaturity = $maturity - $settlement;
47 FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL
50 if ($daysBetweenSettlementAndMaturity > $daysPerYear || $daysBetweenSettlementAndMaturity < 0) {
54 return (365 * $discount) / (360 - $discount * $daysBetweenSettlementAndMaturity);
71 public static function price($settlement, $maturity, $discount)
82 return $e->getMessage();
89 $daysBetweenSettlementAndMaturity = $maturity - $settlement;
92 FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL
95 if ($daysBetweenSettlementAndMaturity > $daysPerYear || $daysBetweenSettlementAndMaturity < 0) {
99 $price = 100 * (1 - (($discount * $daysBetweenSettlementAndMaturity) / 360));
121 public static function yield($settlement, $maturity, $price)
132 return $e->getMessage();
135 $daysBetweenSettlementAndMaturity = $maturity - $settlement;
138 FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL
141 if ($daysBetweenSettlementAndMaturity > $daysPerYear || $daysBetweenSettlementAndMaturity < 0) {
145 return ((100 - $price) / $price) * (360 / $daysBetweenSettlementAndMaturity);
static year($dateValue)
YEAR.
static bondEquivalentYield($settlement, $maturity, $discount)
TBILLEQ.
static validatePrice($price)
static validateMaturityDate($maturity)
static validateSettlementDate($settlement)
static validateFloat($value)
static yield($settlement, $maturity, $price)
TBILLYIELD.
static daysPerYear($year, $basis=0)
daysPerYear.
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.
static price($settlement, $maturity, $discount)
TBILLPRICE.