Vertical Horizontal Filter Adaptive Moving Average (VHF-AMA) – Test Results

The Adaptive Moving Average (AMA) modifies the amount of smoothing it applies to data in an attempt to adjust to the changing needs of a dynamic market.  It makes these adjustments based on the readings from a Volatility Index (VI).  Any measure of volatility or trend strength can be used, however in this article we will focus on how the AMA performs using the Vertical Horizontal Filter (VHF).

The VHF-AMA requires four user selected inputs: A Vertical Horizontal Filter period, a High – Low smoothing period range for the AMA and a power that Alpha is raised to.  With four variables there are thousands of possible combinations so we had to make some educated assumptions based on our previous tests to narrow the choices down.

In our tests on the Vertical Horizontal Filter in a VHF-VMA we revealed that VHF periods of 126, 252 and 80 produced the best results.  Because Volatility Index settings have proven to produce similar results in both the VMA and the AMA, testing these three settings should be sufficient to capture the best results.  Also they corresponded with the approximate number of trading days in standard calendar periods: 80 days = ⅓ year, 126 days = ½ year and there are 252 trading days in an average year, so:

VHF = 80, 126, 252

In previous tests we have seen that a moving average range produces the best results when it can move to as little as 4 periods or less, therefore we will test:

AMA Actual Fast Moving Average (FN) = 1, 4, 10

With the slow moving average we have consistently seen 300 produce the best results while changing this setting hasn’t usually made a big impact.  However we still ran tests through several settings:

AMA Actual Slow Moving Average (SN) = 200, 250, 300

For the Alpha Power we also tried several variables:

Alpha Power (P) = 0.5, 0.75, 1, 1.5, 2, 2.5

We tested trades going Long, using Daily data, taking End Of Day (EOD) signals~ analyzing all combinations of the above settings.

Each time the Alpha Power was adjusted the SC and FC had to be modified to account for the change but the actual FN and SN stayed the same.

For instance a SC – FC range of 1 – 24 with alpha ^ 2 has an actual FN – SN range of about 1 – 300 due to the effect of squaring alpha.  Here is a table that shows the SC – FC ranges used so that the FN – SN ranges stayed constant regardless of ‘P’:

SC and FC values used to keep FN and SN constant as P was changed.

If that doesn’t make a lot of sense then please read our explanation of the Adaptive Moving Average.  A total of 162 different averages were tested and each one was run through 300 years of data across 16 different global indexes (details here).

Download A FREE Spreadsheet With Raw Data For

All 162 VHF-AMA Test Results


Vertical Horizontal Filter Adaptive Moving Average – Test Array

 Vertical Horizontal Filter AMA - Ann Return as Alpha Power is Changed

Above we have charted the annualized returns achieved from each VHF with Alpha raised to different powers along the X axis.  The chart on the left shows the results when the FN = 1 and SN = 300 while on the right FN = 4 and SN = 300.  Clearly keeping the FN at 1 is important to achieve the best returns.  A VHF period of 126 stood out as the best performer and this echoes previous tests.  Finally, when FN = 1, raising Alpha to the power of 1.5 yielded the best results.

 

Best Vertical Horizontal Filter Adaptive Moving Average

126 Day VHF-AMA, EOD 1, 56 ^ 1.5 L - Performance

Included on the above chart is the performance of the 126 Day FRAMA, EOD 4, 300 Long because so far this has been the best performing Moving Average.  The 126 Day VHF-AMA, EOD 1, 56 Long ^ 1.5 produced extremely similar results and even had the same average trade duration of 14 days.  However it did slightly underperform the FRAMA by most measures but lets take a quick look under the hood to see what makes it tick:


126 Day VHF-AMA, EOD 1, 56 ^ 1.5 – Smoothing Period Distribution

126 Day VHF-AMA, EOD 1, 56 ^ 1.5 - Smoothing Distribution

As you can see the VHF-AMA does not have nearly as much of a spread with its smoothing range as the FRAMA.  A larger range makes the FRAMA more able to adapt to different market environments.

 

126 Day VHF-AMA 1, 56 ^ 1.5 – Alpha Comparison

To get an idea of the readings that created these results we charted a section of the alpha for the 126 Day VHF-AMA 1, 56 ^ 1.5 and compared it to the best performing FRAMA and the best VHF-VMA to see if we could learn what makes a good volatility index for use in an AMA:.

126 Day VHF-AMA, EOD 1, 56 ^ 1.5 - Alpha Comparison

The VHF does not look as though it can change as nimbly as the FRAMA while both the AMA and VMA using a VHF look very similar.

 

Excel Spreadsheet

The VHF is outstanding for use in an AMA and we have build an excel spreadsheet for you to download free so you can have a play.  Simply use the flowing link and you will find it under Downloads – Technical Indicators: Adaptive Moving Average (AMA).

 

For more in this series see – Technical Indicator Fight for Supremacy


  • ~ An entry signal to go long for each average tested was generated with a close above that average and an exit signal 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) signals on Daily data. Eg. Daily data with EOD signals would require the Daily price to close above a Daily Moving Average to open a long and to close below that Average to close the position.
  • We used the average annualized return of the 16 markets during the testing period.  The data used for these tests is included in the results spreadsheet and more details about our methodology can be found here.

252 Day ER-AMA, 9 – AMA Indicator Equivalent

Vertical Horizontal Filter Variable MA (VHF-VMA) – Test Results

The Variable Moving Average (VMA) dynamically adjusts its own smoothing period to the changing market conditions based on a Volatility Index (VI).  While any VI can be used, in this article we will look at how the VMA performs using a Vertical Horizontal Filter (VHF).

The VHF-VMA requires two user selected inputs: A Vertical Horizontal Filter Period and a VMA period.  We tested trades going Long and Short using Daily data taking End Of Day (EOD) signals~ analyzing all combinations of:

VHF = 10, 20, 40, 80, 126, 252

VMA = 1 – 20

The VHF lengths were selected due to the fact that they correspond with the approximate number of trading days in standard calendar periods: 10 days = 2 weeks, 20 days = 1 month, 40 days = 2 months, 80 days = ⅓ year, 126 days = ½ year and there are 252 trading days in an average year.

The VMA periods were selected after preliminary tests showed that when combined with the different VHF lengths they resulted in median smoothing periods between 3 and 173 days; a range that should capture the best results based on what we know from previous research into moving averages.

A total of 160 different averages were tested and each one was run through 300 years of data across 16 different global indexes (details here).

Download A FREE Spreadsheet With Raw Data For

All 160 VHF-VMA Long and Short Test Results

.

VHF Variable Moving Average EOD Returns, Long:

.VHF-VMA Annualized Return EOD, Long

.

As with previous VMA test, every single VHF-VMA using EOD signals managed to outperform the average buy and hold annualized return of 6.32%^ during the test period (before allowing for transaction costs and slippage).

The VHF periods of 126, 252 and 80 produced the best results when the VMA period was 10 or less while the highest returns came from a VHF period of 126 and a VMA period of 2.  We have seen in every ‘intelegent’ moving average test so far the predominance of 126 and 252 as the volatility or trend strength indicator settings that produce the best returns.

.

Best EOD Vertical Horizontal Filter Variable Moving Average:

.

126 Day VHF-VMA EOD, 2 Long.

I have included on the above chart the performance of the 126 Day FRAMA, EOD 4, 300 Long becuase so far this has been the best performing Moving Average.  The 126 Day VHF-VMA, EOD 2, Long produced respectable results compared to the best that the FRAMA could produce but still under performed slightly.  Plus there are several other things that go against the 126 Day VHF-VMA, EOD 2 such as a lower return on the NASDAQ, not turning a profit on the Nikkei 225 and a lower average trade duration.  (It also under performed on the short side by a small margin).

