okama.PortfolioDCF.wealth_index
- property PortfolioDCF.wealth_index
Wealth index time series for the portfolio with cash flow (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 cash flow, Wealth index is obtained from the accumulated return multiplicated by the initial investments. That is: initial_amount_pv * (Acc_Return + 1)
- Returns:
- Time series of wealth index values for portfolio and accumulated inflation.
Examples
>>> import matplotlib.pyplot as plt >>> pf = ok.Portfolio(['VOO.US', 'GLD.US'], weights=[0.8, 0.2]) >>> ind = ok.IndexationStrategy(pf) # Set Cash Flow Strategy parameters >>> ind.initial_investment = 100 # initial investments value >>> ind.frequency = "year" # withdrawals frequency >>> ind.amount = -0.5 * 12 # initial withdrawals amount >>> ind.indexation = "inflation" # the indexation is equal to inflation >>> pf.dcf.cashflow_parameters = ind # assign the strategy to Portfolio >>> pf.dcf.wealth_index.plot() >>> plt.show()