Fundamental Analysis of Stocks with Python

Sdílet
Vložit
  • čas přidán 5. 03. 2021
  • Hi everyone,
    in this video we are going to take a look at analyzing stocks using fundamental analysis with Python. We are scraping financials via the Yahoo Finance API and utilizing the data. We are doing a peer group comparison and find the highest dividend payers (in terms of dividend yield) in the Dow Jones.
    Get the Notebook/Source code by becoming a Tier-2 Channel member:
    / @algovibes
    Video on getting tickers from wikipedia:
    • Trading strategy and B...
    Check out my Python for Finance stuff!
    • Python for Finance
    Disclaimer:
    This video is no investment advice. It is for educational and entertainment purposes only.
    #Python #FundamentalAnalysis #Stockmarket

Komentáře • 82

  • @happyfa
    @happyfa Před 3 lety +7

    There is little video concerning FA in python. Thanks for covering it as the most important part

    • @Algovibes
      @Algovibes  Před 3 lety +1

      Thanks a lot for watching :-) Appreciate your comment!

  • @adriaanborgermans5671
    @adriaanborgermans5671 Před rokem +1

    I learn a alot each time i watch a video of yours. I will look for more videos in fundamental analysis in Python. I hope i found one where you backtest a fundamental strategy.

    • @Algovibes
      @Algovibes  Před rokem

      Happy to read. Thanks a ton Adriaan!

  • @PavelSumik
    @PavelSumik Před 3 lety +3

    your videos are really great, thank you very much for your work

    • @Algovibes
      @Algovibes  Před 3 lety +1

      Thank you so much for your kind words! :-)

  • @ihebbibani7122
    @ihebbibani7122 Před 2 lety +2

    Again , Thanks a lot for your contents !

    • @Algovibes
      @Algovibes  Před 2 lety

      And again, thanks a lot for your support and your positive nature :-)

  • @rraul
    @rraul Před 2 lety +1

    Using your tips right now to create a factor investing screener. Thanks!

    • @Algovibes
      @Algovibes  Před 2 lety

      Awesome! Let me know more about the results :-)

  • @guccipepito
    @guccipepito Před 2 lety +1

    SQL video will be soooo nice thanks for your videos buddy

  • @mediamention-kx4ft
    @mediamention-kx4ft Před 2 lety +1

    Thank you!

  • @ashmandu3309
    @ashmandu3309 Před 2 lety +1

    Great video! Will be looking for more python tutorials from you my sensei. OSS!

    • @Algovibes
      @Algovibes  Před 2 lety +2

      :D Thanks mate. I like this karate reference 😛

    • @Kig_Ama
      @Kig_Ama Před rokem

      @@Algovibes 🤣👍

  • @skyline3911
    @skyline3911 Před 2 lety +1

    Many thanks!!! You helped me a lot!

    • @Algovibes
      @Algovibes  Před 2 lety

      That's awesome man, thanks a lot for your comment.

  • @gacctom
    @gacctom Před rokem +1

    Awesome, thank you!

    • @Algovibes
      @Algovibes  Před rokem

      Thanks a lot for your comment buddy :-)

  • @FRANKWHITE1996
    @FRANKWHITE1996 Před 3 lety +1

    Great video. Thanks mate. 🙌🙌🙌

    • @Algovibes
      @Algovibes  Před 3 lety

      Thanks for watching and your support :-) Appreciate it!

  • @matejmak9225
    @matejmak9225 Před rokem +1

    Hello,
    Awesome video as always. Can I ask you a question ? In the end I have problem with showing graph because of this:
    TypeError: 'value' must be an instance of str or bytes, not a float → probably when I require to values on x and y axis.... Is there any solution for this ? Thank you for answer.

    • @Algovibes
      @Algovibes  Před rokem

      stackoverflow.com/questions/64890665/how-do-i-fix-this-type-error-value-must-be-an-instance-of-str-or-bytes-not-a
      ;-)

  • @safetime100
    @safetime100 Před 3 lety +1

    Very good 👍 thanks a lot, more to come please.

    • @Algovibes
      @Algovibes  Před 3 lety

      Thank you very much :-) Appreciate your comment!

  • @azamat_kalam
    @azamat_kalam Před 2 lety +1

    Hey, Algovibes
    Thanks for the videos! How to compare a company's (e.g. 'TSLA') most recent earnings to past earnings, both quarterly and yearly?
    Thanks

    • @Algovibes
      @Algovibes  Před 2 lety

      Hi man, thanks for watching. As far as I know you can pull the PnL for multiple years using yfinance. With that you could compare it. I got more videos on fundamental analysis with Python on my list btw.

  • @SarthakGarg
    @SarthakGarg Před 3 lety +6

    Please make videos on sql as well

    • @Algovibes
      @Algovibes  Před 3 lety +2

      I will :-) Might take some time tho. Thanks for watching mate.

  • @ProSpase
    @ProSpase Před rokem +1

    Is it possible to get historical FA data?

  • @siddhigolatkar8558
    @siddhigolatkar8558 Před rokem +2

    Thank you

    • @Algovibes
      @Algovibes  Před rokem

      Very welcome Siddhi! Thanks for watching :-)

  • @prashantsonar898
    @prashantsonar898 Před 2 lety +2

    Hi Super video....can you also a do video on Fundamental analysis for DAX using same features on last 15 years data and use Deep learning for prediction ? Thank you Again !!!

    • @Algovibes
      @Algovibes  Před 2 lety

      Thank you very much for your kind comment and your suggestion. Very much appreciated!

  • @Ctrlshiv
    @Ctrlshiv Před 2 lety +1

    Pretty awesome stuff, I tried and it work until the point it gave me some namerrror in jupyter so not sure what's wrong, I'm not py pro so I will deep on it later, will reinstall everything from 0 and try again, appreciate the work!.

    • @Algovibes
      @Algovibes  Před 2 lety

      Thanks alot for your feedback man :-)

  • @blankerhans9659
    @blankerhans9659 Před 2 lety +1

    What programm are you using? In pycharm the data frames arent that good looking. :D

  • @itsdan9194
    @itsdan9194 Před rokem +1

    Where can I see, for what Period the data is delivered ? Great video btw. helped a lot.

    • @Algovibes
      @Algovibes  Před rokem

      Thanks mate. Just in the index of the dataframe.

  • @chris_bi
    @chris_bi Před rokem +1

    I would love a combination of this video and your new SQL-Tutorial ;-)
    I'm currently building a quarterly Portfolio Check-up where I could use some help...

    • @Algovibes
      @Algovibes  Před rokem

      Hi Christian, I think I covered something like that in my live stream:
      czcams.com/video/TJK-Ct9WnCw/video.html

  • @markk4203
    @markk4203 Před 2 lety +2

    Around 5:10, you note this takes a long time because the program has to scrape at every step. What is involved with the database that makes this unnecessary and the database faster/more efficient? And--if it's about already having the data in the database, then does this take into consideration the time it took to import data into the database originally?

    • @Algovibes
      @Algovibes  Před 2 lety +2

      The data is requested via the request module in the background. When you are storing the fundamentals into a database (sqlite or mysql or whatever you want) you don't have to perform this request anymore and can directly query the data using a sql statement.
      Regarding the last question: The data is not really dynamic (such as prices which are updated every fraction of a second) so it is not relevant to take this into consideration.

    • @markk4203
      @markk4203 Před 2 lety +2

      @Algovibes So it takes less time to query the database than it does to initially request the data and store it into the database?

    • @TainuiaKid1973
      @TainuiaKid1973 Před 2 lety

      @@markk4203 Yes.

    • @Kig_Ama
      @Kig_Ama Před rokem

      @@Algovibes Can u make a video where u store it in a database first, so it becomes more efficient?

  • @Cunetch
    @Cunetch Před 2 lety +3

    Hi, do you think you can cover discounting cash flows in Python. Is it suitable?

    • @Algovibes
      @Algovibes  Před 2 lety +3

      Hi man,
      in the very beginning of this channel I actually made a vid on the NPV:
      czcams.com/video/1_uF6o-9ms0/video.html
      Maybe helpful. But I wanted to do some Corporate Finance / Financial modeling topics - just don't know if there is any demand for that. Do you have anything specific what you would be interested in?

    • @Cunetch
      @Cunetch Před 2 lety +2

      @@Algovibes Thank you for replying, I am asking because I am using excel to compute equity value and modeling in general. When I analyze stocks, however retrieving all balance sheet, CF and earnings info is time consuming. Maybe if there is a way to speed up the process of gathering and filtering large amounts of accounting and financial data (like earnings, EBITDA, Depreciation and Amortization) over 10 years for instance. Thank you anyway, whatever you can come up with will be very helpful I am sure!

  • @a1b290
    @a1b290 Před 3 lety +2

    Great video, enjoyed it. Thanks. Are you able to post the code?

    • @Algovibes
      @Algovibes  Před 3 lety +1

      Thanks a lot for your feedback :-) Appreciate it!
      Yes I will work on publishing my code within this year but I just don't have enough time right now to set it up properly and want to focus the remaining time on producing content. Thanks a lot for your understanding.

  • @benn8319
    @benn8319 Před rokem +2

    Hi, this has stopped working. Has something changes with YFinance? Do we need an upgraded version?

    • @benn8319
      @benn8319 Před rokem +1

      scratch that, but as a note, make sure you have the latest yfinance version which is now 0.2.3 as at 2023!

    • @Algovibes
      @Algovibes  Před rokem +1

      thank you so much!

  • @Kig_Ama
    @Kig_Ama Před rokem +1

    Is it possible to get the ISIN for the fundamentals instead of the symbol?

    • @Algovibes
      @Algovibes  Před rokem

      Yeah you can extract it. It is contained in the info as well.

    • @Kig_Ama
      @Kig_Ama Před rokem

      @@Algovibes r u sure? I couldn't find it in the info.

  • @rushikeshjagtap5403
    @rushikeshjagtap5403 Před 2 lety +1

    Which editor is this?

    • @Algovibes
      @Algovibes  Před 2 lety

      That's Jupyter Notebook :-) Thanks for watching.

  • @Kig_Ama
    @Kig_Ama Před rokem +1

    Can u provide the link for your Boolean indexing approach?

    • @Algovibes
      @Algovibes  Před rokem +1

      yeah but it is an age old video :D
      czcams.com/video/e0tL68PvwUY/video.html

    • @Kig_Ama
      @Kig_Ama Před rokem

      @@Algovibes TY :)

  • @mdjuneid3553
    @mdjuneid3553 Před 3 lety +1

    Hey can you please make a video on how to pull data data from bitmex

    • @Algovibes
      @Algovibes  Před 3 lety +1

      Thanks for watching and your suggestion. I noted that! :-) But you will need to be a bit patient.

  • @Kig_Ama
    @Kig_Ama Před rokem +1

    Do u have a github where we can download the code?

    • @Algovibes
      @Algovibes  Před rokem

      Even better! You can become a channel member and get access to the code and besides that support the channel:
      czcams.com/channels/87aeHqMrlR6ED0w2SVi5nw.htmljoin

  • @bogdanexit1
    @bogdanexit1 Před 3 lety +1

    Please make ths video for Sql

    • @Algovibes
      @Algovibes  Před 3 lety

      I will, thanks a lot for your comment and for watching :-)

  • @rafaelcalisto1700
    @rafaelcalisto1700 Před rokem +1

    Whats the name of this IDE?

    • @Algovibes
      @Algovibes  Před rokem

      That's Jupyter Notebook. Thanks a lot for watching 🙂

  • @vatsal_kanth
    @vatsal_kanth Před 2 lety +1

    Great video. also.. it would also work if we wrote, df[fundamentals] directly. :)

    • @Algovibes
      @Algovibes  Před 2 lety

      You are absolutely right :D I just watched the part again and facepalmed on myself. Thanks buddy!

  • @diehgo_sp
    @diehgo_sp Před rokem +1

    spoiler alert, it doesn't work

    • @Algovibes
      @Algovibes  Před rokem

      Can you elaborate? Happy to take a look and make an updated version of this!

  • @chris_bi
    @chris_bi Před rokem +1

    Did they change something… I am no more getting any data from yfinance. I only receive an almost empty dictionary { regularMarketPrice : None, logo_url : }

  • @Binancian
    @Binancian Před 3 lety +1

    Nice video.Thank you. That booling index method is too much,
    Perhaps, this df2 = df.loc[:,df.columns.isin(fundamentals)] looks simpler.

    • @Algovibes
      @Algovibes  Před 3 lety

      Thanks for your comment, appreciate it :-)
      Do whatever you prefer but make sure it does the right job :-P On a serious note: Thanks for sharing your approach!

    • @Lnd2345
      @Lnd2345 Před rokem

      Or just df[fundamentals]