Machine Learning

Posted on Nov 24, 2017 by Kris Longmore
4 comments.
0 Views

This article is a departure from the quantitative research that usually appears on the Robot Wealth blog. Until recently, I was working as a machine learning consultant to financial services organizations and trading firms in Australia and the Asia Pacific region. A few months ago, I left that world behind to join an ex-client's proprietary trading firm. I thought I'd jot down a few thoughts about what I saw during my consulting time because I witnessed some interesting changes in the industry in a relatively short period of time that I think you might find interesting too. Enjoy! Perceptions around Artificial Intelligence (AI) in the finance industry have changed signifcantly, as scepticism gives way to a rising Fear of Missing Out (FOMO) among asset managers and trading houses. Big Data and AI Strategies – Machine Learning and Alternative Data Approaches to Investing, JP Morgan's 280-page report on the future of machine learning in the finance industry, paints a picture of a future in which alpha is generated from data sources such as social media, satellite imagery, and machine-classified company filings and...

Posted on Sep 06, 2017 by Kris Longmore
6 comments.
0 Views

This article is adapted from one of the units of Advanced Algorithmic Trading. If you like what you see, check out the entire curriculum here. Find out what Robot Wealth is all about here. If you're interested in using artificial neural networks (ANNs) for algorithmic trading, but don't know where to start, then this article is for you. Normally if you want to learn about neural networks, you need to be reasonably well versed in matrix and vector operations - the world of linear algebra. This article is different. I've attempted to provide a starting point that doesn't involve any linear algebra and have deliberately left out all references to vectors and matrices. If you're not strong on linear algebra, but are curious about neural networks, then I think you'll enjoy this introduction. In addition, if you decide to take your study of neural networks further, when you do inevitably start using linear algebra, it will probably make a lot more sense as you'll have something of head start. The best place to start learning about neural networks is the...

Posted on Aug 09, 2016 by Kris Longmore
23 comments.
0 Views

It would be great if machine learning were as simple as just feeding data to an out-of-the box implementation of some learning algorithm, then standing back and admiring the predictive utility of the output. As anyone who has dabbled in this area will confirm, it is never that simple. We have features to engineer and transform (no trivial task - see here and here for an exploration with applications for finance), not to mention the vagaries of dealing with data that is non-Independent and Identically Distributed (non-IID). In my experience, landing on a model that fits the data acceptably at the outset of a modelling exercise is unlikely; a little (or a lot!) of effort is usually required to be expended on tuning and debugging the algorithm to achieve acceptable performance. In the case of non-IID time series data, we also have the dilemma of the amount of data to use in the training of a predictive model. Given the non-stationarity of asset prices, if we use too much data, we run the risk of training our  model on data that...

Posted on Mar 04, 2016 by Kris Longmore
69 comments.
0 Views

Update 1: In response to a suggestion from a reader, I've added a section on feature selection using the Boruta package.  Update 2: Responding to another suggestion, I've added some equity curves of a simple trading system using the knowledge gained from this analysis. Update 3: In response to a comment from Alon, I've added some Lite-C code that generates the training data used in this post and outputs it to a .csv file. You can have some serious fun with this and it enables you to greatly extend the research presented here. Enjoy! Update 4: 30 March 2017: The analysis was extended the analysis to include data up to the end of 2016. Of course, I updated the post to reflect the changes. The code for performing the analysis and generating the data I used in this post, as well the data file itself and another for a different instrument that you can experiment with, are all available for free by clicking here. One of the first books I read when I began studying the markets a few years ago was David...

Posted on Nov 24, 2015 by Kris Longmore
5 comments.
0 Views

Important preface: This post is in no way intended to showcase a particular trading strategy. It is purely to share and demonstrate the use of the framework I've put together to speed the research and development process for a particular type of trading strategy. Comments and critiques regarding the framework and the methodology used are most welcome. Backtest results presented are for illustrating the methodology and describing the outputs only. That done, on to the interesting stuff My last two posts (Part 1 here and Part 2 here) explored applying the k-means clustering algorithm for unsupervised discovery of candlestick patterns. The results were interesting enough (to me at least) to justify further research in this domain, but nothing presented thus far would be of much use in a standalone trading system. There are many possible directions in which this research could go. Some ideas that could be worth pursuing include: Providing the clustering algorithm with other data, such as trend or volatility information; Extending the search to include two- and three-day patterns; Varying the number of clusters; Searching across markets and asset...

Posted on Nov 15, 2015 by Kris Longmore
20 comments.
0 Views

In the last article, I described an application of the k-means clustering algorithm for classifying candlesticks based on the relative position of their open, high, low and close. This was a simple enough exercise, but now I tackle something more challenging: isolating information that is both useful and practical to real trading. I'll initially try two approaches: Investigate whether there are any statistically significant patterns in certain clusters following others Investigate the distribution of next day returns following the appearance of a candle from each cluster The insights gained from this analysis will hopefully inform the next direction of this research. Data preliminaries In the last article, I classified twelve months of daily candles (June 2014 - July 2015) into eight clusters. To simplify the analysis and ensure that enough instances of each cluster are observed, I'll reduce the number of clusters to four and extend the history to cover 2008-2015. I'll exclude my 2015 data for now in case I need a final, unseen test set at some point in the future. Here's a subset of the candles over the entire price history (2008-2014, 2015...