robertmartin8 / PyPortfolioOpt

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

Consider transaction cost during discrete_allocation #413

Closed mgrytsai closed 1 year ago

mgrytsai commented 2 years ago

What are you trying to do? I'm using discrete_allocation to convert my percentage allocation into number of shares I need to buy to get as close as possible to target allocation. However, in real world there is a transaction fee associated.

The question I'm wondering what will be the best option to incorporate transaction fee when doing greedy search.

phschiele commented 2 years ago

@mgrytsai I don't think there is a straightforward way to include it into the existing implementation. Do you absolutely need the greedy approach? For small portfolios, it should be easy to write it as a mixed-integer linear program.