.

126 Day VHF-VMA, EOD 2 – Smoothing Period Distribution:

.

126 Day VHF-VMA, 2 - Smoothing Period Distribution.

Looking at the smoothing distribution you can see that the range for the VHF-VMA of just 5 – 43 is much smaller than the FRAMA.  In fact the entire VHF-VMA range covers only 68% of the FRAMA smoothing periods.  The median for the VHF-VMA is also lower which explains why it produces a shorter average trade duration.

.

126 Day VHF-VMA, 2 – Alpha Comparison

.

To get an idea of the readings that created these results we charted a section of the alpha for the 126 Day VHF-VMA, 2 and compared it to the best performing FRAMA to see if there were any similarities that would reveal what makes a good volatility index:

.

126 Day VHF-VMA, 2 – Alpha Comparison

.

The alpha pattern is not dissimilar for the 126 Day FRAMA 4, 300 and the 126 Day VHF-VMA 2 which explains why they produce comparable results.  The VHF-VMA however tends to produce higher readings resulting in a faster average and rarely moves to extremes.  While the lack of volatility from the VHF-VMA reading is a positive, it provides little variation in the smoothing period as the market changes.

.

Conclusion

.

The VHF-VMA does produce good returns and helps to further prove the validity of Variable Moving Averages in general.  However we found its performance to be slightly lower than the 126 Day FRAMA, EOD 4, 300 in almost every respect and therefore the Vertical Horizontal Filter Variable Moving Average does not warrant use as a trading tool.

Want to have a play with this indicator anyway?  Get a free Excel spreadsheet at the flowing link under Downloads – Technical Indicators: Variable Moving Average (VMA).  It will automatically adjust to one of many different VIs that you can select including the Vertical Horizontal Filter used in this article.

.

For more in this series see – Technical Indicator Fight for Supremacy

.

  • ~ 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) signals on Daily data. Eg. Daily data with EOD signals requires the Daily price to close above a Daily Moving Average to open a long or close a short and vice versa.
  • ^ This was the average annualized return of the 16 markets during the testing period. The data used for these tests is included in the results spreadsheet and more details about our methodology can be found here.

Vertical Horizontal Filter (VHF)

The Vertical Horizontal Filter (VHF) was first presented by Adam White in an article published in the August, 1991 issue of Futures Magazine – Tuning into trendiness with VHF indicator.  Trend following indicators work best in a trending market while in a range bound market, mean reversion strategies tend to excel.  The Vertical Horizontal Filter is designed to determine if prices are in a trending or congestion phase so that the most appropriate trading strategy can be applied.

The Vertical Horizontal Filter can be interpreted in several different ways:

  1. Values can be used to indicate the strength of the trend; higher values equal a stronger trend.
  2. The VHF direction can be used to identify if a trending or congestion phase is developing.
  3. It can also be used as a contrarian indicator where extreme readings foretell of an impending change in the market phase.

.

How To Calculate the Vertical Horizontal Filter:

.

VHF = Numerator / Denominator

Where:

Denominator = n ∑ (ABS(Close – Close[1]))

Numerator = ABS (Max Close[n] – Min Close[n])

n = Number of Periods

Here is an example of a 3 period VHF:

.

Vertical Horizontal Filter Formula.

Vertical Horizontal Filter Excel File

.

I have put together an Excel Spreadsheet containing the Vertical Horizontal Filter and made it available for FREE download.  It contains a ‘basic’ version displaying the example 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: Vertical Horizontal Filter (VHF)

.

Vertical Horizontal Filter Example

.

Vertical Horizontal Filter
.

Test Results

.
As part of the ‘Technical Indicator Fight for Supremacy‘ We have tested/will test the Vertical Horizontal Filter as a component in several technical indicators:

We will also be testing it for buy and sell signals in conjunction with trending and mean revision indicators.

.