okama.PortfolioDCF.cashflow_pv

property PortfolioDCF.cashflow_pv

The discounted value (PV) of the cash flow amount (contributions/withdrawals) at the historical first date.

PV is defined by the discount rate and the cash flow amount: cashflow_pv = amount / (1 + discount_rate) ** period_length

When cash flow ‘amount’ is not defined, cashflow_pv set to None.

Returns:
float, None

The discounted value (PV) of the cash flow amount at the historical first date.

Examples

>>> # Get discounted PV value of of the cash flow amount for a portfolio with 20 years of history (at 2003-10).
>>> pf = ok.Portfolio(['SPY.US', 'AGG.US'], ccy='USD', last_date="2024-10")
>>> ind = ok.IndexationStrategy(pf)  # create cash flow strategy linked to the portfolio
>>> ind.initial_investment = 10_000  # add initial investment to cash flow strategy
>>> ind.amount = -500  # set withdrawal size
>>> ind.frequency = "year"  # set withdrawal frequency
>>> pf.dcf.cashflow_parameters = ind  # assign cash flow strategy to portfolio
>>> pf.dcf.discount_rate = 0.10  # define discount rate
>>> pf.dcf.cashflow_pv
-68.86557103941368