Financial market prediction: BSc thesis
My first results predicted the stock market. Too well.

The problem with having so many ideas per second is that, when you’re asked to pick one to research, your mind goes blank.
I spent months stressed about what to do my thesis on. I only considered building something new, which is what I was used to, and at no point did I think about research, something that had always appealed to me and that I had never got into. I also wasn’t sure whether I wanted cybersecurity or AI, which fascinates me and was the perfect chance to go deeper.
Until, talking with my supervisor, he suddenly mentioned the stock market.
I have been investing since I was eighteen and it had never occurred to me that the thesis could be about that. A light bulb went on. Why not research those algorithms that claim to predict the market? How they work, how good they are, and whether something new could be added to see if they really improve.
As an investor I know very well that what moves a stock isn’t the patterns you can spot in a rise or a fall. What moves it is people’s sentiment. When the big whales, the ones who move the big money, are scared or know something others don’t, they sell. The market drops first because of that sale and then out of fear. Fear of losing more. And when it rises the same thing happens, in reverse.
So I asked myself: if today’s algorithms analyse patterns to guess what happens next, why not also give them aggregate sentiment, what people and analysts are saying?
I knew it was complicated. Published information is already available to everyone, and the big buys and sells happen before it comes out. Besides, some things are impossible to predict: if a company’s CEO dies tomorrow its shares will fall, however optimistic yesterday’s news about results, sales or new products was. Even so, I wanted to know whether adding that information made any difference. And whether it made the same difference for any model or depended on the algorithm and the neural network.
Because in the end what matters isn’t knowing what price the market will close at, but whether it will finish above or below where it started. That is what makes you win or lose money.
I got to work. I compared statistical, machine learning and deep learning models on Bitcoin, Tesla and Nvidia, across several time horizons, with and without news sentiment. And above all I ran a lot of statistical tests, which are the most important and most solid part of the study: they are what make it possible to show that what I’m saying holds.
The first results were fantastic. The models were right far more than 50% of the time, and that could only mean one thing: that soon someone would want to get rid of me, because I had found the key to the world, the secret to making money.
Obviously, that was impossible. I repeated the tests until I realised there was an information leak: I was mixing the models’ training with data from the future. That is where I discovered walk-forward validation, which means training only on what was known up to each point and predicting what comes next, never learning from data that didn’t exist yet.
With that fixed I reached the real conclusion. No, we are not better than the wolf of Wall Street. Nor than the thousands of professional analysts who have spent years looking for the key.
It was a fascinating study and it motivated me enormously, because it helped me understand what happens to my money when I invest. And to truly understand the efficient market hypothesis, which basically says the price already includes the information you have just read. If you think a company is going to post good results because you saw it in the news, the market is already pricing in that probability. Knowing it doesn’t make you privileged.
I got a 10 for how robust the study was. Although I noticed the committee’s disappointment on realising they weren’t going to get rich with me.
Technical summary
My Computer Engineering thesis, graded 10/10. I compared statistical, machine learning and deep learning models for predicting price direction in Bitcoin, Tesla and Nvidia. I also tested whether news sentiment from GDELT improved the predictions.