The Stock Markets and Artificial Intelligence- How Do They Handshake?

Can you really predict the stocks using AI?

Vijayalakshmi Swaminathan
The Research Nest

--

Photo by Markus Spiske on Unsplash

AI is has become a cliched statement. People who have no idea about the science behind a machination attribute it to AI. This world which revolves around money does seem to have put AI to good use. The world of Finance has sought a deal with technology to reel in dollars and pounds.

Before we delve into the details of the how’s, what’s and when’s, let us brush up our basics.

What are stocks and the stock market?

When a start-up is founded, more often than not, founders pool in funding from themselves, venture capitalists, crowd funders, or loans. When the company evolves, it opens for the public to start investing in them. This is commonly called initial public offering (IPO). The listing is usually in one of the stock market exchanges. People ready to invest commute through a broker who handles the transactions between the investors who buy and sell. They are the mediators who eventually connect the sellers to the buyers. The stock is usually a share of ownership within the company. The company uses the money for growth, reparations, branding, and marketing. Owning stocks may give certain privileges of voting, and decisions. This is sometimes reserved for a certain type of stock. However, it is a plain overview and subject to a set of terms and conditions. This is basically how a stock market works.

What does AI have to do with the stock market in any way?

The only reason we invest money is to get more returns. AI helps in doing just that. It tracks the indexes, forecasts the market analytics, and tries to identify the risks. It can answer the following-

  1. What to buy?
  2. When to buy?
  3. When to sell?
  4. The magnitude of returns?
  5. What are the risks involved?

Based on theories, it is stated that the stock market is random in nature. It cannot be predicted. However, research works have evolved to implement different machine learning algorithms through neural nets. The analysis of researches in this crossbreed is presented below.

Some research insights on how and what type of AI has been used in this domain

  • One of the most cited recent research works is based on Reinforcement Learning using Recurrent Neural Networks. Two challenges are addressed- the difficulties in summarizing the financial data and market, and dynamic trading actions. The structure majorly consists of two parts- deep neural nets (DNN), and recurrent neural nets (RNN). The DNN is used for Feature learning. Here, fuzzy data concepts are introduced to remove the uncertainties in the metrics. These metrics define the environment of online trading. No metric can give conclusive evidence. Hence a fuzzy logic is necessary. The task-aware backpropagation through time is used to overcome the vanishing gradient problem in the RNN in the training phase. The model was tested on the stock market futures and commodity futures. Interestingly, its performance surpassed the existing models and provided reliable profits through predictions.
  • One of the other research papers implements Long Short-Term Memory (LSTM) to predict the stock prices of the Chinese Market. The general structure consists of — the input layer which has as many nodes as the features in each sequence, the LSTM layer of memory cells, the dense layer, and the output layer with as many nodes as the performance metrics. They had identified four critical stock data types– the historic price of the data, the metric which is calculated from the historic price which can be Moving averages, history of market indexes, and economic parameters like GDP. The accuracy of the prediction increases as the number of features increases until 10. The sequences were classified based on the earning rate in the ultimate layer. The earning rates had been classified as — [,-1.5], [-1.5,-0.5], [-0.5, 0.4], [0.4, 1.4], [1.4, 2.5], [2.5, 4.3], [4.3,]. The research was jointly conducted under the tutelage of Chinese scientific institutions.
  • The use of RNN in time-based pattern prediction is often restricted to short term goals, as the data cluster sizes are small. To foretell the future at a longer time haul, Representative Pattern Discovery is used. Combining both these methods effectively helps us forecast indexes for all the periods. Sub-sequences are extracted using sliding windows of differing lengths to avoid trivial pattern matched clusters. The strategy used is four-part. Firstly, representative patterns are found. The density peak clustering algorithm is used here. Subsequently, representative matching patterns are gathered. This is done using dynamic time warping. The position of the highest match is the joining point and subsequent RPs behind the join position make the forwards. A time unfolded RNN with a single output is trained by the historical sequences for the correct prediction. In the last step, the outputs of the two methods are weighed. The result is an influence of pattern matching over RNN. The experiment was conducted on the S&P 500, and the results of Fusion Strategy is indeed convincing. It shows a good blend. Hence, there is a good Mean Trend Accuracy (MTA) for all the periods of prediction.
  • A novel and interesting application is the use of textual information to extract data, run simulations on them, and predict the market prices. One particular research proposes to annul the shortcomings of previous methods. Earlier, either textual information or numbers were used for analysis. But now, using the Paragraph Vector to extract the data and LSTM to model the time series have greatly enhanced the prediction accuracy. Paragraph vectors for textual and numerical content are greatly concatenated by adjusting their sizes to have impartiality on the LSTM. The LSTM had one layer and was unrolled 20 steps. A 50 percent dropout was applied to nonrecurrent connections. The output of the LSTM is the predicted stock price. Also, companies in the same industries were considered for stock price prediction.

The original research papers for each of these studies are present in the references for your perusal (in the same order). Stock markets being a game of chance, it is often useful to have a baseline prediction using Artificial Intelligence techniques. Though they promise to give a good prediction, the market is as fickle as the human brain. Hence it is wise to also add your two cents and take a wise decision.

So yeah, don’t bet entirely on the AI to get the job done for you. If you want to try using AI in practice, you can either build your own custom program to give you insights or find one tool online that does this for you.

References and further reading for the geeks:

Hope you found some new insights here :)

--

--

Vijayalakshmi Swaminathan
The Research Nest

I read, learn and create! Always up for engaging conversations about anything! Do connect with me on https://www.linkedin.com/in/vijayalakshmiswaminathan/