okama.IndexationStrategy
- class IndexationStrategy(parent)
Bases:
CashFlow
Cash flow strategy with regualr indexed withdrawals or contributions.
- Parameters:
- parentPortfolio
Parent Portfolio instance.
Examples
>>> import matplotlib.pyplot as plt >>> pf = ok.Portfolio(first_date="2015-01", last_date="2024-10") # create Portfolio with default parameters >>> # Set the cash flow strategy >>> ind = ok.IndexationStrategy(pf) # create IndexationStrategy linked to the portfolio >>> ind.initial_investment = 10_000 # add initial investments size >>> ind.frequency = "year" # set cash flow frequency >>> ind.amount = -1_500 # set withdrawal size >>> ind.indexation = "inflation" >>> # Assign the strategy to Portfolio >>> pf.dcf.cashflow_parameters = ind >>> pf.dcf.use_discounted_values = False # do not discount initial investment value >>> # Plot wealth index with cash flow >>> pf.dcf.wealth_index.plot() >>> plt.show()
Methods & Attributes
Portfolio regular contributions or withdrawals size.
The frequency of regualr withdrawals or contributions in the strategy.
Portfolio cash flow indexation rate.
Portfolio initial investment FV size (at last_date).
- NAME = 'fixed_amount'
- property frequency
The frequency of regualr withdrawals or contributions in the strategy.
Allowed values for frequency:
‘none’ no frequency (default value)
‘year’ annual cash flows
‘half-year’ 6 months cash flows
‘quarter’ 3 months cash flows
‘month’ 1 month cash flows
- Returns:
- str
The frequency of withdrawals or contributions.
- property initial_investment
Portfolio initial investment FV size (at last_date).
Initial investment must be positive.
- Returns:
- float
Portfolio initial investment.
- property amount
Portfolio regular contributions or withdrawals size. Negative value corresponds to withdrawals. Positive value corresponds to contributions. Cash flow value is indexed each period by ‘indexation’.
- Returns:
- float
Portfolio regular cash flow size.
- property indexation
Portfolio cash flow indexation rate.
- Returns:
- float
Cash flow indexation rate.