Machine Learning in Stock Price Trend Forecasting



Similar documents
ALGORITHMIC TRADING USING MACHINE LEARNING TECH-

How can we discover stocks that will

Hong Kong Stock Index Forecasting

Pattern Recognition and Prediction in Equity Market

JetBlue Airways Stock Price Analysis and Prediction

Stock Market Forecasting Using Machine Learning Algorithms

Recognizing Informed Option Trading

CHAPTER 11: THE EFFICIENT MARKET HYPOTHESIS

Strategies for Trading Inverse Volatility

Class 2: Buying Stock & Intro to Charting. Buying Stock

Chapter 5. Risk and Return. Copyright 2009 Pearson Prentice Hall. All rights reserved.

UNUSUAL VOLUME SYSTEM

ETF Evolution: The Innovation of Exchange-Traded Funds

Due to the development of financial. Performance of Stock Market Prediction. Lai, Ping-fu (Brian) Wong Chung Hang

BINARY OPTION TRADING. Lesson #1

ACTIVITY 4.1 READING A STOCK TABLE

Knowledge Discovery in Stock Market Data

Please note trading advice and risk statement on pages three and four

HIGH DIVIDEND STOCKS IN RISING INTEREST RATE ENVIRONMENTS. September 2015

How To Predict Call Option Prices Using Regression Models

Summary of Interview Questions. 1. Does it matter if a company uses forwards, futures or other derivatives when hedging FX risk?

The Logic Of Pivot Trading

The Vega Trap: How Option Volatility Can Make or Break Your Directional Option Trades. Dan Passarelli. Market Taker Mentoring LLC. MarketTaker.

How to Screen for Winning Stocks

Financial Market Efficiency and Its Implications

Factoring In Value and Momentum in the US Market

An Introduction to Modeling Stock Price Returns With a View Towards Option Pricing

Chapter 2.2. Company Fundamentals

Equity forecast: Predicting long term stock price movement using machine learning

COMPARATIVE ANALYSIS BETWEEN THE FUNDAMENTAL AND TECHNICAL ANALYSIS OF STOCKS

Sentiment Analysis of Twitter Feeds for the Prediction of Stock Market Movement

Whether you re new to trading or an experienced investor, listed stock

How Wall Street Works Nightly Business Report

ECON4510 Finance Theory Lecture 7

Alpha - the most abused term in Finance. Jason MacQueen Alpha Strategies & R-Squared Ltd

Implementing Point and Figure RS Signals

Introduction To Financial Markets & Investing

S&P 500 Low Volatility Index

Factors Influencing Price/Earnings Multiple

Best Styles: Harvesting Risk Premium in Equity Investing

Review for Exam 2. Instructions: Please read carefully

Perspective. Economic and Market. The U.S. Stock Market Resides at a Unique Global Zip Code. U.S. stock market diverges

IMPORTANT RISK DISCLOSURE

Index Options Beginners Tutorial

Saving and Investing 101 Preparing for the Stock Market Game. Blue Chips vs. Penny Stocks

DOES BLACK FRIDAY STILL MATTER?

In the wake of the 2014 half-year reporting season, the fundamentals of the Australian stock market are lining up to support quality and growth.

Stock Index Futures Spread Trading

Club. The role of Core Asset Managers in the Global Economy February Introduction. Content: Yves Choueifaty, 300 Club

WINNING STOCK & OPTION STRATEGIES

Chapter 2.3. Technical Analysis: Technical Indicators

JUST SIT BACK AND LET THE GIRTH MODEL MAKE MONEY FOR YOU. Elham Negahdary

Review of VantagePoint 8.6 Release

Using the Bloomberg terminal for data

Flexible Neural Trees Ensemble for Stock Index Modeling

Investing with PredictWallStreet Data September 2013 Update

Sample Leveraged Trades Discussion

Managed Futures Counter-Trend vs. Trend Following. Executive Briefing

A Fidelity Investments Webinar Series: Basics of Stock Investing

Market Efficiency: Definitions and Tests. Aswath Damodaran

CAPTURING THE ALPHA IN STOCK BUYBACKS

YOUR VOTE IS IMPORTANT! VOTE THE WHITE PROXY CARD TODAY FOR THE AMALGAMATION AGREEMENT BETWEEN PARTNERRE AND AXIS CAPITAL

VALUING BANKING STOCKS

