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

Refractor stocks/fa by incorporating stocks/dd and making the menu less reliant on Yahoo Finance #4055

Merged
merged 57 commits into from
Feb 6, 2023

Conversation

JerBouma
Copy link
Contributor

@JerBouma JerBouma commented Jan 26, 2023

The stocks/dd menu shares a strong similarity with stocks/fa up to the point that it makes sense to combine the two. This led to the "New" menu as depicted below.

Next to that, since Yahoo Finance (specifically yfinance) tends to break every now and then, this PR moves it to not be the main source anymore for most of the functionalities in stocks/fa and groups functionalities where relevant.

Furthermore:

  • I've ensured that stocks/quote now uses FinancialModelingPrep as main source and not Yahoo Finance, taken that function from stocks/fa/quote and moved it out of stocks/fa altogether.
  • stocks/filings is moved to stocks/fa
  • The EODHD requires a paid plan in stocks/fa which is now mentioned and documentation is updated to include referral link we also mention here.
Invalid API Key for EODHD. Please note that for Fundamental Data, a paid plan is required.
Get your API key here: https://eodhistoricaldata.com/r/?ref=869U7F4J and select either the 'Fundamentals Data Feed' or 'ALL-IN-ONE Package'.

See the change to the fa menu:

Old

(🦋) /stocks/ $ fa

