A technical approach to equity investing in South Africa: A tale of two indexes

This research uses Simple Moving Averages and four other well-known indicators to investigate the usefulness of the Technical Analysis approach to the Johannesburg stock exchange (JSE) in South Africa. Technical indicators are applied to two JSE indexes representing large cap and small cap companies over the period of 1/2/2002 to 12/31/18. The best trading rules for both the Small Cap and All Share indexes involve the use of two simple moving averages. For the Small Cap Index, our best two trading rules and a low-risk strategy have positive annual net excess return over the Buy and Hold (B&H) strategy for the entire period and each subperiod, thus trading rules can beat the B&H strategy. However, we cannot say the same for the All Share Index (representing large cap companies). Subjects: Financial Economics; Social Sciences; Economics, Finance, Business & Industry; Economics; Finance; Business, Management and Accounting


Introduction
Stock market analysts use two basic methods when making decisions on where to invest their money, Fundamental Approach (FA) and Technical Analysis approach (TA). Analysts who use FA try ABOUT THE AUTHORS Massoud Metghalchi (PhD) is a professor of Finance in the School of Business Administration at the University of Houston -Victoria. His research interests include global equity markets, portfolio management, and technical analysis.
John Kagochi (PhD) is an associate professor of Economics in the School of Business Administration at the University of Houston -Victoria. His research area is in the field of Economic Development, Financial Economics and International Economics.
Linda A. Hayes (PhD) is a professor of Marketing in the School of Business Administration at the University of Houston -Victoria. Her research interests include leadership and market strategy, performance, and trends.

PUBLIC INTEREST STATEMENT
This paper uses technical analysis to investigate market efficiency of small and large cap stocks in the Johannesburg stock exchange from 2002 to 2018. The empirical findings show the best trading rules for both indexes involve the crossing of two moving averages, specifically the golden cross that generates buy and sell signals based on crossing a moving average of 50 days and a moving average of 200 days. We conclude that, in the case of the small cap index, one can apply the golden cross trading rule and beat the B&H strategy in the long and short run, including transaction costs and risk considerations. However, in the case of the large cap index, no technical trading rules studied could beat the B&H strategy both in the long and short run. The implication is that the market is efficient for large cap companies but inefficient for small cap companies. Therefore, South Africa needs to strengthen her regulatory capacities, especially for smaller companies, to enhance investor confidence.

