Part 4A. Moving Average

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

Part 4A.

Moving Average
ECON 3140B
Financial Data Analysis
Spring 2020

1
Introduction
⚫ Chart analysis is largely subjective and
difficult to test
⚫ Technical indicators are more objective
⚫ Moving average is one of the most widely
used of all technical indicators
⚫ Easily quantified and tested

⚫ Simply using Excel spreadsheets can


calculates, and generates specific buy
and sell signals as you wish
2
Moving Averages: Overview
⚫ Moving averages (MA) smooth the price data
to form a trend following indicator
⚫ They do not predict price direction, but
rather define the current direction with a lag
⚫ Moving averages lag because they are based
on past prices
⚫ Despite this lag, moving averages help
smooth price action and filter out the noise

3
Moving Averages: Overview
⚫ MA can be used to identify the direction of
the trend or define potential support and
resistance levels
⚫ MA form the building blocks for many other
technical indicators and overlays, such
as Bollinger Bands and MACD

4
Types of Moving Averages
⚫ Simple Moving Average (SMA)
⚫ Weighted Moving Average (WMA)
⚫ Exponential Moving Average (EMA)

5
Simple Moving Average (SMA)
SMA = (C1 + C2 + … + Cn)/ n
⚫ A simple moving average (SMA) is formed by
computing the average price of a security
over a specific number of periods
⚫ Most moving averages are based on closing
prices
⚫ A 10-day simple moving average is the sum
of 10 days’ closing prices divided by 10
6
SMA: Numerical Example
Time Close SMA
Day 1 10 --
Day 2 8 --
Day 3 7 --
Day 4 7.5 Start Here
Day 5 6
Day 6 9
Day 7 10
Day 8 11
7
SMA: Numerical Example
⚫ Suppose you want to find out the 4-day SMA
of this stock
⚫ 4-day SMA in Day 4

= (10 + 8 + 7 + 7.5) / 4 = 8.125


⚫ 4-day SMA in Day 5

= (8 + 7 + 7.5 + 6) / 4 = 7.125
⚫ 4-day SMA in Day 6

= (7 + 7.5 + 6 + 9) / 4 = 7.375
8
SMA: Numerical Example
Time Close SMA
Day 1 10 --
Day 2 8 --
Day 3 7 --
Day 4 7.5 8.125
Day 5 6 7.125
Day 6 9 7.375
Day 7 10 8.125
Day 8 11 9
9
Simple Moving Average (SMA)
⚫ As its name implies, a moving average is
an average that moves
⚫ Old data is dropped as new data comes
available
⚫ This causes the average to move along the
time scale
⚫ Q: By observing the 4-day SMA in this
example, what can you tell about the price
trend?
10
Calculating SMA By Using
Excel Spreadsheet

11
Weighted Moving Average
(WMA)
1 * C1 + 2 * C2 + … + n *Cn
WMA =
1+2+…+n
⚫ With the same logic to smooth price data and
identify the direction of the trend, WMA place
more weight on more recent data
⚫ The WMA is considered more responsive to
recent market activity than the SMA 12
WMA: Numerical Example
Time Close WMA
Day 1 10 --
Day 2 8 --
Day 3 7 --
Day 4 7.5 Start Here
Day 5 6
Day 6 9
Day 7 10
Day 8 11
13
WMA: Numerical Example
⚫ Suppose you want to find out the 4-day WMA
of this stock
⚫ 4-day WMA in Day 4

= (10*1 + 8*2 + 7*3 + 7.5*4) / 10 = 7.7


⚫ 4-day WMA in Day 5

= (8*1 + 7*2 + 7.5*3 + 6*4) / 10 = 6.85


⚫ 4-day WMA in Day 6

= (7*1 + 7.5*2 + 6*3 + 9*4) / 10 = 7.6


14
WMA: Numerical Example
Time Close WMA
Day 1 10 --
Day 2 8 --
Day 3 7 --
Day 4 7.5 7.7
Day 5 6 6.85
Day 6 9 7.6
Day 7 10 8.65
Day 8 11 9.8
15
Calculating WMA By Using
Excel Spreadsheet

16
Exponential Moving Average
(EMA)
EMAt = (1 – SF) * EMAt-1 + SF * Ct
⚫ while SF = Smoothing Factor = 2 / (n+1)

⚫ EMA place more weight on more recent data


⚫ EMA is considered more responsive to recent
market activity than the WMA
⚫ WMA: assign a fixed weight for each data

⚫ EMA: weight for each data decreases


exponentially 17
EMA: Numerical Example
Time Close EMA
Day 1 10 Start Here
Day 2 8
Day 3 7
Day 4 7.5
Day 5 6
Day 6 9
Day 7 10
Day 8 11
18
EMA: Numerical Example
⚫ Suppose you want to find out the 4-day EMA
of this stock
⚫ We usually use the closing price of the 1st
trading day as the initial EMA, so,
⚫ 4-day EMA in Day 1, EMA1 = 10

