Skip to content
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

Feature/add etf holding performance #5488

Conversation

nectariosouzou
Copy link
Contributor

@nectariosouzou nectariosouzou commented Sep 27, 2023

Description

New terminal command based on #3820. Use loaded ETF ticker to search for current holdings, then find percent change for each stock in fund over specified date. Able to display data in bar chart or table.

Screenshot 2023-09-27 at 7 39 32 PM

etf -> holding_perf

@reviewpad reviewpad bot added the feat M Medium T-Shirt size feature label Sep 27, 2023
@jmaslek
Copy link
Collaborator

jmaslek commented Sep 28, 2023

Hey, thanks for this! Awesome to see! When I run this command with SPY, I end up getting a 404 error:

2023 Sep 28, 10:43 [jmaslek] 🦋 /etf/ $ holding_perf

Error, Status Code: 404.

Since this loop takes some time, could you add a progress bar? We have a function in rich_helpers.py called optional_rich_track that will do it for you.

Also when we have "Number of holdings to get" is it sorted by holding %?

@deeleeramone
Copy link
Contributor

This is great!! FMP does allow gang-loading of tickers, so that might be a way to get around looping the historical data request. It would be good to know what the limitations are (don't trust their documentation) for multi-ticker historical data. Like, QQQ would work but not SPY, or even lower?

@nectariosouzou
Copy link
Contributor Author

Hey, thanks for this! Awesome to see! When I run this command with SPY, I end up getting a 404 error:


2023 Sep 28, 10:43 [jmaslek] 🦋 /etf/ $ holding_perf



Error, Status Code: 404.

Since this loop takes some time, could you add a progress bar? We have a function in rich_helpers.py called optional_rich_track that will do it for you.

Also when we have "Number of holdings to get" is it sorted by holding %?

The 404 is caused by the FMP endpoint not finding that specific ticker. I will maybe add some more info for when that occurs.

Thank you for that info, I'll start working to add a progress bar. I'll also to make sure we sort by holding percentage rather than percent change. Makes more sense.

@nectariosouzou
Copy link
Contributor Author

This is great!! FMP does allow gang-loading of tickers, so that might be a way to get around looping the historical data request. It would be good to know what the limitations are (don't trust their documentation) for multi-ticker historical data. Like, QQQ would work but not SPY, or even lower?

I've been playing around with this. Only allows 5 tickers at a time for, but still worth it to utilize that.

@jmaslek jmaslek added the HACKTOBERFEST Hacktoberfest label Oct 2, 2023
@jmaslek
Copy link
Collaborator

jmaslek commented Oct 3, 2023

Thanks! I just did a super small edit to sort in descending order and then to keep the args --start-date/--end-date

Copy link
Collaborator

@jmaslek jmaslek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also added to default data sources json

@jmaslek jmaslek merged commit c23f2c8 into OpenBB-finance:develop Oct 3, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat M Medium T-Shirt size feature HACKTOBERFEST Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants