Usefulness of Moving Average Based Trading Rules in India

The paper analyzes benefits of moving average based trading rules in India for the period December 2000 to November 2010 covering a period of ten years. We used two stock indices namely Nifty and Junior nifty, jointly they cover top 100 stocks traded in Indian market. It is found that many trading rules offer profit opportunity without trading costs, but the profit vanishes when trading costs are accounted. We therefore estimated breakeven trading cost for each trading rules and found that it is very difficult to trade below breakeven trading cost and accordingly, small investors need to keep an eye on trading cost before selecting trading rule.


Introduction
In recent years objective of trading in equity is increasingly targeted on short-term gains.The traders follow technical trend lines and oscillators in their trading with varied rate of success.From large varieties of technical trading rules used by the traders, it is not easy to find out which particular rule is better.Experts with many years of experience may be able to take good trading decisions but they have a limit on their available time and therefore use of a systematic procedure is important.Further, different practitioners may have different views on the same information and therefore, systematic evaluation methods will reduce personal biases.A large number of models were developed by the practitioners to exploit the trading opportunity in the financial market but the successes of these models varied from case to case.Analysis of financial markets for identifying investment opportunity is generally divided into two distinctive paths: fundamental analysis and technical analysis.Fundamental analysts take trading decisions based on underlying economic reasons affecting a particular stock.Technical analysts believe that all the causes that can affect a market at any given time are already factored into that market's price.With the assumption that the current price fully discounts all the information available in a market, technical analysis, ignores economic issues.Instead, they use various technical charts and forecasting theories to analyze market trend.Historical market data is analyzed to identify development of any repetitive patterns, and if found, it is used to detect current market trend.Though fundamental analysis and technical analysis analyze the markets from two distinctive angles, both the methods try to identify and forecast the market trend and create trading signals with the hope of making a profit.In the study, we analyzed application of few technical trading indicators based on moving averages.

Literature Survey
The main premises on which the Technical Analysis is based are: a) Everything what can affect at the price of any asset is discounted and built-in in this price; b) Prices move in tendencies; and, c) History always is repeated.These bases contradict the weak form of the Hypothesis of Efficient Market and many studies showed evidence that the Technical Analysis is useless to earn a return adjusted by risk that outperform a simple buy and hold trading strategy.According to Bachelier (1900), prices do not follow any pattern and that the movements of the past prices cannot be used to predict the movements of the future prices.He inferred that the mathematical expectation of the speculator is zero.Fama (1965) found that a strategy based on a system of filters could not give better result in comparison to buy and hold strategy and coined the term "Market Efficiency".Levy (1971) analyzed 32 investment strategies based on graph plots, and inferred that the strategies cannot give returns superior to those of the market.However, some recent studies have given some evidence of profit using technical trading.DeBont and Thaler (1985) detected reversion to the average in the returns of long-term.Stocks with low past returns of long-term have future higher returns.They studied the 35 stocks with in the NYSE between 1932 and 1977 and found that stocks with higher yields in the five previous years had a lower relative return (than the market index) in the following three years.The stocks with lesser yields in the five previous years had a higher relative return in the following three years.French and Roll (1986), Lo and MacKinlay (1988), Jegadeesh and Titman (1993), among others, showed that the returns are predictable on the base of past returns.For individual stocks, the certainty of this prediction is small.They found that the returns are positively correlated in the horizon of several months but negatively correlated in the horizon of three to five years (the losers win and the winners lose).Nefcti (1991), Brock, Lakonishok and LeBaron (1992) and few others used trading rules based on simple moving average showed that such strategies, in general, have a return superior to the buy and hold strategy.Brock, Lakonishok, and LeBaron (1992) inferred that their results are consistent and, therefore, the signals of buy and sale created by the Technical Analysis are predictive.Nevertheless, the trading costs would have to be taken carefully into account before doing such investment strategies.They concluded, "It is possible that the rules of the Technical Analysis explain some hidden patterns of behavior.We want to underline that our analysis is based on the simplest rules.Thus, the previous conclusion that the Technical Analysis is useless is at least premature".Sullivan, Timmermann and White (1999) reviewed study of Brock, Lakonishok, and LeBaron (1992) to find out applicability of such schemes outside the sample.In the sample extended to 1996, they reported that there would not be certainty that the rules of trading created by the Technical Analysis are useful during the extended period.It can therefore be implied that the reaction from various studies are mixed and clear evidence of superior performance of technical analysis are not available.

