
I got a question from one of our subscribers recently that asked me about the 'optimal' settings for moving averages. The short answer is that there are none in the sense that different moving average lengths (number of periods that are calculated) and types ('simple', 'exponential', etc.) are a matter of individual PREFERENCE. It's pretty subjective process a lot of the time. There is a more 'objective' determination for length setting involving 'optimization'. #1. Preference and experience; i.e., what you have found best gauges the trend for the stocks and the indexes that you follow and given the TIME FRAME you like to follow and trade (shortterm day to day, weekly, biweekly to monthly, etc). I will give you my take on what works well for moving averages as to type and length, that helps me make trading decisions for the short (235 days) to intermediateterm (23 weeks or a bit longer). #2. There is something called optimization that can be employed in some trading applications to check a moving average trading strategy or trading 'system'. EXAMPLE: For a given time period (e.g., the last 5000 days), what single moving average would have produced the best 'net profit' had you bought or shorted each time a stock or an index closed above or below that (single) moving average. More likely, as it's much more commonly used in making trading decisions, would be what set of TWO moving averages had the greatest net profit for a 'crossover' of the two; i.e., a moving average crossover trading strategy. For example, going long when a 10day average crosses ABOVE the 20day moving average; or, selling short when the shorter moving average crosses BELOW the longer moving average. Optimization is the computer running a test to determine, for the history you have, what set of moving averages performed best for certain criteria; e.g., 'net profit'. For example, I just ran a simple 'optimization' comparing the net profit (over the past 5000 trading days) for all SETS of Simple Moving Averages (SMA) from 5 to 13 as the shorter average, crossing above or below all longer moving average lengths from 21 to 55. And where I only bought when the shorter average crossed above a longer average; no shorting, in order to keep it simple. I would also note that an optimization computation can also include a test of the optimal 'trailing' exit or stopout point in case the trade lost money before there was another crossover 'signal', but was also not employed here in the example. The optimization procedure is usually done to determine the most profitable Trading Strategy or System by determining the total point gain; other computations can be done to account for commission costs, 'slippage', etc, in order to account for the real world of trading. With options, there are more complications, but a rough rule of thumb is that optimizing for the greatest point gain for a set of moving averages (for crossovers) will give us a good set of moving averages with which to determine trend direction. This also assumes that the optimization process has been used for at least several years worth of past price history. There is always something you have to optimize 'FOR'; e.g. greatest point gain. Results showing what set of two 'crossover' moving averages produced the best profit is shown next for the S&P 100 (OEX) and the Nasdaq 100 (NDX) Indexes. Note that ALL charts are as of the Tuesday (3/7) Close. S&P 100 (OEX) DAILY CHART: And, like all use of moving average indicators such as in 'trend following' methods, when the market goes sideways, you have the delightful phenomena known as being 'whipsawed' as a result of the shorter average crossing back and forth multiple times BEFORE there is much of a point gain from getting in on the upside crossover. NASDAQ 100 (NDX) INDEX; DAILY CHART: Needless to say, moving averages FOLLOW emerging and ongoing trends, versus the use of some indicators like stochastics, RSI and MACD that I wrote about in my last 3 (Wednesday) columns, to ANTICIPATE trend reversals. More on moving averages after a brief update of my market outlook. A MIDWEEK TECHNICAL UPDATE: The S&P, both the 500 (SPX) and the 100 (OEX) broke below the low end of their two week old trading range and dipped to the are of the 21day (simple) moving average, my key 'trading' average for the indexes. It has seemed likely that the S&P up trendlines would be reached and the indexes are getting near to them. Hard to predict whether prices will pierce them, since they so often act as strong support. The OEX rebounded to close back above its 21day average today, so is hanging 'tough' so to speak. The most bullish change in my indicators is in my callput 'sentiment' model which continues to fall as shown above. This is a contrary indicator in that the more bearish that traders get collectively, the closer we tend to get to a bottom or eventual bottom. The Nasdaq is another story and we've seen the two market diverge quite a bit during some periods of the past 12 months. The Nasdaq 100 (NDX) pierced ITS up trendline and fell under its pivotal 21day average. Since the Nasdaq, like the S&P may just be retreating to the low end of its multimonth trading range, I wouldn't read too much into these technical tea leaves. What is key is whether the Index can hold above the low end of its range at 16451640; a couple of closes below this area, especially back to back, suggests a next downside objective to as low as 1600. There's a fair amount of talk about a possible big Head & Shoulder's top formation in NDX that shaped up with the highs of December (left 'shoulder'), the January top (the 'head') and the nearly equal to Dec top seen recently (possible right 'shoulder') Again, I won't read much into this major top stuff unless the 16401645 area (the 'neckline') is pierced; if so, a pretty significant top would be suggested by such a break of the lateDec/Feb lows. BACK TO MY MOVING AVERAGE DISCUSSION: The Simple Moving Average (SMA) is the most common type of moving average and one that I use almost exclusively, as well as being the type that I would say is in most common use. Unless a chart with a moving average applied to it says otherwise assume the average is an SMA. The SMA is sometimes the only 'type' (e.g., Simple, Weighted, Exponential) moving average choice for 'the' moving average indicator on charts on web sites that have technical indicators that can be applied to price charts. This is not the case of charting applications like QCharts, TradeStation, etc. WEIGHTED MOVING AVERAGES Such 'frontloading' is the most popular method of calculating a weighted moving average but is not the only possibility. A variation called linear 'stepweighting' assigns a fixed increment weighting to each day that is dependent on the duration of the average. For example, in such a 5day weighted average the most recent days close is 5 times the weight of the first day of the 5day period; the prior day is 4 times the weight of the first day; the third day is 3 times the weight of the first day of the period and so on. EXPONENTIAL MOVING AVERAGE Because of this method of calculation, all daily moving average values are modified once the first exponential weighting occurs. The higher the percentage weighting given to the most recent close, the more sensitive will be the resulting moving average to the most recent price change. All data previously used is always part of the new result, although with diminished significance over time. In the Microsoft daily chart below, a 50day simple, weighted and exponentially smoothed average are all applied. For a 50day average and this period of time, the distance between any moving average TYPE (Simple, Weighted, Exponential) relative to the latest Close, especially when there is a rapid price change, is least with the weighted moving average and greatest with the Simple Moving Average (SMA): You'll note then in the chart above that we were alerted the quickest to price penetrations on the 50day WEIGHTED moving average; it provided a faster 'trigger' on taking or shifting stock/options positions. Much of the time this faster trigger did not bring major time differences in when prices crossed above/below the different averages. However, there were and are periods when small differences in timing are significant in trading results over time. When you DECREASE the 'length' (number of trading periods or 'bars' referenced) setting to smaller numbers, such as '21' in the Google (GOOG) chart below, you'll note that the differences between the SMA, Weighted and Exponential moving averages narrow in correspondingly. To gain a more sensitive 'trigger' to changes AFTER a trend gets underway and while keeping the same length (21 in this case), traders will often increase the WEIGHTING for the last Close or last few closes, as is seen below with the Weighted moving average. Same chart, same 21day average, but the stock now is quicker to cross above or below the new Weighted Moving Average. The advantage of the quicker reacting weighting of a weighted moving average is getting out of a position quicker when the trend momentum, up or down, slows. A principle disadvantage, assuming you are mostly relying on the moving average to get you into or out of a position is being 'whipsawed' and having an increased number of losing trades. In what can be a more effective use of giving STRONGER weight to the most recent close(s), making it a more 'sensitive' average, is as a tool to exit a trend AFTER a big/prolonged move already. Get back in the stock or Index only when a quicker reacting indicator and trend analysis suggest getting back in the direction of the dominant trend; and possibly then only for SHORTERterm price objectives. OR, get back in when the intermediate chart pattern (e.g., a break of a major trendline) or OTHER intermediate indicators suggest (e.g., a Moving Average Crossover) suggest that the intermediate trend has reversed. I'll have more to say on moving averages next week and will continue this thread and discuss my favorite type and setting for moving average as well as using moving averages to suggest support and resistance. MY INDEX TRADER COLUMN: More on my specific predictions, support and resistance, etc. is found in my weekend Index Trader column, available on the Option Investor.com WEB site (not part of the emailed weekend OI Daily). You will see a web LINK to the Index Trader at the top of your weekend Option Investor Daily email. My most recent (Sat, 3/4) Index Trader can also be viewed online by clicking here. ** EMAIL QUESTIONS/COMMENTS ** ** Good Trading Success! ** 