Abstract
This chapter investigates the impact of high-frequency trading (HFT) on market efficiency in the Moroccan Stock Exchange. The endorsement of market efficiency suggests that investors cannot beat the market, while a rejection of market efficiency implies that investors can use HFT to realize higher returns than those of the market. We obtain data at the precision level of milliseconds from the Casablanca Stock Exchange and cover the period from August 1, 2016 (the beginning of high-frequency trading in the Moroccan stock market) to July 31, 2021. The chapter finds from conducting statistical analyses using this data that the market efficiency hypothesis is rejected at very high frequencies: one millisecond, one second, and 30 second. At lower time frequencies such as 1, 2, 5, 10, and 15 minutes, the market efficiency hypothesis is not rejected, which lends evidence that the market is efficient at these frequencies. Based on these results obtained, the main conclusion from this chapter is that investors with a faster market connection (at the millisecond and second level) and an efficient algorithm can use privileged information to realize returns higher than those of the Moroccan Stock Exchange market. Further studies should be completed in other markets to determine if these results are consistent across exchanges.
Access provided by Autonomous University of Puebla. Download chapter PDF
Similar content being viewed by others
Keywords
JEL Classification
1 Introduction
There is a growing interest in high-frequency trading (HFT) due to technological developments and the increasing use of technologies in financial markets. Felker et al. (2014) define HFT, a subset of algorithmic trading (Muthuswamy et al., 2010), as any consistent trading activity with a significantly brief time span, and a high number of daily discrete round turns (completed trades) and messages. Zhang (2010) describes HFT as fully automated trading strategies with very high trading volume and extremely short holding periods ranging from milliseconds to minutes and possibly hours. The United States Securities Exchange Commission (2014) defines five characteristics of HFT:
-
1.
Use of extraordinarily high speed and sophisticated programs for generating, routing, and executing orders;
-
2.
Use of co-location services and individual data feeds offered by exchanges and others to minimize network and other latencies;
-
3.
Very short time-frames for establishing and liquidating positions;
-
4.
Submission of numerous orders that are canceled shortly after submission and;
-
5.
Ending the trading day in as close to a flat position as possible (that is, not carrying significant, unhedged positions overnight).
Companies today are spending tens of millions of dollars on extremely large and/or complex datasets (“big data”) as well as HFT infrastructure and technology, because “[m]illiseconds are millions” (Fang & Zhang, 2016). Using big data is a popular choice in today's financial community as it allows traders to make better investment choices and receive continuous feedback on their actions. The reasoning is that big data entails using large data samples, which increases confidence when making decisions. Despite the inherent volatility in financial markets, big data allows investors to quickly get a picture of the actual situation. Previously, online investing in the stock market involved making decisions based solely on market trends and calculating known risks. Today, these calculations are executed more efficiently by a computer program that can come to smarter conclusions with more information. Therefore, big data plays a primary role in decision-making for online trading, and, accordingly, we have seen an increase in resources allocated to big data in recent years.
HFT developed thanks to big data, which has, in turn, made it possible to place several hundred buy and sell orders in seconds, or even milliseconds, while optimizing risks. The development of HFT allowed investors to buy and resell stocks in a short enough period of time to avoid potentially negative market movement during the transaction.
In this study, we examine the impact of HFT on the market efficiency of the Moroccan Stock Exchange. Market efficiency implies that stock market variations are unpredictable as stock prices reflect the available information (Fama, 1995). This study, the first to use HFT in Africa, relates to one of the most developed African stock markets. Indeed, the Moroccan stock market, also known as the Casablanca Stock Exchange or the CSE, is the third oldest stock market in Africa and the third-largest by market capitalization. The small number of studies on HFT is due to the unavailability of data. This chapter offers two important contributions. First, this chapter builds on existing literature on HFT by analyzing a developing African exchange. Second, this chapter contributes to the analysis of the market efficiency of HFT. Previous studies on the Moroccan Stock Exchange, using daily data, rejected the random walk hypothesis and revealed evidence of behavioral biases such as herding behavior (Ferrouhi, 2021) and calendar anomalies (Ferrouhi et al., 2021).
Moreover, our results have policy implications concerning the accessibility to HFT. Privileged traders that have access to this data can, in theory, beat the market if markets are indeed inefficient. In the next section, we present a brief literature review of existing studies conducted on HFT and market efficiency. Next, in Sect. 3, we present our data and methodology, while in Sect. 4, we present our results. Section 5 serves as a conclusion to the chapter.
2 Literature Review
Several authors find that HFT played a positive role in improving market efficiency (Carrion, 2013; Manahov & Hudson, 2014; Martinez & Rosu, 2013), decreasing volatility (Brogaard, 2011; Hagstrӧmer & Nordѐn, 2013; Hansbrouck & Saar, 2013), and contributing to market stability (Hendershott & Riodran, 2011). However, other studies reveal the negative role of HFT in market volatility (Foucault et al., 2016; Leone & Kwabi, 2019; Zhang, 2010), price instability (Leone & Kwabi, 2019), and market efficiency (Jones, 2013). HFT's lack of availability disadvantages several market actors (Brogaard, 2011; Jones, 2013). For instance, the Australian Securities and Investments Commission (ASIC) report published in 2013 demonstrates that HFT negatively impacts the market.
The extant literature contains few studies that examine the role of HFT in price discovery and price efficiency. Thus, Brogaard et al. (2014) use data at millisecond frequencies from the NASDAQ and the New York Stock Exchange and find that HFT predicts price changes over horizons of less than three to four seconds. Meanwhile, Leone and Kwabi (2019) investigate the weak efficiency form in the FTSE100 and reject the hypothesis of a random walk at both millisecond and second frequencies, while the authors accept this hypothesis at 10, 15, 30, 60, 120, and 240-minute frequencies. Other studies that have investigated the market efficiency of HFT are concerned with stock indices in the United States (e.g. Carrion, 2013; Shafi et al., 2019; Zhang, 2010), in the United Kingdom (e.g. Leone & Kwabi, 2019); in Europe (e.g. Ammar & Hellara, 2021; Haferkom, 2017); currencies (e.g. Manahov et al., 2014), and cryptocurrencies (e.g. Aslan & Sensoy, 2020; Sensoy, 2019), among other things. Virgilio (2019) presents a literature review on the effect of HFT on volatility, transaction costs, liquidity, price discovery, and flash crashes. This chapter will test the market efficiency in HFT and thus fill a gap in the literature.
3 Methodology and Data
This chapter aims to study the impact of high-frequency trading on market efficiency in the Moroccan Stock Exchange. The existence of market efficiency suggests that investors cannot beat the market, while a rejection of market efficiency implies that investors may be able to realize returns higher than the market by using HFT. Fama (1970) defines three forms of market efficiency:
-
(a)
Weak form: prices include all the historical data,
-
(b)
Semi-strong form: prices include all publicly available data, and
-
(c)
Strong form: prices include both the public and private data.
The hypothesis we test in this paper is that HFT improves the market efficiency of the Moroccan Stock Exchange (at the millisecond, 1-second, 30-second, 1-minute, 2-minute, 5-minute, 10-minute, and 15-minute frequencies).
3.1 Methodology
The variance ratio test (Lo & MacKinlay, 1988) and Chow and Denning joint test (1993) are the tests commonly used to test the weak form of efficiency. The variance ratio test tests if a time series follows a random walk. The Lo and MacKinlay variance ratio \(VR\left(k\right)\) is calculated as follows:
where \({\sigma }^{2}(k)\) is 1/k times the variance of (\({X}_{t}- {X}_{t-1})\), calculated as follows:
and \({\sigma }^{2}(1)\) is the variance of (\({X}_{t}- {X}_{t-1})\), calculated as follows:
-
where \(m=q(nq-q+1)(1-k{n}^{-1})\)
-
and \(\widehat{\mu }= \frac{1}{nk} \sum_{t=1}^{nk}\left({X}_{t}- {X}_{t-1}\right)= \frac{1}{nk} ({X}_{nk}- {X}_{0})\)
-
and \({X}_{t}=ln{P}_{t}\)
\({P}_{t}\) is the index price at t. If ratios are equal to one, then that series follows a random walk, while positive or negative ratios are synonymous with positive and negative autocorrelation. Low and Mackinlay (1988) suggest two test statistics:
-
under the null hypothesis of homoskedastic increments random walk:
$${M}_{1}\left(k\right)= \frac{VR\left(k\right)-1}{\phi {(k)}^\frac{1}{2}} , N(\mathrm{0,1})$$where
$$\phi \left(k\right)= \frac{2\left(2k-1\right)(k-1)}{3kn}$$ -
under the null hypothesis of heteroskedastic increments random walk:
$${M}_{2}\left(k\right)= \frac{VR\left(k\right)-1}{{\phi }^{*}{(k)}^\frac{1}{2}} , N(\mathrm{0,1})$$where
$${\phi }^{*}(k)= \sum_{j=1}^{k-1}{\left[\frac{2\left(k-j\right)}{k}\right]}^{2}\delta (j)$$and
$$\delta \left(j\right)= \frac{\sum_{t=j+1}^{nk}{({X}_{t}- {X}_{t-1}- \widehat{\mu })}^{2}{({X}_{t-j}- {X}_{t-j-1}- \widehat{\mu })}^{2}}{{\left[\sum_{t=1}^{nk}{({X}_{t}- {X}_{t-1}- \widehat{\mu })}^{2}\right]}^{2}}$$
Chow and Denning (1993) extend Lo and MacKinlay's variance ratio test and develop the Chow and Denning joint test. Considering a set of variance ratio estimates \(\left\{VR\left({q}_{i}\right) \left|I=1, 2, \dots .,m\right.\right\}\), where m corresponds to a set of a pre-defined number of lags and \({M}_{1}(k)\) and \({M}_{2}(k)\) presented above. The Chow and Denning joint test tests a set of sub-hypothesis:
The largest absolute value of the test statistics are
and
Chow and Denning (1993) follow SMM distribution (studentized maximum modulus distribution). The null hypothesis is rejected at \(\alpha\) level of significance if \(MV\) is greater than \([1- \left(\frac{{\alpha }^{*}}{2}\right)]\) where \({\alpha }^{*}=1- {(1-\alpha )}^\frac{1}{m}\).
Following Belaire-Franch and Opong (2005) and Leone and Kwabi (2019), we use 2, 5, 10, and 30 differences, and employ the variance ratio test and Chow and Denning multiple variance ratio test using heteroskedastic robust versions of both.
3.2 Data
This chapter uses data from the MASI (Moroccan All Shares Index), the Casablanca Stock Exchange’s main index, to conduct its study. As of October 7, 2021, there were 74 companies listed in the MASI, and the CSE had the third-largest market capitalization in Africa (after those of South Africa and Namibia), valued at more than USD 56 billion. We obtained data at the precision level of milliseconds under a non-disclosure agreement from the Casablanca Stock Exchange, which covers the period from August 1, 2016 (the beginning of high-frequency trading in the Moroccan stock market) to July 31, 2021. We then selected data at 1- and 30-second frequencies and at the 1-, 5-, 10-, and 15-minute frequencies. The multitude of this data allows for better knowledge of the Moroccan market in terms of risks and opportunities thanks to the shelling of the raw database, which generates the big data in various timestamps.
4 Results
According to Table 1, the skewness reveals that variations tend to be more negative for all frequencies. These results indicate that investors can realize small gains but are also exposed to big losses. The low kurtosis, observed at all time frequencies, reveals that the data exhibits less extreme values. Additionally, the results of the Jarque–Bera test allow us to reject the normality hypothesis, which indicates that the distribution of values does not follow a Gaussian distribution.
As presented in Sect. 3, variance ratios above one indicate that markets are inefficient, while ratios equal to one indicate weak market efficiency. As Table 2 illustrates below, the Lo and MacKinlay variance ratio exceeds one at the millisecond, 1-second, and 30-second time frequencies, and so we reject the random walk hypothesis and thus reject the hypothesis of market efficiency for these frequencies. The results of the Chow and Denning joint test further confirm this outcome. Thus, we conclude that privileged investors with access to HFT can predict future prices, and so the possibility of arbitrage exists in this market at these time frequencies. Our results are thus in alignment with those of Brogaard et al. (2014) and Leone and Kwabi (2019).
However, results at 1-, 2-, 5-, 10-, and 15-minute frequencies show evidence of a random walk. As a result, we conclude that HFT improves the market efficiency of the Moroccan stock exchange at low time frequencies (1-, 2-, 5-, 10-, and 15-minute frequencies). These results confirm those obtained in developed markets (Carrion, 2013; Manahov & Hudson, 2014; Martinez & Rosu, 2013).
Nevertheless, as the access to high-frequency trading (millisecond, 1-second, and 30-second frequencies) is limited, only investors having access to such data can gain an advantage over the market by predicting future variations. Thus, we remark that the market tends to be more efficient as the data frequency decreases. These findings confirm previous results that the unavailability of HFT disadvantages traders who do not have access to data (Brogaard, 2011; Jones, 2013; Leone & Kwabi, 2019). Thus, the stock market authority for this market (the Moroccan Capital Market Authority) should implement and strengthen measures to protect investors by ensuring that all the information is freely and equally available to investors.
5 Conclusion
This chapter studied the impact of high-frequency trading on market efficiency in the Moroccan Stock Exchange. We used data covering five years, from 2016 to 2021, with frequencies between a millisecond and 15 minutes. We find no evidence of a random walk at the millisecond, 1-second, nor 30-second frequencies. Therefore, it follows that investors with a faster market connection and an efficient algorithm can use privileged information to realize returns higher than those of the market. However, we find evidence of market efficiency at 1, 2, 5, 10, and 15-minute time frequencies. We thus conclude that there is a possibility of arbitrage for investors in this market at higher temporal frequencies. Our main recommendations are that the Moroccan Capital Market Authority implement and strengthen measures to protect investors and increase available information to improve market efficiency, especially at 1-millisecond, 1-second, and 30-second frequencies.
One area in the future to look out for is the growth of big data in financial markets, as it will be useful to analyze our study's data in such a way that time is understood as an important influence on price variations. Such inferences from big data could introduce the application of forecasting and machine learning tools to create accurate models that can be applied and used to forecast future variations more effectively than today. The growth of big data will allow for real-time data analysis from multiple sources (e.g., financial brokers) before executing a trade. Moreover, correlating real-time data with historical data sources would help identify more profitable trades with a higher degree of accuracy; real-time data processing technologies, such as in-memory data grids and processing engines, could assist in this identification, so long as the analysis is made at high frequencies. Investors who can best integrate HFT with big data technologies at high temporal frequencies will be most likely to gain an edge in the financial marketplace in the future.
References
Ammar, I. B., & Hellara, S. (2021). Intraday interactions between high-frequency trading and price efficiency. Finance Research Letters, 41, 101862.
Aslan, A., & Sensoy, A. (2020). Intraday efficiency-frequency nexus in the cryptocurrency markets. Finance Research Letters, 35, 101298.
Australian Securities and Investments Commission. (2013). Dark liquidity and high-frequency trading.
Belaire-Franch, J., & Opong, K. K. (2005). A variance ratio test of the behaviour of some FTSE equity indices using ranks and signs. Review of Quantitative Finance and Accounting, 24(1), 93–107.
Brogaard, J. (2011). High frequency trading and volatility. SSRN eLibrary.
Brogaard, J., Hendershott, T., & Riordan, R. (2014). High-frequency trading and price discovery. The Review of Financial Studies, 27(8), 2267–2306.
Carrion, A. (2013). Very fast money: High-frequency trading on NASDAQ. Journal of Financial Markets, 16, 680–711.
Chow, K. V., & Denning, K. C. (1993). A simple multiple variance ratio test. Journal of Econometrics, 58(3), 385–401.
Fama, E. F. (1970). Efficient capital markets: A review of theory and empirical work. The Journal of Finance, 25(2), 383–417.
Fama, E. F. (1995). Random walks in stock market prices. Financial Analysts Journal, 51(1), 75–80.
Fang, B., & Zhang, P. (2016). Big data in finance. In Big data concepts, theories, and applications (pp. 391–412). Springer.
Felker, T., Mazalov, V., & Watt, S. M. (2014). Distance-based high-frequency trading. Procedia Computer Science, 29, 2055–2064.
Ferrouhi, E. M. (2021). Herding behavior in the Moroccan stock exchange. Journal of African Business, 22(3), 309–319.
Ferrouhi, E. M., Kharbouch, O., Aguenaou, S., & Naeem, M. (2021). Calendar anomalies in African stock markets. Cogent Economics & Finance, 9(1), 1978639.
Foucault, T., Hombert, J., & Roşu, I. (2016). News trading and speed. The Journal of Finance, 71(1), 335–382.
Haferkom, M. (2017). High-frequency trading and its role in fragmented markets. Journal of Information Technology, 32(3), 283–296.
Hagstrӧmer, B., & Nordѐn, L. (2013). The diversity of high frequency traders. Journal of Financial Markets, 16, 741–770.
Hansbrouck, J., & Saar, G. (2013). Low-latency trading. Journal of Financial Markets, 16, 646–679.
Hendershott, T., & Riordan, R. (2011). High frequency trading and price discovery (p. 3). University of California.
Jones, C. M. (2013). What do we know about high-frequency trading? (Columbia Business School Research Paper, 13-11).
Leone, V., & Kwabi, F. (2019). High frequency trading, price discovery and market efficiency in the FTSE100. Economics Letters, 181, 174–177.
Lo, A. W., & MacKinlay, A. C. (1988). Stock market prices do not follow random walks: Evidence from a simple specification test. The Review of Financial Studies, 1(1), 41–66.
Manahov, V., & Hudson, R. (2014). The implications of high-frequency trading on market efficiency and price discovery. Applied Economics Letters, 21(16), 1148–1151.
Manahov, V., Hudson, R., & Gebka, B. (2014). Does high frequency trading affect technical analysis and market efficiency? And if so, how? Journal of International Financial Markets, Institutions and Money, 28, 131–157.
Martinez, V. H., & Rosu, I. (2013, January). High frequency traders, news and volatility (AFA 2013 San Diego Meetings Paper).
Muthuswamy, J., Palmer, J., Richie, N., & Webb, R. (2010). High-frequency trading: Implications for markets, regulators, and efficiency. The Journal of Trading, 6(1), 87–97.
Sensoy, A. (2019). The inefficiency of Bitcoin revisited: A high-frequency analysis with alternative currencies. Finance Research Letters, 28, 68–73.
Shafi, K., Latif, N., Shad, S. A., & Idrees, Z. (2019). High-frequency trading: Inverse relationship of the financial markets. Physica A: Statistical Mechanics and Its Applications, 527, 121067.
US Securities and Exchange Commission. (2014). Equity market structure literature review, part II: High frequency trading.
Virgilio, G. P. M. (2019). High-frequency trading: A literature review. Financial Markets and Portfolio Management, 33(2), 183–208.
Zhang, F. (2010). High-frequency trading, stock volatility, and price discovery. SSRN 1691679.
Acknowledgements
Many thanks to Ayoub Youssefi, Head of the Development Department in the Casablanca Stock Exchange, for sharing the data used in this study. We also thank our colleague Rachida El Guerraoui for proofreading and our reviewers for their valuable comments.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this chapter
Cite this chapter
Ferrouhi, E.M., Bouabdallaoui, I. (2022). High-Frequency Trading and Market Efficiency in the Moroccan Stock Market. In: Walker, T., Davis, F., Schwartz, T. (eds) Big Data in Finance. Palgrave Macmillan, Cham. https://doi.org/10.1007/978-3-031-12240-8_4
Download citation
DOI: https://doi.org/10.1007/978-3-031-12240-8_4
Published:
Publisher Name: Palgrave Macmillan, Cham
Print ISBN: 978-3-031-12239-2
Online ISBN: 978-3-031-12240-8
eBook Packages: Economics and FinanceEconomics and Finance (R0)