Chapter 11

Calculating Indicators and Oscillators

IN THIS CHAPTER

check Analyzing trends using moving averages

check Generating signals with stochastic oscillators

check Measuring momentum with the MACD

check Comparing securities using relative strength

In today’s tech‐driven world, computer technology and powerful software developments have ushered in a new era for technical analysts. With greater reliance on Internet‐ready computers, tablets, and smartphones, we’re constantly connected to the online world. This gives us endless access to a steady stream of financial data, news, analysis tools, and much more, something that was little more than a wild dream only a decade or two ago. Thanks to technology improvements, we have more methods and resources available to us as market participants. In technical analysis specifically, powerful chart indicators have become faster, easier to calculate automatically, and much more accessible to the individual investor.

However, the ease of calculating, modifying, testing, and using computer‐generated trading tools is as much a curse as it is a blessing. New traders often shun visual pattern analysis, instead preferring computer‐generated indicators (series of data points) and oscillators (which show fluctuations of data points). Doing so is a mistake. Although the perceived precision of these calculations seems to add to their allure, you nevertheless need to be aware that computer‐generated analysis tools still have their flaws. These changes give you a combination of visual pattern analysis and calculated indicators and oscillators, such as those we discuss in this chapter.

warning The indicators and oscillators that we describe in this chapter provide you with additional insight into the technical condition of a stock or the market. As with all other financial analysis tools and methods, however, they can’t provide faultless trading signals. No indicator works in every situation, finds every opportunity, and generates perfectly accurate trading signals with guaranteed certainty. When used properly, these indicators help increase your probabilities of making profitable trading decisions, but they must be understood thoroughly and integrated into your trading system appropriately.

As a new trader, it’s easy to be swept up in the seemingly infinite array of indicators and analysis tools at your disposal. By following too many, you risk what we refer to as analysis paralysis. This results when your never‐ending analysis and insatiable desire to check one more indicator, chart, or data set freezes you, preventing you from actually making a decision and taking action. You’re paralyzed by your unending analysis. At the end of the day, your research means nothing if you fail to pull the trigger and place a trade. However, by narrowing your focus to a specific set of tools and indicators that you’re intimately familiar with, you prevent yourself from suffering the unwanted effects of analysis paralysis.

This chapter describes how to create and use a manageable subset of the tools that are available in today’s charting platforms. We recommend that you learn how to use a small set of tools that can help you trade profitably rather than worry about how every available tool works. Find out how to trade profitably using this subset of tools before deciding that you need to add to your toolbox.

In this chapter we describe the computer‐generated tools that we use every day. We explain two types of moving averages, along with the highly popular moving average convergence divergence indicator (MACD) and the stochastic oscillator. In addition, we discuss the powerful concept of relative strength.

tip These indicators and concepts are but a tiny subset of the full collection of technical analysis tools that are available online or in other charting software packages. Although simple, this subset is more than enough to get you started as a profitable trader. Again, try to become familiar with these common and effective tools before branching out into other, more complicated technical indicators. Play around with them using historical data to see when they work and when they fail, and try to understand why. That way, you’ll know when the tools can help you and when they can’t.

The Ins and Outs of Moving Averages

A moving average is a trading indicator that shows the direction and magnitude of a trend over a fixed period of time. Some traders call it a price overlay because it’s superimposed over the price data in a bar chart. Moving averages visually smooth out the data on a price chart to help make trend identification less subjective. All moving averages follow a stock’s price trend but can’t predict changes. They report only what has happened.

As its name implies, a moving average shows the average of a stock’s up‐and‐down price movements during a specific period of time. A stock’s daily closing price usually is the value being averaged, but any value on a price chart can be displayed as a moving average. Some traders, for example, prefer using the midpoint between daily high and low prices for the moving average calculation, while others prefer to use the opening price, the high, or the low. You can also apply moving averages to other financial data, such as volume.

You’ll find that moving averages are used as indicators by themselves or in conjunction with other indicators. They’re also the building blocks for other indicators and oscillators such as the moving average convergence divergence (MACD), invented by Gerald Appel in the 1960s. Before discussing how the MACD is used (see the section “Tracking Momentum with the MACD,” later in this chapter), we must explain moving averages and how they’re calculated. Two important types of moving averages are described in this section.

