Coupons
in package
Table of Contents
Constants
- PERIOD_DATE_NEXT = true
- PERIOD_DATE_PREVIOUS = false
Methods
- COUPDAYBS() : string|int|float
- COUPDAYBS.
- COUPDAYS() : string|int|float
- COUPDAYS.
- COUPDAYSNC() : string|float
- COUPDAYSNC.
- COUPNCD() : float|string
- COUPNCD.
- COUPNUM() : string|int
- COUPNUM.
- COUPPCD() : float|string
- COUPPCD.
- couponFirstPeriodDate() : float
- monthsDiff() : void
- validateCouponPeriod() : void
Constants
PERIOD_DATE_NEXT
private
mixed
PERIOD_DATE_NEXT
= true
PERIOD_DATE_PREVIOUS
private
mixed
PERIOD_DATE_PREVIOUS
= false
Methods
COUPDAYBS()
COUPDAYBS.
public
static COUPDAYBS(mixed $settlement, mixed $maturity, mixed $frequency[, mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD ]) : string|int|float
Returns the number of days from the beginning of the coupon period to the settlement date.
Excel Function: COUPDAYBS(settlement,maturity,frequency[,basis])
Parameters
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $frequency : mixed
-
The number of coupon payments per year (int). Valid frequency values are: 1 Annual 2 Semi-Annual 4 Quarterly
- $basis : mixed = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
-
The type of day count to use (int). 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Return values
string|int|floatCOUPDAYS()
COUPDAYS.
public
static COUPDAYS(mixed $settlement, mixed $maturity, mixed $frequency[, mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD ]) : string|int|float
Returns the number of days in the coupon period that contains the settlement date.
Excel Function: COUPDAYS(settlement,maturity,frequency[,basis])
Parameters
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $frequency : mixed
-
The number of coupon payments per year. Valid frequency values are: 1 Annual 2 Semi-Annual 4 Quarterly
- $basis : mixed = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
-
The type of day count to use (int). 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Return values
string|int|floatCOUPDAYSNC()
COUPDAYSNC.
public
static COUPDAYSNC(mixed $settlement, mixed $maturity, mixed $frequency[, mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD ]) : string|float
Returns the number of days from the settlement date to the next coupon date.
Excel Function: COUPDAYSNC(settlement,maturity,frequency[,basis])
Parameters
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $frequency : mixed
-
The number of coupon payments per year. Valid frequency values are: 1 Annual 2 Semi-Annual 4 Quarterly
- $basis : mixed = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
-
The type of day count to use (int) . 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Return values
string|floatCOUPNCD()
COUPNCD.
public
static COUPNCD(mixed $settlement, mixed $maturity, mixed $frequency[, mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD ]) : float|string
Returns the next coupon date after the settlement date.
Excel Function: COUPNCD(settlement,maturity,frequency[,basis])
Parameters
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $frequency : mixed
-
The number of coupon payments per year. Valid frequency values are: 1 Annual 2 Semi-Annual 4 Quarterly
- $basis : mixed = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
-
The type of day count to use (int). 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Return values
float|string —Excel date/time serial value or error message
COUPNUM()
COUPNUM.
public
static COUPNUM(mixed $settlement, mixed $maturity, mixed $frequency[, mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD ]) : string|int
Returns the number of coupons payable between the settlement date and maturity date, rounded up to the nearest whole coupon.
Excel Function: COUPNUM(settlement,maturity,frequency[,basis])
Parameters
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $frequency : mixed
-
The number of coupon payments per year. Valid frequency values are: 1 Annual 2 Semi-Annual 4 Quarterly
- $basis : mixed = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
-
The type of day count to use (int). 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Return values
string|intCOUPPCD()
COUPPCD.
public
static COUPPCD(mixed $settlement, mixed $maturity, mixed $frequency[, mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD ]) : float|string
Returns the previous coupon date before the settlement date.
Excel Function: COUPPCD(settlement,maturity,frequency[,basis])
Parameters
- $settlement : mixed
-
The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.
- $maturity : mixed
-
The security's maturity date. The maturity date is the date when the security expires.
- $frequency : mixed
-
The number of coupon payments per year. Valid frequency values are: 1 Annual 2 Semi-Annual 4 Quarterly
- $basis : mixed = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
-
The type of day count to use (int). 0 or omitted US (NASD) 30/360 1 Actual/actual 2 Actual/360 3 Actual/365 4 European 30/360
Return values
float|string —Excel date/time serial value or error message
couponFirstPeriodDate()
private
static couponFirstPeriodDate(float $settlement, float $maturity, int $frequency, bool $next) : float
Parameters
- $settlement : float
- $maturity : float
- $frequency : int
- $next : bool
Return values
floatmonthsDiff()
private
static monthsDiff(DateTime $result, int $months, string $plusOrMinus, int $day, bool $lastDayFlag) : void
Parameters
- $result : DateTime
- $months : int
- $plusOrMinus : string
- $day : int
- $lastDayFlag : bool
validateCouponPeriod()
private
static validateCouponPeriod(float $settlement, float $maturity) : void
Parameters
- $settlement : float
- $maturity : float