Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

valuation

import "github.com/cinar/indicator/v2/valuation"

Index

func Fv

func Fv(pv, rate float64, years int) float64

Fv calculates the Future Value (FV) of a Present Value (PV).

Formula: FV = PV * (1 + rate)^years

func Npv

func Npv(rate float64, cfs []float64) float64

Npv calculates the Net Present Value (NPV) of a series of cash flows.

Formula: NPV = sum(CF_i / (1 + rate)^i) for i = 1 to n

func Pv

func Pv(fv, rate float64, years int) float64

Pv calculates the Present Value (PV) of a Future Value (FV).

Formula: PV = FV / (1 + rate)^years

Generated by gomarkdoc