-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ETF support for portfolio allocation command #2143
Conversation
I can not test this because it requires me to set 2FA (which I haven't enabled). Furthermore, the process of getting this code is far too difficult for the user (see: https://github.com/Chavithra/degiro-connector#36-how-to-find-your--totp_secret_key-) The following needs to be done (can you look into this @Chavithra):
|
Hi @JerBouma, are you suggesting letting the user manually adding 2FA password each time they use the Terminal ? Thanks |
Hi @Chavithra, That sounds good. You gotta try and make it accessible for people that just know how to navigate the terminal. We can not ask them to edit some file or extract some code from an URL. Therefore the ideal solution here would be:
|
ok done with help from @Chavithra |
…l into etf_support
There are still some things off. As you can see the return calculation we do is not the same as on DEGIRO. It is fine that it differs a little but this is too much. Furthermore, it is impossible that the benchmark has such poor return given that my current portfolio consists primarily of S&P500 and World (thus the benchmark is closely related). Could you look into this? @montezdesousa |
Description
This PR adds ETF support to the
alloc
command in theportfolio
menu. This means that users that do not provide any country, sector or region for their ETF trades will still be able to see their allocations.The method is similar on what was used to fetch company data for stocks. In this case the allocation_model module will automatically search for the ETF sector/country/region weights and assign the proportional value to the portfolio allocations.
Additional changes:
bench
. It's similar to what was done with risk free rate.show
output and allow exportExample:
Portfolio X holdings, %:
ETF ABC: 1000$, 50%
STOCK XYZ: 1000$, 50%
Suppose ETF ABC has 50% stocks in US and 50% in Brazil, so it will contribute 500$ to the US allocation and 500$ to Brazil.
Suppose STOCK XYZ is from US.
Final country allocs, %:
US: 1500$, 75%
Brazil: 500$, 25%
How has this been tested?
Others
pre-commit install
.pytest tests/...
.