Image for post
Image for post
Photo by Austin Distel on Unsplash

For an investor making investment decisions based on the underlying fundamentals of a company, i.e. fundamental analysis, finding companies to buy can be a daunting task. With ~3,600 publically listed companies in the United States alone, it can be nearly impossible to get a shortlist of companies to begin doing fundamental analysis on. Thankfully, many brokerages offer stock screeners to help mitigate this issue but, even then, you can end up with way too many companies to look through and many stock screeners lack some important criteria.

In this post, I will introduce a simple way to pre-screen the market based on market sectors by comparing the price of an overall sector to the S&P 500. The stocks in the S&P 500 index are said to represent about 82% of the total U.S. equity market value. Because of this, this post makes the assumption that, in general, all sectors should trade more or less together and, if there is a divergence it means that a sector has fallen out of favor and has been discounted by the market. For example, the retail sector was taking a beating before the 2020 Coronavirus Pandemic due to the rise in e-commerce sales. Many companies in the sector however were still healthy, growing, and stable but were sold off anyway as the sector took a hit. Finding this divergence can be the first step in finding these undervalued companies. …


Every mission-critical system can use levels of redundancy to ensure everything is operating as expected. This post outlines one level of redundancy built into my stock data API. The ideas here can be expanded to any mission-critical system with similar hazards.

Image for post
Image for post
Photo by Lars Kienle on Unsplash

In a previous post, I wrote about an API I have created to retrieve data for stocks belonging to the Russell 2000 and S&P 500 indexes. One glaringly obvious issue with the data-gathering techniques discussed in that post is that the process relies on the system currently running the Python script to be running and connected to the internet to fetch the data. This shouldn’t be an issue most of the time. The script currently runs on a Raspberry Pi Model 3 that should have no issues running for long periods of time. However, you can’t be too careful, especially in situations like this where a loss of connectivity for even a few minutes can cause problems in the application (e.g. …


Image for post
Image for post
Photo by Florian Krumm on Unsplash

For quite some time I’ve been wanting to build a home server to safely (and redundantly) store files, host video game servers, and handle various tasks I’ve written about in previous posts (e.g. host discord bots, run algorithmic P2P trading bots, and gather data for my stock information database). To handle these tasks I currently use my primary machine (which I use for work, writing, and programming) and a collection of Raspberry Pi 3’s and 4’s that I have accrued over time. This setup has worked fine so far, but, while adding another SSD to my system that I planned on installing another Linux distro on, I broke the SATA connector on the HDD that I use for file backup. This HDD is used to store family photos and old documents from the various PC’s that I’ve built in the past. …


Image for post
Image for post
Photo by Markus Spiske on Unsplash

NOTE: because I live in Montana (and was too lazy to deal with time zones) the data stored in this database (therefore, the dates and times passed to the API endpoints) are recorded in Mountain Standard Time (Denver, CO’s time zone). I apologize in advance for forcing the conversion and inconvenience onto the user.

Typically it’s difficult to get high fidelity stock price and volume data via API. Most of the time the stock data services offer daily, weekly, monthly, and/or annual information for stocks. For example, in a previous post, I created a wrapper around the Yahoo Finance data download functionality to create an API that downloads daily, weekly, and monthly data. For some applications more granular data, such as one-, three-, and five-minute intervals, is useful, e.g. …


Image for post
Image for post
Photo by Markus Winkler on Unsplash

In a recent post, I wrote about using Monte Carlo simulations to determine the likelihood of a stock option being profitable by generating multiple paths using Geometric Brownian Motion (GBM) and computing some statistics of these paths. This project can be found on my personal project website. Shortly after finishing that project, I was watching a YouTube video from The Plain Bagel, about volatility in the stock market. …


Historical stock data is useful for a variety of applications. Probably the most popular is the attempt to identify trends in the data and to profit off of exploiting them. Another good purpose for the data is to test complex time-series analysis prediction algorithms as the data is nonstationary, sometimes seasonal, and is subject to random shocks as new data is absorbed into the stock price. C++ is a popular programming language most known for its speed but often disliked for its complexity. …


Disclaimer: This project/post is for fun/education please don’t use the results of this project to make investment decisions. If you chose to ignore this disclaimer and do just that I am not responsible for the (very probable) large losses that may occur.

Image for post
Image for post
Photo by M. B. M. on Unsplash

A stochastic process, S, is said to follow Geometric Brownian Motion (GBM) if it satisfies the stochastic differential equation


This project’s GitHub can be found here.

Quick-Nav: Introduction, Implementation, Installation, Examples, Future Work

Image for post
Image for post
Photo by Mika Baumeister on Unsplash

Introduction

For statistical programming languages or languages with good statistics processing libraries, the DataFrame is an essential structure. Most features of these languages and libraries (e.g. the R programming language or the Pandas package for Python), revolve around the DataFrame object which provides useful functionality for working with datasets. There has been a big push to incorporate this type of structure in C++ with a few open-source libraries on GitHub, especially the xtensor project which works to imitate NumPy tensors.

Although I’m sure these libraries are great, for the sake of learning by doing, I decided to create my own implementation of a data storage object in C++ to efficiently handle datasets. Initially, this functionality was part of a library I was creating (also for the sake of learning by doing) called YALL ( Yet Another Learning L ibrary) [the name was thought up independently but it’s not very original]. However, I found this functionality useful and, since it really can be a standalone project, decided to pull it out of YALL and put it in its own repository. …


Image for post
Image for post
Photo by Fabrizio Chiagano on Unsplash

After graduating with my undergraduate degrees in 2015 I began working as a software engineer. Now, software engineering is typically a pretty lucrative field. However, I choose to stay close to home (Montana) and took a position as a developer in North Dakota. The salary and benefits package were good, but not quite at the top of the industry. So, being a fresh graduate, weighed down with a lot of student loans and a small amount of credit card debt, I began looking for ways to make extra money outside of my working hours.

I didn’t want to get a second job since I already devoted most of my time to work. Also, as mentioned above, I was just released into the wild; I didn’t have a ton of capital to jump into real estate investing or other high startup cost revenue streams. Fortunately, after browsing business classifieds for a few months one opportunity caught my eye. Someone was selling 12 vending machines, most of them currently placed, for $100 each. These turned out to be pretty nice machines with the retail value for new units being in the hundreds. They were similar to these but not quite the same (pictured below). Everything on them was metal and well-built, unlike other cheaper plastic machines that are often used. The only problem I had was that I didn’t have $1,200, but I did have ~$500 that I could commit to the enterprise. …


What is Time Series Forecasting

Image for post
Image for post
Photo by M. B. M. on Unsplash

A time series is a collection of observations made sequentially through time, e.g. the value of a company’s stock. Time series forecasting is the practice of making predictions based on a time series. That is, if we’re given some time series data,

About

Anthony Morast

I am a professional software engineer and an amateur mathematician. My main interests are programming, machine learning, fluid dynamics, and a few others.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store