Automated Day Trading using Multivariate Time Series

The Problem:

The rise in low-cost trading brokerages, such as Robinhood, has expanded the number of casual traders who are trying to guess the market to make a quick buck. The movement of stock prices are notoriously erratic, driven by very large investors and high-frequency trading algorithms. These algorithms, while effective, are extremely costly to build and run. There exists a large gap in functionality between high-frequency algorithms and the casual trader making a few trades each week with very little data literacy or visibility.

 

The Data:

Stock ticker information is available for free from a number of API's, including Yahoo Finance. Typically this data is free to access at a low frequency, such as one minute to one day. Additionally commodities and other economic indicators can be easily found from free public sources.

 

The Solution:

We built an end-to-end solution that served as a light-weight middle ground for algorithmic trading. The pipeline runs once per day, soon after the market closes, and gathers the full history for each stock in the S&P 500. It then extracts a number of carefully engineered features, then trains a new multivariate LSTM model to predict the daily returns of each stock. The pipeline then builds a recommended balanced portfolio out of the stocks with the highest predicted returns. It then compares the suggested portfolio to the existing portfolio balance, and buys or sells accordingly in after-hours trading. The entire pipeline was designed to be low-cost and light-weight. It is deployed as an AWS Lambda function, which runs daily in approximately 5 minutes. 

 

The Impact:

This parsimonious solution democratizes algorithmic day trading for a casual user. An interested party can tune their level of risk, tie in a brokerage account, and let the model trade for them each day. Because of the light-weight solution, the model runs in the cloud costing only a few dollars each month. In extensive back testing, the model outperformed the S&P500 by over 20% in 2021.