╭────────────────────────────────────────────────────────────────────────────────────────── Stocks - Fundamental Analysis ───────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                                                    │
│     load               load a specific stock ticker for analysis                       [YahooFinance, IEXCloud, AlphaVantage, Polygon, EODHD]                                                                      │
│                                                                                                                                                                                                                    │
│ Ticker: TSLA                                                                                                                                                                                                       │
│                                                                                                                                                                                                                    │
│     income             income statements of the company                                [YahooFinance, Polygon, AlphaVantage, FinancialModelingPrep, EODHD]                                                         │
│     balance            balance sheet of the company                                    [YahooFinance, Polygon, AlphaVantage, FinancialModelingPrep, EODHD]                                                         │
│     cash               cash flow of the company                                        [YahooFinance, Polygon, AlphaVantage, FinancialModelingPrep, EODHD]                                                         │
│     data               fundamental and technical data of company                       [Finviz]                                                                                                                    │
│     mgmt               management team of the company                                  [BusinessInsider]                                                                                                           │
│     analysis           analyse SEC filings with the help of machine learning           [Elect]                                                                                                                     │
│     score              investing score from Warren Buffett and co                      [FinancialModelingPrep]                                                                                                     │
│     profile            company profile                                                 [FinancialModelingPrep]                                                                                                     │
│     quote              detailed stock quote information                                [FinancialModelingPrep]                                                                                                     │
│     enterprise         company enterprise value                                        [FinancialModelingPrep]                                                                                                     │
│     metrics            key metrics over time                                           [FinancialModelingPrep]                                                                                                     │
│     ratios             in-depth ratios over time                                       [FinancialModelingPrep]                                                                                                     │
│     growth             growth of financial statement items and ratios                  [FinancialModelingPrep]                                                                                                     │
│     revfc              Earning Estimate by Analysts - Revenue                          [SeekingAlpha]                                                                                                              │
│     epsfc              Earning Estimate by Analysts - EPS                              [SeekingAlpha]                                                                                                              │
│     warnings           company warnings according to Sean Seah book                    [MarketWatch]                                                                                                               │
│     dcf                advanced Excel customizable discounted cash flow                [StockAnalysis]                                                                                                             │
│     dcfc               determine the (historical) discounted cash flow                 [FinancialModelingPrep]                                                                                                     │
│     info               information scope of the company                                [YahooFinance]                                                                                                              │
│     mktcap             estimated market cap                                            [YahooFinance]                                                                                                              │
│     shrs               shareholders (insiders, institutions and mutual funds)          [YahooFinance]                                                                                                              │
│     sust               sustainability values (environment, social and governance)      [YahooFinance]                                                                                                              │
│     cal                calendar earnings and estimates of the company                  [YahooFinance]                                                                                                              │
│     divs               show historical dividends for company                           [YahooFinance]                                                                                                              │
│     splits             stock split and reverse split events since IPO                  [YahooFinance]                                                                                                              │
│     web                open web browser of the company                                 [YahooFinance]                                                                                                              │
│     hq                 open HQ location of the company                                 [YahooFinance]                                                                                                              │
│     overview           overview of the company                                         [AlphaVantage]                                                                                                              │
│     key                company key metrics                                             [AlphaVantage]                                                                                                              │
│     earnings           earnings dates and reported EPS                                 [YahooFinance, AlphaVantage]                                                                                                │
│     fraud              key fraud ratios                                                [AlphaVantage]                                                                                                              │
│     dupont             detailed breakdown for return on equity                         [AlphaVantage]                                                                                                              │
│                                                                                                                                                                                                                    │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── OpenBB Terminal v2.2.0 (https://openbb.co) ─╯

New

((🦋) /stocks/ $ fa

╭──────────────────────────────────────────────────────────────────────────── Stocks - Fundamental Analysis ─────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                        │
│     load               load a specific stock ticker for analysis                       [YahooFinance, IEXCloud, AlphaVantage, Polygon, EODHD]                                          │
│                                                                                                                                                                                        │
│ Ticker: TSLA                                                                                                                                                                           │
│                                                                                                                                                                                        │
│ Company Overview:                                                                                                                                                                      │
│     enterprise         company enterprise value                                        [FinancialModelingPrep, YahooFinance]                                                           │
│     overview           financial overview of the company                               [Finviz, FinancialModelingPrep, AlphaVantage, YahooFinance]                                     │
│     divs               show historical dividends for company                           [YahooFinance]                                                                                  │
│     splits             stock split and reverse split events since IPO                  [YahooFinance]                                                                                  │
│     rating             analyst prices and ratings over time of the company             [Finviz, FinancialModelingPrep]                                                                 │
│     rot                number of analyst ratings over time on a monthly basis          [Finnhub]                                                                                       │
│     score              value investing scores for any time period                      [FinancialModelingPrep]                                                                         │
│     warnings           company warnings according to Sean Seah book                    [MarketWatch]                                                                                   │
│     sust               sustainability values (environment, social and governance)      [YahooFinance]                                                                                  │
│     arktrades          get ARK trades for ticker                                       [Cathiesark]                                                                                    │
│                                                                                                                                                                                        │
│ Management and Ownership:                                                                                                                                                              │
│     mgmt               management team of the company                                  [BusinessInsider]                                                                               │
│     shrs               shareholders (insiders, institutions and mutual funds)          [YahooFinance]                                                                                  │
│     supplier           list of suppliers for the company                               [CSIMarket]                                                                                     │
│     customer           list of customers of the company                                [CSIMarket]                                                                                     │
│                                                                                                                                                                                        │
│ Financial Statements:                                                                                                                                                                  │
│     income             income statements of the company                                [FinancialModelingPrep, Polygon, AlphaVantage, EODHD, YahooFinance]                             │
│     balance            balance sheet statements of the company                         [FinancialModelingPrep, Polygon, AlphaVantage, EODHD, YahooFinance]                             │
│     cash               cash flow statements of the company                             [FinancialModelingPrep, Polygon, AlphaVantage, EODHD, YahooFinance]                             │
│     growth             growth of financial statement items and ratios                  [FinancialModelingPrep]                                                                         │
│     metrics            key financial metrics over time                                 [FinancialModelingPrep, AlphaVantage]                                                           │
│     ratios             extensive set of ratios over time                               [FinancialModelingPrep]                                                                         │
│     dupont             detailed breakdown for Return on Equity (RoE)                   [AlphaVantage]                                                                                  │
│     fraud              key fraud ratios including M-score, Z-score and McKee           [AlphaVantage]                                                                                  │
│     sec                SEC filings                                                     [MarketWatch, FinancialModelingPrep]                                                            │
│     analysis           analyse SEC filings with the help of machine learning           [Elect]                                                                                         │
│                                                                                                                                                                                        │
│ Future Expectations:                                                                                                                                                                   │
│     earnings           earnings dates and reported EPS                                 [AlphaVantage, YahooFinance]                                                                    │
│     epsfc              Earning Estimate by Analysts - EPS                              [SeekingAlpha]                                                                                  │
│     revfc              Earning Estimate by Analysts - Revenue                          [SeekingAlpha, YahooFinance]                                                                    │
│     est                quarter and year analysts earnings estimates                    [BusinessInsider]                                                                               │
│     pt                 price targets over time                                         [BusinessInsider]                                                                               │
│     dcf                advanced Excel customizable discounted cash flow                [StockAnalysis]                                                                                 │
│     dcfc               determine the (historical) discounted cash flow                 [FinancialModelingPrep]                                                                         │
│                                                                                                                                                                                        │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── OpenBB Terminal v2.2.0 (https://openbb.co) ─╯

@reviewpad reviewpad bot added the feat XL Extra Large feature label Jan 26, 2023
@JerBouma JerBouma added feat M Medium T-Shirt size feature and removed feat XL Extra Large feature labels Jan 26, 2023
@reviewpad reviewpad bot added feat XL Extra Large feature and removed feat M Medium T-Shirt size feature labels Jan 26, 2023
@jmaslek
Copy link
Collaborator

jmaslek commented Jan 26, 2023

So one thing to note, if you look at yfinance 0.2.9, it seems like they replaced .info with .fast_info, so does this work if you locally run with pip install -U yfinance ?

@JerBouma
Copy link
Contributor Author

I was playing around with fast_info and it doesn't seem to include all info so I sticked with .info. This PR isn't a 100% fix but mostly just moves things around.

@jmaslek
Copy link
Collaborator

jmaslek commented Jan 27, 2023

Aight. I wasn't sure if info was being deprecated and would break

@JerBouma JerBouma changed the title Refractor stocks/fa with less Yahoo Finance Refractor stocks/fa by incorporating stocks/dd and making the menu less reliant Yahoo Finance Jan 27, 2023
@JerBouma
Copy link
Contributor Author

Updated but 100% tests won't work flawlessly. That's a task for next week.

@jmaslek
Copy link
Collaborator

jmaslek commented Jan 27, 2023

Updated but 100% tests won't work flawlessly. That's a task for next week.

Wait until we bump yf. That will (likely) need tests to be rerun anyways

@jmaslek
Copy link
Collaborator

jmaslek commented Jan 27, 2023

Does it make more sense to do things under dd instead of fa ? Since all the fa are technically dd but all the dd is not technically fa? Or make a name of dfa - due diligence and fundamental analysis?

Also you need to make sure you change all of the SDK paths and docstring hints/examples for whatever we go with

@JerBouma
Copy link
Contributor Author

JerBouma commented Jan 27, 2023

Does it make more sense to do things under dd instead of fa ? Since all the fa are technically dd but all the dd is not technically fa? Or make a name of dfa - due diligence and fundamental analysis?

Also you need to make sure you change all of the SDK paths and docstring hints/examples for whatever we go with

Fundamental Analysis is really the whole area of examining the business model, management, competitive advantage, governance, financial statements and ratios, intrinsic value estimations and future estimations. That's in essence what you see in this menu. Yes, it would also include a comparison analysis and market analysis but that's secondary topics. I can not think of a better name to capture what's inside the menu than "Fundamental Analysis".

The act of due diligence is just so much more and can also expand technical analysis, quantitative analysis, market analysis, economy analysis and more as in essence doing DD is a fully fledged investigation before you are making a decision to make alterations to your portfolio. There are also multiple areas here, financial due diligence, legal due diligence, commercial due diligence and more. With all of those areas, you essentially touch upon everything about the company. So, renaming to dd would be odd since then it should also include all other aspects.

For example, see these sources:

Thanks for the reminder, need to look into that as well.

@JerBouma JerBouma changed the title Refractor stocks/fa by incorporating stocks/dd and making the menu less reliant Yahoo Finance Refractor stocks/fa by incorporating stocks/dd and making the menu less reliant on Yahoo Finance Jan 28, 2023
@JerBouma
Copy link
Contributor Author

@jmaslek I lack technological know-how to fix these merge conflicts. I gave it a shot but if I continue the chances are pretty high I'll just overwrite the wrong code. Can you look into this?

@jmaslek
Copy link
Collaborator

jmaslek commented Jan 30, 2023

@jmaslek I lack technological know-how to fix these merge conflicts. I gave it a shot but if I continue the chances are pretty high I'll just overwrite the wrong code. Can you look into this?

Probably wont have time to check for a few days. But it looks like those are just some files that you moved to the fa folder? So you just may need to delete them. And then all the yaml are just tests you can delete and rewrite in the fa folder.

@jmaslek
Copy link
Collaborator

jmaslek commented Feb 3, 2023

I wouldn't redirect. Just say its been deprecated and functions are integrated into fa. If we redirect then it still works and when we drop it completely, will cause issues.

In a couple weeks we just drop that call_dd completely (add a TODO :) )

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.

And the sdk needs to be remapped before merge. Requesting changes so that I remember this

@JerBouma
Copy link
Contributor Author

JerBouma commented Feb 3, 2023

Changed it!

@jmaslek
Copy link
Collaborator

jmaslek commented Feb 6, 2023

sdk ?

@JerBouma
Copy link
Contributor Author

JerBouma commented Feb 6, 2023

The contributing guidelines give me no clue what to do with SDK 🤷

image

@jmaslek
Copy link
Collaborator

jmaslek commented Feb 6, 2023

you need to remap all the functions that were stocks.dd.{} to stocks.fa.{}

@JerBouma
Copy link
Contributor Author

JerBouma commented Feb 6, 2023

But where do you do that

@jmaslek
Copy link
Collaborator

jmaslek commented Feb 6, 2023

But where do you do that

I seeeeee. That is the part not updated. It is in miscellaneous/library/trail_map.csv

@JerBouma JerBouma force-pushed the feature/yfinance-refractor-stocks branch from 0708d3e to d8765cb Compare February 6, 2023 20:27
reviewpad[bot]
reviewpad bot previously requested changes Feb 6, 2023
Copy link

@reviewpad reviewpad bot left a comment

Choose a reason for hiding this comment

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

The dependency tree has been changed. Please update requirements.txt and requirements-full.txt

@JerBouma
Copy link
Contributor Author

JerBouma commented Feb 6, 2023

Soo this should be it, fixed the OpenBB SDK stuff and I've fixed a bunch of sheet_name errors as well in the meantime. Let's see if we can merge this in soon if everything is ok as it is giving merge conflicts like every day.

@JerBouma
Copy link
Contributor Author

JerBouma commented Feb 6, 2023

The dependency tree has been changed. Please update requirements.txt and requirements-full.txt

No clue what this is about.

@jmaslek
Copy link
Collaborator

jmaslek commented Feb 6, 2023

The dependency tree has been changed. Please update requirements.txt and requirements-full.txt

No clue what this is about.

ignore

@jmaslek
Copy link
Collaborator

jmaslek commented Feb 6, 2023

Soo this should be it, fixed the OpenBB SDK stuff and I've fixed a bunch of sheet_name errors as well in the meantime. Let's see if we can merge this in soon if everything is ok as it is giving merge conflicts like every day.

will review shortly.

@JerBouma
Copy link
Contributor Author

JerBouma commented Feb 6, 2023

@jmaslek Lol tests fail at thought of the day, can you take a look what to do with those?

@jmaslek
Copy link
Collaborator

jmaslek commented Feb 6, 2023

@jmaslek Lol tests fail at thought of the day, can you take a look what to do with those?

Done.

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.

Everything is working on my end in terminal and in SDK. Thing this organization makes a ton more sense.

@JerBouma
Copy link
Contributor Author

JerBouma commented Feb 6, 2023

Aight, I'll merge it when it's done with the tests. I'll make sure to check the commands over the coming days if it all works well.

This all came from the fact that during presentations I kept typing "Now go to the dd menu", "Now go back to the fa" menu 😝

@JerBouma JerBouma merged commit 0ee2ebc into develop Feb 6, 2023
@JerBouma JerBouma deleted the feature/yfinance-refractor-stocks branch February 15, 2023 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat XL Extra Large feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants