Photo by Tolga Ulkan on Unsplash

In a previous post, I wrote about a genetic algorithm (GA) whose goal is to find stocks that could potentially create a promising put-selling portfolio. Currently, the GA searches through stocks that offer weekly options and tries to build a portfolio with three objectives:

  1. Maximize the premium earned when selling the options
  2. Minimize the risk, which in this case is stock price volatility
  3. Build a portfolio for which the user has enough cash collateral to actually trade

Although I don’t use the algorithm’s results directly to sell puts, it has become an interesting resource for providing ideas on which stocks…


Photo by Autumn Mott Rodeheaver on Unsplash

Some years ago my wife bought me a few (6) Raspberry Pi 3 B+ single board computers for Christmas so that I could experiment with creating and managing clusters of computers (it’s what I’d asked for). Since then, I’ve discovered better ways to do high-performance computing with a few higher-end PCs that I use regularly. Thus, my Raspberry Pi cluster largely sits dormant performing only a few small tasks (primarily gathering data for my stock price API and acting as an SSH access point for my home network). Before this, I had used the Raspberry Pis for many tasks and…


In a previous post, I wrote about finding undervalued sectors in the stock market by determining the divergence of the sector from some representation of the market itself. This post was intended to be a starting point for an investor to determine which sectors (or which stocks belonging to a sector) might warrant a closer look. If you primarily invest in ETFs this is a pretty useful tool as you could invest in an ETF representing the sector if further research deemed that the sector is worthwhile of investment. …


Real estate is an imperishable asset, ever increasing in value. It is the most solid security that human ingenuity has devised. It is the basis of all security and about the only indestructible security.

— Russell Sage

Photo by Sieuwert Otterloo on Unsplash

Buy and hold real estate investing can be very satisfying and, oftentimes, very lucrative. In his book, One Up on Wall Street, even legendary stock picker Peter Lynch recommends buying a home before picking individual stocks in the stock market due to its investment potential (although some of his message comes off slightly sarcastic). Unlike with stocks and bonds purchasing real estate allows…


Photo by Mae Mu on Unsplash

The wheel is a loss-limited option selling strategy that is very effective at generating income in a portfolio. Typically when trading the wheel, stocks with weekly options are preferred since they fetch higher premiums (percentage-wise) than monthly options or LEAPS. However, due to the high number of stocks on US stock exchanges offering weekly options and the differences in volatility and price, it’s challenging to find an optimal set of stocks to sell puts against that will maximize your collateral usage and income while minimizing the risk taken due to volatility.

Optimization problems like this, wherein some variables are maximized…


Photo by Vlado Paunovic on Unsplash

Deviating from my usual content, in this post I’m going to provide some necessary knowledge for working with a combinatorial object known as a Latin square. These objects were the centerpiece of my (IMO poorly written) undergraduate thesis and are one focal point of research that I continue to this day, development of this research can be seen on its GitHub page. This post can be considered a primer for understanding other posts pertaining to the research I’m doing with these objects which is largely computational and, at this time, includes developing more efficient algorithms and computing paradigms for generating…


Photo by Markus Winkler on Unsplash

Ensemble learning is a process used in deep learning wherein multiple models, or experts or classifiers, are combined in an ensemble to improve forecasting results. Each individual model in the ensemble, once trained, produces a prediction on an unseen data point. These predictions are then aggregated in some way. For regression problems, the aggregation is typically the arithmetic mean, while the mode of the predictions is usually used for classification problems, i.e. the most predicted class. The quintessential example of an ensemble model is the random forest. …


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…


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.

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…


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…

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