The Moving Average Method
The moving average (MA) method is the most widely used methods of technical analysis.As distinct from a diagrammatic technical analysis, the MA method is easy to quantify and apply in investment decision-making or empirical tests.A moving average is an average of observations from several successive time-periods.To estimate a moving average sequence, we calculate successive averages of a predetermined number of successive observations.The objective of the MA method is to smooth out variations in the data.The method compares of the recent market price with the MA of the stock price.If the current price is higher than the MA, a long investment position is taken.Conversely, if the current price is lower than the MA, a short position is taken.In another variation, the current market price is replaced with a short MA, and method compares of the short MA with the long MA.The effectiveness of this method largely depends on how the moving averages are calculated i.e. how many past observations are used to estimate MA and the methodology used to estimate the MA.There are three types of MAs  Simple (arithmetic),  Weighted (linear) and  Exponential The simple MA is a time series constructed by taking averages of several sequential values of another time series.It is the mathematical average of past few days observed price data.Some argue that greater weight should be given to observations that are more recent and worked out weighted MA by giving predetermined weightings to past observations so that observations that are more recent are given a greater weight in the average.However, both the simple and the weighted MAs exclude observations beyond the range considered for calculating average.In exponential MA, all the existing observations in the database are considered and like the weighted MA, it gives greater weights to more recent observations.The weightage of past observations are reduced exponentially.The scale of reduction in weight age is controlled by setting the value of α.EMA t = α.P t + (1-α)EMA (t-1) EMA t is the value of exponential moving average including current observation (P t ) on time't'.The scaling factor 'α' determines weight distribution to past data.The moving averages have a major deficiency.They are mainly a "lagging" indicator.Moving averages, because of their mathematical construction (averaging prices over some prior periods), lag behind the current price.In financial markets, where the price moves very fast, this lag affect will affect identifying trading opportunity in correct time.The shorter the length of a moving average, the more sensitive it will be to price changes and the longer the length of a moving average, the less sensitive it will be to sudden price variation.According to the moving average rule, buy and sell signals are produced by comparing two moving averages of the stock.A typical moving average trading rule produces a buy signal when the short-period moving average crosses the long-period moving average from below and vice versa.The moving average rule is a trend following system and when prices are rising (falling), the short-period average have larger (lower) values in comparison to the long-period average, signaling a long (short) position.In the study we examined, a buy (sell) signal is created when the short period moving average is above (below) the long period moving average.The same trading position is held until the positions of two moving averages are reversed.

Index data used in study
The current study examines the profitability of technical trading rules applied to two Indian Stock Indices for the period December 2000 to November 2010, covering a period of 10 years.The daily closing values of i) S&P CNX Nifty and ii) CNX Nifty Junior are analyzed for the study.

S&P CNX Nifty
The S&P CNX Nifty is a 50 stock, float-adjusted market-capitalization weighted index for India, accounting for 23 diversified sectors of the economy.It is used for a variety of purposes, such as benchmarking fund portfolios, index based derivatives and index funds.The S&P CNX Nifty is derived from economic research and is created for those interested in investing and trading in Indian equities.The S&P CNX Nifty stocks represent about 65% of the total float-adjusted market capitalization of the National Stock Exchange (NSE).The S&P CNX Nifty is a diversified index, accurately reflecting the overall market.The reward-to-risk ratio of S&P CNX Nifty is higher than other leading indices, offering similar returns but at lesser risk.Selection of the index set is based on the following criteria:  Liquidity.For inclusion in the index, the security should have traded at an average impact cost of 0.50 % or less during the last six months, for 90% of the observations. Float-Adjusted Market Capitalization.Companies eligible for inclusion in the S&P CNX Nifty must have at least twice the float-adjusted market capitalization of the current smallest index constituent. Float.Companies eligible for inclusion in the S&P CNX Nifty should have at least 10% of its stock available to investors (float).For this purpose, float is stocks which are not held by the promoters and associated entities (where identifiable) of such companies. Domicile.The company must be domiciled in India and trade on the NSE.
The S&P CNX Nifty reflects the return one would get if an investment is made in the index portfolio.As the S&P CNX Nifty is computed in real-time, it takes into account only the stock price movements.However, the price indices do not consider the return from dividend payments of index constituent stocks.Only the capital gains and losses due to price movement are measured by the price index.In order to get a true picture of returns, the dividends received from the index constituent stocks also need to be included in the index movement.Source: S&P CNX Nifty Index Methodology, http://www.nseindia.com/content/indices/nifty_freefloat_method.pdf3.2.2CNX Nifty Junior The next rung of liquid securities after S&P CNX Nifty is the CNX Nifty Junior.It may be useful to think of the S&P CNX Nifty and the CNX Nifty Junior as making up the 100 most liquid stocks in India.As with the S&P CNX Nifty, stocks in the CNX Nifty Junior are filtered for liquidity, so they are the most liquid of the stocks excluded from the S&P CNX Nifty.The maintenance of the S&P CNX Nifty and the CNX Nifty Junior are synchronized so that the two indices will always be disjoint sets; i.e. a stock will never appear in both indices at the same time.Hence it is always meaningful to pool the S&P CNX Nifty and the CNX Nifty Junior into a composite 100 stock-index or portfolio.CNX Nifty Junior is computed using market capitalization weighted method, wherein the level of the index reflects the total market value of all the stocks in the index relative to a particular base period.The method also takes into account constituent changes in the index and importantly corporate actions such as stock splits, rights, new issue of shares etc without affecting the index value.From May 04, 2009 CNX Nifty Junior is computed using Free Float Market Capitalization weighted method, wherein the level of index reflects the free float market capitalization of all stocks in Index.CNX Nifty Junior was introduced on January 1, 1997, with base date and base value being November 03, 1996 and 1000 respectively and a base capital of Rs.0.43 trillion.
 CNX Nifty Junior represents about 11 % of the Free Float Market Capitalization as on Sep 30, 2010. The traded value for the last six months of all Junior Nifty stocks is approximately 14% of the traded value of all stocks on the NSE  Impact cost for CNX Nifty Junior for a portfolio size of Rs.25 lakhs is 0.09%.
