Monday, 21 March 2016

Machine Learning for Finance

I've long been a fan of machine learning, and actually this is how I started off with my study into computational trading - back in the day looking at neural network solutions for trading algorithms. I quickly learnt that it was not an easy area to apply this technology, and at that time I was hand-coding all the algorithms myself. I decided that I need to know more about trading in general, before trying to apply raw computational power - I needed more knowledge of the domain area.

I recently decided to take up machine learning again, this time using Python programming language. Python has rapidly become a key programming language in the area of computational finance and analysis, and there's a library for almost anything you can think of. The language itself is not too hard, but understanding all the different library functions is the main difficulty here.

For my first steps I just wanted to try something simple, yet relevant. I've used a machine learning algorithm to classify candles types for EUR/USD (daily candles). This is using K-means clustering (with k = 16) on normalized candle data. As expected it has learnt a set of 16 candle shapes and sizes, nothing particularly special about them - they could be any randomly picked candles from the last few years of data. However, these have been learned as exemplars of broad classification types.


This was really just an experiment in programming and using  the libraries. Next I will extend the study, and look at classifying candles at the tops/bottoms of ranges, see if there is some change.

Further down the line, it should be possible to look at patterns of candles (e.g. 3 candle patterns), and classify these into common groups.

No comments:

Post a Comment