The Equity Evaluations In. Standard & Poor s. Stock Reports

Study on the Volatility Smile of EUR/USD Currency Options and Trading Strategies

on share price performance

Getting Started with Recognia Technical Insight

April 27, Dear Client:

Lecture 15: Final Topics on CAPM

Financial Analysis Project. Apple Inc.

Mutual Fund Investing Exam Study Guide

Complete Overview. The Value Line Selection & Opinion

Introduction to. A Wealth Protection Strategy

Chapter 4.1. Market Rotations

Ignite 2015 Opening Session

Lecture 3: Linear methods for classification

Chapter 14 Capital Structure in a Perfect Market

Using The Stock Market Game (SMG)

Integrated Company Analysis

How To Use Multiple Time Frames For Setups. by Chris Vermeulen

How To Outperform The High Yield Index

The Lam Group Newsletter Vol. 2, No. 1 First Quarter 2002

Example: Credit card default, we may be more interested in predicting the probabilty of a default than classifying individuals as default or not.

Long-term Stock Market Forecasting using Gaussian Processes

Chapter 4.1. Intermarket Relationships

Beating the NCAA Football Point Spread

ETF Total Cost Analysis in Action

Presentation - March, Jeff Hooke Managing Director, Focus Securities

Option pricing. Module 3

Introduction... 4 A look at Binary Options Who Trades Binary Options? Binary Option Brokers... 5 Individual Investors...

THE U.S. INFRASTRUCTURE EFFECT INTERVIEW BY CAROL CAMERON

Trade for Big Profits: The Top Stock Methodology

STock prices on electronic exchanges are determined at each tick by a matching algorithm which matches buyers with

Need a clue to short-term market direction? The premium between the Standard & Poor's 500 futures

Practice Set #4 and Solutions.

Risk and return (1) Class 9 Financial Management,

ALPS Equal Sector Factor Series ALPS SECTOR LEADERS ETF

Implied Volatility Skews in the Foreign Exchange Market. Empirical Evidence from JPY and GBP:

Applying Machine Learning to Stock Market Trading Bryce Taylor

Employer Health Insurance Premium Prediction Elliott Lui

Transcription:

Machine Learning in Stock Price Trend Forecasting Yuqing Dai, Yuning Zhang yuqingd@stanford.edu, zyn@stanford.edu I. INTRODUCTION Predicting the stock price trend by interpreting the seemly chaotic market data has always been an attractive topic to both investors and researchers. Among those popular methods that have been employed, Machine Learning techniques are very popular due to the capacity of identifying stock trend from massive amounts of data that capture the underlying stock price dynamics. In this project, we applied supervised learning methods to stock price trend forecasting. According to market efficiency theory, US stock market is semi-strong efficient market, which means all public information is calculated into a stock's current share price, meaning that neither fundamental nor technical analysis can be used to achieve superior gains in a short-term (a day or a week). Indeed, our initial next-day predication has very low accuracy around 50%. However, as we tried to predict long-term stock price trend, our models achieved a high accuracy (79%). Based on our prediction result, we built a trading strategy on the stock, which significantly outran the stock performance itself. II. IMPLEMETATION A. Data Collection The training data used in our project were collected from Bloomberg Database. In this project, we picked 3M Stock to apply our method. The data contains daily stock information ranging from 1/9/2008 to 11/8/2013 (1471 data points). There are 16 features that we can use to apply our learning theory. In addition, we used the daily labeling as follows: label "1" if the closing price is higher than that of the previous day. Otherwise label "-1". For example, if the closing price of stock A on 11/11/2013 is higher than that on 11/10/2013, and on 11/10/2013, the PE ratio, PX volume, PX ebitda,...,s&p 500 index are X 1, X 2,...,X 15, so the training data of A on 11/10/2013 is (X, Y), where X = (X 1, X 2,...,X 15 ) T, Y = (+1) Stock Features 3M Co (NYSE: MMM) PE ratio, PX volume, PX ebitda, current enterprise value, 2-day

