Completing our basic stock screener - Using Programming for Fundamental Investing Part 10

sentdex · Intermediate ·💻 AI-Assisted Coding ·12y ago

Key Takeaways

Completes a basic stock screener using programming for fundamental investing principles

Full Transcript

hello and welcome to the 10th fundamental investing with the use of programming tutorial where we left off i was showing you all how to further screen a batch of data that way you don't have to continue running through the whole huge set right so in this case you know instead of running through 3000 bits of 3000 tickers you can generate kind of a screened list that is very loose but yet kind of whittles down this list so the absolute absurdity uh companies aren't included that way every time you want to look through them you're not getting just crazy stuff that you it's just wasting your bandwidth and yahoo's bandwidth so um so that's how to start screening stocks and then what we did here is this one was basically with a bunch of twos and now this one required a price to book up one instead of a price to book of two but allowed the rest so um with that we generated here uh all of these companies met that requirement and then at the end it printed out a very small list or a much smaller one anyway of companies and if we look through this list pretty quickly we see that a fam is at least a decent one it's it's peg or it's forward peg raise it's 1.28 so the goal is really a one but 1.28 not so bad um and you know the debt to equity is pretty low the trailing p is pretty low um price to book under one that's good so we're pretty we're pretty happy with this company again it doesn't meet all of the fundamental requirements however so just keep that in mind i'm not suggesting anybody goes out and buys a fan by any means please heed the warning in front of the video but let's say let's say we're interested we want to know more about afam right so uh which is almost family so what do we do at this point right once we've found all this information where what might we do now well at this point i mean we can look through this list and really probably whittle this liz down a little bit more and maybe require a debt to equity ratio that is a not not available but also under uh 40 or something like that would knock out quite a few of these companies immediately um so this list would really be like 10 companies right or something like that so you could probably do that and even get this list smaller and at that point you really can go through this stuff by hand there's it's not as necessary that you use a program anymore but so for example let's let how would we do that though uh because there is one more thing i still want to show you guys as far as acquiring this data so let's say a fam we're interested to know more about a-fam so what we can do is uh come over to yahoo.com let me drag it over here oh this was that navy yard shooting i guess anyway finance click on that and we'll just put in a fam and can you believe summers withdraw i still can't believe that happened but anyway really thought he was for sure gonna get it um okay so we find afam and then to get to some interesting information for afam let's go to the income statements the next thing we kind of want to know is um what are the financials for this company like what's the bottom line is are we are we doing good you know with this company or what like why because generally if it's undervalued there's a good reason but many times there there it's just like i don't know poor sentiment and emotional kind of stuff it can lead to very undervalued companies so anyway checking out their income statement we can view both uh quarterly and we'll see that quarterly um goes back only a year uh fairly level but again they are here they're kind of slowly chipping away at earnings and let's take a further back approach and let's check out all the annual data here and let's go over so this one goes back obviously three years so december 31st uh 2012 2011 2010. but again we can see that their earnings are actually slowly and decrease uh so that would kind of make us shy away a little bit but again the value investing kind of one of the more bigger principles of value investing is that we kind of we you you shy away from uh speculation so we're not looking you know we're not growth investors here we're not momentum investors here you know so the fact that it's decreasing in profits isn't necessarily a a something that's going to make us check this off the list at the same time we want to know now um generally you want to look more like five years back if not 10 years back and if we kind of browse around here on yahoo we see that whoa there's really no easy way like how do we get further back data well i've kind of looked around online and there is really no at least free source of historical either quarterly or annual earnings data so that kind of sucks right and you can buy it and usually you have to buy it in batches and it's you know in the hundreds if not thousands of dollars for this financial data but luckily there is kind of a way around paying for that historical data um don't think that many institutions are using this i bet they're actually buying the data but you can do this so what can you do to get around this well you can go to google and either type in wayback machine or you can go to their website it is let me just go back to the home page here this is their home page it's archive dot org and then slash web slash web dot php and here what the idea of this is is it basically they're they cache pages right they visit these pages and they just save all of the html and then so what you can do is you can type in old internet pages into here and kind of visit the website from like way back in the day right so like we go to oh facebook wow facebook you're pretty lame anyway due to robots.txt facebook won't let us parse them that's great facebook thank you anyway i was going to show you guys an old version of facebook but i guess we can't so anyway back to yahoo um so let's say we want to know like okay well this this one was only going back to 2010 but what if we you know come up into our address bar here copy this come over to the wayback machine and paste in afam so we'll hit show all hopefully that'll work okay so so we can see with the annual results of afam it actually hasn't even pulled anything from it for afm in 2013. uh but we do have something for 2012 and then we have a gap of about you know two years here but it looks we're obviously missing december here december here in december here but let's click on this one because this one is missing this december so i bet this one starts at this here this here so i bet it'll line up just perfectly so at the moment again um we've got december 12 2012 all the way back to 2010 what we need is starting at 2009 and prior so can we do that well let's click on this 2012 version and you like you click here and then it gives you like a calendar and then if it's got like a little blue on it that means it's got a page from that day so we can click on that and wait for it to load and once it loads sure enough we you know we already had this data and but we didn't have 2009 right so now we've got the 2009 data which shows they were actually making you know from 2009 to 2010 they actually made quite a healthy profit right they went from 158 to 182. um so now we're kind of curious okay well what about 2008 right um can we get some data on uh 08. so uh we come back over to here and or not here sorry go back over here uh right so click on this one and we'll just see so we've got a little toolbar here yeah it looks like okay cool oh man it didn't give us hmm what's this one 2012 and then before that is 2009. but we don't have anything so we're missing one bit of data right for that the the december 31st uh 2009 and one moment we actually maybe even get around that but if you look at o5 okay they were making about 36 mil then they made you know almost 45 million then almost 70 million and then we could see before they actually dropped down at least by 09 back to the 50s but now and then again now recently they're making much larger digits so actually on a large enough time scale you know this company is actually still in growth um so that is something that you you want to kind of keep in mind that and again you know for fundamental investors and value investors i mean we're not even looking we're not like looking to buy and hold for a year you're looking to buy and hold for 10 years or something like that right and on a 10-year scale this company is actually looking pretty solid and we could continue going back because we could go back again in 2007 right so we've got 07 0605 what if we want to go back even further can we do it let's try it um then we go even back to o4 where they were making even less money so again growth still growing okay so but what about what was the one that we're missing i think we were missing was it 2009 or 2008 i can't even remember now i think we were missing a the december 24 december 31st 2009. now we got an 09 there so maybe we were missing 08 i don't know surely we would have a weight here though so nine oh i see well that's weird why we i wonder why we don't have an 08 in this poll because it pulled it on jan 3rd 2009 maybe the earnings just hadn't come out yet so i think this is like the quarter the period ending so earnings maybe hadn't come out so so how will we get around that well we could instead click on quarterly data and i think the way this website works is it'll let us do this yes so um right so we want the 2008 data so if you look well you can track their earnings in the quarterly because it looks like we've got a poll here and a poll here so we might be able to just just add it up right so uh so i think this is kind of a good example of um you know what you can do to get around these requirements to to buy the data and most of the most of the companies have enough uh crawls where you don't even have to do this but again uh with a zoomed out version of this company i think that in using like way back machine you get the older data to me this company actually looks pretty good from a from a value investor's standpoint and based purely on their uh data now i don't know too much about almost family incorporated but um i'll probably actually even look into this company myself so anyway but again that's not a suggestion to buy any securities or anything don't buy this stock based on what i've said so anyway um so that's kind of a good way to go about uh getting the historical earnings data for companies now obviously you could also buy this stuff um i i think thompson reuters will sell it to you you can contact them it's probably in the 2 300 maybe 500 range to get the data you can also at least what i did is i just pulled this data with a program and just went through every company and just pulled all of the historical data and then compiled it that way i didn't have to go through this stuff by hand and i might eventually put out a tutorial on how to parse wayback machine i'm just not sure i want to do that to wayback machine because it creates probably an unnecessary load for them so i haven't really decided if i want to show a tutorial on that or not but maybe i'll do that if there's enough interest in it maybe i'll do it um as far as other forms of investing or fundamental investing are concerned um you know you might be looking for different stats uh maybe you want something from other pages uh so maybe you want you're looking for uh something other than the key stats or you know you might be looking for other stats you should that you should already have that pretty down pat even if you wanted other stats you should be able to kind of figure it out from the program that we've shown so far but obviously you know you can parse anything over here you can parse analyst opinions you can parse all of this stuff and they've got cash flow you could parse other pages and stuff and so anyway you can set up a program to do a lot of this kind of research for you so just like parsing wayback machine if anybody if there's enough requests for something that i haven't really covered fully uh as far as pulling data from yahoo finance uh if there's enough requests for it i'll just make a video on showing you how to do it i think this kind of series is pretty much wrapped up at this point there's not too much new i could show you guys as far as parsing data from a table is concerned as far as getting the historical data that's how you can do it you should be pretty much all set then you can start doing a security analysis really on the company and deciding what your value of the company is versus you know what these figures have said um so anyway um that should pretty much cover it for fundamental investing all that from here you know you can do all kinds of stuff that you you know whatever kind of stuff you want to do from here mostly we've just kind of used the computer to to help us in the research process and find eligible companies so hopefully you guys have enjoyed this series as always thank you for watching thanks for your support your subscriptions and until next time

