Wednesday, October 24, 2007

Investing in stocks by using moving average

Friends many of you might be in dilemma about investing in stocks. Equity investment is essential for giving your investment profile a higher growth but it’s also risky. So it’s always advisable to know a bit of techniques before you jump in. Essentially investment can be done by fundamental analysis or technical analysis. Choose the one you are comfortable with. Here I am going to discuss a method of technical analysis called moving average. But I also give a caution that though I have tried to tell the best it may have some error so please do a digging of yourself before you invest and learn well before you leap. A moving average averages data in a specified period that "moves" in order to stay current with the present. A 100-day moving average, for example, moves so that it always represents the average of the last 100 days. There are two kinds of moving averages discussed here, simple and exponentially weighted. SIMPLE MOVING AVERAGE The simple moving average is calculated, as you can imagine, quite simply. Lets use an example of a 200-Day Moving Average (200-DMA). You add the data of the last 200 days, and then divide the result by 200. Simple. The average "moves" and changes each day as the oldest value is dropped out of the calculation and the new day's value added in. In a simple moving average every day's value is given equal weight, and the effect of large values dropping out of the calculation as the average moves can unduly affect the result or skew the result in a way that may not be desirable. Another disadvantage of the simple moving average is that data must be maintained for the entire period covered by the average. For the standard 200-DMA this can become quite cumbersome. EXPONENTIALLY WEIGHTED MOVING AVERAGE (EMA) The exponentially weighted moving average (hereafter called the exponential average) has the advantage of giving the most weight to the most current value. Also it only requires that you maintain the value of the previous day's average rather than the data for the entire period being averaged, so it is very compact. TWO CALCULATION METHODS I hate to complicate the issue by presenting different methods of calculating EMAs, but I have used one method for years (Method A), and it is the one I use in calculating all of my indicators. For periods longer than 10, there is very little variation between the two methods, but for short periods Method B would be the preferred method. EMA CALCULATION METHOD A To calculate an exponential average you must first calculate the EXPONENT, which is the element in the formula that determines the period of the moving average. . Dividing 2 by the number of days in the period being averaged does this. For example, the exponent for a 200-DMA is determined by dividing 2 by 200. The result is 0.01 (2/200=0.01). After you have determined the exponent, you have to calculate a simple moving average for the specified period before you can begin the exponential weighting. The simple MA is only calculated once when setting up the exponential calculation. Once you have computed the exponent and the simple MA, you are prepared to begin calculating the exponential average. The following is a key for the symbols in the formula. PDA = Prior Day's Average (Begin with simple MA, thereafter PDA is an exponential value.) Exp = Exponent CDV = Current Day's Value (If you are averaging a stock price, CDV is today's price.) EMA = Current Day's Exponential Moving Average To calculate the exponential average, subtract PDA from CDV, multiply the remainder by Exp, and add the result to PDA (round to two places). Expressed as a formula: ((CDV-PDA)*Exp)+PDA = EMA Using real numbers: PDA = 52Exp = 0.01 (200-DMA)CDV = 49 ((49-52)*0.01)+52 = 51.97000 EMA CALCULATION METHOD B This in the method commonly used in charting software for EMA calculations. The following is the formula for calculating the exponent for this method: Exp = 2/Period + 1 For example, the exponent for a 200-DMA is determined by dividing 2 by 201. The result is 0.00995 (2/(200+1) = 0.00995). After you have determined the exponent, calculate a simple moving average for the specified period before beginning the exponential weighting. The simple MA is only calculated as a starting point in the calculation. Once you have computed the exponent and the simple MA, you are prepared to begin calculating the exponential average. The following is a key for the symbols in the formula. PDA = Prior Day's Average (Begin with simple MA, thereafter PDA is an exponential value.) Exp = Exponent CDV = Current Day's Value (If you are averaging a stock price, CDV is today's price.) EMA = Current Day's Exponential Moving Average The formula to calculate the exponential average with this method is: (CDV * Exp) + (PDA * (1 - Exp)) = EMA Using real numbers: PDA = 52Exp = 0.00995 (200 -DMA)CDV = 49 (49 * 0.00995) + (52 * (1 - 0.00995)) = 51.97015 HOW ARE MOVING AVERAGES USED The primary purpose of moving averages is to "smooth" data so that trends are more discernable. They are used to construct market indicators and to assist in interpretation of price charts. Moving average crossovers can also be used as signals to buy and sell. This is normally done in two ways: (a) By watching for price to cross whatever moving average you may be using (b) Running two moving averages of the same price or index, one faster than the other (for example, a 20-DMA and a 200-DMA), and buying or selling when the faster average crosses the slower. The weakness of moving average buy and sell systems is that they will most likely become unprofitable when the stock or index begins moving sideways in a narrow trading range. Under these circumstances price never moves above or below the average far enough to become profitable. I don't recommend pure moving average systems for timing purposes, but, in spite of their weaknesses, if you are trying to develop your own system of timing, the use of moving averages is a good place to start looking. WHICH AVERAGING METHOD TO USE Whether to use a simple of exponential average is a matter of preference. I prefer the exponential because of their compactness and because they are more influenced by current prices.

No comments: