Custom Rebalancing
You can decide custom dates for rebalancing, by doing this:
1
from empyrial import empyrial, Engine
2
​
3
portfolio = Engine(
4
start_date= "2018-06-09",
5
portfolio= ["BABA", "PDD", "KO", "AMD","^IXIC"],
6
weights = [0.2, 0.2, 0.2, 0.2, 0.2], #equal weighting by default
7
benchmark = ["SPY"], #SPY by default
8
rebalance = ["2018-06-09", "2019-01-01", "2020-01-01", "2021-01-01"] #dates of rebalancing
9
)
10
​
11
empyrial(portfolio)
Copied!
⚠️ 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.
Last modified 4mo ago
Copy link