1. Introduction and Related Work
A narrow stock market can be defined in several ways. In the context of this article a narrow market is considered as one that, either, is not very liquid, i.e., the investor pool is not too large, or that it has some peculiarities, such as a high proportion of retail investors, making price discovery more difficult. The objective of this article is to get a better sense of the feasibility [
1], under relatively realistic assumptions, of the applicability of neural networks as a forecasting tool in narrow markets. Even in this type of narrow market, we will show that neural networks are robust enough to generate relatively accurate forecasts. The forecasts that we obtained in this type of market were comparable to those of deeper market but, at least in most cases, of moderately lower accuracy.
Neural networks are an algorithm commonly used for forecasting purposes [
2,
3,
4] that does not require any previous modeling of the underlying system. However, there is a very large amount of factors to take into consideration when building a network ranging from the number of neurons to the critically important decision of the training algorithm applied. When forecasting stocks or equity indexes one of the most important factors, together with the chosen algorithm, is deciding what input to use. In this case we decided to use several moving averages that will be defined in later sections. Moving averages are some of the most frequently used indicators for stock performance [
5,
6,
7,
8,
9] and they are easily obtained.
In this article we cover equity indexes representative of countries that are classic examples of markets with different levels of narrowness. This will range from extremely deep markets such as the U.S., represented with the Dow Jones index, to very narrow markets such as the Tanzanian case. As the forecasting accuracy will depend on the structure of the neural network a relatively large amount of configurations will be tested, including ten different learning algorithms as well as varying number of neurons.
It should be taken into account that some of the most narrow markets might have stale prices as some quoted prices are not representative of an actual trade in the day analyzed but of trades on previous days as there was no or very little trading activity on the day analyzed. This might cause the price level of the index to have an estimated volatility lower than its real volatility. This should be taken into considerations when developing investment strategies based on neural networks.
A large amount [
10,
11,
12] of stock forecasting techniques have developed overtime with an increase in the number of such techniques in recent years as asset prices became easily available and computer power not only significantly increased but also became more affordable. Narrow markets tend to be defined in the literature in the sense of a thin market, or in other words markets with low liquidity. It should be noted that in the context of this article, narrow market is understood as, not only, encompassing relatively illiquid markets but also markets that while having relatively ample liquidity might present significant price distortions due to structural factors such as having a large percentage of the traded volume done by individual investors. Markets with a large proportion of institutional investors are usually considered as reflecting prices in a more rational way than in markets were the predominant investors is retail. The underpinning of this idea is that institutional investors have better information and more training and, hence, would make, on average, more reasonable investment decisions. Two important conclusions frequently cited in the literature [
13] regarding thin markets are that price discovery is more difficult, as prices do not necessarily reflect the actual price of the stock, and that thin markets are more easily manipulated than deep markets. For instance, an unscrupulous investor with a relatively small amount of capital could “corner the market” becoming the dominant player in a security, distorting prices. Such a type of malpractice would be much more difficult in a deep liquid market where the investor represents just a very small part of the total traded volume and becomes in practice, at least to some degree, a price taker.
An example of a thin, or in our context narrow, market could be the equity market in Switzerland. Switzerland has a very large, particularly when compared to its overall GDP, financial sector but its domestic stock market is relatively small. Bruand [
14] selected this market as representative of a thin market. One of the main conclusions of [
14] was that the introduction of derivatives in that market seemed to have had some positive effects, helping improving liquidity. In our paper we differentiate between moderately narrow markets such as the one in Switzerland and very narrow markets, for instance in Namibia. In a related article, Ilkka and Paavo [
15] treated the Helsinki Stock exchange as a thin market and tried to determine if accurate forecasts could be done. They concluded that forecasts were doable in this thin market, obtaining better results for a one-month time horizon than for quarterly predictions.
One of the main objectives of this paper is to show that neural networks are an applicable tool for stock forecasting on narrow markets. Narrow stock markets, perhaps because they tend to be located in less developed economies, have attracted considerably less academic research. Having tools that can generate acceptably accurate stock forecasts can be useful for the development of the stock market in those narrow markets. In turn, the development of the stock market can also potentially help the development of the economy of that country. Therefore, it seems of importance to analyze if well-known techniques, such as neural networks, are actually applicable for stock market forecasting purposes on narrow markets.
The question if the stock market can be forecasted using techniques, such as neural networks, using historical prices is not a trivial one, regardless if the particular market analyzed is considered narrow or otherwise. The efficient market hypothesis, created by Fama [
16], supports the idea that stock prices cannot forecasted using only inputs such as historical prices and trading volumes. To be more precise there are three versions of the market efficient hypothesis: Weak, semi-strong and strong. The weak version states that all the information contained in historical stocks prices is already entirely reflected in the current prices. Or in other words, regardless of the technique used it is not possible to forecast future stock prices using only historical prices. The semi-strong version states that current prices reflect not only all the information from historical prices but also from fundamental analysis of the companies. In other words, this hypothesis defends the postulate that investment analysts cannot generate accurate stock forecast using fundamental analysis of companies, such as the analysis of their financial statements and business model. The semi-strong case includes all public information (including historical stock prices). The strong version of the efficient market hypothesis states that all information, both public and private information (including historical stock prices), is immediately reflected in the current stock price of the company. The strong version of the efficient market hypothesis states that not even insiders of the company, such as for instance a CEO, can generate an accurate stock forecast and benefit from it using all the public and private information available to them. There is ample literature in support and against the efficient market hypothesis. One of the underlying implied assumptions of the efficient market hypothesis is that information flows, almost immediately, as stock prices reprice, basically, instantly reacting to all new (private and public) information. In this context, narrow markets are particularly interesting because it is conceivable that the information flow in narrow stocks markets, like for instance in Tanzania, being slower and arguably less efficient than in markets, such as the United States, that have a better telecommunication infrastructure.
Assuming that markets are not completely efficient, in which case there is no point in using any type of stock forecasting tool, then finding tools that generate relatively accurate forecasts is of a topic of clear importance. As previously mentioned, narrow markets, perhaps, because they tend to be (but clearly not always) associated with smaller economies have not received the same level of interest by much less existing literature covering those markets. Nevertheless, there are some interesting articles in the topic. For instance, Idowu et al. [
17], found that neural networks are applicable tool for forecasting stock prices in the Nigerian stock market, which is an example of a narrow markets. The neural network used in this article was a feedforward network. Idowu et al. [
17] mentioned in their paper a small number of academic articles analyzing markets such as the Nigerian market. Another interesting article is from Senol and Ozturan [
18], that analyzes the stock forecasting abilities of neural networks in the stock market of Turkey, which is another narrow market. Senol and Ozturan [
18] concluded that their results seem to contradict the efficient market hypothesis. Similar results were found by Samarawickrama [
19] in the case of the stock market of Sri Lanka. The similarity of these papers is that they tend to analyze one specific country without considering similarities, such as classifying countries according to their level on narrowness. They also tend to use a relatively small number of learning algorithms, and they usually do not compare those results with the ones obtained in other markets, such as the US or Europe.
1.1. Neural Networks
Over the last few decades there has been an increase in the amount of quantitative and machine learning techniques applied to stock forecasting, one of these techniques is neural networks [
20,
21,
22,
23,
24]. Neural networks are very flexible tools with applications in many forecasting areas. There are some basic characteristics necessary to define a neuronal network such as the number of neurons or the learning algorithm (supervised learning) that will be used to train the network. There are typically at least three steps when creating a neural network. In the first step the basic network architecture is chosen. In the second step, when the basic structure is already in place the network is trained. After that, in the last step, the network is used to create forecasts from previously unseen data (set aside during the training phase) and the forecasting accuracy is calculated. This last step is typically done to avoid the issue of over-fitting which can cause the network to generalize poorly or in other words perform poorly when applied to new (unseen) data. The choice of learning algorithm as well as the number of neurons used can have a very significant impact on the results. There have been an increasing number of articles [
24,
25,
26,
27,
28] covering applications of neural networks for stock forecasting purposes. An example of an application of neural network in a moderately narrow market can be found in [
29]. In this article the author analyzed the stock market of Kuwait, concluding that neural networks are an appropriate tool for that market.
1.2. Stale Prices and Data Availability
Stale prices and data availability are typically not real concerns in the stock markets of many developed economies but some of the equity markets that we analyzed in this article, namely Namibia, do present some data issues. In some periods there was no or very little trading in the Namibian index. This leads to the classic issue of stale price as the quoted price might not reflect the current “true” price but the latest transaction that might have happened on a previous day. A related issue is when trading has occurred on a stock on that day but the amount traded is too small to be useful as an indication of the current price for a trade. This is of particular importance for institutional investors that tend to trade larger amounts than retail investors.
Stale prices are likely to produce artificially good forecasts as the estimate for the volatility of the stock is likely underestimating the real volatility. In
Figure 1 the normalized traded volume for the 2012 to 2017 period can be seen. The normalization was done by dividing the daily traded volume in the market by the maximum traded volume in a single day during that period. During 120 days, representing approximately 8.0% of the days, the traded volume did not reach 0.05% of the total peak traded volume. In 401 days, accounting for 26.8% of the total days, the traded volume did not reach 0.5%. In
Figure 2 shows an extreme example for illustrative purposes. For the three months period from 5 January 2011 to 31 March 2011 there were four days in which there appears an ending price level for the index but there is no recorded traded volume. It should be noted that this period was not included in the analysis and that it is shown only as an example. For the majority of the other indexes the issues of stale prices and data availability were not as apparent as in the case of Namibia.
4. Discussion
Neural networks appear to be an applicable tool for stock forecasting purposes on narrow markets with performance that is comparable but typically lower than in deeper markets. Forecasts in some particularly narrow markets might appear to be very accurate but that could be related to stale prices. This phenomenon appear when the quoted price is not representative of an actual transaction on the analyzed day but of some transaction on a previous day. This is typically associated with illiquid markets. Besides, for this type of extreme case, it would appear that neural networks do a relatively good job forecasting stock performance in the countries analyzed. The 50-day moving average provided results that were at least statistically not worse than the 100-day or 200-day moving averages for most of the neural network configurations analyzed. For other, deeper, markets, such as the U.S. market, there appears to be less statistically significant differences between these different moving averages regarding forecasting accuracy. It should also be noted that increasing the number of neurons did, in most cases, not only not increase forecasting accuracy but it decreased it. This was a general trend observed when using virtually all of the training algorithms with basically all the ten stock indexes analyzed. This might be related to the issue of local minima in neural networks. As the number of neurons increases the neural network might get stuck in a local minimum, basically losing generalization power. Therefore, an important takeaway is that naively increasing the level of complexity of a neural networks, by adding large amounts of neurons to the network, is not likely to translate into more accurate stock forecasts.
The fact that neural networks appear to be applicable for stock forecasting in narrow markets suggest that while there are clearly very big differences between narrow and deep markets they might also share some features that allow the successful use of the same forecasting technique, such as neural networks, in both types of markets. As previously mentioned the flow of information is likely very different in some of the narrow markets analyzed, with relatively poor telecommunication and trading infrastructure, compared to countries such as the United States, but, interestingly, it appears that regardless of these obvious differences neural networks have comparable levels of applicability, for stock forecasting purposes, in narrow and deep markets.
5. Conclusions
Besides the many differences between narrow and deep stock markets it appears that neural networks are an efficient forecasting tool for both types of markets. This is a rather surprising result as the differences between those markets could be rather large with the basic expectation being that their behavior and, hence, the appropriate tool for forecasting the dynamics of its stock markets being rather different. This does not appear to be the case with neural networks generating relatively accurate forecasts for narrow, moderately narrow, deep and very deep markets. Just to put it into perspective, the results suggest that the same technique (neural network) of stock forecasting is applicable to stock markets as different as the ones in Namibia, Tanzania and the United States. One issue that should however be taken into account is that some of those are narrow stock markets, particularly in the case of Namibia is stale prices. Some of the prices quoted in a narrow stock market might not reflect the “true” price of a stock as for example that stock might not have traded in a given day with the price quoted being that of the previous day. That would decrease the volatility of the quoted stock prices, compared to the actual price of the stocks (at which a stock transaction can be actually carried out). This reduction in volatility might make the forecasting task easier but less reliable as an investment tool. Nevertheless, even after accounting for the issue of stale prices it would appear that neural networks can be successfully applied to different stocks markets with varying degrees of narrowness.
It is interesting that the results, while comparable, seem to indicate that the forecast for moderately narrow markets are slightly less accurate than those for deep markets. This might be due to the previously mentioned differences in quality and reliability of the information and trading platform in those markets. It is also interesting to observe that the results support the idea that the analyzed markets are not perfectly efficient, even those that are very deep, as forecasting tools such as neural network are able, using only historical data (moving averages are constructed using only historical data) to generate relatively accurate forecasts, which would seem to contradict the efficient market hypothesis, which is a result in line with other paper analyzing the predicting capabilities of neural networks in the stock market. Perhaps one of the most important takeaways is that the results support the hypothesis that both narrow and deep markets are not perfectly efficient and that stock forecasting tools can be used successfully.