package
0.0.0-20211202201625-e4f601ef4382
Repository: https://github.com/alpeb/go-finance.git
Documentation: pkg.go.dev
# Functions
DaysDifference returns the difference of days between two dates based on a daycount basis.
DaysPerYear returns the number of days in the year based on a daycount basis.
DepreciationFixedDeclining returns the depreciation of an asset using the fixed-declining balance method
Excel equivalent: DB.
DepreciationStraightLine returns the straight-line depreciation of an asset for each period
Excel equivalent: SLN.
DepreciationSYD returns the depreciation for an asset in a given period using the sum-of-years' digits method
Excel equivalent: SYD.
DiscountRate returns the discount rate for a bond
settlement is the unix timestamp (seconds) for the settlement date
maturity is the unix timestamp (seconds) for the maturity date
price is the bond's price per $100 face value
redemption is the bond's redemption value per $100 face value
Excel equivalent: DISC.
EffectiveRate returns the effective interest rate given the nominal rate and the number of compounding payments per year.
FutureValue returns the Future Value of a cash flow with constant payments and interest rate (annuities).
InterestPayment returns the interest payment for a given period for a cash flow with constant periodic payments (annuities)
Excel equivalent: IMPT.
InternalRateOfReturn returns the internal rate of return of a cash flow series.
ModifiedInternalRateOfReturn returns the internal rate of return of a cash flow series, considering both financial and reinvestment rates
financeRate is the rate on the money used in the cash flow.
NetPresentValue returns the Net Present Value of a cash flow series given a discount rate
Excel equivalent: NPV.
NominalRate returns the nominal interest rate given the effective rate and the number of compounding payments per year.
Payment returns the constant payment (annuity) for a cash flow with a constant interest rate.
Periods returns the number of periods for a cash flow with constant periodic payments (annuities), and interest rate.
PresentValue returns the Present Value of a cash flow with constant payments and interest rate (annuities).
PriceDiscount returns the price per $100 face value of a discounted bond
settlement is the unix timestamp (seconds) for the settlement date
maturity is the unix timestamp (seconds) for the maturity date
discount is the bond's discount rate
redemption is the bond's redemption value per $100 face value
Excel equivalent: PRICEDISC.
PrincipalPayment returns the principal payment for a given period for a cash flow with constant periodic payments (annuities)
Excel equivalent: PPMT.
Rate returns the periodic interest rate for a cash flow with constant periodic payments (annuities).
ScheduledInternalRateOfReturn returns the internal rate of return of a scheduled cash flow series.
ScheduledNetPresentValue returns the Net Present Value of a scheduled cash flow series given a discount rate
Excel equivalent: XNPV.
TBillEquivalentYield returns the bond-equivalent yield for a Treasury bill
settlement is the unix timestamp (seconds) for the settlement date
maturity is the unix timestamp (seconds) for the maturity date
discount is the T-Bill discount rate
Excel equivalent: TBILLEQ.
TBillPrice returns the price per $100 face value for a Treasury bill
settlement is the unix timestamp (seconds) for the settlement date
maturity is the unix timestamp (seconds) for the maturity date
discount is the T-Bill discount rate
Excel equivalent: TBILLPRICE.
TBillYield returns the yield for a treasury bill
settlement is the unix timestamp (seconds) for the settlement date
maturity is the unix timestamp (seconds) for the maturity date
price is the TBill price per $100 face value
Excel equivalent: TBILLYIELD.
# Constants
Actual/360.
Actual/365.
Actual/actual.
European 30/360.
US(NASD) 30/360.
MaxIterations determines the maximum number of iterations performed by the Newton-Raphson algorithm.
These constants are used in the TVM functions (parameter "paymentType").
These constants are used in the TVM functions (parameter "paymentType").
Precision determines how close to the solution the Newton-Raphson algorithm should arrive before stopping.