okama.PortfolioDCF.wealth_index
- property PortfolioDCF.wealth_index
Calculate wealth index time series for the portfolio with contributions and withdrawals.
Wealth index (Cumulative Wealth Index) is a time series that presents the value of portfolio over historical time period considering cash flows.
Accumulated inflation time series is added if inflation=True in the Portfolio.
If there is no cashflows Wealth index is obtained from the accumulated return multiplicated by the initial investments. That is: initial_amount_pv * (Acc_Return + 1)
initial_amount_pv is the discounted value of the initial investments (initial_amount).
Values of the wealth index correspond to the beginning of the month.
- Returns:
- Time series of wealth index values for portfolio and accumulated inflation.
Examples
>>> import matplotlib.pyplot as plt >>> x = ok.Portfolio(['SPY.US', 'BND.US']) >>> x.dcf.wealth_index.plot() >>> plt.show()