19
EMA: Numerical Example
EMAt = (1 – SF) * EMAt-1 + SF * Ct

⚫ For the smoothing factor, SF = 2 / (4+1) = 0.4


⚫ 4-day EMA in Day 2, EMA2

= (1 – 0.4) * EMA1 + 0.4*C2


= 0.6 * 10 + 0.4* 8
= 9.2

20
EMA: Numerical Example
⚫ 4-day EMA in Day 3, EMA3
= (1 – 0.4) * EMA2 + 0.4*C3
= 0.6 * 9.2 + 0.4* 7
= 8.32
⚫ 4-day EMA in Day 4, EMA4

= (1 – 0.4) * EMA3 + 0.4*C4


= 0.6 * 8.32 + 0.4* 7.5
= 7.992
21
EMA: Numerical Example
Time Close EMA
Day 1 10 10
Day 2 8 9.2
Day 3 7 8.32
Day 4 7.5 7.992
Day 5 6 7.195
Day 6 9 7.917
Day 7 10 8.750
Day 8 11 9.650
22
Calculating EMA By Using
Excel Spreadsheet

23
Types of Moving Averages:
Comments
⚫ SMA is the most popular type of MA
⚫ EMA have less lag and are therefore more
sensitive/ responds quicker to recent prices
changes than WMA and SMA
⚫ We will use EMA when we calculate
Moving Average Convergence/ Divergence
(MACD)

24
Trend Identification
⚫ The direction of the moving average conveys
important information about prices
⚫ A rising MA shows that prices are generally
increasing (uptrend)
⚫ A falling MA indicates that prices, on average
are falling (downtrend)

25
Trend Identification Example

26
Trend Identification Example

27
Lengths of MA Period
⚫ The length of the moving average period
depends on the analytical objectives
⚫ Some are more popular than others
⚫ Short-term trend: 10-day and 20-day MA

⚫ Medium-term trend: 50-day MA

⚫ Long-term trend: 200-day and 250-day MA

⚫ e.g.: A falling long-term MA reflects a


long-term downtrend
28
Support and Resistance
⚫ Moving averages can also act as support in
an uptrend and resistance in a downtrend
⚫ A short-term uptrend may find support when
price retreats near the 20-days MA
⚫ A medium-term downtrend may find
resistance when rebounds near the 50-day
MA

29
MA as Support in Uptrend

Breakout

30
MA as Resistance in Downtrend

Breakout
31
Double Crossovers
⚫ Two moving averages can be used together to
generate crossover signals
⚫ Double crossovers involve one relatively short-
term MA and one relatively long-term MA
⚫ Popular combinations
⚫ 10-day MA and 50-day MA

⚫ 20-day MA and 50-day MA

⚫ 50-day MA and 250-day MA

32
Double Crossovers
⚫ If the shorter period MA crosses over the
longer period MA from below to above, then it
is considered bullish and a buy opportunity
⚫ Golden Cross 黃金交叉

⚫ If the shorter period MA crosses over the


longer period from above to below, then it is
considered bearish and a sell opportunity
⚫ Death Cross 死亡交叉

33
Golden Cross + Death Cross

Death
Cross

Golden Cross
34
Generating Double Crossovers
Signal By Using Excel

35
Sorting of Moving Averages:
Analytical Tool For Sentiment
Strong Uptrend
⚫ When current price is decisively higher than
all moving averages, and,
⚫ Short-term MA is decisively higher than
medium-term MA, and,
⚫ Medium-term MA is decisively higher than
long-term MA

36
37
Sorting of Moving Averages:
Analytical Tool For Sentiment
Before/ Waiting For Breakout
⚫ When short-term MA, medium-term MA and
long-term MA are very close to each other,
and,
⚫ When current price is in between the clusters
of those moving averages

38
Sorting of Moving Averages:
Analytical Tool For Sentiment
Strong Downtrend
⚫ When current price is decisively lower than all
moving averages, and,
⚫ Short-term MA is decisively lower than
medium-term MA, and,
⚫ Medium-term MA is decisively lower than
long-term MA

39
40
Final Say on Moving Average
⚫ The direction of the moving average conveys
important information about price trend
⚫ Double crossovers generate good trading
signal
⚫ Sorting of moving averages give you ideas
about the market sentiment

41
Final Say on Moving Average
⚫ However, moving averages are lagging
indicators: give late signals
⚫ Don’t expect to sell at the top and buy at
the bottom using moving averages
⚫ As with most tools, moving averages should
be used in conjunction with other tools
⚫ e.g. Use moving averages to define the
overall trend and then use RSI to
define overbought or oversold levels
42

You might also like