Products
Quiz Locked
You need to complete all the
Chapters to unlock module Quiz
Understanding Oscillating Indicators: MACD, RSI, and Stochastic
READING
8 mins read
Stock prices and market movements change every second. To be successful in the markets, accurate and timely analysis of price swings is crucial. This is where oscillating indicators come into play.
Oscillating indicators are technical analysis markers that ‘oscillate’ or move within a specific range, providing insights into the market or an asset’s strength, trend momentum, and speed. These indicators are particularly useful for identifying potential turning points in the market and determining whether an asset is overbought or oversold.
MACD (Moving Average Convergence and Divergence) and the RSI (Relative Strength Index) are the two most popular oscillating indicators. This chapter explores how these indicators work and how you can deploy them when you trade.
-
MACD
Developed by Gerald Appel in the late 70s, the MACD, or Moving Average Convergence and Divergence, is the most reliable and popular oscillating indicator. MACD combines moving averages, convergence, and divergence to provide insight into market trends and read momentum.
But what do these terms actually mean? Let’s take a look at these three components in detail below:
- Moving average (MA): The moving average is a widely used indicator that smooths out price data to identify underlying trends over a period. In context to the MACD, it refers to the calculation of the difference between two moving averages – 12 Day EMA and 26 Day EMA. We’ll explore more on this below.
- Convergence: Convergence in plain English is one when a thing moves toward another. In the context of MACD, convergence refers to the narrowing gap between the two averages.
- Divergence: This is quite the opposite of convergence. Divergence is when the two averages ‘diverge’ or move away from one another.
The MACD analyses the relationship between moving averages and observes convergence and divergence to spot trends and reversals, identify overbought and oversold levels, and confirm the strength of the trend.
How To Calculate the MACD?
Here’s how we utilise the moving averages and their convergence and divergence to calculate the MACD.
-
12-Day and 26-Day EMA
To begin, you must compute two EMAs - a 12-day EMA and a 26-day EMA. As you know, the EMA will assign more weight to the recent closing price, making it sensitive to short-term price changes. The 12-day EMA will focus on shorter trends, while the 26-day EMA will look at the longer trends.
-
MACD Line
The MACD line is formed by subtracting the 26-day EMA from the 12-day EMA. If the difference is positive, it may be indicative that the shorter EMA is above the longer EMA, and a bullish trend is taking place. The opposite is true if the difference is negative.
All the values (negative and positive) are plotted to generate the MACD line.
-
9-Day EMA and Histogram
To smooth out the MACD line and generate buy and sell points, a 9-day EMA is analysed alongside the MACD line. The 9-Day EMA, which trails the MACD line, acts as a signal or trigger line.
The histogram visually represents the difference between the MACD line and the signal line. Think of it this way – if you find it difficult to plot and understand the MACD and signal lines, you can use the histogram. If it is moving upward, it indicates a positive trend. If it moves downwards, that is indicative of a bearish or negative trend.
Now that you understand the different components of the MACD, let’s study the different MACD crossovers.
Types of MACD Crossovers
MACD crossovers are formed on the basis of how the MACD line reacts with the signal line and the zero line. Traders extensively use these crossovers to understand trends, and reversals and generate sell/buy signals. Let’s explore them below.
-
Signal Line Crossover
This is the most common type of MACD crossover. When the MACD line crosses above the signal line, it generates a bullish sign. You may treat it as an entry or buy sign; conversely, if the MACD line falls below the signal line, it is indicative of a bearish trend. Treat it as an exit or sell sign.
-
Zero Line Crossover
To understand this type of MACD, take a look at the image below (which represents everything we covered about MACD):
Here, observe the zero line. If the MACD crosses the zero line, it is indicative of a bullish trend and when it falls below zero, it indicates that a bearish trend is developing. If the MACD is below the trigger/signal line and crosses the zero line, that is also a sign of a bull trend.
-
MACD Divergence Crossover
When the MACD line and the price of the underlying asset ‘diverge’, it may be referred to as the MACD Divergence crossover, and it can be either bullish or bearish. When the price makes lower lows while the MACD line makes higher lows, it can be indicative of a bullish MACD divergence (a point of entry or buy sign). However, if the price makes higher highs but the MACD line makes lower highs, it can be viewed as a bearish MACD divergence (a point of exit or sell sign).
Do you see how all these lines, signals, and their movements help us understand the underlying trend?
Let’s now see another very popular oscillating indicator – RSI.
-
RSI
The RSI, or Relative Strength Index, is a widely used leading oscillating indicator that measures the momentum and ‘strength’ of a price trend. Note that RSI does not imply studying the strength of an ‘index’. The RSI studies the internal strength of a stock or the security in concern.
The RSI oscillates between 0-100 and is calculated based on the ratio of average gains to average losses over a specified period, typically 14 days.
Developed by J. Welles Wilder Jr, the RSI indicator basically serves as a tool for traders and investors to measure speed and change in price movements and identify overbought and oversold levels.
The whole concept of RSI rests on ‘overbought’ and ‘oversold’ securities. Understand this – overbought levels signify that the stock is trending at a high bull momentum but may not last long, thereby causing a downtrend. The opposite is true for oversold levels that signify a prolonged bear run, which may soon enter an uptrend.
Now, how do you calculate the oversold and overbought levels and the RSI? Well, you can use the formula stated below:
RSI = 100 - ( 100 /(1+RS))
Here, RS = Average gain/ Average loss
Let’s understand the RSI and its calculation with a simple example. The table below shows stock X's closing data over 14 days.
Sl. No |
Closing Price |
Gain |
Loss |
1 |
100 |
0 |
0 |
2 |
102 |
2 |
0 |
3 |
104 |
2 |
0 |
4 |
103 |
0 |
1 |
5 |
105 |
2 |
0 |
6 |
107 |
2 |
0 |
7 |
108 |
1 |
0 |
8 |
105 |
0 |
3 |
9 |
106 |
1 |
0 |
10 |
109 |
3 |
0 |
11 |
110 |
1 |
0 |
12 |
108 |
0 |
2 |
13 |
107 |
0 |
1 |
14 |
109 |
2 |
0 |
Total |
16 |
7 |
|
Average |
1.777 |
1.75 |
Per this table, the average gain of the stock X over 14 days is 1.777, and the average loss is 1.75. Then, per the RS formula,
RS = Average gain / Average loss
RS = 1.777/1.75
RS = 1.0158
Now that we have calculated the RS let’s calculate the RSI, which is computed as follows:
RSI = 100 - ( 100 /(1+RS))
RSI = 100 - (100/ (1+1.0158))
RSI = ~50.39
So, the 14-day RSI of stock X is ~51. But what does this number mean? What if the number is 20, or 60 or 70 or 80? This question leads us to what we call RSI range levels. Read further to understand what these levels mean and how to interpret them.
RSI Range Levels
Interpreting the RSI involves understanding its key levels and the signals they generate. The RSI scale, which ranges from 0 to 100, has two common threshold levels – 30 and 70. Let’s read what these levels and numbers imply in context to the RSI
-
RSI at 30
When the RSI reaches the 30 level, it is often viewed as an indicator of an oversold market. But what does an ‘oversold market’ mean? It simply implies that the stock in question is experiencing an excessive downturn or decline and, in all possibilities, may be in for an upturn or rebound. As a trader, it is essential to pay attention to this RSI level as it may provide valuable insights into potential buying opportunities.
Think of it this way – When an RSI is reading 30, it may suggest that the selling pressure on the asset (for whatever reason) is very strong, and buyers may step into this favourable environment to take advantage of the oversold condition.
-
RSI at 70
You know that RSI 30 implies an oversold market. Now, the opposite is true for RSI at 70. When an RSI reaches the 70 level, it is an indicator of an overbought market, i.e., the enthusiasm for the stock can be assumed to be high, and a corrective downturn may be on the way. And just like RSI at 30 may provide entry points, one can use high RSI levels (let’s assume 70 here) to plot for exit points.
When the RSI reads 70, indicating high buying pressure, sellers may enter the market to capitalise on the overbought situation.
-
RSI at 50
When the RSI reaches the 50 level, it may be indicative of a balanced market condition. It may depict that the average gains and losses over a specified period are relatively equal. i.e. there is a balance of buyers and sellers in the market, just like the example above.
Now that you understand how to read an RSI remember this – an RSI reading of 30 doesn't necessarily mean an immediate reversal, nor does a reading of 70 imply an immediate downtrend. Prices may continue to decline or rise depending on several factors.
And that is why it is important to use RSI in conjunction with other indicators and tools to confirm signals. Using any indicator solely may be unwise and can result in losses.
-
Stochastic Oscillator
The stochastic oscillator, or the stochastic indicator introduced by George C. Lane in the late 1950s, is a popular two-line oscillating indicator that helps traders identify potential reversal in price trends and generate buy and sell signals.
Here’s how this indicator functions – It compares a security’s closing price to its price range over a specified period and determines its relative position within that range. By doing so, it reveals the strength or weakness of the current price trend and provides insights into potential trends and reversals.
Just like the ADX and RSI, the stochastic oscillator is bound between 0 and 100 and is believed to be an effective tool for navigating slow trends or broad trading ranges.
Let’s see how this indicator is applied and how to determine it.
How to Calculate the Stochastic Oscillator?
The stochastic oscillator comprises two main lines called %K and %D. Below is a step-by-step procedure on how to calculate these values (or lines):
- Select a time period. It is typically 14 individual periods. For example, it will be 14 weeks on a weekly chart. So it can be 14 days, weeks, months and so on.
- Next, identify the highest high and lowest low within this time frame. Also, determine the current closing price of the asset or stock in consideration.
- Now, calculate the %K using this formula:
%K= ((Current closing price -Lowest trading price) / (Highest trading price- Lowest trading price))*100
- Apply a moving average (usually a 3-period moving average) to the %K value to derive the %D value:
%D= 3-period moving average of %K
The resulting %K and %D values are plotted on a chart, typically alongside the price chart, to provide cues for potential trading opportunities.
Interpreting the Stochastic Oscillator
The stochastic oscillator can be interpreted as follows:
-
Overbought and Oversold Levels
The stochastic oscillator typically uses the 80 and 20 levels to identify overbought and oversold levels (these levels can be customised). If this oscillator rises above 80, it can be indicative that the security is overbought and is due for correction. Conversely, when the oscillator falls below 20, it could imply that the security is oversold and may be ripe for an upward bounce.
-
Signal Line Crossover
As we covered above, the stochastic oscillator is a two-line indicator – %K and %D. When the %K crosses over the %D, it may be the beginning of a bullish trend. But, if the %K undercuts the %D, it can indicate a bearish trend.
-
Bullish and Bearish Divergence
Divergence occurs when the price of a security and the stochastic oscillator move in an opposite direction. If suppose the price makes a lower low, but the oscillator forms a higher low, it could indicate a bullish divergence (i.e. an uptrend may be on the way). However, if the price makes a higher high but the oscillator forms a lower high, a bearish divergence may take place.
To increase the reliability of the stochastic oscillator, it may be wise to use it alongside other technical indicators and tools. With this, we've reached the end of this module on technical indicators, summarising vital technical indicators and trading strategies for market analysis and decision-making.