Linear Regression Indicator (LRI) & Time Series Forecast (TSF)

Linear Regression is a statistical tool used to predict future values from past values.  By using the least squares method, a straight line can be plotted that minimizes the distance between the resulting line and the data set in order to reveal a trend.

The Linear Regression Indicator (LRI) plots the end value of a Linear Regression Line at each data point.  A variation on the same idea is the Time Series forecast (TSF) which is found by adding the Linear Regression Slope to the Linear Regression Line.  The TSF basically projects the LRI forward one period.  The TSF is also sometimes referred to as a Moving Linear Regression or Regression Oscillator.

By calculating these two indicators on a moving basis the result looks similar to that of a moving average and can be used in the same way.

.

Calculating a Linear Regression Line

.

Linear Regression Line = a + bx

Where:

a = (Σy – bΣx) / n

b = (nΣ(xy) – (Σx) (Σy)) / (nΣx² – (Σx)²)

b = Linear Regression Slope.

x = The current time period.

y = The data series (Usually the close price).

n = Number of periods.

.

Linear Regression Indicator & Time Series Forecast Excel File

.

Calculating these indicators by hand is a pain in the ass so we have build an Excel spreadsheet containing both the Linear Regression Indicator and Time Series forecast that you can download for free.  Find it at the following link near the bottom of the page under Downloads – Technical Indicators: Linear Regression Indicator (LRI) & Time Series Forecast (TSF).  Please let us know if you find it useful.

.

Linear Regression Indicator, Time Series Forecast and a Simple Moving Average

.

Linear Regression Indicator, Time Series Forecast and SMA.

Test Results

.

We tested the Linear Regression Indicator and Time Series forecast through 300 years of data across 16 global markets to reveal which is the best and if either of them are worth using as trading tool for data smoothing – see the results.

.

.

Wilder’s Smoothing was developed buy J. Welles Wilder, Jr. and he used it as a component in several of his other indicators including the RSI which is one of the most popular technical indicators of all time.

Sine Weighted Moving Average (SW-MA)

The Sine Weighted Moving Average is being tested along with many other indicators in the ‘Technical Indicator – Fight for Supremacy‘.  It is not an indicator that many people will be familiar with so I will briefly cover how it is calculated and have also built the Sine Weighted Moving Average into an Excel Spreadsheet for free download.

A Sine wave is a smooth, repetitive oscillation that shifts between a high of y and a low of -y.  A SW-MA takes its weighting from the first half of a Sine wave cycle so the largest weighting is given to the data in the middle.  The result is very similar to the Triangular Moving Average (Tri-MA) but much more difficult to calculate.  Below you can see how the weighting is applied to a 50 period SW-MA, EMA and SMA:

.

Weight - SW-MA vs EMA vs SMA

.

How To Calculate a Sine Weighted Moving Average

.

To calculate the Sine Weighted Moving Average multiply the sine value for each period by the close price for that period, add it all up and divide the result by the sum of the sine weights.  As a formula it looks like this:

.

Sine Weighted Moving Average Formula.

Here is an example of a 3 period Sine Weighted Moving Average:

.

Calculating a Sine Weighted Moving Average

.

Sine Weighted Moving Average Excel File

.

An Excel Spreadsheet containing a Sine Weighted Moving Average is available for FREE download.  It contains the ‘basic’ version you can see above and a ‘fancy’ one that will automatically adjust to the length you specify.  Find it at the following link near the bottom of the page under Downloads – Technical Indicators: Sine Weighted Moving Average (SW-MA).  Please let us know if you find it useful.

.

Sine Weighted Moving Average and a Simple Moving Average

.

Sine Weighted Moving Average and a Simple MA

.

Test Results

.

We tested several different types of Weighted Moving Averages including the SW-MA through 300 years of data across 16 global markets to reveal which is the best and if any of them are worthy of use as a trading tool.  See the results – Weighted Moving Averages Put To The Test

.

.

Wilder’s Smoothing was developed buy J. Welles Wilder, Jr. and he used it as a component in several of his other indicators including the RSI which is one of the most popular technical indicators of all time.
Wilder’s Smoothing was developed buy J. Welles Wilder, Jr. and he used it as a component in several of his other indicators including the RSI which is one of the most popular technical indicators of all time.

Triangular Moving Average (TriW-MA)

The Triangular Weighted Moving Average (TriW-MA) is included in the ‘Technical Indicator – Fight for Supremacy‘ so before we test it here is some information on how it is calculated.  If you would like to use the Triangular Moving Average in Excel then you can download a free spreadsheet HERE.

The TriW-MA gets it name from the way it applies the weight to data; because the emphasis is on the values in the middle, the weighting takes the shape of a triangle.  Below you can see how the weighting is applied to a 50 period TriW-MA, EMA and SMA:

.

Weight - TriW-MA vs EMA vs SMA

.

How To Calculate a Triangular Weighted Moving Average

.

To calculate a Triangular Weighted Moving Average multiply each close price by the weight for that period, add it all up and divide the result by the sum of the weights.  The weighting multiplier starts at 1 and increases by 1 until it peaks half way through the set before decreasing symmetrically back down to finish at 1 again.

Here is an example of a 3 period Triangular Weighted Moving Average:

.

Calculating a Triangular Weighted Moving Average

.

The same result can be achieved by using a double smoothed moving average AKA the Triangular Simple Moving Average.

.

Triangular Weighted Moving Average Excel File

.

An Excel Spreadsheet containing a Triangular Weighted Moving Average is available for FREE download.  It contains the ‘basic’ version you can see above and a ‘fancy’ one that will automatically adjust to the length you specify.  Find it at the following link near the bottom of the page under Downloads – Technical Indicators: Triangular Weighted Moving Average (TriW-MA).  Please let us know if you find it useful.

.

Triangular Moving Average and a Simple Moving Average

.

Triangular Weighted Moving Average and a Simple MA

.

Test Results

.

We tested several different types of Weighted Moving Averages including the TriW-MA through 300 years of data across 16 global markets to reveal which is the best and if any of them are worth using in your trading systems.  See the results – Weighted Moving Averages Put To The Test