Endpoint Moving Average (EPMA)

Parameters: period = 20 (5–100) offset = 0 (-10–10)

Overview

The Endpoint Moving Average (EPMA), also known as Least Squares Moving Average (LSMA) or Time Series Forecast (TSF), establishes an average price by fitting a least squares straight line through past closing prices and taking the endpoint of that line as the average. Introduced by Patrick E. Lafferty in the October 1995 issue of Technical Analysis of Stocks & Commodities, EPMA uses the endpoint of the sloped regression line as the plot point for each day, making it more representative of present trends than traditional moving averages.

Unlike a Simple Moving Average that effectively draws a horizontal line through past prices, EPMA draws a sloping line that projects where price should be based on the linear regression trend. This creates a weighted average of past N prices with weights going from 2×N-1 down to -N+2, resulting in a moving average that adapts quickly to price movements and helps identify trend direction more responsively. Because it picks up the end of the sloped line for each time interval, EPMA leads rather than lags price action, though this responsiveness can make it more prone to whipsaws than traditional lagging indicators.

Interpretation & Trading Signals

Trend Analysis:

  • Slope Direction: Rising EPMA indicates uptrend, falling indicates downtrend
  • Trend Strength: Steeper slope shows stronger trend momentum
  • Present Trends: More representative of current market conditions than SMA
  • Regression-Based: Uses linear regression to project future price direction

Trading Applications:

  • Support/Resistance: Channel lines above/below regression act as dynamic levels
  • Crossover Signals: Price crossing EPMA indicates momentum shift
  • Inertia Indicator: Used to calculate momentum/resistance to trend change
  • Combined Signals: Blends with Percentile Rank and MAD filtering for high-probability trades

Calculation Formula:

  • Weighted Average: (2×N-1)×p[1] + (2×N-4)×p[2] + ... + (-N+2)×p[N]
  • Weight Sum: Divided by sum of weights (2×N-1 + 2×N-4 + ...)
  • Alternative Names: LSQMA, Moving Linear Regression, TSF, Modified MA
  • Zero Lag: Projects current value based on regression endpoint

Example Usage

Code examples will be available once the Rust implementation is complete.

Performance Analysis

Related Indicators