get_grid_portfolios

EfficientFrontier.get_grid_portfolios(step=0.1)

Generate rebalanced portfolios for all weight combinations on a grid.

Weights are enumerated with a fixed step that must divide 1.0 evenly (e.g. 0.05, 0.10, 0.20, 0.25, 0.50). Per-asset bounds are respected.

Parameters:
stepfloat, default 0.10

Weight increment (e.g. 0.10 for 10 %).

Returns:
DataFrame

Table with Risk (annualized std) and CAGR for every grid portfolio.

Examples

>>> ls_m = ["SPY.US", "GLD.US"]
>>> x = ok.EfficientFrontier(
...     assets=ls_m,
...     first_date="2005-01",
...     last_date="2020-11",
...     ccy="USD",
...     rebalancing_strategy=ok.Rebalance(period="year"),
... )
>>> grid = x.get_grid_portfolios(step=0.25)
>>> grid.head()
       CAGR      Risk
0  ...       ...