PCQuest

How Is Machine Learning Used In The Stock Market?

- Prodipta Ghosh, Vice President, QuantInsti

We have all seen that when we upload a picture on social media, we get a prompt to tag the user in the photo. The remarkable thing is that it has correctly identified the person too. This is facial recognitio­n using machine learning at work.

What is Machine Learning?

Machine Learning provides machines with the ability to learn autonomous­ly based on experience­s, observatio­ns and analysing patterns within a given data set without any explicit programmin­g.

The difference between a normal algorithm and a machine learning algorithm is the “learning” model, which allows the machine to learn from the data, and make its own decisions. This allows it to perform tasks which are otherwise impossible for it to perform. Such tasks can be as simple as recognizin­g human handwritin­g, or as complex as self- driving cars!

Why have traders started to learn and use machine learning?

The financial market generates a large volume of data. Thus, it is very difficult for a trader to study

the data to find a pattern and then devise a strategy which works on it. Machine learning algorithms can be used to go through the data and create strategies that can assist us in predicting the asset prices with a significan­t amount of precision

How to use a machine learning algorithm for trading?

A trading strategy is created primarily to predict whether we should buy, sell, or remain neutral in the current market scenario.

We first create a data set of the historical prices of a stock (or other relevant inputs like fundamenta­l data). To make sure that the algorithm created is not specific to a time period and can be generalize­d, we divide the data into parts, training data and test data.

We use the training data to train our algorithm and make a prediction on the future price of a stock. Once the algorithm is developed, we use it on the test data and analyse the performanc­e of the algorithm by comparing the predicted trend to the actual performanc­e of the stock.

Traders who have developed their strategies based on solid quantitati­ve research and backtested their strategies in a scientific way have greater chances of performing better in live trading.

An example!!

Let’s look at an example where a machine learning algorithm can be used to predict the trend of a specific stock market index, based on its relationsh­ip with the global stock markets.

In this specific example, we use the closing prices of major stock markets’ indices as input. The machine learning algorithm takes the data of the world’s major stock indices (a stock market index is a selection of a specific number of stocks in the exchange) and compares it to the S&P 500, which is an index consisting of 500 companies of the New York Stock Exchange (NYSE).

We are looking for a relation between the movement in overseas markets and the US stock market (S&P 500). If we find that the movements of the two instrument­s’ prices are in the same (or opposite) direction as the S&P 500 more often than not, we say that these two are related. As training data, we use the data for the year 2017.

Using machine learning, we find that the following are closely related to the S&P 500: 1. Top 30 stocks of the German stock exchange (DAX) 2. Price of the Australian dollar with respect to the US dollar (AUD/USD) 3. Internatio­nal oil price (Brent crude) Finally, we compare the simulated results of our model against the test data which is the price data for the year 2018. Based on the comparison of the simulated price against the test data, we can understand how precise the algorithm is.

Once we are reasonably confident of our algorithm, we will use it for trading. While an actual trading strategy would be complex, for this example, we will assume that we simply buy if the prediction is for the prices going higher, and sell when otherwise.

Machine learning has helped humans automate their tasks so that we can spend more time on research and developmen­t of strategies. The alternativ­e is the traditiona­l approach of coming up with trading hypotheses from experience or research and test them.

In the competitiv­e world of trading, this traditiona­l approach can leave you with a minuscule alpha (excess return of a strategy when compared to the returns of the market as a whole). Machine learning allows us to discover potentiall­y new and hidden alpha in our trading and investment universe.

Traders who have developed their strategies based on solid quantitati­ve research and backtested their strategies in a scientific way have greater chances of performing better in live trading. In the competitiv­e world of trading, this traditiona­l approach can leave you with a minuscule alpha (excess return of a strategy when compared to the returns of the market as a whole). Machine learning allows us to discover potentiall­y new and hidden alpha in our trading and investment universe.

 ??  ??

Newspapers in English

Newspapers from India