A stock from the above two index may be replaced from an index for the following reasons:  Compulsory changes like corporate actions, delisting etc.In such a scenario, the stock having largest market capitalization and satisfying other requirements related to liquidity, turnover and free float will be considered for inclusion. When a better candidate is available in the replacement pool, which can replace the index stock.
However where a stock is replaced due to a stock being transferred to S&P CNX Nifty then the stock coming into CNX Nifty Junior need not have twice the market capitalization of the stock which is being transferred to S&P CNX Nifty.Source: http://www.nseindia.com/

Trading Costs
Assessing the profitability of trading strategies needs an assessment of the trading costs facing the trader.Total trading costs include not only the bid-ask spread but also applicable commissions, price impact costs, taxes, short-sale costs, and other immediacy costs.It is found that institutions that are passive traders (using limit orders or crossing trades) incur opportunity costs because trades are not always carried out and those that are active traders (using market orders) incur sizable immediacy costs.A trading rule is useful when the trading can create risk-adjusted profit that is greater than the trading cost.The trading cost in financial markets are always positive, so a market is still considered efficient as long as a technical trading system does not produce returns greater than trading costs.A few decades before, trades in the market were recorded and carried out manually, causing a higher trading cost, and many times exceeding 1% of turnover value.Because of computerization of trades in the exchanges, the costs of trading are reduced.Costs will be further reduced if transaction is settled off and delivery is not taken.Besides, technical trading in derivatives market can be carried out paying much lower trading costs.In any case, a trade is profitable only if it produces net profit more than the trading costs.Let C be the trading cost per trade and N t be the number of trading signal produced by the trading rule in year t.Then the trading cost incurred in the year would be 2CN t per year (trading cost is payable both during buying and selling).The trading are profitable when the Annual profit (P t ) is greater than Trading cost (2CN t ).The breakeven trading cost may be estimated as follows: C(breakeven) estimates can also be used as a measure of trading rule performance, the higher the figure, the higher the capacity of the trading rule to absorb the trading cost.

Estimation of Returns
The buy and sell signals (S t ) generated from the model are transformed to +1 and -1 respectively and one period return based on trading signal is computed as follows: R (t+1) = S t ( X (t+1) -X (t) ), where, R (t+1) is one period profit of the trader from the decision taken (S t ) at period t.When S (t+1) = S t , the existing position of the asset is maintained and no new transaction is carried out and no trading cost is incurred.When S (t+1)  S t , the existing position is reversed needing two transactions (first for closing the current position and second for taking a new position).
Taking trading cost into account, daily return becomes: R (t+1) = S t ( X (t+1) -X (t) ) -tc S (t+1) -S t X (t) , where tc is trading cost of a transaction and S (t+1) -S t  is absolute value of the difference between S (t+1) and S t .
The returns from the trading are converted to percentage return, and produced in tables 1 and 2.