net price change, 10-day volatility, 50-day moving average, 10-day moving average, quick ratio, alpha overridable, alpha for beta pm, beta raw overridable, risk premium, IS EPS, and corresponding S&P 500 index Data Source Bloomberg Data Terminal B. Model Selection 1. Next-Day Model In our project, we mainly applied supervised learning theories, i.e. Logistic Regression, Gaussian Discriminant Analysis, Quadratic Discriminant Analysis, and SVM. The most important result that we should watch closely is the accuracy of prediction, which we define as follows: Accuracy the number of days that model correctly classified the testing data = total number of testing days We used 70% of the data sets as training data and tested our fitted models with the remaining 30% data sets. Model Logistic Regression GDA QDA SVM Accuracy 44.5% 46.4% 58.2% 55.2% It turned out that the next-day prediction has a very low accuracy with the highest accuracy (QDA) being only 58.2%. We know that by flipping a coin we can probably get an accuracy of roughly 50% since the investing decision is binomial. Such result can be explained by the semi-strong efficient market theory, which states that all public information is calculated into a stock's current share price, meaning that neither fundamental nor technical analysis can be used to achieve superior gains. 2. Long-Term Model Although our next-day prediction isn t very positive, we believe the financial data of a particular stock can still provide some insights for the stock s future movement. After all, that why so many financial institutions/individual investors believe their work is meaningful. Especially, we think sometimes because of the existence of market sentiment, some information will not be reflected in the stock price immediately. Besides, in the eyes of investors, we also care about the predictions results of longer term to design our long-term investment strategy.

Here, we define our problem as predicting the sign of difference between tomorrow s stock price and that of certain days ago. Again, we used 70% of the data set as training data and tested our fitted models with the remaining 30% data sets. 0.9 0.8 0.7 Long- Term Pedic8on Accuracy Acuuracy 0.6 0.5 0.4 0.3 Accu_GDA Accu_Logis8cs Reg. Accu_SVM Accu_QDA 0.2 0 10 20 30 40 50 60 Time Window (days) From the chart, we can see that for SVM and QDA model, the accuracy increases when the time window increases. Furthermore, SVM gives the highest accuracy when the time window is 44 days (79.3%). It s also the most stable model. C. Feature Selection 80.00% 75.00% Feature Selec8on Accuracy 70.00% 65.00% 60.00% 55.00% 50.00% 0 2 4 6 8 10 12 14 16 Number of Features From the chart established by backward stepwise feature selection, we can see that when we used all of the 16 features, we get our highest prediction accuracy. It makes sense because with over 1400 data points but only 16 features, there s no need to reduce

the number of features. III. TRADING STRATEGY A. Predictor Characteristics From the previous analysis, we have already determined that the best predicting model for 3M stock is SVM model. Here we use SVM as our predictor in order to develop our trading strategy. Predictor Kernel SVM Polynomial Number of Features 16 Time Window 44 days B. Strategy Implementation Initially, we used 990 of our 1470 data points to fit our model. Then we used our model to predict the stock price and made according investment decision on an on-time basis, meaning we will take in new information and update our predictor every trading date. Our back-testing of the strategy is over the course of December 2011 to October 2013. On each day of the beginning 44 days, we will make a decision whether to buy the stock or not based on our prediction of whether the stock price would go up after 44 days. After the first 44 days, on each day we will make an investment decision again. It s better illustrated in the following decision tree: Predic8on Increase Decrease Buy if not Hold if already Do nothing if not Sell if already Equivalently, we can interpret the strategy as if there are 44 traders. Trader i is responsible for trading his portfolio on i, 44+i,, 44n + i, day. Traders are independent to each other.

P&L Comparison Price Level 140 130 120 110 100 90 80 70 60 7/18/11 2/3/12 8/21/12 3/9/13 Dates 3M Stock Performance Our Strategy From the plot above, it s obvious that our strategy has outrun the performance of the stock, with an annualized return 19.3% vs. 12.5%. IV. CONCLUSION In this project, we applied supervised learning techniques in predicting the stock price trend of a single stock. Our finds can be summarized into three aspects: 1. Various supervised learning models have been used for the prediction and we found that SVM model can provide the highest predicting accuracy (79%), as we predict the stock price trend in a long-term basis (44 days). 2. Our feature selection analysis indicates that when use all of the 16 features, we will get the highest accuracy. That s because the number of data points is much bigger than that of the features. 3. The trading strategy based on our prediction achieves very positive results by significantly outrunning the stock performance. As for our future work, we believe we can make the following improvements: 1. Test our predictor on different stocks to see its robustness. Try to develop a more general predictor for the stock market. 2. Construct a portfolio of multiple stocks in order to diversify the risk. Take transaction cost into account when evaluating strategy s effectiveness