Simple moving average

A simple moving average (SMA) is simple to calculate and simple to use. To calculate it, you add a number of prices together and then divide by the number of prices you added. (We explain how to use an SMA in the later section “Comparing SMAs and EMAs.”)

An example makes the SMA clearer. In this example, a nine‐day moving average of Bank of America’s (BAC) closing price is calculated throughout August 2016 and then is plotted on a price chart. To start the SMA calculation, use the closing prices shown in Table 11‐1. Add the first nine closing prices together, from August 1 through August 11, and divide by 9. The resulting value is placed alongside the ninth trading day, August 11. Continue for each subsequent day in the month.

TABLE 11‐1 Simple Moving Average of BAC Closing Price

Date

Close

SMA

8/1/2016

14.21

8/2/2016

14.01

8/3/2016

14.36

8/4/2016

14.36

8/5/2016

14.92

8/8/2016

15.00

8/9/2016

15.06

8/10/2016

14.69

8/11/2016

14.76

14.59

8/12/2016

14.79

14.66

8/15/2016

14.90

14.76

8/16/2016

15.04

14.83

8/17/2016

15.02

14.90

8/18/2016

15.03

14.92

8/19/2016

15.09

14.93

8/22/2016

15.05

14.93

8/23/2016

15.22

14.98

8/24/2016

15.27

15.04

8/25/2016

15.40

15.11

8/26/2016

15.66

15.19

8/29/2016

15.71

15.27

8/30/2016

16.06

15.38

8/31/2016

16.08

15.50

Figure 11‐1 shows a bar chart of Bank of America (BAC) from August 2016 through September 2016. The thick black line superimposed on the chart’s price data represents the simple moving average for BAC.

image

Chart courtesy of StockCharts.com

FIGURE 11‐1: This chart shows a nine‐day simple moving average for Bank of America.

To calculate the second SMA point, add the prices from August 2 through August 12 together, divide by 9, and place the result as the SMA data point next to August 12. Another way to think of calculating SMAs is that you drop the oldest price in the calculation and add the closing price from the next price bar. Continue this series by dropping the oldest price, adding the newest price, and dividing by 9 for the remainder of the month.

If you’re mathematically inclined, here’s what the series looks like as an equation:

images

