Comment on page

Custom Rebalancing

You can decide custom dates for rebalancing, by doing this:
from empyrial import empyrial, Engine
portfolio = Engine(
start_date= "2018-06-09",
portfolio= ["BABA", "PDD", "KO", "AMD","^IXIC"],
weights = [0.2, 0.2, 0.2, 0.2, 0.2], #equal weighting by default
benchmark = ["SPY"], #SPY by default
rebalance = ["2018-06-09", "2019-01-01", "2020-01-01", "2021-01-01"] #dates of rebalancing
⚠️ In that case, make sure, that the 1st element of the list corresponds to the start_date and the last element corresponds to the end_date which is today's date by default.