PROTECTED SOURCE SCRIPT

The V_Wave: Volatility Adaptive Moving Average

Updated
This is work in progress - but i wanted to see if there's interest to use or test it - or if someone finds it useful. there's already a crowd of great moving averages out there :)

This is a different type of zero-lag weighted moving average - and it's a concept that i have been working on for a while now. Given that this is WIP, i decided to keep the code protected for now.

The idea is to create a moving average that responds faster to the changes in the underlying data - which is the case with other zero-lag moving averages - but in this case, i also wanted to make it adaptive, so it accelerate when the volatility increases and at the same time, maintain limited lag and reasonable smoothing, even at longer length.

How Does it Compare to other MA's
==============================
in the chart, we can see a comparison between the V_Wave (thick yellow line) and the 3 common MAs, Hull Moving Average (HMA, aqua), a Weighted Moving Average (WMA, brown) and an Exponential Moving Average (EMA, grey)

the most important advantage in V_Wave, is because of the way the algorithm works, and that it maintains direct association with the underlying data and the given length, the V_Wave will have less overshoot when compared to other moving averages - i.e, it stays closer to the underlying data points at times of quick reversals or big changes - like the V reversal on the right of the chart. You can also test it against other MAs you may be already using and share your findings back with me.

settings:
=========
- the settings provide the ability to choose the source data (close vs hl2, ..etc), the length, and the ability to adjust the "aggressiveness" of the line (Accelerator) ..
- this accelerator is the factor that tells the V_Wave how fast to respond to the volatility changes. when you increase the accelerator, the V_Wave is more aggressive, and will respond faster to changes in volatility -- it becomes more responsive to changes in the trend, but that will sacrifice the smoothness of the line.
- i capped this value to 7, because beyond that, the accelerator will have a diminished effect.
- Also note that due to association with volatility, the V_Wave will behave differently at lower time frames -- and becomes closer to an EMA but better (in responsiveness) than a WMA.

- the smoothing is built-in for now, and will adjust based on the length, in a way similar to how HMA smoothing works (see my previous post on Evolving the Zero Lag MA for details on that) - in future versions, i may make it a manual entry or a selection between manual/automatic

Usage:
=======
Use the V_Wave as you use other moving averages - once you get to know how it behaves and adapts to underlying data changes.
you can use it as a filter to generate signals once it crosses other MAs, or another V_Wave of a different length / acceleration.

will be great if you share your test results and your use cases to help me improve how the V_Wave works.

best of luck!
Release Notes
update: "Source" was still using "Close" - now fixed.

Also posting an example demonstrating a possible signal setup using a dual V_Wave configuration, using open and close of various length to detect trend change and entry zones
snapshot
Release Notes
Quick Update:
No real change to the code here - just found out i unintentionally over-written the original chart that shows the comparison between the V_WAVe against the other MA's - so bringing that back.

Also showing how the V_WAVe adapts to increasing price volatility (as expressed by STDEV), which enables limited overshoot during significant price swings and sudden changes in trend direction.
Release Notes
v2 with a fix and couple of improvements:
- Fixed an issue with the accelerator: when value is too high, may cause the V_Wave to behave erratically (thanks to cheatcountry for feedback and the actual fix)
- Introduced auto-smoothing option
Adaptive Moving Average (AMA)HMAHull Moving Average (HMA)Moving Averagesredkv_waveweightedmovingaverageWeighted Moving Average (WMA)

Protected script

This script is published closed-source and you may privately use it freely.

Want to use this script on a chart?

Disclaimer