Literature review
In the 1960s and 1970s, almost all financial economists held TA in contempt, arguing in favor of the random walk theory and the efficient market hypothesis (EMH). The EMH argues that no investors or traders can make abnormal returns on a stock because all data and information, past and present, are fully reflected in the current price. The EMH does not postulate that prices are always right but only says that no one knows whether a security is undervalued or overvalued, and deviations from the current stock price are random. Thus, there is an equal chance that stocks are undervalued or overvalued at any point in time, and this random deviation from the current price implies no one can consistently find undervalued stock and make abnormal profits. Some financial economists are, however, skeptical of the EMH and try to use various quantitative methods to beat the B&H strategy. In a recent article, Kishan (2017) writes that computers can see the various markets and are able to assess how they are performing with the ability to detect patterns that could reveal profitable trading strategies.
Most early research supported the EMH but the trend started to shift in the 1980s and 1990s when papers using TA methods started showing its predictive power. As a result, many financial economists began implementing TA methodology that results in a solid research stream concerning TA (see Yen & Lee, 2008;Kirkpatrick & Dahlquist, 2011). As noted by Park and Irwin (2007), after surveying 137 papers on TA from 1960TA from to 2004TA from , most early studies (1960TA from to 1988 do not support TA for equity markets. However, among the 95 modern studies (1988 to 2004), the authors conclude that 56 studies support the profitability of TA, 19 studies provide mixed results, and 20 studies do not support TA. Among the most noticeable studies is the seminal work by Sweeney (1986) that uses TA methodology to review ten currencies from 1973 to 1980 and concludes that TA is profitable in more than 80% of the cases. In addition, Lukac et al. (1988) use four TA indicators, including moving average trend determination, to 12 U.S. future markets and conclude that trading rules have predictive powers and can beat the B&H strategy. Elsewhere, Brock et al. (1992) apply two very wellknown TA indicators on the Dow Jones Industrial Index for a period of 90 years and conclude that their results are consistent with technical rules having predictive power.
Since the Park and Irwin (2007) survey, a majority of the research shows that TA has predictive power. However, a major question these studies have in common is whether a trader can use the predictive power of TA to beat the profitability of the B&H strategy considering risk and transaction costs. The answer to this question is mixed, where some research indicates that it is possible to beat the B&H strategy even considering risk and transaction costs, especially in the case of emerging stock markets. On the other hand, other research concludes that it is not possible to beat the B&H strategy, especially for developed markets. Studies concerning the profitability of TA include Balsara et al. (2009), Chen et al. (2011), Chen and Li (2006, Chong et al. (2010), Han et al. (2013), Hsu and Kuan (2005), Lesmond et al. (2004), Menkhoff and Taylor (2007), Metghalchi et al. (2008), Metghalchi et al. (2012), Metghalchi et al. (2015), Mitra (2011), Mobarek and Angelo Fiorante (2014), Teixeira and Inácio de Oliveira (2010), Shynkevich (2016) and Shynkevich (2017). About 25% of these research studies reject the predictive power of TA, while the other 75% support the predictive power of TA. However, half of the 75% of research that supports the predictive power of TA rejects the profitability of TA when considering transaction costs and risk. This study applies TA to two South African Stock Indexes traded in the Johannesburg Stock Exchange in South Africa. Fama (1970) defines weak-form efficiency in financial markets as one where security prices always fully reflect all available past information, while semi-strong efficient security prices fully reflect past and present information, and strong-form efficient security prices reflect all (past, present and future) available information. Some studies focusing on emerging markets, especially the African stock markets, support the "weak-form" efficient market hypothesis (Magnusson & Wydick, 2002;Ntim et al., 2011;Vitali & Mollah, 2010). These studies support the EMH arguing that stock prices follow the random walk hypothesis and no profitable information could be attained by investors to drive profits above the B&H strategy.

Market efficiency of African stock markets
However, other studies on African stock markets do not support the efficiency of Africa's stock markets. These studies argue that it is possible to discern recurring price patterns for profitable trading using the TA approach. For example, Ogieva and Ogbeide (2017) study of daily data from 2003 to 2015 for the Nigeria capital market concluded that the TA approach has predictive power for the Nigeria stock market. These findings are consistent with the Magnusson and Wydick (2002) regional study for a number of African markets during the 1992-1998 period, the Appiah-Kusi and Menyah (2003) study of 11 African stock markets, and the Vitali and Mollah (2010) study of the Nigeria Stock Market for the 1999-2009 period.
The Vitali and Mollah (2010) study apply correlations, runs and variance-ratio tests on daily data from selected African stock markets for the period 1999-2009. The results from their study find that the Egypt, Kenya, Morocco, Nigeria, and Tunisia markets are not weak-form efficient, implying that the TA approach discerns the future security prices in these markets. In contrast, their study finds South Africa to be weak-form efficient, indicating security prices in the Johannesburg Stock Exchange follow the random walk hypothesis. Using serial correlation methodology on monthly data from 1992 to 1998 for selected Africa stock markets, Magnusson and Wydick (2002) find empirical support for TA in Ghana, Nigeria and Zimbabwe. On other-hand Botswana, Côte d'Ivoire, Kenya, Mauritius, and South Africa financial markets are found to be weak-form efficient.
The Ntim et al. (2011) study constructs an African continent-wide stock price index (Africa All Share Index) of 16 African countries and applies variance-ratio tests on daily data for the period 2000-2007 to test market efficiency. Their study finds that the Africa All Share Index was weak-form efficient. However, this result is contrary to respective countries' national stock price indexes that they find are not weak-form efficient. The conflicting findings are largely attributed to the methodological approach adopted in the construction of the Africa All Share Index. The Ntim, et al. (2007) study finds that the Ghana stock market is not weak-form efficient using non-parametric variance-ratio tests. Elsewhere, Jefferis and Smith (2005) Appiah-Kusi and Menyah (2003) who also apply the GARCH approach on weekly data for 11 African countries. Their study results find Nigeria, South Africa, Botswana, Ghana, Ivory Coast and Swaziland are not weak-form efficient since TA had predictive power on future security prices. However, for Egypt, Kenya, Zimbabwe, Mauritius and Morocco, security prices follow the random walk hypothesis and, hence, are weak-form efficient.
Studies that look at other African country stock indexes are not conclusive. Mlambo and Biekpe (2007) apply runs-test methodology for serial dependency to measure efficiency of selected African stock exchanges. Their results show Namibia, Botswana, Kenya and Zimbabwe are weakform efficient while Mauritius and Ghana are not weak-form efficient. Additionally, data from Egypt, Botswana and BRVM (regional stock exchange serving eight West African countries) indicate the presence of serial correlation in stock returns. Their research recommends further study using linear models to confirm weak-form inefficiency, noting that the finding of weak-form efficiency in Namibia and Botswana could be attributed to dual listing of firms from the two countries in the South Africa stock exchange. Also, Alagidede and Panagiotidis (2009) investigate the behavior of stock returns in the seven largest stock markets in Africa using conditional volatility models and find the presence of volatility clustering, leptokurtosis and leverage effect in the African stock market data. Nwosu et al. (2013) apply linear and non-linear models to four major stock markets in Africa and the US using 1998-2008 data. Results from their study show that Egypt, Kenya and South Africa security prices are not following the random walk hypothesis, while Nigeria and USA security prices are following the random walk hypothesis, hence weak-from efficient.
Empirical evidence from Africa stock exchanges is still not conclusive on the applicability of TA, especially in emerging frontier markets. This is largely attributed to differences in study periods, frequency of data used, and the methodological approach adopted, where a battery of tests has been used to measure market efficiency. These tests include GARCH, variance-ratio tests, run tests, unit-root tests, and ARIMA linear and non-linear models. The current study is an attempt to fill this gap. Table 1 summarizes the major studies regarding African market efficiencies: As we can see from the above research, no major study has been done for South Africa using technical indicators to test the market efficiency of a South African stock index.

The Johannesburg Securities Exchange (JSE)
The

Data and methodology
We use two South African stock indexes, the FTSE/JSE Africa All Share Index which represents mostly large cap companies and the FTSE/JSE Africa Small Cap Index which represents small cap companies. Both index data are taken from the Datastream database. We use DataStream's Johannesburg interbank one-month average rate as a proxy for a money market rate. In addition, we use the spot gold price in Johannesburg in estimating gold returns. Data are from 1/2/2002 to 12/31/18. However, since we lose some data because of the estimation of a moving average of 200 days, all the calculations are made from 1/2/2003 to 12/31/2018. The daily stock index return and gold return, R t , are estimated in percentage terms and calculated using the following continuously compounded formula: To estimate the daily money market return, we follow Lucke's (2002) technique of dividing the annual interbank rates by 260. The stock index prices, gold prices and interest rates are expressed in South African Rand.
In this paper, we test the performance of both All Share and Small Cap South African stock indexes using popular technical trading rules. These rules are Simple Moving Average or SMA, Relative Strength Index or RSI, Moving Average Convergence Divergence or MACD, Stochastic indicator, the Parabolic Stop And Reverse indicator (PSAR), and Rate of Change or ROC technical indicators. For details of these indicators see either Murphy (1999) or Pring (1991). Briefly, the SMA is one of the oldest trend determination techniques that traders have been using since the middle of the twentieth century. SMA(N), simple moving average of N days, is estimated by N past closing index prices divided by N, or SMA(N) = sum (close, N)/N. We examine the SMA(N) where N = 20, 50, 65, 100, 150, and 200 days. The SMA rules can be described as follows: go long or a buy signal is emitted when the price index moves from below to above an MA(N), and a sell signal is emitted when the price index penetrates an MA(N) from above to below. Thus, a day is recorded a "buy" when P t > SMA(N) and a "sell" when P t < MA(N). Note that when the model emits sell signals, a trader stays out of the market or is neutral, and he or she is not shorting the market.
The second well-known indicator used in this paper is the Relative Strength Index (RSI), a popular momentum indicator developed by Wilder (1978). The calculation of RSI-14 which is used in this paper can be estimated as follows: where RS = Average of 14 days positive returns/Average of 14 days negative returns.
For an upward trending stock index, RSI usually stays above 50; thus, in this paper, we are in the market, a buy day, if RSI is greater than 50, and we are out of the market, or neutral, if RSI is below 50.
Another indicator is Appel's (1974) Moving Average Convergence Divergence (MACD). The MACD is another trend-following dynamic indicator. It indicates the correlation between two price moving averages. Appel recommended estimating MACD by subtracting the value of a 26-period exponential moving average (EMA) from a 12-period EMA. Then, a 9-period EMA of the MACD is estimated as a signal line as follows: In this paper, we have used a few variants of MACD, and the best variant is chosen as follows: We will be in the market, a buy day, if MACD is greater than zero and if the signal line is increasing; otherwise, we will be out of the market or neutral.
The Stochastic oscillator created by George Lane in the 1950s is also used in this paper. This popular indicator shows the location of a security's current close price relative to its price range over a given time period, and we use Lane's recommendation of 14 days. The basic calculation is called the raw stochastic (also known as %K) which specifies the relative position of the closing price within the range of the previous N days as follows: %KðTodayÞ ¼ 100 � close today À lowest low of N days ðhigh À lowÞ range of past N days (5) A smoother version of the raw stochastic (%K) is known as %D, which is essentially the moving average 3 of %K. A buy signal is emitted when % K goes above % D and we will be in the market; otherwise, we will be out of the market, or neutral.
The PSAR is a stop-loss system. The stop is continuously moved in the direction of the position. The indicator is below the prices on the bull market (Up Trend), when it's bearish (Down Trend), it is above the prices. Thus, a buy signal is generated when price is above PSAR and a sell signal is emitted, if price is below the PSAR.
The last indicator used in this paper is the Rate of Change (ROC), which is also referred to as simply Momentum. ROC measures the percent change in price from one period to the next. The speed of price movement and the rate at which prices are moving up or down provide clues to the amount of strength the bulls or bears have at a given point in time. We estimate the ROC by dividing the day's closing price by the closing price N number of days ago and then multiplying the quotient by 100 as follows: A buy (sell) signal is emitted when ROC crosses the zero line from below (above). When the ROC indicator emits a buy signal, a trader will be in the market (Buy day) and, when it emits a sell signal, the trader will be out of the market (sell day or neutral). We use 20-day and 30-day ROC trading indicators in this paper.
Following Metghalchi et al. (2015) for each technical trading rule, all trades are made at the end of the day at the close of the market. We assume a trader can estimate the price that will trigger a buy or sell signal and initiate a conditional limit order just a few minutes before market close. For example, assume a trader has adopted the SMA of 200 days trading rule, and the SMA200 days of the SA price index have closed at the level of 10,000 yesterday. The trader will have a conditional order to buy this index at market close if the index closes above 10,000. If the index closes above 10,000, then the trader's order is filled and the next day is a buy day. If the trader's order is not filled (the index closes below 10,000), then the trader's conditional order is not filled and the next day will be a sell day or the trader will be out of the market. This method of trading at the end of the day eliminates the nonsynchronicity bias. The trader is either in the market "buy" days, out of the market "sell" days or neutral.
We use one-indicator trading rules for all of the above indicators, and we also use two-indicator trading rules by combining the above indicators. An example of using two-indicator trading rules would be using a combination of Simple Moving Average 50 (SMA50) and RSI > 50.
If we follow the B&H strategy, we will be in the market all the time, and there will be a return every day. However, for our trading rule models, when the rule emits sell signals, the trader is out of the market or neutral. Therefore, it is inappropriate to compare these models where a trader could be many days out of the market with zero return with the B&H strategy. In order to compare each trading rule with the B&H strategy, we must decide what a trader would do if the rule emits a sell signal and the trader is out of the market. Following Metghalchi et al. (2019), we consider six strategies for these trading rules, and each strategy will have a return every day that can be compared with the B&H return for that day. These six strategies are: (1) The trader will be long the index when trading rules emit buy signals and be in the money market when out of the market (Strategy 1).
(2) The trader will be long the index when trading rules emit buy signals and short the stock index when a rule emits sell signals (Strategy 2).
(3) The trader will borrow at the money market rate and double the index investment when trading rules emit buy signals and be in the money when out of the market (Strategy 3).
(4) The trader will borrow at the money market rate and double the index investment when trading rules emit buy signals and short the stock index when a rule emits a sell signal (Strategy 4).
(5) The trader will be long the index when trading rules emit buy signals and, when a rule emits a sell signal, the trader goes long South African Gold index (Strategy 5).
(6) The trader will borrow at the money market rate and double the index investment when trading rules emit buy signals and go long South African Gold when a rule emits a sell signal (Strategy 6).
Note the return for leverage days is estimated as follows: R t = 2* R t -R tM , where R t and R tM are the index return and money market return on day t. Similar to the B&H strategy, a trader has a position every day. Therefore, a return can be calculated for each of these six strategies, and we can compare the risk return (inclusive of transaction costs) of each strategy with the B&H model.
For each trading rule and strategy, we will have a return each day and, then, we subtract each day's B&H return from the return of this trading rule and strategy to get the Daily Difference Return (DDR). We then add up this DDR for the period under consideration to estimate total daily excess return over the B&H strategy.
Each trading rule has many trading ins and outs of the market, and this implies transaction costs. To compare strategies to the B&H strategy that has no ins and outs of the market, we need to estimate the breakeven cost (BC) that eliminates total daily excess return over the B&H strategy during a period for each trading rule. Following the Bessembinder and Chan (1998) methodology, we estimate the one-way BC as follows: we add up DDR for the period under consideration to estimate total daily excess return over the B&H strategy; then, we divide this total excess return by the number of years to get average annual excess return for each rule and strategy. For strategies 1 and 3, we divide average annual excess return by the average number of trades per year to get the BC for that rule and strategy. For strategies 2, 4, 5, and 6, we divide the average annual excess return by two times the average number of trades per year to get the BC. The reason for two different estimations of BC is that for strategies 1 and 3, when a model emits a sell signal, a trader parks money in the money market and does not incur any transaction costs; whereas, for strategies 2, 4, 5, and 6, when the model emits a sell signal, the trader either shorts the market or buys gold and, in either case, incurs transaction cost.
Next, we estimate the return of each trading rule and strategy and analyze the breakeven cost (BC) and risk for each rule and strategy. If the BC for any trading rule is less than the actual cost of trading in South Africa and if the risk of that trading rule and strategy is less than the risk of B&H strategy, then a trader could beat the B&H strategy by applying this particular trading rule with the strategy under consideration. Table 2 presents summary statistics for both the All Share Index and Small Cap Index for the entire period and each sub-period studied. The average annual return for the All Share Index is 10.87% versus 12.83% for the Small Cap Index with standard deviations of 22.49 and 11.32%, respectively. We speculate that the reason large cap index has a higher standard deviation (SD) than the Small Cap Index is because of the sub-prime crisis of 2008-9 that affected mostly large cap stocks. The Kurtosis for the Small Cap Index is much higher than 3, implying that the return distributions are not normal; however, the Kurtosis for the large cap index is closer to 3, implying a near normal distribution. The Jarque-Bera test statistics for the Small Cap Index are very high and rejects normality of returns for the entire period and each sub-period. The Jarque-Bera test statistics for the large cap index are much smaller than the Jarque-Bera test statistics for small caps, although it still rejects normality of returns. There is a difference regarding autocorrelation of returns, with the autocorrelation for the large cap index being very low and the autocorrelation for the Small Cap Index being very high and significant.

Empirical estimation
In Table 3, we provide the estimated BCs and total number of trades for various trading rules and strategies based on one indicator for the South African All Share Index. The results of Table 3 are very weak, and no trading rule and strategy beat the B&H strategy. Let us take MA50 for strategy 1 as an example. Total DDR over the 16 years was −0.54780 (not shown) and MA50 implied 306 trades in and out of the market, resulting in a BC of −0.54780/306 = −0.18%. Similarly, for the ROC 30 trading rule for strategy 6, total DDR over the 16 years was −0.63769 (not shown) and ROC30 implied 324 trades in and out of the market, resulting in a BC of −0.10 [−0.63769/ (2*324)]. Since none of the BCs are large enough, we conclude that one indicator trading rules for the All Share Index is not better than the B&H strategy.
We also estimate the BCs for the Small Cap Index and report the BCs for various rules and strategies as shown in Table 4. The results of Table 4 are much better than the results of Table 3. For example, for the MA50 trading day rule for the Small Cap Index, the total DDR over the 16 years is 119.51 (not shown) and MA50 implies 138 trades in and out of the market, resulting in a BC of 119.51%/138 = 87%. Looking at BCs of various strategies, we conclude that strategy 1 is better than strategy 2 and strategy 3 is better than strategy 4; this is because strategies 2 and 4, when the rule emits a sell signal, the trader will short the market and incur transaction costs, whereas strategies 1 and 3 will be in the money market when the rule emits a sell signal. Also, strategy 6 using leverage has better BCs than strategy 5. Given that strategies 1, 3, and 6 are superior to strategies 2, 4, and 5, for the remaining discussion, we will only provide data for strategies 1, 3, and 6.
Next, we use two indicators for both the All Share Index and the Small Cap Index. Since there are many combinations of two indicators, we only show the best five trading rules with two indicators for both the All Share Index and the Small Cap Index.   It is surprising that among the many two-indicator models we have estimated, the best five models are all using two Simple Moving Average models. Using other indicators such as RSI or MACD did not return better results than the best five two-indicator trading rules shown. This is perhaps the reason many professionals use moving average as their most important tool. The best two-indicator models of combining one SMA and one non-SMA for the Small Cap Index were the combination of ROC30 and SMA200 which resulted in BCs of 0.78%, 2.24%, 1.16% for strategies 1, 3, and 6, respectively. For the All Share Index, a combination of ROC30 and SMA200 resulted in BCs of −0.13%, −0.03%, and 0.03% for strategies 1, 3, and 6, respectively.
The BCs in Table 5 for the Small Cap Index are very high and imply possibilities of applying technical trading rules to beat the B&H strategy. For example, a trader can follow strategy 1 and be in the market if SMA20 is greater than SMA200 and be in the money market if SMA20 is less than SMA200. If a trader does this for the Small Cap Index, and if the actual one-way transaction cost is less than 4.89%, then this trader will beat the B&H strategy. The same trading rule (SMA20 > SMA200) has tremendous profitability if we apply strategy 3 or 6. All the BCs for the Small Cap Index are very high implying profitability of technical trading for the Small Cap Index if a combination of two SMAs is used. For the three best trading rules for the All Share Index, the BCs are small for strategy 1 and are higher for strategies 3 and 6. If we do not consider risk, we could say technical trading rules beat the buy and hold strategy for both the Small Cap Index and the All Share Index, given that the actual cost of one-way equity trading in South Africa is 0.55% 1 . Almost all of the BC numbers in Table 5 are higher than 0.55%.

Risk consideration
As we have mentioned, at first glance, it seems that our best three trading rules (Combination of two SMAs of Table 5) have much higher BCs than the actual one-way trading cost (0.55%), thus implying that even considering transaction costs, technical trading rules are profitable for both Small Cap and All Share indexes. In order to compare these trading rules and strategies, we must also compare the risk of each trading rule and strategy with the risk of the B&H strategy. Each rule and strategy and the B&H strategy have a return each day. We define the risk of each rule and strategy by the standard deviation of the daily return of that rule and strategy. Table 6 presents the BCs, annual excess return, and risk of our three best models. −0.14 1.14 0.91 43 S1 = Strategy 1, S3 = Strategy 3, S6 = Strategy 6. BC = Breakeven cost, Trades = total number of trades.
Annual excess returns are estimated by adding up daily excess returns of each strategy over 16year period and, thereafter, dividing it by 16 (number of years). Daily excess return is estimated by subtracting the daily stock index return from the daily rule and strategy of 1,3, or 6 returns. We need to compare the risk of various rules and strategies with the risk of the B&H strategy. The risk (standard deviation) of the B&H strategy for the Small Cap Index for the entire period is 0.593% and for the All Share Index is 1.177%. The reason for the All Share Index having higher risk than the Small Cap Index could be that the sub-prime crisis of 2008 had more effect on the All Share Index than the Small Cap Index.
For the Small Cap Index, the risk of strategy 1 for the best three trading rules is lower than the risk of the B&H strategy. On average, the risk of the three best rules is about 76% of the risk of the B&H strategy (0.451/0.593). However, the risk of strategies 3 and 6 is higher than the risk of the B&H strategy. On average for the three best models (rules), the risk of strategy 3 is about 52% higher and the risk of strategy 6 is about 112% higher than the risk of the B&H strategy. It is not surprising to see the risk of strategy 3 and 6 being higher than the B&H strategy since they use leverage.
To summarize the results for the Small Cap Index, a trader has a choice of a risk-return trade-off. A trader can have lower risk (strategy 1) than the B&H strategy and beat the B&H strategy considering transaction costs. For example, a trader can choose SMA20 > SMA200 and strategy 1 for the Small Cap Index and will have an annual excess return over the B&H strategy of 4.89%. This trader will make on average one trade per year (total trades are 16 from Table 5 over 16 years). Assuming a oneway transaction cost of 0.55%, the net annual excess return for this rule and strategy 1 is 4.34% (4.89%-1*0.55%). If this trader can tolerate 52% more risk than the B&H strategy and follow this rule with strategy 3, then the net annual excess return will be 15.01%. If the trader prefers even more risk, this rule with strategy 6 will signify an annual net excess return of 19.87%. Another example is the famous trading rule of SMA50 > SMA200. This rule will have an annual excess return of 3.68 for strategy 1; this trading rule has 14 total number of trades over the entire period resulting in an average of 0.875 trades per year. Thus, the SMA 50 and 200 days trading rule will have an annual net excess return of 3.20% (3.68%-0.875*0.55). Similarly, the net annual excess return of the SMA 50 and 200 days trading rule with strategies 3 and 6 are 12.67% and 15.44%, respectively. In summary for the Small Cap Index, the combination of SMA technical trading rule works, and a trader can have Risk is the standard deviation of daily returns, AER = annual excess return of each strategy over the Buy & Hold strategy, BC is the breakeven cost, S1, S3, S6 are strategies 1, 3, and 6. lower risk (Strategy 1) than the B&H strategy and beat it considering transaction costs. In addition, there is a risk-return trade-off and, if a trader chooses to have more risk (Strategies 3 and 6); this trader can have substantial excess profits.
The results are not the same for the All Share Index. From Table 6, the BCs for strategy 1 with lower risk than the B&H strategy are lower than the actual transaction cost; thus, for the All Share Index, one cannot successfully apply technical trading rules with strategy 1. However, for the All Share Index, if a trader takes more risk than the B&H strategy, then one can beat the B&H. For example, the best rule for the All Share Index is SMA50 > SMA150 which will result for strategy 1 in a net annual excess return of −0.11% [0.68-(23/16)*0.55], a net annual excess return of 4.90% for strategy 3 and net annual excess return of 6.66% for strategy 6. However, average risk of strategy 3 for our best three trading rules for the All Share Index is about 1.665% which is 41% more risk than the B&H (1.177%); similarly, the average risk of strategy 6 is about 1.889% which is 61% more risk than the B&H strategy. Thus, the only strategy with lower risk than the B&H is strategy 1 which has a negative net annual excess return; thus, we conclude that a trader cannot effectively apply technical trading rules for the All Share Index.

Robustness analysis
In order to investigate the robustness of technical trading rules, we divide the entire 16-year period into two 8-year sub-periods. Sub-period 1 is from 2003 to 2010 and sub-period 2 from 2011 to 2018. Table 6 presents the BCs, annual excess return, risk, and number of trades for each subperiod for the best three trading rules for the Small Cap Index. The BCs are estimated by dividing the total excess return over the B&H strategy in each sub-period into the total number of trades in that sub-period.
As can be seen in Table 7, the BCs are very high for sub-period 1 and above the actual one-way transaction cost of 0.55 for sub-period 2. The risk of each strategy should be compared with the risk of B&H strategy for each sub-period, which is 0.614 for sub-period 1 and 0.568 for sub-period 2.
The conclusion is the same when analyzing the sub-periods as when analyzing the entire period. The risk of our three best trading rules of strategy 1 (0.48 to 0.50) is lower than the risk of the B&H strategy in sub-period 1 of 0.614, and the risk of our three best trading rules (0.40) is lower than the risk of the B&H strategy in sub-period 2 of 0.568. However, the risk of strategy 3 (0.97 to 1.00) for sub-period 1 and for sub-period 2 (0.80 to 0.81) is higher than the risk of the B&H strategy for sub-periods 1 and 2. For strategy 6, the risks are even higher than strategy 3. Thus, for the Small Cap Index, the same conclusion can be reached as for the entire period; namely, a trader can have lower risk (Strategy 1) than the B&H strategy but have net annual excess return over the B&H strategy. In addition, the trader has a good choice of a risk-return trade-off, where she can take higher risk than the B&H strategy and have very high net annual excess return.
For example, a trader in sub-period 1, using SMA20 > SMA200 for the Small Cap Index, will have annual excess return of 6.25 (from Table 7). This trader will make on average 0.625 trades per year (total trade in sub-period 1 is 5 over 8 years). Assuming a one-way transaction cost of 0.55, the net annual excess return for this rule and strategy 1 is 5.91 (6.25-0.625*0.55). If this trader can tolerate 60 more risk than the B&H strategy and follow this rule with strategy 3, the net annual excess return will be 24.62. If the trader prefers even more risk or 127 of the B&H strategy using Strategy 6, this rule with strategy 6 will imply annual net excess return of 27.63. The famous trading rule of SMA50 > SMA200 will result in net annual excess returns of 4.46, 21.73, and 23.03 for strategies 1, 3, and 6, respectively.
The same conclusion is reached in sub-period 2; a trader using SMA20 > SMA200 in sub-period 2 and following strategy 1 with lower risk (0.40) than the B&H strategy can make an annual excess return of 3.52 (see Table 7). This trading rule has a total of 11 trades over the sub-period 2 resulting in a net annual excess return of 2.77 (3.52-0.55*11/8). If this trader follows strategy 3 with 42 higher risk than the B&H strategy, she can make a net annual excess return of 6.16, and if she follows strategy 6 Risk is the standard deviation of daily returns, AER = annual excess return of each strategy over the Buy & Hold strategy, BC is the breakeven cost, S1, S3, S6 are strategies 1, 3, and 6.
with 89 more risk than the B&H strategy, she can make a net annual excess return of 12.87. For SMA50 > SMA200, the net annual excess returns in sub-period 2 are 1.94, 3.61, and 7.85, respectively. In summary, for the Small Cap Index, SMA technical trading works in sub-period 1 and sub-period 2, where a trader can have lower risk (Strategy 1) than the B&H strategy and beat it considering transaction costs. The risk-return trade-off exists for this trader in each sub-period with very high excess return over the B&H strategy.
A similar analysis was done for the All Share Index. We report in Table 8 the BCs, risk, annual excess return and total trades for our best trading rules for each sub-period. For the All Share Index, the best model is SMA50 > SMA150. From Table 8, we can see that for sub-period 1, a trader using this trading rule and following strategy 1 will have annual excess return of 2.35. This trader will make on average 1.25 trades per year (total trade in sub-period 1 is 10 over 8 years). Assuming a one-way transaction cost of 0.55, the net annual excess return for this rule and strategy 1 is 1.66 (2.35-1.25*0.55). In the same way, we estimate net annual excess return of this trading rule for strategies 3 and 6 to be 11.26 and 11.02, respectively. The net annual excess returns for the SMA50 and 200 days rule for the All Share Index in sub-period 1 are 0.55, 9.17, and 9.15, respectively, for strategies 1, 3, and 6. The risk of strategy 1 (0.908 to 0.973) is lower than the risk of B&H, 1.365. However, the risk of strategy 3 (1.816 to 1.976) and strategy 6 are much higher than the risk of B&H.
For sub-period 2 and SMA50 greater than SMA150 rule, the net annual excess returns are −1.88, −2.48, and 2.30, respectively. However, only strategy 1 has lower risk than the risk of B&H strategy (0.953) in sub-period two. Therefore, for the All Share Index and strategy 1, a trader will have negative net annual excess return for the entire period and sub-period 2, and she will have a small net excess return in sub-period 1. We conclude that a trader cannot use technical trading rules to beat the B&H strategy in case of the All Share Index.
In summary, for the Small Cap Index, the combination of SMA technical trading rules work for the entire period and in each sub-period 1 and sub-period 2, where a trader can have lower risk (strategy 1) than the B&H strategy and beat it considering transaction costs. Why does technical analysis work for small caps but not for large caps? One possible reason for the success of the Small Cap Index is that the underlying stocks are traded less and thus the prices may become stale. In Table 9, we provide the trading volumes for the small and large cap indexes.
As can be seen from Table 9, the trading volume for the All Share Index is almost 8 times the trading volume of Small Cap Index. Because of their size, small-cap companies have fewer shares outstanding. This may create liquidity problems for traders and investors. In case of negative news for small-cap companies, it may become difficult to find buyers if many investors are trying to unload their shares at the same time. Because of this, many investors avoid small-cap companies, and prices will be stickier for these companies. In a dissertation, Theart (2014) concludes that liquidity is not a statistically significant risk factor affecting all share market returns in the South African equity market. Instead, the effect of liquidity is significant in small portfolios only. Another possibility for profitability of the Small Cap Index could be the high autocorrelation of returns as implied by summary statistics of Table 2. The small size of companies, the absence of liquidity, and the presence of autocorrelation of returns in the Small Cap Index could be factors that contribute to foreign investors avoiding the small cap stocks. This results in more stable prices for smallcap companies and the possibility of profitable technical trading. This inefficiency of the Small Cap Index has implications for investors, regulators and policymakers and implies less than optimal allocation of investment resources in South Africa. Policy-wise, we recommend regulatory and institutional reforms in order to increase the liquidity and ownership of small cap companies.

Conclusions
There is controversy whether technical trading rules are useful for predicting stock market returns. Most research regarding emerging markets support that trading rules have predictive power; however, when considering transaction costs and risk, the results are not clear cut. In this paper, we investigate some popular trading rules for the South African All Share Index and Small Cap Index over the period 2003-2018. Our results support the predictive power of trading rules for the Small Cap Index but not for the All Share Index.
We use both one-indicator trading rules and two-indicator trading rules and consider six strategies. The best trading rules for both the Small Cap and All Share indexes involve the use of two simple moving averages. For the Small Cap Index, SMA20 > SMA200 and SMA50 > SMA200 are the best two models. For the All Share Index, SMA50 > SMA150 and SMA50 > SMA200 are the best trading rules. Out of six strategies, strategies 1, 3, and 6 were superior to strategies 2, 4, and 5.
For the Small Cap Index, our best two trading rules and strategy 1 with lower risk than the B&H strategy will have positive annual net excess return over the B&H strategy for the entire period and each sub-period, implying that technical trading rules can beat the B&H strategy considering both risk and transaction costs. However, we cannot say the same for the All Share Index for South Africa.