FIR Hann Window Indicator (Ehlers)From Ehlers' Windowing article:
"A still-smoother weighting function that is easy to program is called the Hann window. The Hann window is often described as a “sine squared” distribution, although it is easier to program as a cosine subtracted from unity. The shape of the coefficient outline looks like a sinewave whose valleys are at the ends of the array and whose peak is at the center of the array. This configuration offers a smooth window transition from the smallest coefficient amplitude to the largest coefficient amplitude."
Ported from: { TASC SEP 2021 FIR Hann Window Indicator } (C) 2021 John F. Ehlers
Stocks & Commodities V. 39:09 (8–14, 23): Windowing by John F. Ehlers
Original code found here: traders.com
FIR Chart: traders.com
ROC Chart: traders.com
Ehlers style implementation mostly maintained for easy verification.
Added optional ROC display.
Style and efficiency updates + Hann windowing as a function coming soon.
Indicator added twice to chart show both FIR and ROC.
Ehlers
Ehlers Convolution Indicator [CC]The Convolution Indicator was created by John Ehlers (Cycle Analytics For Traders pgs 170-174) and this is version of an indicator to find potential reversal points. The idea behind this indicator is to use a variation of his AutoCorrelation Indicator that transforms the data using digital signal processing and as you can see it looks very similar to his BandPass Filter . The idea is that when this indicator peaks then it has reached a potential reversal point and so the stock may continue in the current direction but most of the time this indicator correctly points out the reversal points. I have included normal buy and sell signals but generally speaking you would want to buy when the indicator is around 0.05 to 0.10 and moving up and sell when it reaches its peak and is starting to move down.
Let me know if you have any other scripts you would like to see me publish!
Ehlers Optimum Predictor [CC]The Optimum Predictor was created by John Ehlers (Rocket Science For Traders pgs 209-210) and this indicator does a pretty good job of predicting major market moves. When the blue line crosses over the red line then this indicator is predicting an upcoming uptrend and when the blue line crosses under the red line then it is predicting an upcoming downtrend. Ehlers recommends using this indicator with an entire trading system to filter out any bad signals but most of the signals it gives are pretty accurate. He uses advanced digital signal processing to predict the future prices and uses it in an ema formula for the calculation. There are several ways to interpret this indicator: you can look for crossovers, you can also look for when the indicator goes above 0 for a general uptrend or below 0 for a general downtrend.
Let me know if there are any other scripts you would like to see me publish!
Ehlers Market Mode Indicator [CC]The Market Mode Indicator was created by John Ehlers (Rocket Science For Traders pgs 114-117) and this is a handy tool that will tell you if the market is currently in a cycle or a trend. When the current market is in a cycle or choppy state then the indicator will read 0 and when it is in a trend then it will read 1. He uses some advanced digital signal processing to figure out the current trend and for how long it has been trending. I have included buy and sell signals using the trendline and so buy when the line turns green and sell when it turns red. Let me know if this indicator is useful for you.
Let me know if there are any other indicators you would like to see me publish!
TEMA/MAMA CrossThis is a strategy based on the TEMA and Ehler's MAMA moving averages. Crosses of the fast and slow TEMA are commonly used for entry and exit strategies. The Ehler's Mesa Adaptive Moving Average is a trend-following price indicator that uses a Hilbert Transform. Having plotted both TEMA and eMAMA side-by-side for some time, I noticed a pattern where the fastTEMA crossed over the eFAMA (eFAMA is the Ehler's MAMA following/slow MA) prior to a price increase. This is a strategy to test that observation.
The strategy (at present) only does long entries. It enters long when the fastTEMA crosses up over the (slow) eFAMA. It uses a traditional exit when the fastTEMA crosses below the slowTEMA. I have tested this on several tokens on 1hr charts using a fastTEMA length of 13. Play with it on different charts and different lengths to see how it works for you.
Ehlers Relative Vigor Index [CC]The Relative Vigor Index was created by John Ehlers (Cybernetic Analysis For Stocks And Futures pg 58) and this is a momentum indicator that is similar to the Accumulation Distribution Oscillator created by Jim Waters and Larry Williams. He uses digital signal processing to smooth the indicator to provide clear buy and sell signals. The idea behind this indicator is that during uptrends, prices tend to close near the high and during downtrends, prices tend to close near the low. I have included strong buy and sell signals in addition to normal ones so strong signals are darker in color and normal ones are lighter in color. Buy when the line turns green and sell when it turns red. Usually the best signals I have found for this indicator is when the indicator is below the 0 line and turns green then it is usually a sign of a strong uptrend.
Let me know if there are any other scripts you would like to see me publish!
Ehlers Adaptive Bandpass Filter [CC]The Adaptive Bandpass Filter was created by John Ehlers (Cycle Analytics For Traders pgs 153-156) and this uses his autocorrelation code to provide the adaptive lengths to use for the underlying bandpass filter. The bandpass filter is a common way in digital signal processing to filter out the underlying noise in the data. It can actually be turned into a leading indicator by changing the bw variable to a smaller amount. Since this indicator is adaptive using the cycle period, the buy and sell signals are different compared to the normal bandpass filter. Buy signals for this indicator according to Ehlers are when the line is red and the line is under the oversold line (also red) then you buy when the indicator line turns green and then you exit when the indicator line turns red and is above the overbought line. This indicator doesn't provide clear buy and sell signals in all circumstances but generally speaking buy when the indicator line turns green and sell when it turns red. Feel free to experiment with this one.
Let me know if there are any other scripts you would like to see me publish!
Ehlers Adaptive Stochastic Indicator V1 [CC]The Adaptive Stochastic Indicator V1 was created by John Ehlers (Rocket Science For Traders pgs 233-234) and this indicator uses the same calculations to find a cycle period that is then used for both the creation of the stochastic indicator but also for the smoothing to create a double smoothed stochastic indicator. Because it is calculated this way, this indicator is more reactive than almost any other stochastic indicator and provides clear buy and sell signals especially when the underlying stock is trending. It is interpreted in the same way as a normal stochastic indicator so great buy signals are when the indicator is below the oversold line and starts to move up and vice versa. 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!
MESA Stochastic Multi LengthJohn Ehler's MESA Stochastic uses super smoothing to give solid signals. This indicator uses the same rules as every other Stochastic indicator so it would be worth looking into if you are not already familiar with reading a Stochastic. There are 4 different lengths displayed to give traders an edge on reading the market. This is a great tool to analyze waves and find tops and bottoms. It gives great pump and dump signals and even helps filter out bad trades when used with other indicators such as Boom Hunter.
Below are some examples of signals to look out for:
oo
Ehlers Modified Relative Strength Index [CC]The Modified Relative Strength Index was created by John Ehlers (Cycle Analytics For Traders pgs 87-88) and this is a typical RSI that uses his roofing filter as the input. He smooths it with his own super smoother filter to provide signals. This indicator is extremely reactive and works in cycles so keep that in mind. I haven't been able to come up with clear buy and sell signals at this point so let me know if you any suggestions but I'm publishing the code to complete my goal of publishing all of his work one day. I will be publishing a bunch of Ehlers scripts in the next few weeks so stay tuned. What I recommend for buy and sell signals at this point are to buy when the indicator goes below the oversold line and starts going up and sell when the indicator goes below the oversold line a second time. Vice versa for sell signals.
Let me know if there are any other scripts you would like to see me publish!
Ehlers AutoCorrelation Indicator [CC]The AutoCorrelation Indicator was created by John Ehlers (Cycle Analytics pgs 94-98) and this can be viewed as both a momentum indicator and a trend indicator. This was his basis for several other indicators that he created which I will be publishing soon but essentially as this indicator goes up then the stock is in an uptrend and also has upward momentum. You will notice that this indicator starts to go down even during an uptrend showing that the underlying trend is going to have an upcoming reversal. He also warns that the halfway mark is a possible reversal point so keep an eye out for that.
Generally speaking a good signal is to enter a long position when the indicator is under the midline and is starting to go up (or when the line is green) and to exit the position when the indicator goes over the midline. I have included strong buy and sell signals in addition to normal ones so darker colors mean strong signals and lighter colors mean normal signals.
Let me know if there are any other indicators you would like me to publish!
Ehlers Adaptive Relative Strength Index V1 [CC]The Adaptive Relative Strength Index was created by John Ehlers and this is his first version. I will of course publish his updated version at a later date along with publishing the final script from Jim Sloman's Ocean Theory book. I have changed his script to include extra smoothing to provide clear buy and sell signals. This is a version of a RSI that is very adaptive to changes by finding the length of the current cycle and using that to calculate the rsi and I use this same basic process to provide extra smoothing. A great strategy of course is to buy right after the indicator goes from below the oversold level to right above it and stay in until the indicator turns red or when it reaches the overbought level. I have included strong buy and sell signals in addition to normal ones and the darker colors mean strong signals and lighter colors are normal signals.
Let me know what other indicators you would like to see me publish!
Ehlers Distance Coefficient Filter [CC]The Distance Coefficient Filter was created by John Ehlers and this is one of his more unknown moving averages. It works well because in an uptrend or downtrend it behaves more like a trailing stop system but it also deals with issues like pullbacks pretty quickly. I think it works well with the default values but let me know if you find a more profitable system. Buy when the indicator 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 Smoothed Adaptive Momentum [CC]The Smoothed Adaptive Momentum indicator was created by John Ehlers and this indicator gives a lot of useful information. When the indicator is above 0 then there is very strong upward momentum and when the indicator falls below 0 then there is very strong downward momentum. A very profitable way to use this particular indicator is buy long when the indicator is below 0 and it crosses over it's signal line and then sell of course when you get the first sell signal. I have included strong buy and sell signals in addition to normal ones so darker colors mean strong signals and lighter colors are normal signals. Buy when the line turns green and sell when it turns red.
Let me know if you have any other scripts you would like to see me publish!
Ehlers Simple Clip Indicator [CC]The Simple Clip Indicator was created by John Ehlers (Stocks and Commodities June 2021 pg 10) and this is obviously very similar to the previous indicator I published ( Ehlers Simple Deriv Indicator ) so I would recommend to try both out and see what you prefer. This is a new momentum indicator that is extremely responsive to price changes and when the indicator is above 0 then this means the stock is in a long term uptrend and when it is below 0 then it is in a long term downtrend. I have color coded the indicator line to show you both strong buy and sell signals and normal buy and sell signals. Dark colors are strong signals and of course green means a buy signal and red means a sell signal. I did change the original buy and sell signals that Ehlers included in his scripts because I didn't find that they worked very well so let me know what you think of my changes.
Let me know if there are any other indicators you would like to see me publish!
Ehlers Adaptive Cyber Cycle [CC]The Adaptive Cyber Cycle was created by John Ehlers and this is a cycle based indicator which you don't find too many of these days. Each stock goes through cycles which are repeating patterns of price movement and cycle indicators help you find the timing of the cycle to capitalize on the underlying cycle. That is an extremely simple explanation but most importantly don't interpret these indicators as the same as other indicators because it may seem like there are very many false signals but that is because of the different cycles the stock is undergoing. 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.
[blackcat] L2 Ehlers Adaptive Jon Andersen R-Squared IndicatorLevel: 2
Background
@pips_v1 has proposed an interesting idea that is it possible to code an "Adaptive Jon Andersen R-Squared Indicator" where the length is determined by DCPeriod as calculated in Ehlers Sine Wave Indicator? I agree with him and starting to construct this indicator. After a study, I found "(blackcat) L2 Ehlers Autocorrelation Periodogram" script could be reused for this purpose because Ehlers Autocorrelation Periodogram is an ideal candidate to calculate the dominant cycle. On the other hand, there are two inputs for R-Squared indicator:
Length - number of bars to calculate moment correlation coefficient R
AvgLen - number of bars to calculate average R-square
I used Ehlers Autocorrelation Periodogram to produced a dynamic value of "Length" of R-Squared indicator and make it adaptive.
Function
One tool available in forecasting the trendiness of the breakout is the coefficient of determination (R-squared), a statistical measurement. The R-squared indicates linear strength between the security's price (the Y - axis) and time (the X - axis). The R-squared is the percentage of squared error that the linear regression can eliminate if it were used as the predictor instead of the mean value. If the R-squared were 0.99, then the linear regression would eliminate 99% of the error for prediction versus predicting closing prices using a simple moving average.
When the R-squared is at an extreme low, indicating that the mean is a better predictor than regression, it can only increase, indicating that the regression is becoming a better predictor than the mean. The opposite is true for extreme high values of the R-squared.
To make this indicator adaptive, the dominant cycle is extracted from the spectral estimate in the next block of code using a center-of-gravity ( CG ) algorithm. The CG algorithm measures the average center of two-dimensional objects. The algorithm computes the average period at which the powers are centered. That is the dominant cycle. The dominant cycle is a value that varies with time. The spectrum values vary between 0 and 1 after being normalized. These values are converted to colors. When the spectrum is greater than 0.5, the colors combine red and yellow, with yellow being the result when spectrum = 1 and red being the result when the spectrum = 0.5. When the spectrum is less than 0.5, the red saturation is decreased, with the result the color is black when spectrum = 0.
Construction of the autocorrelation periodogram starts with the autocorrelation function using the minimum three bars of averaging. The cyclic information is extracted using a discrete Fourier transform (DFT) of the autocorrelation results. This approach has at least four distinct advantages over other spectral estimation techniques. These are:
1. Rapid response. The spectral estimates start to form within a half-cycle period of their initiation.
2. Relative cyclic power as a function of time is estimated. The autocorrelation at all cycle periods can be low if there are no cycles present, for example, during a trend. Previous works treated the maximum cycle amplitude at each time bar equally.
3. The autocorrelation is constrained to be between minus one and plus one regardless of the period of the measured cycle period. This obviates the need to compensate for Spectral Dilation of the cycle amplitude as a function of the cycle period.
4. The resolution of the cyclic measurement is inherently high and is independent of any windowing function of the price data.
Key Signal
DC --> Ehlers dominant cycle.
AvgSqrR --> R-squared output of the indicator.
Remarks
This is a Level 2 free and open source indicator.
Feedbacks are appreciated.
PSAR + EMA + TEMACombined PSAR with EMA and/or TEMA lines, including fast/slow plots, for entry/exit signals. Includes signals for all plots.
Credit to TEMA With Alert by BerkSay and Parabolic SAR by Alex Orekhov (everget).
Ehlers Simple Deriv Indicator [CC]The Simple Deriv Indicator was created by John Ehlers (Stocks and Commodities June 2021 pg 10) and this is a heavily modified version of his original script that changes the buy and sell signals. I did testing with his original settings but they didn't seem to be very profitable for most stocks so I created my own system. This indicator does have a lag though so it is best used for trend confirmation imo. 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 NonLinear Filter [CC]The NonLinear Filter was created by John Ehlers and this one of his more unknown filters that work very well as a trendline and moving average. This is one of my favorites along with the instantenous trendlines that he created. 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 scripts for!
Advance AMA with Sylvain BandsMany traders believe that the moving averages are favorite tools and analysts have spent decades trying to improve moving averages partiularly the simple moving average. One way to address the disadvantages of moving averages is to multiply the weighting factor by a volatility ratio which is called Adaptive moving averages.
This indicator uses an special adaptive moving averages which is developed by John Ehlers. The model adapts to price movement “based on the rate change of phase as measured by the Hilbert Transform Discriminator”. This method of adaptation features a fast and a slow moving average so that the composite moving average swiftly responds to price changes and holds the average value until the next bars close. In addition, the smoothed Volatility Bands were created by Sylvain Vervoort is included.
Ehlers 3 Pole Super Smoother Filter [CC]The 3 Pole Super Smoother Filter was created by John Ehlers and this is an oldie but a goodie. A great moving average that clearly shows a good trendline and so buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you want me to publish!
Ehlers Laguerre Relative Strength Index [CC]The Laguerre Relative Strength Index was created by John Ehlers and this is essentially his version of the RSI but I find that the buy and sell signals work better with his version as you can see. Buy when the line turns green and sell when the line turns red.
Let me know if there are any other indicators you want me to publish!