Volume Adaptive Bollinger Bands (MZ VABB)This indicator is a functional enhancement to John Bollinger's Bollinger Bands. I've used Volume to adapt dynamic length which is used in basis (middle line) of Bollinger Bands and Simple Moving Average is replaced with Adaptive Ehlers Deviation Scaled Moving Average ( AEDSMA ).
BOLLINGER BANDS BASIC USAGE AND LIMITATIONS
Bollinger bands are popular among traders because of their simple way to detect volatility in market and redefine support and resistance accordingly. These are some basic usages of original Bollinger Bands:
Most commonly Bollinger Band works on 20 period Simple Moving Average as Basis / Middle Line and standard deviation of 2 for volatility detection.
Upper and lower bands can act as support and resistance which accordingly update with standard deviation of same period as of Simple Moving Average.
As upper and lower bands act as volatility measure which benefits in Squeeze detection and breakout trading.
Among all the usages there are some limitations as follows:
Original Bollinger Bands use 20 period Simple Moving Average as Basis which itself restricted to some number of data pints and if market moves in one direction or simply goes sideways for long time; candles can stay on either bands for long time. This gives benefit for staying in directional trade but will completely nullify the use of both bands as support and resistance.
Above point simply be explained as markets can stay overbought / oversold for long time and one way to make Bollinger Bands more useful is to simply use higher periods in SMA but as we know with higher periods SMA becomes more laggy and less adaptive.
Most traders use BBs alongside some other Volume Oscillator for example "On Balance Volume" but that does solve BBs limitations issue that it should be more adaptive to detect volatility in market.
VOLUME ADAPTIVE BOLLINGER BAND WORKING PRINCIPLE
Best way to make original Bollinger band more adaptive was to just use dynamic length instead on constant 20 period. This dynamic length had to be based on some other powerful parameter which can't be volatility as BB itself is a volatility indicator and adapting its length based volatility would have been superimposing volatility on Bollinger bands giving unrealistic results.
For adaptive length, I tried using Volume and for this purpose I used my Relative Volume Strength Index " RVSI " indicator. RVSI is the best way to detect if Volume is going for a breakout or not and based on that indication length of Bollinger Band Basis Moving Average changes.
RVSI breaking above provided value would indicate Volume breakout and hence dynamic length would accordingly make Bollinger band basis moving average more over fitted and similarly standard deviation of achieved dynamic length would give better bands for support and resistance. Similar case would happen if Volume goes down and dynamic length becomes more underfit.
According to my back testing studies I found that Simple Moving Average wasn't the best choice for dynamic length usage in Bollinger Band Basis. So, I used Adaptive Ehlers Deviation Scaled Moving Average ( AEDSMA ) which is more adaptive and already modified to adapt with RVSI.
SLOPE USAGE FOR TREND STRENGTH DETCTION
Volume Adaptive Bollinger Bands are more reactive to market trends so, I used slope for trend strength detection.
If slope of Volume Adaptive Bollinger Band Basis (i.e. AEDSMA ), Upper and Lower Bands is supporting a trend at same time then script will provide signal in that direction. That signal can also use Volume as confirmation if Bollinger Bands trend direction is supported by Volume or not.
DYNAMIC COLORS AND TREND CORRELATION
I’ve used dynamic coloring in Basis ( AEDSMA ) to identify trends with more detail which are as follows:
Lime Color: Slope supported Strong Uptrend also supported by Volume and Volatility or whatever you’ve chosen from both of them.
Fuchsia Color: Weak uptrend only supported by Slope or whatever you’ve selected.
Red Color: Slope supported Strong Downtrend also supported by Volume and Volatility or whatever you’ve chosen from both of them.
Grey Color: Weak Downtrend only supported by Slope or whatever you’ve selected.
Yellow Color: Possible reversal indication by Slope if enabled. Market is either sideways, consolidating or showing choppiness during that period.
SIGNALS
Green Circle: Market good for long with support of Volume and Volatility or whatever you’ve chosen from both of them.
Red Circle: Market good to short with support from Volume and Volatility or whatever you’ve chosen from both of them.
Flag: Market either touched upper or lower band and can act as good TP and warning for reversal.
FIBONACCI BANDS
I’ve included Fibonacci multiple bands which would act as good support/resistance zones. For example, 0.618 Fib level act as good local support and resistance in both upper and lower zones. Fibonacci values can be modified but should be lower than 1.
DEFAULT SETTINGS
I’ve set default Minimum length to 50 and Maximum length to 100 which I’ve found works best for almost all timeframes but you can change this delta to adapt your timeframe accordingly with more precision.
Dynamic length adoption is enabled based on Volume only but volatility can be selected which is already explained above.
Trend signals are enabled based on Slope and Volume but Volatility can be enabled for more precise confirmations.
In “ RVSI ” settings "Klinger Volume Oscillator" is set to default but others work good too especially Volume Zone Oscillator. For more details about Volume Breakout you can check “MZ RVSI Indicator".
ATR breakout is set to be positive if period 14 exceeds period 46 but can be changed if more adaption with volatility is required.
EDSMA super smoother filter length is set to 20 which can be increased to 50 or more for better smoothing but this will also change slope results accordingly.
EDSMA super smoother filter poles are set to 2 because found better results with 2 instead of 3.
FURTHER ENHANCEMENTS
So far, I've achieved better results with "Klinger Volume Oscillator" in RVSI but TFS Volume Oscillator and On Balance Volume can be used which would change dynamic length differently. It doesn't mean that results would be wrong with some oscillator and precise with others but every oscillator works in its specific way for and RVSI just detect strength of Volume based on provided oscillator.
Ehler
Adaptive Ehlers Deviation Scaled Moving Average (AEDSMA)AEDSMA INTRODUCTION
This indicator is a functional enhancement to “Ehlers Deviation Scaled Moving Average (EDSMA / DSMA)”. I’ve used Volume Breakout and Volatility for dynamic length adaption and further Slope too for trend evaluation.
EDSMA was originally developed by John F. Ehlers (Stocks & Commodities V. 36:8: The Deviation-Scaled Moving Average).
IDEA PLACEMENT
I’ve traded almost every kind of market with different volatility conditions using Moving Averages. It was too much of a hassle to select and use different MA length depending upon market trend. So, the journey started with adapting Moving Averages with another parameter and that’s how “MZ SAMA ” came into being where Slope was used to adapt Adaptive Moving Average with trend change. The problem was still pretty much the same as SAMA might not be effective on every market condition. Hence, I worked on Volume to adapt Moving Averages accordingly. I cane up with “MZ RVSI ” which I used in “MZ DVAMA ” to adapt dynamic length in Adaptive Moving Average and also used “MZ RVSI " alongside Slope as confirmation of trend changes.
Meanwhile, I started using DVAMA methodology on different types on Moving Averages that allow dynamic length for example Hull Moving Average, Linear Regression Curve, SMA, WMA, TMA and many more. All of my tested Mas showed too much flexibility because of volume based Adaptive length.
I came across a script of “Adaptive Hull Moving Average” which pretty much used the similar methodology as DVAMA but when I looked into its depth, its volume oscillator wasn’t working at all and only volatility based dynamic length was used. It was an interesting idea so, I decided to use Volume and Volatility alongside for better results but was nearly impossible to achieve what I wanted using only Hull Moving Average.
I had been using EDSMA in “MA MTF Cross Strategy” and “MZ SRSI Strategy V1.0” previously. It was the perfect choice when comparing to usage of slope on it. DSMA works perfectly as support and resistance as its Deviation Scaled. So, I tried using it to adapt dynamic length based on Volume and Volatility and I wasn’t disappointed. It worked like a charm when I adapted dynamic length between 50 and 255.
DYNAMIC LENGTH BENEFITS
Dynamic length adaption methodology works in a way of adapting Relatively Lower Length leading toward overfitting if trend is supported by Volume and Volatility . Similarly, adapting Relatively Higher Length leading toward underfitting if trend isn’t supported by Volume and Volatility .
Dynamic length adaption makes Moving Average to work better for both Bull and Bear-runs avoiding almost every fake break-in and breakouts. Hence, adaptive MA becomes more reliable for breakout trading.
MA would be more useful as it would adapt almost every chart based on its Volume and Volatility data.
DYNAMIC COLORS AND TREND CORRELATION
I’ve used dynamic coloring to identify trends with more detail which are as follows:
Lime Color: Strong Uptrend supported by Volume and Volatility or whatever you’ve chosen from both of them.
Fuchsia Color: Weak uptrend only supported by Slope or whatever you’ve selected.
Red Color: Strong Downtrend supported by Volume and Volatility or whatever you’ve chosen from both of them.
Grey Color: Weak Downtrend only supported by Slope or whatever you’ve selected.
Yellow Color: Possible reversal indication by Slope if enabled. Market is either sideways, consolidating or showing choppiness during that period.
SIGNALS
Green Circle: Market good for long with support of Volume and Volatility or whatever you’ve chosen from both of them.
Red Circle: Market good to short with support from Volume and Volatility or whatever you’ve chosen from both of them.
Yellow Cross: Market either touched top or bottom ATR band and can act as good TP or SL.
EDSMA EVELOPE/BANDS: I’ve included ATR based bands to the Adaptive EDSMA which act as good support/resistance despite from main Adaptive EDSMA Curve.
DEFAULT SETTINGS
I’ve set default Minimum length to 50 and Maximum length to 255 which I’ve found works best for almost all timeframes but you can change this delta to adapt your timeframe accordingly with more precision.
Dynamic length adoption is enabled based on both Volume and Volatility but only one or none of them can also be selected.
Trend signals are enabled based on Slope and Volume but Volatility can be enabled for more precise confirmations.
In “ RVSI ” settings TFS Volume Oscillator is set to default but others work good too especially Volume Zone Oscillator. For more details about Volume Breakout you can check “MZ RVSI Indicator".
ATR breakout is set to be positive if period 14 exceeds period 46 but can be changed if more adaption with volatility is required.
EDSMA super smoother filter length is set to 20 which can be increased to 50 or more for better smoothing but this will also change slope results accordingly.
EDSMA super smoother filter poles are set to 2 because found better results with 2 instead of 3.
FURTHER ENHANCEMENTS
So far, I’ve seen better results with Volume Breakout and Volatility but other parameters such as Linear Slope of Particular MA, MACD, “MZ SRSI ”, a Conditional Uptrend MA or simply KDJ can also be used for dynamic length adaption.
I haven't yet gotten used to pine script arrays so, defining and using conditional operators is pretty much lazy programming for me. Would be great redefining everything through truth matrix instead of using if-else conditions.
Ehlers Directional Movement Hann Window Indicator [CC]The Directional Movement Hann Window Indicator was created by John Ehlers (Stocks and Commodities Dec 2021 pgs 17-18) and this is his updated version of the classic Directional Movement indicator created by J. Welles Wilder. Ehlers uses the Hann Window Filtering after using an exponential moving average to smooth the classic directional movement indicator. This helps significantly with the lag and lack of smoothing which are both issues with the classic indicator. I have included strong buy and sell signals in addition to the normal ones so strong signals are darker in color and normal signals are lighter in color. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like to see me publish!
Ehlers Stochastic Relative Vigor Index [CC]The Stochastic Relative Vigor Index was created by John Ehlers (Cybernetic Analysis For Stocks And Futures pgs 84-89) and this of course is very similar to the Ehlers Fisher Stochastic Relative Vigor Index I just published. In hindsight I probably should have published this one first but just like with the other script this is a stochastic version of a Relative Vigor Index and I added some smoothing to make buy and sell signals clearer. There are several ways to identify buy and sell signals but generally in the long term it is a buy signal when the indicator is below the oversold line and is moving up and in the short term when the indicator is above it's trigger line which is what I coded the buy and sell signals to follow. Buy when the line is green and sell when it turns red.
Let me know if there are any other scripts you would like to see me publish!
Ehlers Deviation Scaled Super Smoother [CC]The Deviation Scaled Super Smoother was created by John Ehlers and this is an excellent moving average that changes direction very quickly and can keep up with the current underlying trend. This indicator works by applying a Hann Windowed Moving Average to the stock's momentum and scaling that by the Root Mean Square and then using that value in the input for a Super Smoother . I have included strong buy and sell signals in addition to normal ones so lighter colors are normal signals and darker colors are strong ones. Buy when the line turns green and sell when it turns red.
Let me know if there are any other scripts you would like to see me publish!
Ehlers Fisher Stochastic Relative Vigor Index [CC]The Fisher Stochastic Relative Vigor Index was created by John Ehlers (Cybernetic Analysis For Stocks And Futures pgs 101-104) and this is a many layered indicator created from his original Relative Vigor Index turned into a stochastic and then performing a Fisher transform on the results. I have included extra smoothing to provide clearer buy and sell signals as well as normal and strong buy and sell signals. As always strong signals are darker in color and normal signals are lighter in color. Buy when the line turns green and sell when it turns red.
Let me know if there are any other scripts you would like to see me publish!
Ehlers Variable Index Dynamic Average [CC]The Variable Index Dynamic Average was created by Tushar Chande and this is a variation of that original formula created by John Ehlers. As you can see I have included the default Vidya from a script by @everget and as you can see the Ehlers version is able to follow the price much closer. I have included strong buy and sell signals in addition to normal ones and so darker colors are strong signals and lighter colors are normal ones. Buy when the line turns green and sell when it turns red.
Let me know if there are any other scripts you would like to see me publish!
Ehlers Cycle Period [CC]The Cycle Period was created by John Ehlers and this is yet another version that shows how to calculate the current cycle period which is the approximate amount of days between a current peak or valley and the next peak or valley. I would not recommend this for trading since it is more for informational use only but I would try experimenting with this output to be used with another indicator as an input length. I have included strong buy and sell signals in addition to normal ones so strong signals are darker in color and normal signals are lighter in color.
Let me know if there are any other scripts you would like to see me publish!
Ehlers Kaufman Adaptive Moving Average [CC]The Kaufman Adaptive Moving Average was created by Perry Kaufman and this is a variation of that original formula created by John Ehlers. I have included a side by side with an original script (blue line) done by @HPotter that shows that Ehlers version is slightly more reactive compared to the original version. I have included strong buy and sell signals in addition to normal ones and so darker colors are strong signals and lighter colors are normal ones. Buy when the line turns green and sell when it turns red.
Let me know if there are any other scripts you would like to see me publish!
Ehlers Mesa Spectrum Dominant Cycle [CC]The Mesa Spectrum Dominant Cycle was created by John Ehlers and this is the foundation for many indicators he created that would later follow. This is his updated version of his original Mesa algorithm and I do not recommend this indicator as a stand alone for trading. This is more of an informational indicator that will tell you the current dominant cycle period which is the approximate period between peaks and valleys in the underlying data. I have color coded buy signals just in case with both strong and normal signals. Darker colors are strong and lighter colors are normal. Buy when the line is green and sell when it is red.
Let me know if there are any other indicators you would like to see me publish!
Ehlers Average Error Filter [CC]The Average Error Filter was created by John Ehlers and this is a variation of a Zero Lag Exponential Moving Average that uses a Super Smoother to filter out the noise and then uses a second Super Smoother of the difference between the current price and the filtered data. This works well as a trendline and does give out a few false signals like all indicators inevitably do but most signals do a good job of keeping up with the trend and providing clear entries and exits when the trend changes. I have included strong buy and sell signals in addition to normal ones so like always darker colors are strong signals and lighter colors are normal ones. Buy when the line turns green and sell when it turns red.
Let me know if there are any other scripts you would like to see me publish!
Ehlers Error Correcting Exponential Moving Average [CC]The Error Correcting Exponential Moving Average was created by John Ehlers and Ric Way (Stocks & Commodities V. 28:11 (30-35)) and this is an excellent moving average that accurately identifies the trend and sticks with the price during trends or choppy periods pretty well. It looks back to find the best gain setting for each day that returns the smallest difference between the current price and the ema based on the gain setting and uses that day's info in it's total calculations and if there is a zero gain for the day then it is just a classic ema. I have included strong buy and sell signals in addition to normal ones so lighter colors are normal and darker colors are strong. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like to see me publish!
Ehlers Moving Average Difference Hann Indicator [CC]The Moving Average Difference Hann Indicator was created by John Ehlers (Stocks and Commodities Nov 2021) and this is an improved variation of his Moving Average Difference Indicator that uses smoothing from his Hann Windowing Indicator to provide smoother buy and sell signals. As for how this indicator works it is an improved version of the classic MACD indicator which of course takes a difference between two exponential moving averages. I have included strong buy and signals in addition to normal ones so lighter colors are normal signals and darker colors are strong signals. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like to see me publish!
Ehlers High Pass Filter [CC]The High Pass Filter was created by John Ehlers and I would define this indicator as both a momentum indicator but also a predictor indicator. This does a pretty good job of predicting future price action even though I have double smoothed it to provide clear buy and sell signals. I will be publishing quite a few more Ehlers indicators very soon so stay tuned. This indicator can be interpreted in a few different ways but most importantly it is a mid to long term sell signal when the indicator falls below the zero line and vice versa. It also falls below the zero line when the underlying price data starts losing momentum so it can be used also as a price reversal. I have included strong buy and sell signals in addition to normal ones so darker colors are strong signals and lighter colors are normal signals. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like to see me publish!
Ehlers Moving Average Difference Indicator [CC]The Moving Average Difference Indicator was created by John Ehlers (Stocks and Commodities Oct 2021 pg 23) and this is essentially his version of the famous MACD indicator. He calls this indicator the "thinking mans" MACD because his thought process for creating the lengths is based on half of the period of the dominant cycle. These are the default lengths that he created but feel free to test it out with your own variations and please let me know if you come up with a better one. I'm sorry for my long delay from TV. Sometimes I just need to step away and collect my thoughts before I burn myself out with the many scripts I keep publishing daily. I will try to get back into publishing daily again because I have a personal backlog of over 50 scripts ready to go that I haven't published yet. As always I have included strong buy and sell signals in addition to normal ones so darker colors are strong and lighter colors are normal. Buy when the line turns green and sell when it turns red.
Let me know if there are any other scripts you would like to see me publish!
Ehlers Cycle Amplitude [CC]The Cycle Amplitude was created by John Ehlers (Trend Modes and Cycle Modes) and this indicator wasn't meant to give buy and sell signals by itself but I'm publishing this open source script in case someone comes up with a cool way to use this indicator for buy and sell signals. This indicator essentially tells you the distance between the peaks from the Cycle BandPass Filter and I will be including the last script tomorrow most likely. I'm reusing the same exact buy and sell signals from the cycle bandpass filter so if you have any questions then feel free to refer to the link I posted.
Let me know if there are any other scripts you would like to see me publish!
Ehlers Cycle BandPass Filter [CC]The Cycle BandPass Filter was created by John Ehlers (Cycle Modes and Trend Modes) and this is an alternate to the default BandPass Filter by changing some settings. This will be another series I will be introducing showing some indicators created by Ehlers and that didn't get much attention. This identifies the underlying cycle in the price data and these indicators aren't very common so I want to introduce more of these to tv. Buying and selling with these indicators can be a bit tricky but overall what Ehlers recommends is to buy at the lowest point and sell at the highest point to capture the underlying cycle. I have included strong buy and sell signals as darker colors and normal signals as lighter colors. Buy when the line turns green and sell when it turns red.
Let me know if there are any other scripts you would like to see me publish!
Ehlers Instantaneous Phase Dominant Cycle [CC]The Instantaneous Phase Dominant Cycle was created by John Ehlers (Stocks & Commodities V. 18:3 (16-27)) and this is one of many similar indicators that I will be publishing from Ehlers in the next few months that calculate the current dominant cycle period. The cycle period can be used in multiple ways but generally this means that if the stock is currently at a low then the current cycle period will tell you when the next lowest low will get hit or vice versa. This is also useful for using this cycle period as an input for other indicators to provide a very good adaptive length. Let me know how you wind up using these indicators in your daily trading. I have included the same buy and sell signals from my recent Hilbert Transform and so buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like to see me publish!
Ehlers Hilbert Transform [CC]The Hilbert Transform was created by John Ehlers (Stocks & Commodities V. 18:3 (16-27)) and this indicator can work pretty well as a trend confirmation. This essentially transforms the underlying price data into a soundwave and when you compare the two (blue is positive and red is negative) then it provides fairly clear buy and sell signals. Ehlers did warn in his original article that this indicator has a lag of 4 bars so you have to keep that in mind. I have found that this indicator works pretty well when you buy when the blue line goes over the red line and sell when the blue lines hits the zero line. You could also ignore the red line and buy when the blue line crosses over the zero line and sell when it crosses under. Let me know how you wind up using this indicator in your trading.
Let me know if there are any other scripts you would like to see me publish!
Ehlers Squelch Indicator [CC]The Squelch Indicator was created by John Ehlers (Stocks & Commodities V. 18:9 (42-46)) and this indicator is a variation of his Market Mode Indicator and its purpose is the same as in it determines if the market is trending or in a choppy market. If this indicator is at the 1 level then this means the market is trending and if it is at 0 then the market is choppy. I would recommend to adjust the squelch variable to find a setting that works well for you. If you want to avoid more choppy markets then adjust the squelch variable to a lower amount and vice versa. I have included basic buy and sell signals so buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like to see me publish!
Ehlers Simple Window Indicator [CC]The Simple Window Indicator was created by John Ehlers (Stocks and Commodities Sep 2021) and this is the last of the 4 new indicators that he published in the latest issue of Stocks & Commodities. Since these are all part of a series, the idea behind each indicator is the exact same. The only difference is of course the calculation for each indicator. This script is different mostly because it is extremely noisy in comparison so I had to smooth it twice to provide clear buy and sell signals. Window functions are used in digital signal processing to filter out noise and the end result is an oscillator that centers around the 0 line. The easy way to understand these indicators that I will be publishing and those are that when they are above 0, it usually means an uptrend and below 0 then a downtrend. For more immediate signals, I have included both normal and strong buy and sell signals so darker colors for strong signals and lighter colors for normal signals. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like me to publish!
Ehlers Triangle Window Indicator [CC]The Triangle Window Indicator was created by John Ehlers (Stocks and Commodities Sep 2021) and this is one of 4 new indicators that he published in the latest issue of Stocks & Commodities and I will be publishing the last one tomorrow. Since these are all part of a series, the idea behind each indicator is the exact same. The only difference is of course the calculation for each indicator. Window functions are used in digital signal processing to filter out noise and the end result is an oscillator that centers around the 0 line. The easy way to understand these indicators that I will be publishing and those are that when they are above 0, it usually means an uptrend and below 0 then a downtrend. For more immediate signals, I have included both normal and strong buy and sell signals so darker colors for strong signals and lighter colors for normal signals. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like me to publish!
Ehlers Hamming Window Indicator [CC]The Hamming Window Indicator was created by John Ehlers (Stocks and Commodities Sep 2021) and this is one of 4 new indicators that he published in the latest issue of Stocks & Commodities and I will be publishing the other 2 in the next few days. Since these are all part of a series, the idea behind each indicator is the exact same. The only difference is of course the calculation for each indicator. Window functions are used in digital signal processing to filter out noise and the end result is an oscillator that centers around the 0 line. The easy way to understand these indicators that I will be publishing and those are that when they are above 0, it usually means an uptrend and below 0 then a downtrend. For more immediate signals, I have included both normal and strong buy and sell signals so darker colors for strong signals and lighter colors for normal signals. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like me to publish!