Rebalancing bands - new rebalancing strategies for investment portfolios.
- Calendar-based rebalancing
- Rebalancing bands (threshold-based)
Mean-variance optimization with rebalancing-strategy-adjusted Efficient Frontier and asset weight bounds.
New features
Rebalance - new class to define rebalancing strategies
Rebalancing strategies are now defined in both Portfolio and EfficientFrontierReb with Rebalance class.
rs = ok.Rebalance(period="year", abs_deviation=0.10, rel_deviation=0.30)
pf = ok.Portfolio(['SPY.US', 'AGG.US'], rebalancing_strategy=rs)WARNING:
The previous Portfolio class initialization method is now deprecated.
ok.Portfolio(rebalancing_period="year") will not work anymore.
However, as the default rebalancing strategy is monthly calendar-based. The simple definition without rebalancing strategy is still working:
ok.Portfolio(['SPY.US', 'AGG.US'], weights=[.6, .4])Rebalance class
- New
Rebalanceclass has 3 parameters: period, abs_deviation, rel_deviation Rebalance.wealth_ts()calculates wealth index time series of rebalanced portfolio (optionally with assets wealth time series)Rebalance.assets_weights_ts()calculates assets weights monthly time series for rebalanced portfolioRebalance.return_ror_ts()returns monthly rate of return time series of rebalanced portfolio
New methods and properties in Portfolio class
- new property
rebalancing_strategyto configure rebalancing period, absolute and relative deviations - new property
rebalancing_eventsreturns time series of rebalancing events and type of rebalancing
Changes in PortoflioDCF class
PortfolioDCF.monte_carlo_wealth_pvcalculates discounted random wealth indexes with cash flowsPortfolioDCF.monte_carlo_wealth_fvcalculates not discounted (nominal) random wealth indexes with cash flowsPortfolioDCF.find_the_largest_withdrawals_size()now uses bisection method to find the largest withdrawals size.PortfolioDCF.find_the_largest_withdrawals_size()has 3 possible goals: 'maintain_balance_pv', 'maintain_balance_fv' and 'survival_period'PortfolioDCF.find_the_largest_withdrawals_size()new attributewithdrawals_rangedefines the possible range for withdrawals to speed up the calculationsPortfolioDCF.find_the_largest_withdrawals_size()hasiter_maxattribute to limit the intermediate steps when searching for resolutionPortfolioDCF.find_the_largest_withdrawals_size()returnsResultclass. If the solutions is not found it is still possible to see the intermediate steps
New methods and properties in EfficienFrontierReb class
EfficienFrontierReb class now uses rebalancing_strategy parameter for initialization (the same as Portfolio).
It supports bounds to define the weight limitations for the assets.
- new
rebalancing_strategyparameter to define the rebalancing strategy - new
boundsparameter defines the bounds for the assets weights - new
EfficienFrontierReb.plot_pair_ef()method plots the Efficient Frontier of every pair of assets
Changes in EfficientFrontier class
EfficientFrontier.get_monte_carlomethod generates random rebalanced portfolios with Monte Carlo simulation according toboundslimitations.
New Jupyter Notebook with examples for Rebalancing strategies
New Jupyter Notebook with examples of investment portfolios with different rebalancing strategies:
10 rebalancing portfolio.ipynb
