Premium Market Analysis

Quantitative trading, Trader education

Machine Learning in Quant Trading: Misconceptions and Wrong Applications

I was not surprised to learn that quant funds using machine learning underperformed human traders in 2020. From the articles I read in financial blogosphere, it is clear that many quants who try to apply machine learning to trade the markets do not have a clear concept of strategy development. Here is why.

I have written a few articles about the problems quant funds face. The most serious problem is that many quant funds misapply machine learning.  Machine learning is very powerful but lack of context end experience can lead to bad results. For example, recent Quantopian withdrawal from the quant trading strategy development and fund space is an example of why all the good and powerful tools in the world are not sufficient if the targets are unrealistic and there is lack of experience with problems such as data-mining bias and data snooping. Quantopian offered a powerful platform to thousands of quants for free but that was not enough. In this article I will attempt to explain why trading strategy development is a very difficult area that requires an array of skills.

In a nutshell, trading strategy development is an optimization problem on several levels and this is also the fundamental problem: optimization can easily lead to over-optimization and actually the dividing line is not obvious, i.e., it is hard to determine where optimization ends and over-optimization begins. Even worse, over-optimized strategies may work for many years delivering excellent results and rejecting them is a TYPE-II error. On the other hand, non-optimized strategies may underperform severely due to bias-variance trade-off. Trading strategy development is a science but also an art. The probability that a graduate with a Masters in Computer Science or Data Science will be immediately able to deliver a result is very low.

The misunderstandings and misapplications of machine learning in trading system development are evident from a large volume of articles in financial blogosphere. For an example, click here. Forecasting prices is not equivalent to a trading strategy. The former is easier, the latter includes additional requirements: position size determination, stop-loss and profit-targets if relevant, satisfactory values for a number of metrics people use to evaluate performance and much more, including the most crucial: actual performance.

As I demonstrate in the article link above, minimizing MSE or any other related metric, such as log-loss, is not enough for developing a successful trading strategy. Blind application of deep learning will probably lead to reinventing a low pass filter the elaborate way; you can achieve the same with a fast moving average. The problems of tracking price and trading price are not related in a straight-forward fashion: as many traders know, being right about direction and actually making money are far from equivalent. Optimization of MSE or related metrics is naïve approach to trading strategy development. Below is a possible form the optimization may take although there are many alternatives:

max f(M)     {M: metrics}
w.r.t. m(xi)       {xi, i = 1,2,…,n are parameters in model m(x)}

subject to
mj < Vj    {mj, j=1,2,…. is a metric, e.g., Max. DD, trade average holding period, among many and Vj is the value}
mk > Vk  {mk, k =1,2,…. is a metric, e.g., average trade value, number of trades, Sharpe, MAR, CAGR, win rate, among many, and Vk is the value.}

The model m(x) generates a sequence of trades (entry and exit signals) and the trade values are used to calculate the various metrics. Let us look at a simple example below.

Example (Model: moving average cross-over)

w.r.t. MA cross(f,s)   {f is fast moving average period and s is slow moving average period)

subject to
Max. DD < 15%
Sharpe > 1

The optimization determines the best values of f and s that maximize the metric CAGR while satisfying the constraints, if such values exist. Usually, if a solution is not possible, developers go back and tweak the model and/or constraints. This tweaking introduces bias. The worst and largest bias is when genetic algorithms or permutations methods are used to configure and select a model and then adjust its parameters until the objective function (metric) is maximized subject to the constraints. In this case it is impossible in practice to determine whether the model is random or not before using it; it may be a good model but most probably it is a spurious result due to data-mining bias.

The above procedure has very loose or no connection to the way some quants use machine learning to develop trading strategies. Extracting features from the data to configure a model, in most cases abstract, via classification is a process plagued by excessive data mining bias unless there is an underlying theory of why these features have economic value. The model m(x) in the optimization above does not exist and it is extracted from the data. If one repeats this procedure many times, then the probability a random model emerges goes asymptotically to one. I have described this trap in this article.

Those not familiar with the subject of trading strategy development should be able to get the main idea from this brief article of how complex this process is. Yet, many quants, especially new to the field, think they will load a few Python libraries, feed the data and magic will come out. No, the market is not that simple.

Quant funds should scale down on machine learning hype and expectations; go back to traditional approach of developing strategies based primarily on the use of hypotheses that are as unique as possible. This process is quasi-quant but then they can use machine learning for meta-classification, i.e., for selecting the best strategies to trade at a given time based on equity curve performance and market conditions.  Otherwise, the human traders will continue to outperform quant funds.

Technical and quantitative market analysis is included in our Weekly Premium Reports. Market signals for position traders are offered by our premium Market Signals service

If you found this article interesting, you may follow this blog via RSS or Email, or in Twitter