Next: , Previous: , Up: Averages   [Index]

8.5 Endpoint Moving Average

The endpoint moving average (EPMA) establishes an average price by fitting a least squares straight line (see Linear Regression) through the past N days closing prices and taking the endpoint of the line (ie. the line as at the last day) as the average.

This calculation goes by a number of other names, including least squares moving average (LSQMA), moving linear regression, and time series forecast (TSF). Joe Sharp’s “modified moving average” is the same thing too.

The formula ends up being a straightforward weighted average of past N prices, with weights going from 2*N-1 down to -N+2. This is easily derived from the least squares formulas, but just looking at the weightings the connection to least squares is not at all obvious. If p1 is today’s close, p2 yesterdays, etc, then

       (2*N-1)*p[1] + (2*N-4)*p[2] + ... + (-N+2)*p[N]
EPMA = -----------------------------------------------
        2*N-1       +  2*N-4       + ... +  -N+2

The weights decrease by 3 for each older day, and go negative for the oldest third of the N days. The following graph shows that for N=15.

Endpoint MA weights graph

The negatives mean the average is “overweight” on recent prices and can overshoot price action after a sudden jump. In general however because the fitted line deliberately goes through the middle of recent prices the EPMA tends to be in the middle of recent prices, or a projection of where they seemed to be trending.

It’s interesting to compare the EPMA with a plain SMA (see Simple Moving Average). An SMA effectively draws a horizontal line through the past N days prices (their mean), whereas the EPMA draws a sloping line.

The inertia indicator (see Inertia) uses the EPMA.

Next: , Previous: , Up: Averages   [Index]

Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014, 2015, 2016, 2017 Kevin Ryde

Chart is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.