How to predict future movement of stock prices using machine learning


Download Article as PDF


For a while, I have been interested in finance and especially in algorithmic trading. I had this question over my head for some time “Can the long term investment be helped by machine learning?”. The answer seems to be yes based on many models we currently have for company evaluation, especially when it comes to evaluating intrinsic value of the company and comparing it to the market price. Benjamin Graham set a set of criteria, which are pretty much numerical and require analyst to look at couple of financial ratios. Graham criteria are hard to apply in today’s market because they are too harsh. But the question is, can we learn new criteria by using historical data?

FinMarkets

That is what I tried to do. My friend helped me to extract some historical data from Bloomberg terminal about stock prices and ratios from stocks in several indexes (S&P1000, FTSE100,S&P Europe 350, etc.). We took the data over the 3 years, starting with 2012, ending at the last quarter 2015. Then I applied some machine learning algorithms and used the past price and the financial indicators as features to predict whether the future price (1 year from the past price) will be 10% higher or not. I used a number of machine learning algorithms such as SVM, Naive Bayes, Bayesian Networks, Random Forest, Random Tree and even some ensemble learning methods. The results of this work and more detailed description can be seen on the ArXiv paper I recently published. It can be found here.

I got that in about 75% cases machine learning is able to recommend the stock that will grow according to the set criteria (in our case rise 10%). Still one stock out of four will under-perform, but 3 will perform well. I believe this is quite good performance and can be used out of the box for long term stock recommendation. However, it should be used with caution and analyst can still have a look at recommended stocks, but it can save a lot of time while choosing a stock price.

Born in Bratislava, Slovakia, lived in Belgrade, Serbia, now living in Manchester, UK, and visitng the world. Nikola is a great enthusiast of AI, natural language processing, machine learning, web application security, open source, mobile and web technologies. Looking forward to create future. Nikola has done PhD in natural language processing and machine learning at the University of Manchester where he worked for 2 years. In 2020, Nikola moved to Berlin and works in Bayer Pharma R&D as a computational scientist.

Leave a Reply

Your email address will not be published. Required fields are marked *