How to Scrape and Parse Stock Earnings Reports

For years I looked for a simple way to get earnings reports from Wall St. It seems they would change their earning reports on a regular basis and the dates would be inconsistent. Then one day when I wasn’t paying attention, BAM. Earnings report and the stock would take off or crash on the numbers and I would be left holding the bag or missed the boat. You get the point.

It has been my experience that Yahoo Financial calendar provides the most consistent and update earning report for listed companies. (If there any better ones out there please do email or do PR for the repo.)  So now that I have found a source, how to do I make take that information and standardize and normalize it into a database. Obviously once I have that information in a database, I can use that data to purchase calls, puts or evaluate the earnings date based on a host of other information I have available to “cross reference” or analyze.

Luckily, through the power of scraping + python + github anybody can now have standardized earnings date reports and now I can scrape and standard the data and manipulate it to my needs.

In my repo I added the file earnings.py.  This is where the magic occurs..

Just a simple Mysql table to capture date, stocks, eps estimates, etc…

q = "truncate yahoo_earnings"
cursor.execute(q)

Then we have to a little “wonky” stuff with the dates that we are going to query. It seems like weather I’m in PHP or Python, I’m always getting entagled in dealing with DATE or TIME, if anybody can parse those dates better please send at PR.

#set dates
now = datetime.now()
startDate = now.strftime('%b %d %Y %I:%M%p')
print(startDate)
endDate = now + timedelta(days=60)
endDate = endDate.strftime('%b %d %Y %I:%M%p')
print(endDate)
startDate = datetime.strptime(
startDate, '%b %d %Y %I:%M%p')
endDate = datetime.strptime(
endDate, '%b %d %Y %I:%M%p')

Then as you can see from the code it’s pretty simple after that, call the function, parse the data, load it into your database or where ever you need it. Oh I forgot to mention, Make a ton of Money.

All this code can be found in my stock and options API repo, specifically with the Earnings-Scraper/earnings.py file that I’m discuss here. If you want the raw repo from wenboyu2

 

How do you get a job in algorithmic trading?

TL;DR: Looking for employment resources in Finance Programming / Trading algorithms? I’m in a rock and hard place…

I have the ability to write stock trading algorithms, portfolio trading algorithms. Also Cryptocurrencies, Options, and if need be futures and FX.

I blame the great depression for my ability to code, infact I call myself a “self taught depression coder”. Meaning that during the great recession I couldn’t find a job, so I took off my MBA in Finance on my resume and started teaching myself PHP and MySql. I also know Javascript, python, node, etc, to name a few.  So I don’t have the Computer Science Degree or Statistics PhD , but I’m right in the middle with an MBA and proven coding skills.

Currently, I’m a fully employed programmer. Why you might ask? Well because I can’t seem to walk down the street without someone trying to hire me for a programming job for the last few years. The pay is great, the risk is low and generally the stress is low. I have made lot of money programming other peoples ideas. Oddly enough, a lot of them failed, not because of me, but mostly because the ideas where not that great in the first place.  For example, a new paypal system for marijuana or a website to list trailers? Hmm… last time I checked it was free to list trailers on craigslist. Oh well, even though the money is great, there is a limit to how much you can get paid versus boredom and intellectual challenge.

So know I have slowed down any side work and only work on my algorithms at night. My day programming job is not intellectually challenging, so I have to spend my nights writing algorithms to remain intellectually stimulated. I’m also an SEC register online adviser (RIA), but I don’t have any clients as marketing is not necessarily my strong suit.

Basically, I’m looking for people or websites that might help me find a job in the area of quantitative finance / algorithm trading. Not interest at working at one of the banks, or investment firms cause I’m sure they got it all covered. But maybe a smaller shop. The only other stipulation is that I have made my home in Denver, with no desire to move to Co-Location alley (NJ,NY).

I was wondering if any can point me to a website/recruiters/firms/portfolio manager  that specialize in algorithmic trading or if there are an Adviser or RIA that would like to discuss some opportunities.

A click and show resume can be found here.   Some of my trades can be found here.