tip Luckily, you don’t have to perform these calculations yourself. You can let StockCharts.com automatically calculate the SMA for you. Below your chart on the SharpCharts Workbench (http://stockcharts.com/h-sc/ui), you find the simple moving average as one of the dropdown menu options in the Overlays panel. Select Simple Moving Avg. from the menu, choose the period over which you want the SMA to be calculated, and then click Update. The simple moving average lines will be automatically generated on your chart. Refer to Figure 11‐1 to see an example of a nine‐day simple moving average for Bank of America (BAC).

Exponential moving average

Another commonly used moving average is the exponential moving average (EMA), which can be superimposed on a bar chart in the same manner as an SMA. The EMA is also used as the basis for other indicators, such as the MACD (moving average convergence divergence) indicator, which we discuss later in this chapter.

Although the calculation for an EMA looks a bit daunting, in practice it’s simple. In fact, it’s easier to calculate than an SMA, and besides, your charting software will do it for you. Here are the calculations:

images

You can handle the start of the calculation in one of two ways. You can begin either by creating a simple average of the first fixed number (N) of periods and use that value to seed the EMA calculation, or you can use the first data point (typically the closing price) as the seed and then calculate the EMA from that point forward. You’ll see other traders handling it both ways, but the latter method makes more sense to us. It’s the method used in calculating the EMA amounts in Table 11‐2, which shows a nine‐day EMA calculation for Bank of America throughout August 2016. The EMA value for August 1 is seeded with that day’s closing price of $14.21. The actual EMA calculation begins with the August 2 closing price. For comparison, we include the results of the earlier SMA calculation to illustrate the difference between an EMA and an SMA.

TABLE 11‐2 Exponential Moving Average of BAC

Date

Close

EMA

SMA

8/1/2016

14.21

14.21

8/2/2016

14.01

14.17

8/3/2016

14.36

14.20

8/4/2016

14.36

14.23

8/5/2016

14.92

14.36

8/8/2016

15.00

14.48

8/9/2016

15.06

14.59

8/10/2016

14.69

14.61

8/11/2016

14.76

14.64

14.59

8/12/2016

14.79

14.67

14.66

8/15/2016

14.90

14.71

14.76

8/16/2016

15.04

14.77

14.83

8/17/2016

15.02

14.82

14.90

8/18/2016

15.03

14.86

14.92

8/19/2016

15.09

14.90

14.93

8/22/2016

15.05

14.93

14.93

8/23/2016

15.22

14.98

14.98

8/24/2016

15.27

15.03

15.04

8/25/2016

15.40

15.10

15.11

8/26/2016

15.66

15.21

15.19

8/29/2016

15.71

15.31

15.27

8/30/2016

16.06

15.46

15.38

8/31/2016

16.08

15.58

15.50

In this example, the EMA doesn’t show the same nine‐day lag at the beginning of the chart as the SMA. Notice that the results of the moving‐average calculations also differ. Figure 11‐2 shows the difference between the SMA and the EMA on the Bank of America chart. The EMA data is shown as a solid dark line. For comparison, the SMA data is also plotted using a thinner, lighter line.

image

Chart courtesy of StockCharts.com

FIGURE 11‐2: This chart shows a nine‐day exponential moving average for Bank of America.

tip Good news! You don’t have to perform the EMA calculation yourself either. You can let StockCharts.com automatically calculate it for you. Below your chart on the SharpCharts Workbench (http://stockcharts.com/h-sc/ui), you’ll find the exponential moving average as one of the dropdown menu options in the Overlays panel. Select Exp. Moving Avg. from the menu, choose the period over which you want the EMA to be calculated, and click Update. The exponential moving average line will be automatically generated on your chart. Refer to Figure 11‐2 to see an example of a nine‐day exponential moving average for Bank of America (BAC).

Comparing SMAs and EMAs

Both simple moving averages and exponential moving averages are used regularly by long‐term investors, position traders, and short‐term traders alike. Each moving average has its strengths and weaknesses. Which you choose can be a matter of personal preference, but one may be better suited than the other depending on the time frame you’re trading. As position traders, we use a combination of both SMAs and EMAs.

Consistency

The SMA has the benefit of being consistently calculated from one charting platform to the next. If you ask for a 20‐period SMA, you can be certain that the result will be identical to every other 20‐period SMA for the same stock during the same time period (assuming there are no errors in the price data).

warning Unfortunately, EMAs are not always as consistent as SMAs because of the way the EMA is calculated. The starting point matters. You actually need more data when calculating an EMA than was used in the example in Table 11‐2. In theory, you need to use all the price data available for any individual stock. In practice, however, that is rarely done. Some charting software enables you to specify how much data is used when calculating an EMA, but most web‐based charting sites do not. The result: One charting vendor may calculate EMA values that differ from those provided by another.

Discovering that you’re basing your trading decisions on an inaccurate moving average is more than a bit disconcerting. This problem has less of an effect with short‐period calculations such as the nine‐day EMA example in Table 11‐2, but it’s especially problematic for longer‐term EMA calculations. For this reason, the EMA is commonly reserved only for shorter‐term periods. For example, many traders use three moving averages on their daily charts: a short‐term 20‐day EMA, an intermediate‐term 50‐day SMA, and a longer‐term 200‐day SMA.

Reaction time

In general, short‐term traders are more likely to employ EMAs, but position traders are more inclined to use SMAs. The EMA is usually closer to the current closing price, which tends to make it change direction faster than the SMA. As a result, an EMA is likely to be quicker in signaling short‐term trend changes. One of the most common EMA durations is the 20‐period. This is a popular moving average on daily charts.

tip The SMA is probably the better indicator for identifying long‐term changes in a trend. Unfortunately, those signals are likely to take more time to appear than the ones generated by a comparable EMA. The method used to calculate the SMA causes it to react to price changes a bit more slowly, and that’s the trade‐off for getting a signal that is potentially more reliable.

Sensitivity

An unfortunate result of the method of calculating an SMA is that every time you add a price, another price falls off the back end of the equation. In other words, each new SMA data point is affected by two prices, the most recent closing price and the oldest closing price in the calculation. Ideally, you want the most recent data to have a greater influence on your indicators than the older data. But with an SMA, the oldest price affects the newest SMA point with the same weight as the newest price.

EMA calculations eliminate that concern. Each data point affects the EMA only once. You never have to drop the oldest price as a new price is added. For that reason, the EMA has a much longer memory than the SMA. Every price ever used in calculating the EMA has some small effect. As an added benefit, EMA calculations place additional weight on the most recent price.

Interpreting and using moving averages

Traders use moving averages to better visualize the trend of a stock and to trigger buy and sell signals. In general, when a moving average slopes upward, you can infer that the trend is up, and when the moving average slopes downward, the trend is down. When prices cross over the chart’s moving averages, signals are generated and trends are likely to change.

One simple mechanical strategy that some traders employ works like this:

  • Buy when the moving average slopes upward and the closing price crosses above the moving average.
  • Close the position when the price closes below the moving average.
  • Sell short when the moving average slopes downward and the closing price crosses below the moving average.
  • Close the short position when the price closes above the moving average.

warning Although simple crossover strategies like this are remarkably effective in some trending situations, they’re ineffective in others. As with all other strategies we’ve covered, nothing is certain. There’s no holy grail system that’s guaranteed to return profitable trades 100 percent of the time. Many variables must be in alignment for this approach to work, just like any other system. For example, the stock must be trending (see Chapter 10), and the period for the moving average must be chosen carefully for the indicator to be effective. These trend‐following systems break down when a stock is stuck moving sideways in a trading range (see Chapter 9).

Figure 11‐3 shows an example of this simple mechanical strategy on a chart of the SPDR S&P 500 ETF (SPY), an exchange‐traded fund (ETF) that mirrors the S&P 500 Index. The chart is shown with a 50‐period SMA.

image

Chart courtesy of StockCharts.com

FIGURE 11‐3: A chart of SPY, an ETF that mirrors the S&P 500, with a 50‐period SMA.

After bottoming in early June, SPY began climbing to the upside. Using the trading rules of this simple mechanical strategy, the first buy signal occurred shortly after in late July, when the stock closed above its SMA as the moving average turned higher. Notice that SPY traded above its 50‐period SMA until late October, when it closed below its moving average. According to our simple mechanical strategy, this generated a sell signal for the position.

As it turns out, this sell signal indicated the beginning of a relatively brief retracement (see Chapter 10). Notice that the SMA rolled over and began to slope downward during the pullback. However, on the final trading day of the year, December 31, SPY closed well above its 50‐period SMA just as the moving average was beginning to reverse its downtrend. This signals a buy according to the simple mechanical system and ultimately marked the start of a strong uptrend for multiple months. Notice that the price of SPY seemed to bounce off of its 50‐period SMA multiple times during the course of that uptrend.

We normally want some sort of confirmation signal before entering or exiting any position in a stock or ETF. For example, we may temper the buy signal in the simple mechanical strategy described earlier with a requirement that the stock price remain above its SMA for several days after the initial signal before entering a position. The same is true for the sell, or close, signal. You want the stock to close below the SMA for several days, or you’d like to see another coincident sell signal — perhaps one of the visual patterns we discuss in Chapter 10 — before exiting your position. We use a long‐period SMA to provide one of several signals to exit from existing positions. For example, if the price closes below a relatively long‐term moving average and remains below it for a couple of days, we use that signal to exit our position.

tip When your trading strategy is based on just one moving average or a simple trend‐following model, your ability to analyze a stock or fund during a period of range‐bound trading can be limited. When a stock is stuck in a trading range or pulls back in a retracement, it’s difficult to know whether the buy and sell signals that the moving averages generate are truly good entry or exit points. Using multiple moving averages and thoroughly understanding the implications of their crossovers is a good way to prevent falling for false signals, but ultimately, the smartest strategy is to combine these tools with other indicators, chart pattern analysis, fundamentals, and more. This helps you either confirm or reject the signals you’re receiving from the moving averages.

Support and resistance factors

In addition to their trend‐following abilities, moving averages also tend to provide support and resistance in stock prices that are trending up or down. When a price is trending higher, you often see the stock bounce off its moving average during its inevitable pullbacks, only to reverse course and head higher. The same is true in reverse for stock prices that are trending lower. You often see a downtrending stock rally up toward its moving average and seemingly bounce off that price before heading lower. The moving average acts as an area of resistance.

Back in Figure 11‐3, the uptrending SPY approached its 50‐period moving average in mid‐December (2012), early 2013, late February 2013, and mid‐April 2013. In each small retracement within the broader uptrend, SPY pulled back very close to its moving average before recovering back to the upside. Short‐term traders use these opportunities to enter positions in the direction of the dominant trend. When moving averages show a stock trending higher by sloping upward, for example, short‐term traders buy into a position when the stock price closes near or just below the moving average so they can ride the trend to sell at a higher price later on. Position traders also can use these signals as second‐chance entry points, whenever they miss the first breakout. This strategy is called buying on a pullback.

Deciding the moving average time frame

Perhaps the most difficult decision you have to make when creating a moving average is determining the length or period that best fits the situation. Regardless of whether you select an EMA or an SMA, shorter periods yield more signals, but a greater percentage of those signals are false. Longer moving average periods yield fewer signals, but a greater percentage of those signals are true. One hitch: Longer‐term moving averages react slower to new price changes, and thus the signals they generate take more time to appear and occur later than they do in shorter‐term moving averages.

tip In general, the shorter your trading horizon, the shorter the moving averages you want to select. For us, a nine‐period moving average is nearly useless. It generates too many signals that we have no intention of following. More isn’t always better. We want our technical analysis tools to provide better signals, not more, because although getting good signals is important, avoiding bad signals is paramount.

To reiterate, we rarely use ultra short‐term moving averages to generate buy signals. Instead, we use a combination of short‐, intermediate‐, and long‐period moving averages to monitor the health of a trend on daily charts. Typically, we select a 20‐day EMA (for the short term), a 50‐day SMA (for the intermediate term), and a 200‐day SMA (for the long term). These can change, however, depending on the duration of the existing trend and prevailing economic conditions. If a trend has existed for a relatively long period of time, the 50‐day SMA can provide good signals as an exit indicator. However, if the economy appears to be nearing a peak, as described in Chapter 5, then we tend to tighten our exit procedures and look more toward the 20‐day EMA for indications of a trend change. See Chapter 13 for more on trading strategies and exit procedures.

warning Traders can fall into a trap when trying to fine‐tune the moving average — or any indicator, for that matter — for a specific stock or situation. Logically, it seems right to test many different moving average periods using historical data to find the one that generates the most profitable trades and the fewest losing trades, and modern charting software enables you to do just that to your heart’s content. However, you’ll soon discover that what worked when using historical data often fails miserably when trading real money in real time. This problem is well‐known to statisticians and economists who build mathematic models to forecast future events. It’s called curve fitting because you’re molding your model to fit the historical data. We talk about this problem more in Chapter 16. For now, know that fine‐tuning an indicator for a specific stock or index rarely results in consistent predictive value, and you must avoid it. You simply can’t trade using historical data. You’re better off settling on a moving average period that satisfies the requirements for a great many situations, rather than trying to fine‐tune the time frame of a moving average to fit each stock.

Understanding Buy and Sell Pressure through Stochastic Oscillators

The stochastic oscillator indicates momentum and is intended to help show buying and selling pressure. This indicator compares current closing prices with the recent range of high to low prices and displays the results on a chart. Stochastic oscillator values cycle, or oscillate, between 0 and 100 percent.

Calculating stochastic oscillators

The typical stochastic oscillator is measured across a 14‐day period, but a different time frame can be specified. Here’s the calculation:

images

This calculation describes a fast stochastic. The names %K and %D, respectively, identify the stochastic oscillator and the signal line. We typically use a variation of this indicator that’s called a slow stochastic. The slow stochastic oscillator calculation is

images

In effect, the slow stochastic uses the %D value from the fast stochastic calculation as its starting point. While the fast and slow stochastics look similar when plotted on a chart, the slow stochastic is smoother and less jumpy. It generates fewer and more reliable trading signals, but the signals appear more slowly than with the fast stochastic. Note: Some charting platforms permit you to specify different values for the moving average period, and some even permit you to change from an SMA to an EMA.

tip Again, this calculation is done for you at StockCharts.com. Below your chart on the SharpCharts Workbench (http://stockcharts.com/h-sc/ui), you find the fast and slow stochastics in the dropdown menu of the Indicators panel. Select whichever indicator you prefer, set the parameters that fit your needs, and then click Update. The stochastics indicator automatically appears on your chart. The default settings are the most common, but you can apply custom parameters if you please. You can also choose whether you want the indicator displayed above or below the primary price chart.

Interpreting stochastic oscillators

As we mention earlier, the stochastic oscillator cycles between 0 and 100 percent. Readings of more than 80 percent imply an overbought condition. Readings of less than 20 percent are interpreted as an oversold condition. As with most indicators, an overbought condition can be resolved if a stock trades lower or enters a period of consolidation. Similarly, an oversold condition can be resolved if a stock trades higher or enters a period of consolidation.

Overbought and oversold conditions can persist for extended periods of time, so when the indicator line crosses above the 80 percent threshold or below the 20 percent level, it’s not an immediate signal to sell or buy. Although this move should tell you to keep a close eye on things in case a sudden reversal is initiated, the real stochastic oscillator signals are generated in the following circumstances:

  • When the stochastic oscillator moves from below to above 20 percent, triggering a buy signal
  • When the stochastic oscillator moves from above to below 80 percent, triggering a sell signal

Figure 11‐4 shows a slow stochastic oscillator on a price chart for Alaska Air (ALK). Note the transitions from below to above 20 percent that occurred in June, ­September, and November 2016. All three represented good entry opportunities for this uptrend, particularly in June after the stock had remained below the 20 percent level for multiple weeks. Also, note that few of the indicator’s sell signals, where the stochastic oscillator crosses below 80 percent, represented good selling or shorting opportunities while Alaska was trending higher. (Note: ­Figure 11‐4 shows a slow stochastic oscillator with the parameters 14, 3 positioned below the chart.)

image

Chart courtesy of StockCharts.com

FIGURE 11‐4: A chart of Alaska Air with the slow stochastic oscillator below the price chart.

Some traders use a stochastic oscillator crossover strategy, where buy signals are triggered when %K crosses above %D, and sell signals are triggered when %K crosses below %D. For our style of trading, that generates too many signals, a very high percentage of which are false, as you can see in Figure 11‐4.

tip The stochastic oscillator is most effective when used in conjunction with other technical indicators. When a stock is trending, the stochastic oscillator is useful in finding entry points within a dominant trend. In an uptrend, for example, a buy signal that’s generated when the stochastic oscillator moves from below to above 20 percent is likely to be a reliable one. At the same time, however, the stochastic oscillator signals many overbought conditions within an uptrend and rarely generates useful sell signals. For this reason, it’s wise to pair the stochastic oscillator with other indicators to help generate useful sell signals in an uptrend.

The stochastic oscillator also works well in trading‐range situations. Many short‐term traders use it to trigger buy and sell signals when a stock is in a trading range.

Tracking Momentum with the MACD

The moving average convergence divergence (MACD) indicator is one of the most popular trend‐following momentum indicators. The MACD is designed to generate trend‐following trading signals based on moving‐average crossovers while overcoming problems associated with many other trend‐following indicators. The MACD also acts as a momentum oscillator, showing when a trend is gaining strength or losing momentum as it cycles above and below a center zero line. The MACD is an excellent indicator and an integral part of our trading tool set.

Calculating the MACD

As with other technical indicators, today’s charting software calculates the MACD for you. Still, knowing how this indicator is created helps you gain a better understanding of how it works. Based on just three moving averages of different periods, the MACD isn’t complex to calculate. Here are the steps:

  1. Calculate a 12‐period EMA.
  2. Calculate a 26‐period EMA.
  3. Subtract the 26‐period EMA from the 12‐period EMA to create the MACD line.
  4. Use the resulting MACD line to calculate a 9‐period EMA to create the signal line.
  5. Plot the MACD as a solid line; plot the signal line as either a dashed or lighter‐colored line.

An additional indicator, the MACD histogram, is often shown as part of the MACD. It uses a histogram to show the difference between the MACD line and the signal line:

  • When the MACD line is above the signal line, the histogram is plotted above zero.
  • When the MACD line is below the signal line, the histogram is plotted below zero.
  • When the MACD line and the signal line cross, the histogram is plotted at zero.

Figure 11‐5 shows a daily chart of Bank of America (BAC) along with the MACD indicator (including the MACD histogram), shown below the primary price chart.

image

Chart courtesy of StockCharts.com

FIGURE 11‐5: A daily chart of Bank of America with the MACD and an MACD histogram.

BAC traded sideways for the first few months of 2016, consolidating within a trading range. In early July, the stock began to rally to the upside. It continued its bullish climb throughout the last half of the year, turning on the jets in November and rocketing up in the last few months of 2016. Notice the corresponding periods on the MACD. The MACD line (the solid line) crosses over the zero center line in mid‐July, just after the stock begins what would eventually become a strong uptrend. This was a buy signal for this stock. You may also notice that the MACD line crossed the signal line earlier in the month at the start of July. This MACD crossover signal is another early indication suggesting a possible new uptrend. See Chapter 13 for more about how we use this signal.

tip You can easily add the MACD indicator to your charts on StockCharts.com. Below your chart on the SharpCharts Workbench (http://stockcharts.com/h-sc/ui), use the dropdown menu in the Indicators panel to select MACD. Use the default settings (12, 26, and 9) or customize the moving average parameters to your liking. Click Update and the MACD will automatically appear on your chart. As with other indicators, you can choose to position the MACD either above or below the primary price chart, whichever is your preference. In Figure 11‐5, you see that we set the MACD below the chart.

Using the MACD

The MACD provides a remarkable amount of information in a concise format. As you can see in Figure 11‐5, the MACD oscillates above and below a center zero line and serves as a good indicator for showing the direction of the dominant trend. It signals

  • An uptrend when the MACD line crosses above the center line
  • A downtrend when the MACD line crosses below the center line

Some short‐term traders use the signal line to trigger

  • Buy signals when the MACD line crosses above the signal line
  • Sell signals when the MACD line crosses below the signal line

In our own trading, we find that the short‐term signal line crossover technique generates too many false signals to be a reliable tool. Instead, we prefer using the position of the MACD line relative to the zero line as an indication that the stock has begun trending.

Figure 11‐6 shows a chart of daily prices for QQQ, an exchange‐traded fund that tracks the NASDAQ Index.

image

Chart courtesy of StockCharts.com

FIGURE 11‐6: The chart of QQQ shows a bearish divergence between price and the MACD.

Notice how QQQ establishes a series of higher highs and higher lows beginning in late June, but the MACD line establishes a series of lower highs between early August and the start of November. This creates what’s known as a divergence ­pattern. This particular example of a divergence pattern is a bearish or negative divergence. In a bearish divergence, the stock establishes a series of higher highs and higher lows in an uptrend, but the MACD establishes a series of lower highs and shows a downtrend. A bullish divergence is the reverse: The stock establishes a series of lower highs and lower lows, while the MACD establishes a series of higher highs and shows an uptrend.

tip Divergences that occur in the same direction as the dominant trend are often useful for entering positions. However, a divergence that is counter to the dominant trend is less likely to be a reliable trading signal. For example, a bearish divergence in a dominant uptrend is rarely a good signal to enter a short position. During a strong uptrend, the MACD is likely to show a bearish divergence simply because the pace of the uptrend is likely to slow. As the uptrend slows, the longer‐term moving average catches up to the shorter‐term moving average, resulting in a bearish divergence on the MACD. While this type of bearish divergence may not be a great signal to enter a short position, it may indicate that the stock has entered, or is about to enter, a period of retracement.

The bearish divergence on QQQ in Figure 11‐6 is best interpreted as a sign that the momentum of the strong July rally was slowing. The slope of the fund’s uptrend during that month was remarkably strong, which simply can’t continue forever. As the stock entered a new month, the uptrend continued, but not at such a steep slope. This allowed the moving averages used in the calculation of the MACD to converge, resulting in a negative divergence.

Each time the MACD line crosses above or below the signal line, it suggests a potential change in the direction of the dominant trend. Although it’s not an outright buy signal or sell signal, it does suggest that a change may be in the wind. In the case of a bearish divergence, the best way to utilize that information is to monitor individual stocks and ETFs for weakness and either close long positions when they deteriorate or initiate new short positions as they present themselves. In Chapter 13, we provide additional ideas to help integrate the information generated by the MACD indicator into a useful trading strategy.

remember Nothing in the stock market is ever guaranteed. There’s no magic indicator that will send perfectly reliable buy and sell signals 100 percent of the time. Instead, indicators such as the MACD can help increase your probability of making smarter, more‐informed trading decisions. Your goal is to act rationally based on the information available to you. Indicators such as the MACD can help you achieve that very objective.

warning Most charting platforms enable you to fine‐tune the MACD calculation, customizing the moving average parameters to your liking. Many traders adjust the 12‐, 26‐, and 9‐period values in an attempt to better fit the MACD to their trading needs. Although nothing is inherently wrong with this approach, you nevertheless run the risk of inadvertently curve‐fitting whenever you try to find parameters that give you better results for a specific stock. That said, Gerald Appel, the man who developed the MACD, uses values different from the original 12, 26, and 9. He also uses different values to generate buy signals than he does to generate sell signals. It’s perfectly fine to experiment with various MACD settings, but we recommend first establishing some solid experience using the default parameters. The 12‐, 26‐, and 9‐period settings are the most common for a reason. Learn how to use the indicator with the standard parameters before attempting to modify and improve it.

Revealing Relative Strength

Relative strength measures the performance of one security — a stock, ETF, index fund, and so on — against another, or against the performance of a benchmark index such as the S&P 500. The idea is to determine how the stock is performing compared with, for example, the broader total market. By focusing your attention on the strongest stocks or funds that are outperforming the rest of the pack, you increase your probability of successful, profitable results.

warning Unfortunately, you may run across another indicator with a similar name when working with your charting software. The other indicator is called the relative strength index (RSI), and it’s completely different from the relative strength discussed here. RSI is an oscillator that is used in a way similar to the stochastic oscillator described earlier. To keep the two separate, we suggest you call the RSI by its initials and use the phrase relative strength when you mean to compare the performance of a stock or ETF against a broad‐based index or another security.

Calculating relative strength

There are multiple ways to calculate relative strength, but one of the simplest and most effective is to simply divide the stock price by the index value and plot the result, like this:

images

Another technique compares the price of the stock during a given period of time against the index during the same period. Our preference is comparing percentage changes during the same period. The calculation looks like this:

images

You can plot both of these approaches on a stock chart. Some online resources provide powerful relative strength tools that allow you to visualize the performance of one stock or fund against another security. The PerfCharts tool at ­StockCharts.com, for example, allows you to simultaneously chart the performance of multiple stocks or ETFs within a group to see how they perform against a benchmark (typically the S&P 500). See www.stockcharts.com/charts/performance for an example.

tip StockCharts.com lets you create your own performance charts using any stocks, ETFs, or indexes of your choice. This unique relative strength tool is called a ­PerfChart. You can customize your PerfCharts with up to ten different symbols. To get started, visit www.stockcharts.com/freecharts and look for the PerfCharts box on the left side of the page. Select from one of the predefined groups or enter your own list of symbols in the box labeled Create a PerfChart. Once your PerfChart has loaded, you can adjust the date range and time frame using the slider below the chart. You can also change the PerfChart’s mode from line to histogram view using the buttons in the bottom‐left corner.

Putting relative strength to work

tip At its core, relative strength allows you to strategically determine which stocks or ETFs are outperforming others. This allows you to zero in on the best trading candidates and, most importantly, helps you avoid stocks or funds that are underperforming the rest of the pack. If you’re consistently investing in average or below‐average stocks, you’re bound to keep placing losing trades. By narrowing your focus to the top performers, relative strength improves your probabilities of making profitable trading decisions.

Relative strength is one of the final pieces of the technical‐analysis puzzle. The strongest trading candidates fit the following criteria:

  • Exhibits solid fundamentals as a strong company
  • Has earnings that are growing faster than average
  • Is a leading stock in a strong sector of the market
  • Operates in a growing economy
  • Is approaching a technical buy signal on its price chart
  • Performs better than the average stock

These characteristics favor a long position, of course. For short position candidates, the criteria are reversed.