An experiment – predicting the stock market

During my three weeks of vaccation, I had an interesting conversation with a company that has a bot that trades soccer bets. This inspired me to set up classifier model that tries to predict the stock market.

Seeing into the future by looking on the past

My idea is to start with something that is really simple to implement and test – predicting the stock market tomorrow based on the history. I have no particular interest in stocks and the only thing I really know is that you should buy cheaper than you sell, hence this is the only thing the classifiers know as well =)

Google Stock Chart

What’s going to happen tomorrow?


For training data I’ve used historical stock prices that are downloaded from Yahoo Finance. Then I’ve automatically created one classifier per stock (in total about 3100 classifiers) that, given the todays stock state predicts tomorrows by inferring over historical data. From the 3100 classifiers (stocks) I will pick the top X classifiers that are most confident. This is done by evaluating the training data and picking those that historically would have worked best. This is the most time consuming task takes several hours to run 10-fold-cross-validation.


As I evaluate this project I will post predictions in this blog and follow up with the accuracy when the correct answers are known.

More to come!!

2 thoughts on “An experiment – predicting the stock market”

    1. Hi Roger,

      I’ve no plans for that until it’s well tested, I guess the first step in that direction would be to completely automate it to play on virtual stocks. If these tests works well during a longer period of time it could be worth switch over to the real marked and inserting some money into the system. For now I will run some manual tests every now and then, I’ll get back to you with some predictions soon =)


Comments are closed.