In this tutorial we aim to use the key indicators that Warren Buffett uses to determine the strength of an underlying business, so that we can find excellent stocks that are worth more time investigating. However, the ASX alone currently has 2061 listed stocks, how can we possibly reduce that number? With our Quant hat on, we can expedite this process using some key assumptions and our skills in python.
Here we investigate how to use web scraping to create large lists of companies to get financial statements data for Yahoo Finance. Unfortunately, this dataset is limited to 4 years, however not bad for the depth of companies, anything longer than this duration and I suspect we would need to pay for that kind of data access.
Now we can rely on a python module called yahoofinancials to retrieve Yahoo Financial data by the bucket load. We can speed this function up by using Multithreading as we are Input/Output limited in calling this API not CPU limited.
Now we can use the data to calculate the return on equity (ROE) and the earnings per share (EPS) growth over several years for each stock. Finally, we can apply our conditions to the two dictionaries and print the stocks that are present to both. These are the companies that are worth further investigation.
Full code available on my website: quantpy.com.au/python-for-finance/warren-buffett-v…
00:00 Intro
01:40 Web Scraping with BeautifulSoup
12:45 Using yahoofinancials python module
17:48 Multithreading!
25:10 Selecting companies based on ROE & EPS Growth
★ ★ QuantPy GitHub ★ ★
Collection of resources used on QuantPy YouTube channel. github.com/thequantpy
★ ★ Discord Community ★ ★
Join a small niche community of like-minded quants on discord. discord.com/invite/aY2Af4CxHP
★ ★ Support our Patreon Community ★ ★
Get access to Jupyter Notebooks that can run in the browser without downloading python.
www.patreon.com/quantpy
★ ★ ThetaData API ★ ★
ThetaData's API provides both realtime and historical options data for end-of-day, and intraday trades and quotes. Use coupon 'QPY1' to receive 20% off on your first month.
www.thetadata.net/
★ ★ Online Quant Tutorials ★ ★
WEBSITE: quantpy.com.au/
★ ★ Contact Us ★ ★
EMAIL: pythonforquants@gmail.com
Disclaimer: All ideas, opinions, recommendations and/or forecasts, expressed or implied in this content, are for informational and educational purposes only and should not be construed as financial product advice or an inducement or instruction to invest, trade, and/or speculate in the markets. Any action or refraining from action; investments, trades, and/or speculations made in light of the ideas, opinions, and/or forecasts, expressed or implied in this content, are committed at your own risk an consequence, financial or otherwise. As an affiliate of ThetaData, QuantPy Pty Ltd is compensated for any purchases made through the link provided in this description.
コメント