robertmartin8 / PyPortfolioOpt

Financial portfolio optimisation in python, including classical efficient frontier, Black-Litterman, Hierarchical Risk Parity
https://pyportfolioopt.readthedocs.io/
MIT License
4.26k stars 929 forks source link

Suggestion on DiscreteAllocation class for regular rebalancing #486

Open HYANGKI-LEE opened 1 year ago

HYANGKI-LEE commented 1 year ago

Hello, Robert

I found your DiscreteAllocation.greedy_portfolio() in pypfopt while implementing a regular rebalancing task. However, my challenge was that my situation was not SIMPLY convert continuous weights to discrete allocation.

A new situation I had to consider was:

Thankfully, thanks to your project, I was able to implement the task without difficulty. I really appreciate this part.

I am using your code by modifying the structure as below.

[Inputs & Outputs in DiscreteAllocation class] “””

[After modifying] “””

If this fixing fits the direction of your project PyPortfolioOpt, I'd be happy to share with you.

Please read the above and reply. Thank you for your time.

robertmartin8 commented 1 year ago

If this can be implemented in a self-contained way with a couple of unit tests, I'm happy to accept a PR!

AnkitAggarwalAlphagrep commented 1 year ago

@HYANGKI-LEE Can you please create a PR, I would like to use that code.

Thanks