Machine Learning Engineer Nanodegree
Gil Akos April 7th, 2017
Deep Learning Stock Value Predictor
Investment firms, hedge funds, and automated trading systems have used programming and advanced modeling to interact with and profit from the stock market since computerization of the exchanges in the 1970s1. Whether by means of better analysis, signal identification, or automating the frequency of trades, the goal has been to leverage technology in order create investment systems that outperform alternatives - either service providers (competitors like alternative hedge funds) or products/benchmarks (ETFs or the S&P 500).
Today, the most promising and adcendant technology, Deep Learning, is the target of incorporation into advanced investment systems2 offered by "Artificially Intelligent Hedge Funds"3 and "Deep Investing"4 as-a-service startups, with claims of outperformance of the S&P 500 Index of up to 87%4. Given profit opportunity that large, can a basic Deep Learning model built with publicly available technology achieve positive predictive performance? Even an order of magnitude less of an advantage (8.7%) over the noise in the market and a baseline of the S&P ETF (SPY) could be valuable for an amateur investor!
This project seeks to utilize Deep Learning models, specifically Recurrant Neural Nets (RNNs), to predict stock prices. Much academic work has been developed using this technique5, as well as similar studies using Boltzmann machines6 for both momentum trading strategies and time series prediction. As discussed above and in the below articles from sources ranging from technology magazines (Wired3) to the standard bearer for market information (Financial Times2), these models are also being applied to real world trading platforms7. In this study, I will use Keras8 to build a RNN to predict stock prices using historical closing price and trading volume and visualize both the predicted price values over time and the optimal parameters for the model.
Project assets are organized as follows:
- Development (python notebooks)
Project Assets (exports per study)
Sequence of Project Studies
- Study 00 // Data Exploration // Gathering and Analyzing Stock Data
- Study 01 // Benchmark Model // Linear Regression with Sci-kit Learn
- Study 02 // Benchmark Model // Polynomial Regression with Sci-kit Learn
- Study 03 // Deep Learning Model // Multi-Layer Perceptron with Keras and Tensorflow
- Study 04 // Deep Learning Model // Long Short-term Memory “LSTM” with Keras and Tensorflow
- Study 05 // Deep Learning Model // LSTM with Variable “Lookback” Dataset (Adjusted Close)
- Study 06 // Deep Learning Model // LSTM with Variable “Lookback” Dataset (Trading Volume)
- Study 07 // Deep Learning Model // LSTM with two “Stacked” LSTM Layers (Adjusted Close)
- Study 08 // Deep Learning Model // LSTM with two “Merged” LSTM Branches (Adjusted Close + Volume)
- Study 09 // Deep Learning Model // LSTM with two “Merged” LSTM Branches with “Zero” Padding Datasets (Adjusted Close + Trading Volume)
- Study 10 // Deep Learning Model // LSTM with two “Merged” LSTM Branches with “i” Padding Datasets (Adjusted Close + Trading Volume)
- Study 11 // Deep Learning Model // LSTM with two “Merged” LSTM Branches (Adjusted Close + SPY Adjusted Close)
- Study 12 // Deep Learning Model // Final LSTM with Tuned Dataset (Adjusted Close) and Parameters
- Study 13 // Deep Learning Model // Final LSTM with Tuned Dataset (Adjusted Close) and Parameters using four previously unused tickers
- Bloomberg // History of Algorithmic Trading Shows Promise and Perils
- Financial Times // Money managers seek AI’s ‘deep learning’
- Wired // The Rise of the Artificially Intelligent Hedge Fund
- Stocks Neural Net // About
- Deep Learning for Time Series Modeling
- Applying Deep Learning to Enhance Momentum Trading Strategies in Stocks
- MIT Technology Review // Will AI-Powered Hedge Funds Outsmart the Market?
- Keras // Deep Learning library for Theano and TensorFlow