Analysis of Results
The profit figures from trading rules based on various moving averages are tabulated in tables 1 to 2. Table-1 contains results with respect CNX Nifty and tables 2 contain result of CNX Nifty Junior.In columns 2 and 3, returns gained in 'buy' and 'sell' positions are reported.In column 4, combined result arising out of both buy and sell positions are produced.The returns are estimated using log differences of daily price quotes and further added to get annualized return.Column 5 produced number of trades per year.In column 6, breakeven trading cost figures are given.If actual trading costs exceed breakeven trading cost, the net profit from that trading rule will be negative.It can be found from the tables that the annualized return figures following all 'Buy' signals are positive and in most cases, returns following 'Sell' signals are positive.This shows that trading signals are able to detect both uptrend and downtrend of the market well.Producing Sell signal in downtrending market enabled to produce profit in bear markets.

Data Snooping Bias
According to White (2000), good performance results from the model can be gained by an extensive specification search and specifications that have given better results can be handpicked.He argued that even when no relations exists, extensive data manipulation often reveal one or more forecasting models look good, which are purely an act of data manipulation.
To remove the data snooping, he suggested a procedure to test a hypothesis on predicting ability of the models.
The procedure was based on the work of Diebold and Mariano (1995) and West (1996) to test predicting superiority of a specific model over a benchmark model.The performance of the models can be measured by estimating following performance statistic.
, where n is the number of forecasts made, µ f t t + is a measure that estimate difference in returns between a trading rule performance and a benchmark.
In the study, daily data for 10 years having 2497 daily observations for each time series are used.The first trading signal was produced using first 60 observations, as one of the trading rules needs 60 days previous data to produce trading signal.Therefore in our analysis n = 2437, p=61 and T=2497.In the analysis, we have set 1 t = , so that prediction is made on day-to-day basis and the prediction is valid for one day.The performances of the models are benchmarked against no position and zero return.The null hypothesis is that the model is no better than the benchmark, i.e., 0 ( * ) 0 H E f = Rejection of the null will lead to the conclusion that model cannot produce superior trading performance relative to benchmark.The p-values of the hypothesis tests using the time series data are given in table-3.It can be seen that the null hypothesis can be rejected even at 1% significance levels in most of the cases.Thus, it can be inferred that the returns produced by the models are statistically significant when trading costs are not considered.

Results after trading costs
The results from the trading models were generally satisfactory when trading costs are ignored.However, the problem surfaces when trading costs are added.The breakeven trading costs for each series were estimated and reported in table 1 and 2. If the actual trading costs are higher the breakeven trading costs, the trading based on technical rules are not viable.The breakeven trading costs in Nifty series with 3 day SMA is as low as 0.163%.However, positive return of from that rule cannot be realized unless trading costs are kept much below breakeven trading costs.Few trading rules, such as 60 day SMA in Nifty series produces 20.71% annualized profit with a breakeven trading cost of 1.256%.Traders following this rule may remain profitable even after trading costs, as the rule produced lower number of trades per year.It can be seen that, use of shorter period moving averages show better returns than longer period moving averages when trading costs are ignored, but shorter period moving averages cause more number of trades and increases trading cost.The shorter period moving averages are more affected by changes in trading cost.The higher the trading costs, the lesser number of trades are desirable and traders need to switch to the models that use longer moving averages.

Conclusions
The analysis in the study has found profits from technical analysis when trading cost is ignored or kept at a low level but found that trading cost is an important factor determining profitability of the trading.An increase in trading cost can make a profitable trading rule to report losses.The trading costs are also not fixed and vary with time, primarily due to bid-ask spread changes and impact-costs, etc.To have some control on trading cost, we estimated breakeven trading costs that can be used as an upper limit for trading.Unless actual trading costs are lower than the breakeven trading cost, trading on the technical rules may not be undertaken.Further, these models give trading signal when market movement in either direction is high.In such periods, some of the ingredients of trading cost, e.g., bid-ask spread, impact costs, etc. also increases and as such, breakeven trading cost for individual models are an important controlling boundary to decide execution of a trade.Trading is not an easy path for small investors as trading cost for them is higher in comparison to large investors.Small investors trading on delivery basis, pays trading cost of about 1% per trade.With such high trading costs making profit from technical trades are difficult.Only a few models showed breakeven trading cost of more than

Figure
Figure 2. Price Chart for CNX Nifty Junior

Table 1 .
Results using Nifty Series

Table 2 .
Results using Junior Nifty Series