Closed kevinl1210 closed 2 years ago
Interesting!
It looks like there shouldn't be any problem with your set of constraints. Something that might be worth trying is using very loose sector constraints i.e set all lower to 0 and all upper to 1. If this works, then you can start bringing the bounds towards your desired bounds to try and see where the bug is coming from.
If it doesn't work, then I'll need to think more.
Another thing: could you try running without ef.add_objective(objective_functions.L2_reg, gamma=0.1)
? max_sharpe
doesn't work well with additional objectives
Thanks. It is working fine after tuning the sector_lower and sector_upper to different values, and fillna to my price dataset.
Hi, I am trying to use the max_sharpe() to optimize my portfolio. p.s. I am not optimizing portfolio of stock but wine assets.
I have 90 assets in the price df.
return:
risk matrix:
The error occurs in ef.max_sharpe()
I have also tried to use min_volatility/efficient_risk/efficient_return instead of max_sharpe, but same error occurs. When i comment add_sector_constraints(), it is working fine.