About turning interest in the stock exchange into a home project

TL; DR: I decided to create an automated email newsletter designed to monitor the stock market, giving information about the S&P 500, Nasdaq and Dow Jones indexes during the premarket session and in a historical perspective.

The other day I read this tweet from Jason Frede, the founder of Basecamp . It said that the company was working on a new Hey email application . It made me think. Checking my inbox is one of my first morning things. Quickly looking through the mail, I learn about whether there is something important among the letters, and about what I need to pay attention to. I read the news and take the time to keep my inbox clean. Email is my central everyday tool.





I like to subscribe to newsletters. Mostly technical, like Techmeme , Ruby Weekly , Hacker News , Node Weekly . I am also subscribed to the WSJ , Morning Brew and NYT news . I constantly subscribe to many mailings, but I am very demanding of what gets into my inbox, so I unsubscribe from those mailings that I don’t read.

E-mail has a bad reputation. Spam gets into mailboxes; mess is easy to get into Inbox. But I, in spite of this, always rejoice in receiving a well-written letter. I am pleased that the senders of such a letter took the time to write something worthwhile. And besides, they also beautifully designed their message, trying to make it look good in dozens of different email clients, each of which displays the markup of the letter in its own way.

I, sitting at home, self-insulated, and having some free time at the same time, began to think about how to make some kind of my own project. He had to meet the following requirements:

  • It should be something that I can complete in a maximum of a week.
  • Any third-party services I use should be free or freemium services.
  • The project should have been fully automated. Once it works, manual intervention in it is not required.
  • This project should bring me some benefit.

It was bitter to look at the March market decline. The stock market was so volatile that it was difficult to track its ups and downs. In general, I wanted to create something related to exchanges.

There are many portals to monitor the market, such as the resource finviz.com , which gives a lot of information in real time. There are many specialized sites. What can I say, it’s enough to enter the stock exchange code of the instrument in Google, and the search engine will give information about its value and show a graph.

When you read financial news or listen to a podcast on this topic, they always report the situation when opening and closing the market. They say, for example, that the NASDAQ Composite stock index fell by 300 points, up to 7,500 points. Someone from the financial sector, or someone who is well versed in the markets, such data will come in handy. And I was only interested in how many percent a certain instrument gained or lost over a certain period. For example - for a day, for a week, for six months. Thanks to such information, I can find out in which direction the market is moving, I can see the trend.

Something else that I learned a while ago is related to futures transactions, to what is called a “premarket”. Data about the premarket session provide, before the market opens, valuable information about the market trend.

So, if you go back to Jason Freud’s email and tweet, it so happened that I decided to do a newsletter with information about the stock markets and with the data that interested me. Namely, we are talking about the following:

  • Premarket data for major indices - S&P 500, Nasdaq and Dow Jones.
  • Historical index data, expressed as a percentage.

I wanted the newsletter to go out every weekday before the market opens. This would allow me to get enough information to decide whether to closely monitor the market on this day and whether to act.

Given all this, I started some research, trying to figure out what I need in order to create such a newsletter.

Here is what I needed to find and do in order to make my idea a reality:

  1. API .
  2. API, .
  3. , API.
  4. .
  5. , .
  6. .
  7. -, .
  8. , .
  9. .

The first couple of days I spent registering on financial and email sites and experimenting with the corresponding APIs. As a result, I found the Sendgrid freemium mail service . And I decided to take market data, referring to the undocumented API Alpha Vantage Yahoo Finance.

The amazing thing is how much work is needed to make even something very simple. In addition to writing code , which is very interesting, I needed to solve a bunch of boring administrative tasks. Among them are the following:

  • Selection of the name of the project.
  • Buying and setting up a domain.
  • Creating and redirecting an address, like markets@bullish.email.
  • Validation of the address and domain on Sendgrid.
  • Set up Google Analytics and the Google Search Console.
  • Creation of accounts on Gravatar and on Google so that the letter would have a profile picture.
  • Configuring DNS pointing to GitHub for hosting the site.

Probably, the selection of the name of the project and the search for an affordable domain take the most time in my home projects. And this is the first thing I do, although it contradicts the opinions of other people. I like to experiment with names and find exactly what I need. When I succeed, it makes me terribly happy, and I find the right positive attitude for working on the project.

Here are the names I looked at:

  • Buy high sell low
  • Buy the dip
  • Bull or bear
  • Mr. Market

The name that I felt was the best fit for the project was Bullish ▲. I think the point here is that it is connected with the end of the longest bull market in the US in history. I found a great domain, for only $ 3.88. So the project was born https://bullish.email .


Do you know where the promo banner is made? At Google Slides

Modern technology has at least one nice thing: almost everyone offers free versions of their products. For example, you can use the services of a certain cloud provider for free and almost forever - until you exceed the limits of the free offer. You can publish a site on GitHub for free, you can use SSL for free, and much more. This is just great.

But back to the project. I put together all its parts. Spent a ton of time writing letters in Sendgrid. Then he wrote clumsy code to make sure that everything works as it should. Then he rewrote it as it should. As a result, I got a working version of the project that met my standards.

The last task that I had to solve was planning to run the code, preparing and calling Sendgrid to send letters in the morning. At first I thought about serverless code execution. But then I realized that I had a Raspberry Pi lying around somewhere . Why not take this thing?

As a result, I set up the Raspberry Pi so that every day, around 9 a.m. EST, 30 minutes before the market opened, the corresponding cron task would be executed. I also took advantage of a small nice program, Cronhub, which can monitor cron tasks and send notifications in case the task does not start. That's all. I spent a little more than a week on the project, and as a result, in addition to the site and the newsletter, I got that pleasant feeling when my next project got from an idea to a working system.


This is what the letter looks like. If you are

interested, you can download the project repository and try it on our VPS .

Dear readers! Do you have any home projects like the one the author of this material did?


All Articles