Original Description

Fundamental Investing Playlist: http://youtu.be/fBEMfugH3OA?list=PLQVvvaa0QuDejNczz7dbpyu3JnwUBvNch This is the tenth video in the series for using programming to aid fundamental investing analysis, showing you how to use programming to finish our stock screener for basic fundamental principles. The idea is to use programming to help you find possible and eligible companies for further consideration. This entire series focuses on using programming specifically for value investing, just as an example to use throughout the video. Sentdex.com Facebook.com/sentdex Twitter.com/sentdex
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from sentdex · sentdex · 0 of 60

← Previous Next →
1 Matplotlib Python Tutorial Part 1: Basics and your first Graph!
Matplotlib Python Tutorial Part 1: Basics and your first Graph!
sentdex
2 Python Encryption Tutorial with PyCrypto
Python Encryption Tutorial with PyCrypto
sentdex
3 Python's Logging Function
Python's Logging Function
sentdex
4 wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!
wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!
sentdex
5 wxPython Tutorials 2: Making Windows GUIs with Python: Customizing Window Parameters
wxPython Tutorials 2: Making Windows GUIs with Python: Customizing Window Parameters
sentdex
6 wxPython Programming Tutorial 3: Menu Bar and Menu Button
wxPython Programming Tutorial 3: Menu Bar and Menu Button
sentdex
7 wxPython Programming Tutorial 4: Panels
wxPython Programming Tutorial 4: Panels
sentdex
8 wxPython Programming Tutorial 5: User Input Saved To Variables
wxPython Programming Tutorial 5: User Input Saved To Variables
sentdex
9 wxPython Programming Tutorial 6: Multiple Choice Input
wxPython Programming Tutorial 6: Multiple Choice Input
sentdex
10 wxPython Programming Tutorial 7: Adding Static Text and Colors
wxPython Programming Tutorial 7: Adding Static Text and Colors
sentdex
11 wxPython Programming Tutorial 8: Custom Button Images
wxPython Programming Tutorial 8: Custom Button Images
sentdex
12 wxPython Programming Tutorial 9: Tool Bar Items and Sub Menus!
wxPython Programming Tutorial 9: Tool Bar Items and Sub Menus!
sentdex
13 Basic PHP Tutorial 13: Multi-dimensional Array
Basic PHP Tutorial 13: Multi-dimensional Array
sentdex
14 Basic PHP Tutorial 15: Functions and Global Variables
Basic PHP Tutorial 15: Functions and Global Variables
sentdex
15 Basic PHP Tutorial 12: Associative Array
Basic PHP Tutorial 12: Associative Array
sentdex
16 Basic PHP Tutorial 14: Foreach loop
Basic PHP Tutorial 14: Foreach loop
sentdex
17 Basic PHP Tutorial 16: Include and Require
Basic PHP Tutorial 16: Include and Require
sentdex
18 Basic PHP Tutorial 7: Assignment, comparison and Logical operators
Basic PHP Tutorial 7: Assignment, comparison and Logical operators
sentdex
19 Basic PHP Tutorial 4: Variables and Comments
Basic PHP Tutorial 4: Variables and Comments
sentdex
20 Basic PHP Tutorial 11: Arrays part 1, basic array
Basic PHP Tutorial 11: Arrays part 1, basic array
sentdex
21 Basic PHP Tutorial 6: If else and else if conditionals cont'd
Basic PHP Tutorial 6: If else and else if conditionals cont'd
sentdex
22 Basic PHP Tutorial 1: Intro to PHP
Basic PHP Tutorial 1: Intro to PHP
sentdex
23 Basic PHP Tutorial 3: HTML with PHP
Basic PHP Tutorial 3: HTML with PHP
sentdex
24 Basic PHP Tutorial 9: While Loop
Basic PHP Tutorial 9: While Loop
sentdex
25 Basic PHP Tutorial 10: Switch Statement
Basic PHP Tutorial 10: Switch Statement
sentdex
26 Basic PHP Tutorial 2: Print and Echo
Basic PHP Tutorial 2: Print and Echo
sentdex
27 Basic PHP Tutorial 5: If else and else if conditional statements
Basic PHP Tutorial 5: If else and else if conditional statements
sentdex
28 Basic PHP Tutorial 8: Arithmatic Operators: Doing math with php
Basic PHP Tutorial 8: Arithmatic Operators: Doing math with php
sentdex
29 Basic PHP Tutorial 17: User Input Form Example / String Manipulation
Basic PHP Tutorial 17: User Input Form Example / String Manipulation
sentdex
30 Basic PHP Tutorial 18: HTML Entities and forms cont'd
Basic PHP Tutorial 18: HTML Entities and forms cont'd
sentdex
31 Basic PHP Tutorial 19: Finding words in strings
Basic PHP Tutorial 19: Finding words in strings
sentdex
32 Basic PHP Programming Tutorial 20: Saving to a File / writing and appending
Basic PHP Programming Tutorial 20: Saving to a File / writing and appending
sentdex
33 Basic PHP Programming Tutorial 22: Hashing part 2: salting
Basic PHP Programming Tutorial 22: Hashing part 2: salting
sentdex
34 Basic PHP Programming Tutorial 23: Variables in Strings and tokenizing
Basic PHP Programming Tutorial 23: Variables in Strings and tokenizing
sentdex
35 Basic PHP Programming Tutorial 21: MD5 Hashing For Security
Basic PHP Programming Tutorial 21: MD5 Hashing For Security
sentdex
36 Basic PHP Programming Tutorial 24: String similarity
Basic PHP Programming Tutorial 24: String similarity
sentdex
37 Basic PHP Programming Tutorial 25: Time and Time stamps
Basic PHP Programming Tutorial 25: Time and Time stamps
sentdex
38 Basic PHP Programming Tutorial 26: Die and Exit
Basic PHP Programming Tutorial 26: Die and Exit
sentdex
39 Basic PHP Programming Tutorial 27: MySQL Databases Part 1
Basic PHP Programming Tutorial 27: MySQL Databases Part 1
sentdex
40 Basic PHP Programming Tutorial 28: MySQL Database Part 2: Reading From Database
Basic PHP Programming Tutorial 28: MySQL Database Part 2: Reading From Database
sentdex
41 Basic PHP Programming Tutorial 29: MySQL Database Part 3: Inputting Data
Basic PHP Programming Tutorial 29: MySQL Database Part 3: Inputting Data
sentdex
42 Basic PHP Programming Tutorial 30: MySQL database in Use
Basic PHP Programming Tutorial 30: MySQL database in Use
sentdex
43 Django Tutorial Web Development with Python Part 1: Installing Django
Django Tutorial Web Development with Python Part 1: Installing Django
sentdex
44 Python Tutorial: File Deletion and Folder Deletion / directory deletion
Python Tutorial: File Deletion and Folder Deletion / directory deletion
sentdex
45 Python Tutorial: How to Rename Files and Move Files with Python
Python Tutorial: How to Rename Files and Move Files with Python
sentdex
46 3D Graphs in Matplotlib for Python: Basic 3D Line
3D Graphs in Matplotlib for Python: Basic 3D Line
sentdex
47 3D Plotting in Matplotlib for Python: 3D Scatter Plot
3D Plotting in Matplotlib for Python: 3D Scatter Plot
sentdex
48 3D Charts in Matplotlib for Python: Multiple datasets scatter plot
3D Charts in Matplotlib for Python: Multiple datasets scatter plot
sentdex
49 Sikuli Tutorial 1: Visually programming in python!
Sikuli Tutorial 1: Visually programming in python!
sentdex
50 Sikuli Tutorial 2: Program visually in python!
Sikuli Tutorial 2: Program visually in python!
sentdex
51 Sikuli Tutorial 3: Program visually in python!
Sikuli Tutorial 3: Program visually in python!
sentdex
52 3D Bar Charts in Python and Matplotlib
3D Bar Charts in Python and Matplotlib
sentdex
53 3D Plane wire frame Graph Chart in Python
3D Plane wire frame Graph Chart in Python
sentdex
54 Raspberry Pi Part 1 Introduction
Raspberry Pi Part 1 Introduction
sentdex
55 Raspberry Pi Part 8: First Download and Update! (Firmware)
Raspberry Pi Part 8: First Download and Update! (Firmware)
sentdex
56 Raspberry Pi Part 10: How to set up a Linux Web Server on your Pi
Raspberry Pi Part 10: How to set up a Linux Web Server on your Pi
sentdex
57 Raspberry Pi Part 11: Remote Desktop
Raspberry Pi Part 11: Remote Desktop
sentdex
58 Twitter Analysis: How to rank a user's influence
Twitter Analysis: How to rank a user's influence
sentdex
59 GPIO Tutorial for Pi Part 2 - Programming the GPIO
GPIO Tutorial for Pi Part 2 - Programming the GPIO
sentdex
60 GPIO Tutorial for Raspberry Pi Part 1 - Setting up
GPIO Tutorial for Raspberry Pi Part 1 - Setting up
sentdex

Related Reads

📰
Antigravity has no task queue. Meet @trigger, its real async primitive
Learn about Antigravity's async primitive @trigger and how it replaces traditional task queues in the Python SDK
Medium · Programming
📰
The AI Senior Dev Dilemma: Am I Coding or Just Prompting?
Senior devs face a dilemma in AI-driven development: are they truly coding or just prompting AI tools, and what does this mean for their skills and career?
Dev.to · Agentic Architect
📰
The Python Skills AI Still Can’t Replace in 2026
Learn the Python skills that AI still can't replace in 2026, focusing on security, architecture, and judgment
Medium · Programming
📰
The Python Skills AI Still Can’t Replace in 2026
Learn which Python skills AI still can't replace in 2026, including security, architecture, and judgment
Medium · Python
Up next
CodeAI at #ISTELive and their free lessons and learning space
Cool Cat Teacher
Watch →