MCPcopy Create free account

hub / github.com/Confunctionist/finance / functions

Functions47 in github.com/Confunctionist/finance

↓ 14 callersMethodMulf
Mulf Multiplies a Money with a float to return a money-stored type
money.go:452
↓ 13 callersFunctionI
I Interest (of 1 value returned) for n periods i - interest rate per period n - number of periods returned as a decimal representation of the interest
money.go:397
↓ 13 callersMethodPow
Pow is the power of Money
money.go:467
↓ 9 callersMethodSetf
Setf sets a float64 into a Money type for precision calculations
money.go:654
↓ 6 callersMethodSet
Set sets the Money field M
money.go:648
↓ 5 callersFunctionMean
Mean Average mean = SIGMA a / len(a) SIGMA a total of all of the elements of a len(a) = the number of values
money.go:424
↓ 4 callersMethodGet
Get gets the float64 value of money (see Value() for int64)
money.go:371
↓ 4 callersFunctionIfl
Ifl Interest (float64 arguments) r PLUS - interest rate per period - use (1 + r), E for ln etc. n - number of periods returned as a decimal representa
money.go:405
↓ 3 callersFunctionRnd
RND rounds int64 remainder rounded half towards plus infinity trunc = the remainder of the float64 calc r = the result of the int64 cal
money.go:603
↓ 3 callersFunctionnow
worker funcs for GetQuote
money.go:690
↓ 2 callersMethodDiv
Div Divides one Money type from another
money.go:313
↓ 2 callersMethodString
String for money type representation in basic monetary unit (DOLLARS CENTS)
money.go:669
↓ 2 callersMethodValue
Value returns in int64 the value of Money (also see Gett(), See Get() for float64)
money.go:684
↓ 1 callersMethodAbs
Abs Returns the absolute value of Money
money.go:209
↓ 1 callersMethodAdd
Add Adds two Money types
money.go:217
↓ 1 callersMethodNeg
Neg Returns the negative value of Money
money.go:459
↓ 1 callersMethodPVf
PVf Present Value of a single future Value (using non integer period) pv = fv * ( 1 / ( 1 + r )^n) pv = present value fv = future value r = interest r
money.go:515
↓ 1 callersMethodSub
Sub subtracts one Money type from another
money.go:674
↓ 1 callersFunctiongetQuotePage
(t, e string)
money.go:855
↓ 1 callersMethodparseQuote
(b []byte)
money.go:817
↓ 1 callersMethodquoteFields
(bKey, bVal []byte)
money.go:699
FunctionBS
Black-Scholes (European put and call options) C Theoretical call premium (non-dividend paying stock) c = sn(d1) - ke^(-rt)N(d2) d1 = ln(s/k) + (r + s^
money.go:239
FunctionCMP
CMP Compounded Interest Rate i = (fv / pv) ^ (1/n) - 1 pv = present value fv = future value n - number of periods i = interest rate in percent per per
money.go:259
MethodCNI
CNI Continuous Interest fv = pv * e ^ (i * n) pv - principal or present value i - interest rate per period n - number of periods returned as a decimal
money.go:269
FunctionCov
Cov Covariance Cov(x,y) = SIGMA(XY) - (SIGMA(X) * SIGMA(Y)) SIGMA a total of all of the elements of a n is the number of x,y data points
money.go:277
FunctionDecimalChange
DecimalChange resets the package-wide decimal place (default is 2 decimal places)
money.go:293
MethodFV
FV Future Value (compound interest) fv (m) = pv * ( 1 + i )^n pv = present value fv = future value (the maturity value) i = interest rate in percent p
money.go:351
MethodFVA
FVA Future Value of an Annuity fv = pmt * ( ( 1 + n )^n - 1 ) / r fv = future value pmt (m) = payment per period r = interest rate in percent per peri
money.go:326
MethodFVGA
FVGA Future Value of a growing Annuity fv = pmt * ( (1+i)^n - (1+r)^n ) / (i - r) when i = r, fv = pmt * n * ((1+i)^(n-1)) pmt (m) = amount of each pa
money.go:338
MethodFVi
FVi Future Value Simple Interest fv = pv * (1 + ( i * n ) ) fv - future value (maturity value) pv (m) - principal or present value i - interest rate p
money.go:361
MethodGetQuote
GetQuote obtains a security quote of type Quote q = Quote t = the string ticker ex. "GOOG" "VTI" e = the string exchange ex. "NASDAQ" "NYSE"
money.go:379
MethodGett
Gett gets value of money truncating after DP (see Value() for no truncation)
money.go:366
MethodInterest
Interest I = pv * i * n pv (m) - principal or present value i - interest rate per period n - number of periods returned into a money type as an int64-
money.go:389
MethodIs
Is Simple Interest (also see Compounded Interest Rate) i = fv - pv pv = present value in Money m = future value (maturity value) in Money i = interest
money.go:415
MethodMP
MP Mortgage Payment pmt = loan * r * (1 + r)^n / ((1 + r)^n - 1) loan - loan amount i - note percent interest rate (not monthly rate) n - number of pe
money.go:442
MethodMul
Mul Multiplies two Money types
money.go:447
MethodPV
Present Value of a Series of cash flows (using non integer time periods) general case pv = SIGMA (n, t=0) [fv-sub(t) / ((1 + i) ^ n-sub(t))] pv = pres
money.go:482
MethodPVA
PVA Present Value of an Annuity (ordinary) pv = pmt * (1 - ( 1 / ((1+i)^n)) / i) m = amount of each payment and solution returned n = periods r = inte
money.go:494
MethodPVAD
Present Value of an Annuity Due pv = pmt * (1 - ( 1 / ((1+i)^n)) / i) * (i+1) pmt = amount of each payment n = periods r = interest rate in decimal pe
money.go:503
MethodPVGA
PVGA Present Value of a growing Annuity pv = pmt * (1 - ( (1+g) / ((1+r)^n)) / (r-g)) pv = present value (returned as m) m = payment per period r = in
money.go:526
MethodPVGAD
PVGAD Present Value of a growing Annuity due (start of period) pv = pmt * (1 - ( (1+g) / ((1+r)^n)) / (r-g)) * (1+r) pv = present value pmt = payment
money.go:537
MethodPVP
PVP Present Value (of an integer period) pv = fv * ( 1 / ( 1 + i )^n) pv = present value fv = future value r = interest rate in percent per period n =
money.go:557
MethodPVi
PVi Present Value of a single future Value (using integer period) pv = fv * ( 1 / ( 1 + r )^n) pv = present value fv = future value r = interest rate
money.go:547
FunctionR
R Regression slope(b) = (n * SIGMAXY - (SIGMA X)(SIGMA Y))) / (n * SIGMAX^2) - (SIGMAX)^2) Intercept(a) = (SIGMA Y - b(SIGMA X)) / n r-squared = (Cov(
money.go:569
FunctionSD
SD Standard Deviation sd = sqrt(SIGMA ((a[i] - mean) ^ 2) / len(a)) SIGMA a total of all of the elements of a a[i] is the ith elemant of a len(a) = th
money.go:624
FunctionSDs
SDs Standard Deviation of a sample sd = sqrt(SIGMA ((a[i] - mean) ^ 2) / (len(a)-1)) SIGMA a total of all of the elements of a a[i] is the ith elemant
money.go:638
MethodSign
Sign returns the Sign of Money 1 if positive, -1 if negative
money.go:661