@sheetxl/formulas-extended 0.7.23-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +11 -0
- package/README.md +59 -0
- package/browser/cjs/B4JJfKSI4ppwU855.cjs +1 -0
- package/browser/cjs/BWDfauDHqB6U_2ka.cjs +1 -0
- package/browser/cjs/BwLx9ix5Sq7suAYP.cjs +1 -0
- package/browser/cjs/C2uDl8VIJqh58YF_.cjs +1 -0
- package/browser/cjs/CW-b31_-r-_raT8Y.cjs +1 -0
- package/browser/cjs/Clu7XiAsCB48GDXN.cjs +1 -0
- package/browser/cjs/CnZfa45XxA-9Jhmp.cjs +1 -0
- package/browser/cjs/DsFZgtSQpC75d1M0.cjs +1 -0
- package/browser/cjs/JfM6P_qoQQTWakZf.cjs +1 -0
- package/browser/cjs/bM25C5avKgBAJVfk.cjs +1 -0
- package/browser/cjs/fqTQ_p3ehzUvc1tF.cjs +1 -0
- package/browser/cjs/h3dw1jAp2J5Pu4p3.cjs +1 -0
- package/browser/cjs/index.cjs +1 -0
- package/browser/cjs/jev6VGWTdgEgm4Yk.cjs +1 -0
- package/browser/cjs/lEQC21-Sk4lwHy2r.cjs +1 -0
- package/browser/esm/-9SircqlVS-6jMNw.mjs +304 -0
- package/browser/esm/BCWg0NNa-nGjBMYM.mjs +19 -0
- package/browser/esm/BSWSZ6lA8jcSqHmz.mjs +19 -0
- package/browser/esm/BUYVOSf4JEFM5iRs.mjs +45 -0
- package/browser/esm/BWbYcyqeI2q9zobt.mjs +63 -0
- package/browser/esm/BatWJFRiqJI5wALH.mjs +52 -0
- package/browser/esm/CRT-M9ZISwPJluM8.mjs +71 -0
- package/browser/esm/Ck9zOHAyQJLQF_j_.mjs +83 -0
- package/browser/esm/CmXZZdy6rEOCrUnH.mjs +63 -0
- package/browser/esm/DAxAXOJZXvqvlnoT.mjs +28 -0
- package/browser/esm/DHrrLoyQ_KZ3yWWr.mjs +55 -0
- package/browser/esm/DboajdAr6s1IjcXM.mjs +45 -0
- package/browser/esm/Dtof6I8zPa8LIz89.mjs +35 -0
- package/browser/esm/XphbS4usCLMa2WZ2.mjs +20 -0
- package/browser/esm/index.mjs +2978 -0
- package/licenses/dependencies.txt +1 -0
- package/node/esm/-9SircqlVS-6jMNw.mjs +304 -0
- package/node/esm/BBREUOtt4cAHs88k.mjs +45 -0
- package/node/esm/BCWg0NNa-nGjBMYM.mjs +19 -0
- package/node/esm/BSWSZ6lA8jcSqHmz.mjs +19 -0
- package/node/esm/BUYVOSf4JEFM5iRs.mjs +45 -0
- package/node/esm/BWbYcyqeI2q9zobt.mjs +63 -0
- package/node/esm/BatWJFRiqJI5wALH.mjs +52 -0
- package/node/esm/CRT-M9ZISwPJluM8.mjs +71 -0
- package/node/esm/Ck9zOHAyQJLQF_j_.mjs +83 -0
- package/node/esm/CmXZZdy6rEOCrUnH.mjs +63 -0
- package/node/esm/DHrrLoyQ_KZ3yWWr.mjs +55 -0
- package/node/esm/Dp0K0CPOWr5We6lS.mjs +28 -0
- package/node/esm/Dtof6I8zPa8LIz89.mjs +35 -0
- package/node/esm/XphbS4usCLMa2WZ2.mjs +20 -0
- package/node/esm/index.mjs +3047 -0
- package/package.json +43 -0
- package/resources/contents.json +14 -0
- package/resources/locales/contents.json +9 -0
- package/resources/locales/de/functions.json +59 -0
- package/types/index.d.ts +4 -0
- package/types/src/.generated/decl/cube/Cube.decl.d.ts +4 -0
- package/types/src/.generated/decl/cube/Cube.decl.d.ts.map +1 -0
- package/types/src/.generated/decl/financial/ACCRINT.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/ACCRINT.decl.d.ts.map +1 -0
- package/types/src/.generated/decl/financial/AMORDEGRC.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/AMORDEGRC.decl.d.ts.map +1 -0
- package/types/src/.generated/decl/financial/Date.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/Date.decl.d.ts.map +1 -0
- package/types/src/.generated/decl/financial/Financial.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/Financial.decl.d.ts.map +1 -0
- package/types/src/.generated/decl/financial/Financial2.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/Financial2.decl.d.ts.map +1 -0
- package/types/src/.generated/decl/financial/Financial3.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/Financial3.decl.d.ts.map +1 -0
- package/types/src/.generated/decl/financial/Financial4.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/Financial4.decl.d.ts.map +1 -0
- package/types/src/.generated/decl/financial/ODD.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/ODD.decl.d.ts.map +1 -0
- package/types/src/.generated/decl/financial/VDB.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/VDB.decl.d.ts.map +1 -0
- package/types/src/.generated/decl/statistical/ETS.decl.d.ts +4 -0
- package/types/src/.generated/decl/statistical/ETS.decl.d.ts.map +1 -0
- package/types/src/.generated/decl/statistical/Regression.decl.d.ts +4 -0
- package/types/src/.generated/decl/statistical/Regression.decl.d.ts.map +1 -0
- package/types/src/.generated/decl/statistical/TTEST.decl.d.ts +4 -0
- package/types/src/.generated/decl/statistical/TTEST.decl.d.ts.map +1 -0
- package/types/src/.generated/decl/text/RegEx.decl.d.ts +4 -0
- package/types/src/.generated/decl/text/RegEx.decl.d.ts.map +1 -0
- package/types/src/.generated/desc/cube/Cube.desc.d.ts +4 -0
- package/types/src/.generated/desc/cube/Cube.desc.d.ts.map +1 -0
- package/types/src/.generated/desc/financial/ACCRINT.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/ACCRINT.desc.d.ts.map +1 -0
- package/types/src/.generated/desc/financial/AMORDEGRC.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/AMORDEGRC.desc.d.ts.map +1 -0
- package/types/src/.generated/desc/financial/Date.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/Date.desc.d.ts.map +1 -0
- package/types/src/.generated/desc/financial/Financial.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/Financial.desc.d.ts.map +1 -0
- package/types/src/.generated/desc/financial/Financial2.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/Financial2.desc.d.ts.map +1 -0
- package/types/src/.generated/desc/financial/Financial3.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/Financial3.desc.d.ts.map +1 -0
- package/types/src/.generated/desc/financial/Financial4.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/Financial4.desc.d.ts.map +1 -0
- package/types/src/.generated/desc/financial/ODD.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/ODD.desc.d.ts.map +1 -0
- package/types/src/.generated/desc/financial/VDB.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/VDB.desc.d.ts.map +1 -0
- package/types/src/.generated/desc/statistical/ETS.desc.d.ts +4 -0
- package/types/src/.generated/desc/statistical/ETS.desc.d.ts.map +1 -0
- package/types/src/.generated/desc/statistical/Regression.desc.d.ts +4 -0
- package/types/src/.generated/desc/statistical/Regression.desc.d.ts.map +1 -0
- package/types/src/.generated/desc/statistical/TTEST.desc.d.ts +4 -0
- package/types/src/.generated/desc/statistical/TTEST.desc.d.ts.map +1 -0
- package/types/src/.generated/desc/text/RegEx.desc.d.ts +4 -0
- package/types/src/.generated/desc/text/RegEx.desc.d.ts.map +1 -0
- package/types/src/.generated/index.d.ts +7 -0
- package/types/src/.generated/index.d.ts.map +1 -0
- package/types/src/_utils/AnyArgs.d.ts +38 -0
- package/types/src/_utils/AnyArgs.d.ts.map +1 -0
- package/types/src/_utils/Consts.d.ts +14 -0
- package/types/src/_utils/Consts.d.ts.map +1 -0
- package/types/src/_utils/Date.d.ts +33 -0
- package/types/src/_utils/Date.d.ts.map +1 -0
- package/types/src/_utils/FinanaceSolver.d.ts +19 -0
- package/types/src/_utils/FinanaceSolver.d.ts.map +1 -0
- package/types/src/_utils/FinanceCoupon.d.ts +141 -0
- package/types/src/_utils/FinanceCoupon.d.ts.map +1 -0
- package/types/src/_utils/FinanceDate.d.ts +26 -0
- package/types/src/_utils/FinanceDate.d.ts.map +1 -0
- package/types/src/_utils/FinanceDayCount.d.ts +80 -0
- package/types/src/_utils/FinanceDayCount.d.ts.map +1 -0
- package/types/src/_utils/FinanceUtils.d.ts +3 -0
- package/types/src/_utils/FinanceUtils.d.ts.map +1 -0
- package/types/src/_utils/LeastSquares.d.ts +131 -0
- package/types/src/_utils/LeastSquares.d.ts.map +1 -0
- package/types/src/cube/Cube.d.ts +64 -0
- package/types/src/cube/Cube.d.ts.map +1 -0
- package/types/src/financial/ACCRINT.d.ts +19 -0
- package/types/src/financial/ACCRINT.d.ts.map +1 -0
- package/types/src/financial/AMORDEGRC.d.ts +53 -0
- package/types/src/financial/AMORDEGRC.d.ts.map +1 -0
- package/types/src/financial/Date.d.ts +29 -0
- package/types/src/financial/Date.d.ts.map +1 -0
- package/types/src/financial/Financial.d.ts +287 -0
- package/types/src/financial/Financial.d.ts.map +1 -0
- package/types/src/financial/Financial2.d.ts +99 -0
- package/types/src/financial/Financial2.d.ts.map +1 -0
- package/types/src/financial/Financial3.d.ts +95 -0
- package/types/src/financial/Financial3.d.ts.map +1 -0
- package/types/src/financial/Financial4.d.ts +82 -0
- package/types/src/financial/Financial4.d.ts.map +1 -0
- package/types/src/financial/ODD.d.ts +106 -0
- package/types/src/financial/ODD.d.ts.map +1 -0
- package/types/src/financial/VDB.d.ts +27 -0
- package/types/src/financial/VDB.d.ts.map +1 -0
- package/types/src/statistical/ETS.d.ts +45 -0
- package/types/src/statistical/ETS.d.ts.map +1 -0
- package/types/src/statistical/Regression.d.ts +49 -0
- package/types/src/statistical/Regression.d.ts.map +1 -0
- package/types/src/statistical/TTEST.d.ts +27 -0
- package/types/src/statistical/TTEST.d.ts.map +1 -0
- package/types/src/text/RegEx.d.ts +34 -0
- package/types/src/text/RegEx.d.ts.map +1 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { Scalar, IRange, Flatten } from '@sheetxl/primitives';
|
|
2
|
+
/**
|
|
3
|
+
* @summary Returns the number of days from the beginning of the coupon period to the settlement date.
|
|
4
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
5
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
6
|
+
* @param frequency is the number of coupon payments per year.
|
|
7
|
+
* @param basis is the type of day count basis to use.
|
|
8
|
+
*/
|
|
9
|
+
export declare function COUPDAYS(settlement: number, // date
|
|
10
|
+
maturity: number, // date
|
|
11
|
+
frequency: number, basis?: number): number;
|
|
12
|
+
/**
|
|
13
|
+
* @summary Returns the cumulative interest paid between two periods.
|
|
14
|
+
* @param rate is the interest rate.
|
|
15
|
+
* @param nper is the total number of payment periods.
|
|
16
|
+
* @param pv is the present value of the investment.
|
|
17
|
+
* @param startPeriod is the first period in the calculation.
|
|
18
|
+
* @param endPeriod is the last period in the calculation.
|
|
19
|
+
* @param type is the timing of the payment.
|
|
20
|
+
*/
|
|
21
|
+
export declare function CUMIPMT(rate: number, nper: number, pv: number, startPeriod: number, // date
|
|
22
|
+
endPeriod: number, // date
|
|
23
|
+
type: number): number;
|
|
24
|
+
/**
|
|
25
|
+
* @summary Returns the cumulative principal paid on a loan between two periods.
|
|
26
|
+
* @param rate is the interest rate.
|
|
27
|
+
* @param nper is the total number of payment periods.
|
|
28
|
+
* @param pv is the present value of the investment.
|
|
29
|
+
* @param startPeriod is the first period in the calculation.
|
|
30
|
+
* @param endPeriod is the last period in the calculation.
|
|
31
|
+
* @param type is the timing of the payment.
|
|
32
|
+
*/
|
|
33
|
+
export declare function CUMPRINC(rate: number, nper: number, pv: number, startPeriod: number, // date
|
|
34
|
+
endPeriod: number, // date
|
|
35
|
+
type: number): number;
|
|
36
|
+
/**
|
|
37
|
+
* @summary Returns the depreciation of an asset for a specified period using the fixed-declining balance method.
|
|
38
|
+
* @param cost is the initial cost of the asset.
|
|
39
|
+
* @param salvage is the salvage value at the end of the life of the asset.
|
|
40
|
+
* @param life is the number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).
|
|
41
|
+
* @param period is the period for which you want to calculate the depreciation. Period must use the same units as Life.
|
|
42
|
+
* @param month is the number of months in the first year.
|
|
43
|
+
*/
|
|
44
|
+
export declare function DB(cost: number, salvage: number, life: number, period: number, month?: number): number;
|
|
45
|
+
/**
|
|
46
|
+
* @summary Returns the depreciation of an asset for a specified period using the double-declining balance method or some other method you specify.
|
|
47
|
+
* @param cost is the initial cost of the asset.
|
|
48
|
+
* @param salvage is the salvage value at the end of the life of the asset.
|
|
49
|
+
* @param life is the number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).
|
|
50
|
+
* @param period is the period for which you want to calculate the depreciation. Period must use the same units as Life.
|
|
51
|
+
* @param factor is the rate at which the balance declines.
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* Double declining balance (DDB) depreciation method.
|
|
55
|
+
*/
|
|
56
|
+
export declare function DDB(cost: number, salvage: number, life: number, period: number, factor?: number): number;
|
|
57
|
+
/**
|
|
58
|
+
* @summary Returns the discount rate for a security.
|
|
59
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
60
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
61
|
+
* @param pr is the security's price per $100 face value.
|
|
62
|
+
* @param redemption is the security's redemption value per $100 face value.
|
|
63
|
+
* @param basis is the type of day count basis to use.
|
|
64
|
+
*/
|
|
65
|
+
export declare function DISC(settlement: number, // date
|
|
66
|
+
maturity: number, // date
|
|
67
|
+
pr: number, redemption: number, basis?: number): number;
|
|
68
|
+
/**
|
|
69
|
+
* @summary Converts a dollar price, expressed as a fraction, into a dollar price, expressed as a decimal number.
|
|
70
|
+
* @param fractionalDollar is a number expressed as a fraction.
|
|
71
|
+
* @param fraction is the integer to use in the denominator of the fraction.
|
|
72
|
+
*/
|
|
73
|
+
export declare function DOLLARDE(fractionalDollar: number, fraction: number): number;
|
|
74
|
+
/**
|
|
75
|
+
* @summary Converts a dollar price, expressed as a decimal number, into a dollar price, expressed as a fraction.
|
|
76
|
+
* @param decimalDollar is a decimal number.
|
|
77
|
+
* @param fraction is the integer to use in the denominator of the fraction.
|
|
78
|
+
*/
|
|
79
|
+
export declare function DOLLARFR(decimalDollar: number, fraction: number): number;
|
|
80
|
+
/**
|
|
81
|
+
* @summary Returns the effective annual interest rate.
|
|
82
|
+
* @param nominalRate is the nominal interest rate.
|
|
83
|
+
* @param npery is the number of compounding periods per year.
|
|
84
|
+
*/
|
|
85
|
+
export declare function EFFECT(nominalRate: number, npery: number): number;
|
|
86
|
+
/**
|
|
87
|
+
* @summary Returns the future value of an investment based on periodic, constant payments and a constant interest rate.
|
|
88
|
+
* @param rate is the interest rate.
|
|
89
|
+
* @param nper is the total number of payment periods.
|
|
90
|
+
* @param pmt is the payment made each period; it cannot change over the life of the investment.
|
|
91
|
+
* @param pv is the present value of the investment.
|
|
92
|
+
* @param { '0' | '1' } type Indicates when pmts are due.
|
|
93
|
+
*/
|
|
94
|
+
export declare function FV(rate: number, nper: number, pmt: number, pv?: number, type?: number): number;
|
|
95
|
+
/**
|
|
96
|
+
* @summary Returns the future value of an initial principal after applying a series of compound interest rates.
|
|
97
|
+
* @param principal is the present value.
|
|
98
|
+
* @param schedule is an array of interest rates to apply.
|
|
99
|
+
*/
|
|
100
|
+
export declare function FVSCHEDULE(principal: number, schedule: IRange): number;
|
|
101
|
+
/**
|
|
102
|
+
* @summary Returns the interest payment for a given period for an investment, based on periodic, constant payments and a constant interest rate.
|
|
103
|
+
* @param rate is the interest rate.
|
|
104
|
+
* @param per is the period for which you want to find the interest and must be in the range 1 to Nper.
|
|
105
|
+
* @param nper is the total number of payment periods.
|
|
106
|
+
* @param pv is the present value of the investment.
|
|
107
|
+
* @param fv is the future value, or a cash balance you want to attain after the last payment is made.
|
|
108
|
+
* @param type is a logical value representing the timing of payment: at the end of the period = 0, at the beginning of the period = 1.
|
|
109
|
+
*/
|
|
110
|
+
export declare function IPMT(rate: number, per: number, nper: number, pv: number, fv?: number, type?: number): number;
|
|
111
|
+
/**
|
|
112
|
+
* @summary Returns the internal rate of return for a series of cash flows.
|
|
113
|
+
* @param values is an array or a reference to cells that contain numbers for which you want to calculate the internal rate of return.
|
|
114
|
+
* @param guess is a number that you guess is close to the result of IRR.
|
|
115
|
+
*/
|
|
116
|
+
export declare function IRR(values: Flatten<number>, guess?: number): number;
|
|
117
|
+
/**
|
|
118
|
+
* @summary Returns the interest paid during a specific period of an investment.
|
|
119
|
+
* @param rate is the interest rate.
|
|
120
|
+
* @param per period for which you want to find the interest.
|
|
121
|
+
* @param nper number of payment periods in an investment.
|
|
122
|
+
* @param pv lump sum amount that a series of future payments is right now.
|
|
123
|
+
*/
|
|
124
|
+
export declare function ISPMT(rate: number, per: number, nper: number, pv: number): number;
|
|
125
|
+
/**
|
|
126
|
+
* @summary Returns the modified internal rate of return for a series of periodic cash flows.
|
|
127
|
+
* @param values An array of cash flows; must contain at least one positive and one negative value.
|
|
128
|
+
* @param financeRate The interest rate paid on negative cash flows (cost of capital).
|
|
129
|
+
* @param reinvestRate The interest rate received on positive cash flows (reinvestment rate).
|
|
130
|
+
*/
|
|
131
|
+
export declare function MIRR(values: Flatten<number>, financeRate: number, reinvestRate: number): number;
|
|
132
|
+
/**
|
|
133
|
+
* @summary Returns the annual nominal interest rate.
|
|
134
|
+
* @param effectiveRate is the effective interest rate.
|
|
135
|
+
* @param npery is the number of compounding periods per year.
|
|
136
|
+
*/
|
|
137
|
+
export declare function NOMINAL(effectiveRate: number, npery: number): number;
|
|
138
|
+
/**
|
|
139
|
+
* @summary Returns the number of periods for an investment based on periodic, constant payments and a constant interest rate.
|
|
140
|
+
* @param rate is the interest rate per period. For example, use 6%/4 for quarterly payments at 6% APR.
|
|
141
|
+
* @param pmt is the payment made each period; it cannot change over the life of the investment.
|
|
142
|
+
* @param pv is the present value, or the lump-sum amount that a series of future payments is worth now.
|
|
143
|
+
* @param fv is the future value, or a cash balance you want to attain after the last payment is made.
|
|
144
|
+
* @param type is a logical value: payment at the beginning of the period = 1; payment at the end of the period = 0.
|
|
145
|
+
*/
|
|
146
|
+
export declare function NPER(rate: number, pmt: number, pv: number, fv?: number, type?: number): number;
|
|
147
|
+
/**
|
|
148
|
+
* @summary Returns the net present value of an investment based on a discount rate and a series of future payments (negative values) and income (positive values).
|
|
149
|
+
* @param rate is the rate of discount over the length of one period.
|
|
150
|
+
* @param value are 1 to 254 payments and income, equally spaced in time and occurring at the end of each period.
|
|
151
|
+
*/
|
|
152
|
+
export declare function NPV(rate: number, value: number[]): number;
|
|
153
|
+
/**
|
|
154
|
+
* @summary Returns the number of periods required by an investment to reach a specified value.
|
|
155
|
+
* @param rate is the interest rate.
|
|
156
|
+
* @param pv is the present value of the investment.
|
|
157
|
+
* @param fv is the desired future value of the investment.
|
|
158
|
+
*/
|
|
159
|
+
export declare function PDURATION(rate: number, pv: number, fv: number): number;
|
|
160
|
+
/**
|
|
161
|
+
* @summary Calculates the payment for a loan based on constant payments and a constant interest rate.
|
|
162
|
+
* @param rate is the interest rate.
|
|
163
|
+
* @param nper is the total number of payment periods.
|
|
164
|
+
* @param pv is the present value of the investment.
|
|
165
|
+
* @param fv is the future value, or a cash balance you want to attain after the last payment is made.
|
|
166
|
+
* @param type is a logical value: payment at the beginning of the period = 1; payment at the end of the period = 0.
|
|
167
|
+
*/
|
|
168
|
+
export declare function PMT(rate: number, nper: number, pv: number, fv?: number, type?: number): number;
|
|
169
|
+
/**
|
|
170
|
+
* @summary Returns the payment on the principal for a given investment based on periodic, constant payments and a constant payments and a constant interest rate.
|
|
171
|
+
* @param rate is the interest rate per period.
|
|
172
|
+
* @param per is the period for which you want to find the principal payment and must be in the range 1 to Nper.
|
|
173
|
+
* @param nper is the total number of payment periods in the investment.
|
|
174
|
+
* @param pv is the present value of the investment.
|
|
175
|
+
* @param fv is the future value, or a cash balance you want to attain after the last payment is made.
|
|
176
|
+
* @param type is a logical value: payment at the beginning of the period = 1; payment at the end of the period = 0.
|
|
177
|
+
*/
|
|
178
|
+
export declare function PPMT(rate: number, per: number, nper: number, pv: number, fv?: number, type?: number): number;
|
|
179
|
+
/**
|
|
180
|
+
* @summary Returns the price per $100 face value of a discounted security.
|
|
181
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
182
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
183
|
+
* @param discount is the security's discount rate.
|
|
184
|
+
* @param redemption is the amount to be received at maturity.
|
|
185
|
+
* @param basis is the type of day count basis to use.
|
|
186
|
+
*/
|
|
187
|
+
export declare function PRICEDISC(settlement: number, // date
|
|
188
|
+
maturity: number, // date
|
|
189
|
+
discount: number, redemption: number, basis?: number): number;
|
|
190
|
+
/**
|
|
191
|
+
* @summary Returns the present value of an investment: the total amount that a series of future payments is worth now.
|
|
192
|
+
* @param rate is the interest rate.
|
|
193
|
+
* @param nper is the total number of payment periods in an investment.
|
|
194
|
+
* @param pmt is the payment made each period and cannot change over the life of the investment.
|
|
195
|
+
* @param fv is the future value, or a cash balance you want to attain after the last payment is made.
|
|
196
|
+
* @param type is a logical value: payment at the beginning of the period = 1; payment at the end of the period = 0.
|
|
197
|
+
*/
|
|
198
|
+
export declare function PV(rate: number, nper: number, pmt: number, fv?: number, type?: number): number;
|
|
199
|
+
/**
|
|
200
|
+
* @summary Returns the interest rate per period of a loan or an investment. For example, use 6%/4 for quarterly payments at 6% APR.
|
|
201
|
+
* @param nper is the total number of payment periods.
|
|
202
|
+
* @param pmt is the payment made each period and cannot change over the life of the loan or investment.
|
|
203
|
+
* @param pv is the present value: the total amount that a series of future payments is worth now.
|
|
204
|
+
* @param fv is the future value, or a cash balance you want to attain after the last payment is made.
|
|
205
|
+
* @param type is a logical value: payment at the beginning of the period = 1; payment at the end of the period = 0.
|
|
206
|
+
* @param guess is your guess for what the rate will be.
|
|
207
|
+
*/
|
|
208
|
+
export declare function RATE(nper: number, pmt: number, pv: number, fv?: number, type?: number, guess?: number): number;
|
|
209
|
+
/**
|
|
210
|
+
* @summary Returns an equivalent interest rate for the growth of an investment.
|
|
211
|
+
* @param nper is the total number of payment periods.
|
|
212
|
+
* @param pv is the present value of the investment.
|
|
213
|
+
* @param fv is the future value of the investment.
|
|
214
|
+
*/
|
|
215
|
+
export declare function RRI(nper: number, pv: number, fv: number): number;
|
|
216
|
+
/**
|
|
217
|
+
* @summary Returns the straight-line depreciation of an asset for one period.
|
|
218
|
+
* @param cost is the initial cost of the asset.
|
|
219
|
+
* @param salvage is the salvage value at the end of the life of the asset.
|
|
220
|
+
* @param life is the number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).
|
|
221
|
+
*/
|
|
222
|
+
export declare function SLN(cost: number, salvage: number, life: number): number;
|
|
223
|
+
/**
|
|
224
|
+
* @hidden Unimplemented RichData
|
|
225
|
+
* @summary Returns an array of historical quote data for a symbol and date range you specify..
|
|
226
|
+
* @param stock Symbol of financial instrument to be considered or a Stock data type.
|
|
227
|
+
* @param startDate First date to return data from.
|
|
228
|
+
* @param endDate Last date to return data from.
|
|
229
|
+
* @param interval A number indicating the granularity of the data; 0 - Daily, 1 - Weekly, 2 - Monthly.
|
|
230
|
+
* @param headers A logical value to add column header data; 0 - No column header, 1 - Show column header, 2 - Show instrument identifier and column header.
|
|
231
|
+
* @param properties A number indicating which column of data to return; 0 through 5.
|
|
232
|
+
*/
|
|
233
|
+
export declare function STOCKHISTORY(stock: string, startDate: number, // date
|
|
234
|
+
endDate?: number, // date
|
|
235
|
+
interval?: number, // 0=day, 1=week, 2=month
|
|
236
|
+
headers?: number, // 0=none, 1=field names, 2=field names and row numbers
|
|
237
|
+
properties?: Flatten<number>): Promise<IRange>;
|
|
238
|
+
/**
|
|
239
|
+
* @summary Returns the sum-of-years' digits depreciation of an asset for a specified period.
|
|
240
|
+
* @param cost is the initial cost of the asset.
|
|
241
|
+
* @param salvage is the salvage value at the end of the life of the asset.
|
|
242
|
+
* @param life is the number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).
|
|
243
|
+
* @param per is the period and must use the same units as Life.
|
|
244
|
+
*/
|
|
245
|
+
export declare function SYD(cost: number, salvage: number, life: number, per: number): number;
|
|
246
|
+
/**
|
|
247
|
+
* @summary Returns the bond-equivalent yield for a treasury bill.
|
|
248
|
+
* @param settlement is the Treasury bill's settlement date, expressed as a serial date number.
|
|
249
|
+
* @param maturity is the Treasury bill's maturity date, expressed as a serial date number.
|
|
250
|
+
* @param discount is the Treasury bill's discount rate.
|
|
251
|
+
*/
|
|
252
|
+
export declare function TBILLEQ(settlement: number, // date
|
|
253
|
+
maturity: number, // date
|
|
254
|
+
discount: number): number;
|
|
255
|
+
/**
|
|
256
|
+
* @summary Returns the price per $100 face value for a treasury bill.
|
|
257
|
+
* @param settlement is the Treasury bill's settlement date, expressed as a serial date number.
|
|
258
|
+
* @param maturity is the Treasury bill's maturity date, expressed as a serial date number.
|
|
259
|
+
* @param discount is the Treasury bill's discount rate.
|
|
260
|
+
*/
|
|
261
|
+
export declare function TBILLPRICE(settlement: number, // date
|
|
262
|
+
maturity: number, // date
|
|
263
|
+
discount: number): number;
|
|
264
|
+
/**
|
|
265
|
+
* @summary Returns the yield for a treasury bill.
|
|
266
|
+
* @param settlement is the Treasury bill's settlement date, expressed as a serial date number.
|
|
267
|
+
* @param maturity is the Treasury bill's maturity date, expressed as a serial date number.
|
|
268
|
+
* @param pr is the Treasury Bill's price per $100 face value.
|
|
269
|
+
*/
|
|
270
|
+
export declare function TBILLYIELD(settlement: number, // date
|
|
271
|
+
maturity: number, // date
|
|
272
|
+
pr: number): number;
|
|
273
|
+
/**
|
|
274
|
+
* @summary Returns the internal rate of return for a schedule of cash flows.
|
|
275
|
+
* @param values is a series of cash flows that correspond to a schedule of payments in dates.
|
|
276
|
+
* @param dates is a schedule of payment dates that corresponds to the cash flow payments.
|
|
277
|
+
* @param guess is a number that you guess is close to the result of XIRR.
|
|
278
|
+
*/
|
|
279
|
+
export declare function XIRR(values: IRange, dates: IRange, guess?: number): Scalar;
|
|
280
|
+
/**
|
|
281
|
+
* @summary Returns the net present value for a schedule of cash flows.
|
|
282
|
+
* @param rate is the discount rate to apply to the cash flows.
|
|
283
|
+
* @param values is a series of cash flows that correspond to a schedule of payments in dates.
|
|
284
|
+
* @param dates is a schedule of payment dates that corresponds to the cash flow payments.
|
|
285
|
+
*/
|
|
286
|
+
export declare function XNPV(rate: number, values: IRange, dates: IRange): Scalar;
|
|
287
|
+
//# sourceMappingURL=Financial.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Financial.d.ts","sourceRoot":"","sources":["../../../../src/financial/Financial.ts"],"names":[],"mappings":"AACA,OAAO,EAAgC,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAS3G;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACtB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,MAAU,GAChB,MAAM,CAkDR;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,MAAM,EAAE,OAAO;AAC5B,SAAS,EAAE,MAAM,EAAG,OAAO;AAC3B,IAAI,EAAE,MAAM,GACX,MAAM,CA0BR;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,MAAM,EAAE,OAAO;AAC5B,SAAS,EAAE,MAAM,EAAE,OAAO;AAC1B,IAAI,EAAE,MAAM,GACX,MAAM,CA6BR;AAED;;;;;;;GAOG;AACH,wBAAgB,EAAE,CAChB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,MAAS,GACf,MAAM,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M,EACZ,GAAG,EAAE,MAAM,GACV,MAAM,CAGR;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CACrB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,QAAQ,EAAE,MAAM,GACf,MAAM,CAkBR;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,QAAQ,EAAE,MAAM,GACf,MAAM,CAiBR;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,EAAE,EAAE,MAAM,GACT,MAAM,CAcR;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,KAAK,GAAE,MAAY,GAClB,MAAM,CAqDR;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAClB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAuCR"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bond / depreciation functions with no coupon-iteration dependency.
|
|
3
|
+
*
|
|
4
|
+
* Every function here reduces to: dates → day-count → one closed-form formula.
|
|
5
|
+
* None of these call the coupon-walking helpers in /utils/Finance.ts.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @summary Returns the accrued interest for a security that pays interest at maturity.
|
|
9
|
+
* @param issue is the security's issue date, expressed as a serial date number.
|
|
10
|
+
* @param settlement is the security's maturity date, expressed as a serial date number.
|
|
11
|
+
* @param rate is the security's annual coupon rate.
|
|
12
|
+
* @param par is the security's par value.
|
|
13
|
+
* @param basis is the type of day count basis to use.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ACCRINTM(issue: number, // date
|
|
16
|
+
settlement: number, // date
|
|
17
|
+
rate: number, par: number, basis?: number): number;
|
|
18
|
+
/**
|
|
19
|
+
* @summary Returns the interest rate for a fully invested security.
|
|
20
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
21
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
22
|
+
* @param investment is the amount invested in the security.
|
|
23
|
+
* @param redemption is the amount to be received at maturity.
|
|
24
|
+
* @param basis is the type of day count basis to use.
|
|
25
|
+
*/
|
|
26
|
+
export declare function INTRATE(settlement: number, // date
|
|
27
|
+
maturity: number, // date
|
|
28
|
+
investment: number, redemption: number, basis?: number): number;
|
|
29
|
+
/**
|
|
30
|
+
* @summary Returns the amount received at maturity for a fully invested security.
|
|
31
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
32
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
33
|
+
* @param investment is the amount invested in the security.
|
|
34
|
+
* @param discount is the security's discount rate.
|
|
35
|
+
* @param basis is the type of day count basis to use.
|
|
36
|
+
*/
|
|
37
|
+
export declare function RECEIVED(settlement: number, // date
|
|
38
|
+
maturity: number, // date
|
|
39
|
+
investment: number, discount: number, basis?: number): number;
|
|
40
|
+
/**
|
|
41
|
+
* @summary Returns the annual yield for a discounted security.
|
|
42
|
+
* @summary Returns the annual yield for a discounted security. For example, a treasury bill.
|
|
43
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
44
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
45
|
+
* @param pr is the security's price per $100 face value.
|
|
46
|
+
* @param redemption is the security's redemption value per $100 face value.
|
|
47
|
+
* @param basis is the type of day count basis to use.
|
|
48
|
+
*/
|
|
49
|
+
export declare function YIELDDISC(settlement: number, // date
|
|
50
|
+
maturity: number, // date
|
|
51
|
+
pr: number, redemption: number, basis?: number): number;
|
|
52
|
+
/**
|
|
53
|
+
* @summary Returns the price per $100 face value of a security that pays interest at maturity.
|
|
54
|
+
* @summary Returns the price per $100 face value of a security that pays interest at maturity.
|
|
55
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
56
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
57
|
+
* @param issue is the security's issue date, expressed as a serial date number.
|
|
58
|
+
* @param rate is the interest rate.
|
|
59
|
+
* @param yld is the security's annual yield.
|
|
60
|
+
* @param basis is the type of day count basis to use.
|
|
61
|
+
*/
|
|
62
|
+
export declare function PRICEMAT(settlement: number, // date
|
|
63
|
+
maturity: number, // date
|
|
64
|
+
issue: number, rate: number, yld: number, basis?: number): number;
|
|
65
|
+
/**
|
|
66
|
+
* @summary Returns the annual yield of a security that pays interest at maturity.
|
|
67
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
68
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
69
|
+
* @param issue is the security's issue date, expressed as a serial date number.
|
|
70
|
+
* @param rate is the interest rate.
|
|
71
|
+
* @param pr is the security's price per $100 face value.
|
|
72
|
+
* @param basis is the type of day count basis to use.
|
|
73
|
+
*/
|
|
74
|
+
export declare function YIELDMAT(settlement: number, // date
|
|
75
|
+
maturity: number, // date
|
|
76
|
+
issue: number, // date
|
|
77
|
+
rate: number, pr: number, basis?: number): number;
|
|
78
|
+
/**
|
|
79
|
+
* @summary Returns the prorated linear depreciation of an asset for each accounting period.
|
|
80
|
+
* @param cost is the cost of the asset.
|
|
81
|
+
* @param datePurchased is the date the asset is purchased.
|
|
82
|
+
* @param firstPeriod is the date of the end of the first period.
|
|
83
|
+
* @param salvage is the salvage value at the end of life of the asset.
|
|
84
|
+
* @param period is the period.
|
|
85
|
+
* @param rate is the rate of depreciation.
|
|
86
|
+
* @param basis year basis : 0 for year of 360 days, 1 for actual, 3 for year of 365 days.
|
|
87
|
+
*
|
|
88
|
+
* @remarks
|
|
89
|
+
* Computes depreciation using a prorated first period (from purchase
|
|
90
|
+
* date to first-period end), then full annual depreciation until the asset is
|
|
91
|
+
* fully depreciated.
|
|
92
|
+
*
|
|
93
|
+
* Note: basis 2 (Actual/360) is not supported by Excel for this function —
|
|
94
|
+
* only bases 0, 1, 3, 4 are valid.
|
|
95
|
+
*/
|
|
96
|
+
export declare function AMORLINC(cost: number, datePurchased: number, // date
|
|
97
|
+
firstPeriod: number, // date
|
|
98
|
+
salvage: number, period: number, rate: number, basis?: number): number;
|
|
99
|
+
//# sourceMappingURL=Financial2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Financial2.d.ts","sourceRoot":"","sources":["../../../../src/financial/Financial2.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AAEH;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,MAAM,EAAE,OAAO;AACtB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,KAAK,GAAE,MAAU,GAChB,MAAM,CAwBR;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CACrB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,MAAU,GAChB,MAAM,CAgBR;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CACtB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,MAAU,GAChB,MAAM,CAuBR;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CACvB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,MAAU,GAChB,MAAM,CAgBR;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CACtB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,KAAK,GAAE,MAAU,GAChB,MAAM,CA0BR;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CACtB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,KAAK,EAAE,MAAM,EAAE,OAAO;AACtB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,KAAK,GAAE,MAAU,GAChB,MAAM,CAuBR;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EAAE,OAAO;AAC9B,WAAW,EAAE,MAAM,EAAE,OAAO;AAC5B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,MAAU,GAChB,MAAM,CAkDR"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coupon date and day-count functions.
|
|
3
|
+
*
|
|
4
|
+
* Shared validation rule for all six:
|
|
5
|
+
* • frequency must be 1 (annual), 2 (semi-annual), or 4 (quarterly)
|
|
6
|
+
* • basis must be 0–4
|
|
7
|
+
* • settlement must be strictly before maturity
|
|
8
|
+
*
|
|
9
|
+
* COUPNCD and COUPPCD return date number numbers, not day counts — the engine
|
|
10
|
+
* will format them as dates when the cell has a date format applied.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* @summary Returns the number of days from the beginning of the coupon period to the settlement date.
|
|
14
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
15
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
16
|
+
* @param frequency is the number of coupon payments per year.
|
|
17
|
+
* @param basis is the type of day count basis to use.
|
|
18
|
+
*/
|
|
19
|
+
export declare function COUPDAYBS(settlement: number, // date
|
|
20
|
+
maturity: number, // date
|
|
21
|
+
frequency: number, basis?: number): number;
|
|
22
|
+
/**
|
|
23
|
+
* @summary Returns the number of days in the coupon period containing the settlement date.
|
|
24
|
+
* @param settlement Settlement date number number.
|
|
25
|
+
* @param maturity Maturity date number number.
|
|
26
|
+
* @param frequency Coupons per year: 1, 2, or 4.
|
|
27
|
+
* @param basis Day-count basis (0–4). Default 0.
|
|
28
|
+
*/
|
|
29
|
+
export declare function COUPDAYS(settlement: number, // date
|
|
30
|
+
maturity: number, // date
|
|
31
|
+
frequency: number, basis?: number): number;
|
|
32
|
+
/**
|
|
33
|
+
* @summary Returns the number of days from the settlement date to the next coupon date.
|
|
34
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
35
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
36
|
+
* @param frequency is the number of coupon payments per year.
|
|
37
|
+
* @param basis is the type of day count basis to use.
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* Implementation note: unlike COUPDAYBS which calls calculateCoupdaybs directly,
|
|
41
|
+
* COUPDAYSNC computes NCD − settlement under the chosen basis rather than
|
|
42
|
+
* subtracting COUPDAYBS from COUPDAYS. The two approaches agree for all
|
|
43
|
+
* 30/360 bases but diverge for actual-day bases when the coupon period spans
|
|
44
|
+
* a month boundary — the direct NCD approach matches Excel.
|
|
45
|
+
*/
|
|
46
|
+
export declare function COUPDAYSNC(settlement: number, // date
|
|
47
|
+
maturity: number, // date
|
|
48
|
+
frequency: number, basis?: number): number;
|
|
49
|
+
/**
|
|
50
|
+
* @summary Returns the next coupon date after the settlement date.
|
|
51
|
+
* @summary Returns the number of days from the beginning of the coupon period to the settlement date.
|
|
52
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
53
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
54
|
+
* @param frequency is the number of coupon payments per year.
|
|
55
|
+
* @param basis is the type of day count basis to use.
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* Returns an Excel date number number. The cell should be formatted as a date
|
|
59
|
+
* to display meaningfully.
|
|
60
|
+
*/
|
|
61
|
+
export declare function COUPNCD(settlement: number, // date
|
|
62
|
+
maturity: number, // date
|
|
63
|
+
frequency: number, basis?: number): number;
|
|
64
|
+
/**
|
|
65
|
+
* @summary Returns the previous coupon date before the settlement date.
|
|
66
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
67
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
68
|
+
* @param frequency is the number of coupon payments per year.
|
|
69
|
+
* @param basis is the type of day count basis to use.
|
|
70
|
+
*
|
|
71
|
+
* @remarks
|
|
72
|
+
* Returns an Excel date number number. The cell should be formatted as a date
|
|
73
|
+
* to display meaningfully.
|
|
74
|
+
*
|
|
75
|
+
* Excel special case: if the calculated PCD is before the Excel epoch (number < 0),
|
|
76
|
+
* Excel returns 0 rather than a negative number. We follow this behavior.
|
|
77
|
+
*/
|
|
78
|
+
export declare function COUPPCD(settlement: number, // date
|
|
79
|
+
maturity: number, // date
|
|
80
|
+
frequency: number, basis?: number): number;
|
|
81
|
+
/**
|
|
82
|
+
* @summary Returns the number of coupons payable between the settlement date and maturity date.
|
|
83
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
84
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
85
|
+
* @param frequency is the number of coupon payments per year.
|
|
86
|
+
* @param basis is the type of day count basis to use.
|
|
87
|
+
*
|
|
88
|
+
* @remarks
|
|
89
|
+
* Excel special case: if COUPPCD would be negative (bond settling before the
|
|
90
|
+
* Excel epoch), Excel returns #NUM!. We guard this identically.
|
|
91
|
+
*/
|
|
92
|
+
export declare function COUPNUM(settlement: number, // date
|
|
93
|
+
maturity: number, // date
|
|
94
|
+
frequency: number, basis?: number): number;
|
|
95
|
+
//# sourceMappingURL=Financial3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Financial3.d.ts","sourceRoot":"","sources":["../../../../src/financial/Financial3.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,MAAU,GAChB,MAAM,CAcR;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACtB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,MAAU,GAChB,MAAM,CAcR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACxB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,MAAU,GAChB,MAAM,CAiBR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CACrB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,MAAU,GAChB,MAAM,CAiBR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CACrB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,MAAU,GAChB,MAAM,CAkBR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CACrB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,MAAU,GAChB,MAAM,CAmBR"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @summary Returns the price per $100 face value of a security that pays periodic interest.
|
|
3
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
4
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
5
|
+
* @param rate is the interest rate.
|
|
6
|
+
* @param yld is the security's annual yield.
|
|
7
|
+
* @param redemption is the amount to be received at maturity.
|
|
8
|
+
* @param frequency is the number of coupon payments per year.
|
|
9
|
+
* @param basis is the type of day count basis to use.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* Uses the standard coupon bond pricing formula from the Excel spec.
|
|
13
|
+
* For N=1 (single remaining coupon period) a simplified spec formula is used.
|
|
14
|
+
*/
|
|
15
|
+
export declare function PRICE(settlement: number, // date
|
|
16
|
+
maturity: number, // date
|
|
17
|
+
rate: number, yld: number, redemption: number, frequency: number, basis?: number): number;
|
|
18
|
+
/**
|
|
19
|
+
* @summary Returns the annual duration of a security with periodic interest payments.
|
|
20
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
21
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
22
|
+
* @param coupon is the security's annual coupon rate.
|
|
23
|
+
* @param yld is the security's annual yield.
|
|
24
|
+
* @param frequency is the number of coupon payments per year.
|
|
25
|
+
* @param basis is the type of day count basis to use.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* Duration is the weighted-average time (in years) to receive the bond's cash
|
|
29
|
+
* flows, where each weight is the present value of that cash flow as a
|
|
30
|
+
* fraction of the bond's total price.
|
|
31
|
+
*
|
|
32
|
+
* Excel special case: dates in or before the 1900 epoch (number ≤ 0 for
|
|
33
|
+
* settlement, or ≤ 366 for maturity) return #NUM!.
|
|
34
|
+
*/
|
|
35
|
+
export declare function DURATION(settlement: number, // date
|
|
36
|
+
maturity: number, // date
|
|
37
|
+
coupon: number, yld: number, frequency: number, basis?: number): number;
|
|
38
|
+
/**
|
|
39
|
+
* @summary Returns the Macauley modified duration for a security with an assumed par value of $100.
|
|
40
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
41
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
42
|
+
* @param coupon is the security's annual coupon rate.
|
|
43
|
+
* @param yld is the security's annual yield.
|
|
44
|
+
* @param frequency is the number of coupon payments per year.
|
|
45
|
+
* @param basis is the type of day count basis to use.
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* Modified duration = Macaulay duration / (1 + yld / frequency).
|
|
49
|
+
* It measures the percentage price change of a bond for a 1% change in yield.
|
|
50
|
+
*
|
|
51
|
+
* Shares identical parameter validation with DURATION.
|
|
52
|
+
*/
|
|
53
|
+
export declare function MDURATION(settlement: number, // date
|
|
54
|
+
maturity: number, // date
|
|
55
|
+
coupon: number, yld: number, frequency: number, basis?: number): number;
|
|
56
|
+
/**
|
|
57
|
+
* @summary Returns the yield on a security that pays periodic interest.
|
|
58
|
+
* @param settlement is the security's settlement date, expressed as a serial date number.
|
|
59
|
+
* @param maturity is the security's maturity date, expressed as a serial date number.
|
|
60
|
+
* @param rate is the security's annual coupon rate.
|
|
61
|
+
* @param pr is the security's price per $100 face value.
|
|
62
|
+
* @param redemption is the security's redemption value per $100 face value.
|
|
63
|
+
* @param frequency is the number of coupon payments per year.
|
|
64
|
+
* @param basis is the type of day count basis to use.
|
|
65
|
+
*
|
|
66
|
+
* @remarks
|
|
67
|
+
* YIELD is the inverse of PRICE — it finds the yield `y` such that
|
|
68
|
+
* PRICE(settlement, maturity, rate, y, redemption, frequency, basis) = pr.
|
|
69
|
+
*
|
|
70
|
+
* Two cases:
|
|
71
|
+
*
|
|
72
|
+
* N > 1 Newton/secant iteration on calculatePrice (via solveByNewton).
|
|
73
|
+
* Initial guess: the coupon rate, or 0.01 if rate = 0.
|
|
74
|
+
*
|
|
75
|
+
* N = 1 Closed-form rearrangement of the single-period PRICE formula
|
|
76
|
+
* from the Excel spec. No iteration needed.
|
|
77
|
+
*
|
|
78
|
+
*/
|
|
79
|
+
export declare function YIELD(settlement: number, // date
|
|
80
|
+
maturity: number, // date
|
|
81
|
+
rate: number, pr: number, redemption: number, frequency: number, basis?: number): number;
|
|
82
|
+
//# sourceMappingURL=Financial4.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Financial4.d.ts","sourceRoot":"","sources":["../../../../src/financial/Financial4.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CACnB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,MAAU,GAChB,MAAM,CAoBR;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CACtB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,MAAU,GAChB,MAAM,CAuBR;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CACvB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,MAAU,GAChB,MAAM,CAwBR;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,KAAK,CACnB,UAAU,EAAE,MAAM,EAAE,OAAO;AAC3B,QAAQ,EAAE,MAAM,EAAE,OAAO;AACzB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,MAAU,GAChB,MAAM,CAsDR"}
|