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.

Weighted Moving Averages Put To The Test

A Weighted Moving Average smooths data by setting a separate but specific weighting for each data set over the length of its smoothing period.  In this round of testing we will look at the standard Weighted Moving Average (W-MA), the Triangular Weighted Moving Average (TriW-MA) and the Sine Weighted Moving Average (SW-MA) in order to reveal which is the best and if any of them are worth including in your trading tool box.

To evaluate these averages we tested Long and Short trades using Daily and Weekly data, taking End Of Day (EOD) and End Of Week (EOW) signals with Moving Average lengths varying from from 5 – 300 days or 60 weeks.~ These tests were carried out over a total of 300 years of data across 16 different global indexes (details here).

.

Weighted Moving Averages – Test Results:

.

Weighted Moving Average – Test Conclusion

.

Weighted Moving Average - Long and Short Annualized Return

.

Above you can see how the annualized return changes with the length of each Daily, EOD Moving Average for the Long and the Short side of the market.  The relative performance of each MA was similar when going Long or Short but the returns on the Short side were much lower.

There is little difference in performance between the TriW-MA and the SW-MA while the W-MA was clearly superior.  The W-MA performed particularly well with a setting of 35 days or 110 days, peaking with a annualized return of over 10% on these settings.  As the smoothing period is extended beyond 110 days the returns gradually diminished.

Return to Top

.

Weighted Moving Average - Long and Short Annualized Return During Exposure

.

Above you can see the performance of each average during the time that it was exposed to the market.  Across the board the efficiency of each average decreased as the length of each average is was increased.  The W-MA again proved the most effective.

Return to Top

.

Best Weighted Moving Average – Long

.

We tested 357 averages on the Long side but rather than simply selecting the one with the greatest returns over the test period we looked for the following criteria:

  • Annualized Return > 9%
  • Average Trade Duration > 29 Days
  • Annualized Return During Exposure > 15%
  • Annualized Return on Nikkei 225 > 3%
  • Annualized Return on NASDAQ > 12.5%

8/357 Averages made the final cut (see spreadsheet) but we selected the 90 Day Weighted Moving Average with End of Week Signals as the ultimate winner:
.

90 Day W-MA, EOW Long

.
Above you can see how the 90 Day W-MA, EOW Long performed during the test period compared to the 75 Day EMA, EOW Long which was selected as the most effective Exponential Moving Average in a previous test.  The Weighted MA produced very similar results to the EMA but didn’t offer any benefits.

Return to Top

.

Weighted Moving Average – Test Conclusion

.

The Triangular and Sine Weighted Moving Averages proved to be inferior to the W-MA while the standard Weighted Moving Average did produce reasonable returns.  Those returns however, were similar (if slightly inferior) to those of an Exponential Moving Average while not offering any notable benefits.  Therefore it can be concluded that none of the Weighted Moving Averages we tested are worth perusing further.

Return to Top

.

  • ~ An entry signal to go long (or exit signal to cover a short) for each average tested was generated with a close above that average and an exit signal (or entry signal to go short) was generated on each close below that moving average.  No interest was earned while in cash and no allowance has been made for transaction costs or slippage.  Trades were tested using End Of Day (EOD) and End Of Week (EOW) signals for Daily data and EOW signals only for Weekly data.  Eg. Daily data with an EOW signal would require the Week to finish above a Daily Moving Average to open a long or close a short and vice versa.
    .
  • – The average annualized return of the 16 markets during the testing period was 6.32%.  The data used for these tests is included in the results spreadsheet and more details about our methodology can be found here.