Shadow Range IndexShadow Range Index (SRI) introduces a new concept to calculate momentum, shadow range.
What is range?
Traditionally, True Range (TR) is the current high minus the current low of each bar in the timeframe. This is often used successfully on its own in indicators, or as a moving average in ATR (Average True Range).
To calculate range, SRI uses an innovative calculation of current bar range that also considers the previous bar. It calculates the difference between its maximum upward and maximum downward values over the number of bars the user chooses (by adjusting ‘Range lookback’).
What is shadow range?
True Range (TR) uses elements in its calculation (the highs and lows of the bar) that are also visible on the chart bars. Shadow range does not, though.
SRI calculates shadow range in a similar formula to range, except that this time it works out the difference between the minimum upward and minimum downward movement. This movement is by its nature less than the maximums, hence a shadow of it. Although more subtle, shadow range is significant, because it is quantifiable, and goes in one direction or another.
Finally, SRI smoothes shadow range and plots it as a histogram, and also smoothes and plots range as a signal line. Useful up and down triangles show trend changes, which optionally colour the chart bars.
Here’s an example of a long trade setup:
In summary, Shadow Range Index identifies and traces maximum and minimum bar range movement both up and down, and plots them as centred oscillators. The dynamics between the two can provide insights into the chart's performance and future direction.
Credit to these authors, whose MA or filters form part of this script:
@balipour - Super Smoother MA
@cheatcountry - Hann window smoothing
@AlgoAlpha - Gaussian filter
Hann
AIR Vortex ADXThis project started as an effort to improve the user interface of the hybrid indicator ADX of Vortex, which is, as per the name, a blend of ADX and Vortex Indicator. Plotting both indicators on the same polarity and normalising the vortex, a better interpretation of the interaction between the two is possible, and trend becomes apparent.
Basically, the Vortex provides the bright punch and ADX the continuation of the trend and momentum.
A range mixer has been added to the vortex, comprising both true and interpercentile ranges (see my previous script for a desrciption of interpercentile range). Users can activate and add amounts of each as they see fit.
Finally, there is an RSI filter, the idea of which is to filter out ranging (flat) markets, where no distinct direction is yet emerging.
AIR Supertrend (Average Interpercentile Range)Supertrend (ST) is a popular stop loss and trend identification script. The simplicity of seeing a clean trend on a chart makes it attractive, yet it is restricted by only allowing the source, length and multiplier to be adjusted, & these tend to have a limited effect on the properties of the identified trend.
There is a wide variety of interesting ST scripts on TradingView that give the user more control, but none to my knowledge, based on measuring the statistical dispersion of Average Interpercentile Range (AIR).
Two more levels of control:
Normally, ATR Average True Range is used to calculate the range in ST. ATR is initially calculated using RMA to smooth out True Range. This script gives the user the option of changing the MA to some more interesting varieties & modifying their parameters.
The default range setting when you load the indicator on a chart will be AIR.
The real strength of the indicator, however, and the reason I am publishing it, is to release AIR. Play round with the percentile range setting. Lowering it will allow you to stay longer in a trade in a volatile market. Raising it will make it tighter.
For comparison, you can switch back the range setting to ATR and load up RMA to see how the original, classic ST plots.
Alerts are included in this version. Alway use a stop loss.
DISCLAIMER: None of this is financial advice.
Credits to these authors, whose hard work inspired parts of this script:
@ KivancOzbilgic - SuperTrend
@ KioseffTrading - Tillson T3 MA
@ cheatcountry - Hann Window Smoothing
@ mutantdog - Interquartile Range function in his 'Blaze' script
Ehlers Undersampled Double Moving Average Indicator [CC]The Undersampled Double Moving Average was created by John Ehlers (Stocks and Commodities April 2023), and this is a double moving average system which is pretty rare for John Ehlers. For those of you who would like my other take on an Ehlers double moving average, be sure to check out my previous Ehlers double moving average script . He came up with a unique idea for this indicator to create a moving average using a sample of the price data. For example, we use his suggested length of 5 only to use the price data every 5 bars. Feel free to change this, and please let me know if you find a length that works better. He then smooths the indicator using the Hann Windowed Moving Average . I color-coded the lines to show stronger signals in darker colors or standard signals in lighter colors. Buy when the line turns green and sell when it turns red.
Let me know if there is an indicator or script you would like to see me publish!
Ehlers Linear Extrapolation Predictor [Loxx]Ehlers Linear Extrapolation Predictor is a new indicator by John Ehlers. The translation of this indicator into PineScript™ is a collaborative effort between @cheatcountry and I.
The following is an excerpt from "PREDICTION" , by John Ehlers
Niels Bohr said “Prediction is very difficult, especially if it’s about the future.”. Actually, prediction is pretty easy in the context of technical analysis. All you have to do is to assume the market will behave in the immediate future just as it has behaved in the immediate past. In this article we will explore several different techniques that put the philosophy into practice.
LINEAR EXTRAPOLATION
Linear extrapolation takes the philosophical approach quite literally. Linear extrapolation simply takes the difference of the last two bars and adds that difference to the value of the last bar to form the prediction for the next bar. The prediction is extended further into the future by taking the last predicted value as real data and repeating the process of adding the most recent difference to it. The process can be repeated over and over to extend the prediction even further.
Linear extrapolation is an FIR filter, meaning it depends only on the data input rather than on a previously computed value. Since the output of an FIR filter depends only on delayed input data, the resulting lag is somewhat like the delay of water coming out the end of a hose after it supplied at the input. Linear extrapolation has a negative group delay at the longer cycle periods of the spectrum, which means water comes out the end of the hose before it is applied at the input. Of course the analogy breaks down, but it is fun to think of it that way. As shown in Figure 1, the actual group delay varies across the spectrum. For frequency components less than .167 (i.e. a period of 6 bars) the group delay is negative, meaning the filter is predictive. However, the filter has a positive group delay for cycle components whose periods are shorter than 6 bars.
Figure 1
Here’s the practical ramification of the group delay: Suppose we are projecting the prediction 5 bars into the future. This is fine as long as the market is continued to trend up in the same direction. But, when we get a reversal, the prediction continues upward for 5 bars after the reversal. That is, the prediction fails just when you need it the most. An interesting phenomenon is that, regardless of how far the extrapolation extends into the future, the prediction will always cross the signal at the same spot along the time axis. The result is that the prediction will have an overshoot. The amplitude of the overshoot is a function of how far the extrapolation has been carried into the future.
But the overshoot gives us an opportunity to make a useful prediction at the cyclic turning point of band limited signals (i.e. oscillators having a zero mean). If we reduce the overshoot by reducing the gain of the prediction, we then also move the crossing of the prediction and the original signal into the future. Since the group delay varies across the spectrum, the effect will be less effective for the shorter cycles in the data. Nonetheless, the technique is effective for both discretionary trading and automated trading in the majority of cases.
EXPLORING THE CODE
Before we predict, we need to create a band limited indicator from which to make the prediction. I have selected a “roofing filter” consisting of a High Pass Filter followed by a Low Pass Filter. The tunable parameter of the High Pass Filter is HPPeriod. Think of it as a “stone wall filter” where cycle period components longer than HPPeriod are completely rejected and cycle period components shorter than HPPeriod are passed without attenuation. If HPPeriod is set to be a large number (e.g. 250) the indicator will tend to look more like a trending indicator. If HPPeriod is set to be a smaller number (e.g. 20) the indicator will look more like a cycling indicator. The Low Pass Filter is a Hann Windowed FIR filter whose tunable parameter is LPPeriod. Think of it as a “stone wall filter” where cycle period components shorter than LPPeriod are completely rejected and cycle period components longer than LPPeriod are passed without attenuation. The purpose of the Low Pass filter is to smooth the signal. Thus, the combination of these two filters forms a “roofing filter”, named Filt, that passes spectrum components between LPPeriod and HPPeriod.
Since working into the future is not allowed in EasyLanguage variables, we need to convert the Filt variable to the data array XX . The data array is first filled with real data out to “Length”. I selected Length = 10 simply to have a convenient starting point for the prediction. The next block of code is the prediction into the future. It is easiest to understand if we consider the case where count = 0. Then, in English, the next value of the data array is equal to the current value of the data array plus the difference between the current value and the previous value. That makes the prediction one bar into the future. The process is repeated for each value of count until predictions up to 10 bars in the future are contained in the data array. Next, the selected prediction is converted from the data array to the variable “Prediction”. Filt is plotted in Red and Prediction is plotted in yellow.
The Predict Extrapolation indicator is shown above for the Emini S&P Futures contract using the default input parameters. Filt is plotted in red and Predict is plotted in yellow. The crossings of the Predict and Filt lines provide reliable buy and sell timing signals. There is some overshoot for the shorter cycle periods, for example in February and March 2021, but the only effect is a late timing signal. Further reducing the gain and/or reducing the BarsFwd inputs would provide better timing signals during this period.
ADDITIONS
Loxx's Expanded source types:
Library for expanded source types:
Explanation for expanded source types:
Three different signal types: 1) Prediction/Filter crosses; 2) Prediction middle crosses; and, 3) Filter middle crosses.
Bar coloring to color trend.
Signals, both Long and Short.
Alerts, both Long and Short.
Adaptive MA Difference constructor [lastguru]A complimentary indicator to my Adaptive MA constructor. It calculates the difference between the two MA lines (inspired by the Moving Average Difference (MAD) indicator by John F. Ehlers). You can then further smooth the resulting curve. The parameters and options are explained here:
The difference is normalized by dividing the difference by twice its Root mean square (RMS) over Slow MA length. Inverse Fisher Transform is then used to force the -1..1 range.
Same Postfilter options are provided as in my Adaptive Oscillator constructor:
Stochastic - Stochastic
Super Smooth Stochastic - Super Smooth Stochastic (part of MESA Stochastic ) by John F. Ehlers
Inverse Fisher Transform - Inverse Fisher Transform
Noise Elimination Technology - a simplified Kendall correlation algorithm "Noise Elimination Technology" by John F. Ehlers
Momentum - momentum (derivative)
Except for Inverse Fisher Transform, all Postfilter algorithms can have Length parameter. If it is not specified (set to 0), then the calculated Slow MA Length is used.
Adaptive MA constructor [lastguru]Adaptive Moving Averages are nothing new, however most of them use EMA as their MA of choice once the preferred smoothing length is determined. I have decided to make an experiment and separate length generation from smoothing, offering multiple alternatives to be combined. Some of the combinations are widely known, some are not. This indicator is based on my previously published public libraries and also serve as a usage demonstration for them. I will try to expand the collection (suggestions are welcome), however it is not meant as an encyclopaedic resource, so you are encouraged to experiment yourself: by looking on the source code of this indicator, I am sure you will see how trivial it is to use the provided libraries and expand them with your own ideas and combinations. I give no recommendation on what settings to use, but if you find some useful setting, combination or application ideas (or bugs in my code), I would be happy to read about them in the comments section.
The indicator works in three stages: Prefiltering, Length Adaptation and Moving Averages.
Prefiltering is a fast smoothing to get rid of high-frequency (2, 3 or 4 bar) noise.
Adaptation algorithms are roughly subdivided in two categories: classic Length Adaptations and Cycle Estimators (they are also implemented in separate libraries), all are selected in Adaptation dropdown. Length Adaptation used in the Adaptive Moving Averages and the Adaptive Oscillators try to follow price movements and accelerate/decelerate accordingly (usually quite rapidly with a huge range). Cycle Estimators, on the other hand, try to measure the cycle period of the current market, which does not reflect price movement or the rate of change (the rate of change may also differ depending on the cycle phase, but the cycle period itself usually changes slowly).
Chande (Price) - based on Chande's Dynamic Momentum Index (CDMI or DYMOI), which is dynamic RSI with this length
Chande (Volume) - a variant of Chande's algorithm, where volume is used instead of price
VIDYA - based on VIDYA algorithm. The period oscillates from the Lower Bound up (slow)
VIDYA-RS - based on Vitali Apirine's modification of VIDYA algorithm (he calls it Relative Strength Moving Average). The period oscillates from the Upper Bound down (fast)
Kaufman Efficiency Scaling - based on Efficiency Ratio calculation originally used in KAMA
Deviation Scaling - based on DSSS by John F. Ehlers
Median Average - based on Median Average Adaptive Filter by John F. Ehlers
Fractal Adaptation - based on FRAMA by John F. Ehlers
MESA MAMA Alpha - based on MESA Adaptive Moving Average by John F. Ehlers
MESA MAMA Cycle - based on MESA Adaptive Moving Average by John F. Ehlers, but unlike Alpha calculation, this adaptation estimates cycle period
Pearson Autocorrelation* - based on Pearson Autocorrelation Periodogram by John F. Ehlers
DFT Cycle* - based on Discrete Fourier Transform Spectrum estimator by John F. Ehlers
Phase Accumulation* - based on Dominant Cycle from Phase Accumulation by John F. Ehlers
Length Adaptation usually take two parameters: Bound From (lower bound) and To (upper bound). These are the limits for Adaptation values. Note that the Cycle Estimators marked with asterisks(*) are very computationally intensive, so the bounds should not be set much higher than 50, otherwise you may receive a timeout error (also, it does not seem to be a useful thing to do, but you may correct me if I'm wrong).
The Cycle Estimators marked with asterisks(*) also have 3 checkboxes: HP (Highpass Filter), SS (Super Smoother) and HW (Hann Window). These enable or disable their internal prefilters, which are recommended by their author - John F. Ehlers. I do not know, which combination works best, so you can experiment.
Chande's Adaptations also have 3 additional parameters: SD Length (lookback length of Standard deviation), Smooth (smoothing length of Standard deviation) and Power (exponent of the length adaptation - lower is smaller variation). These are internal tweaks for the calculation.
Length Adaptaton section offer you a choice of Moving Average algorithms. Most of the Adaptations are originally used with EMA, so this is a good starting point for exploration.
SMA - Simple Moving Average
RMA - Running Moving Average
EMA - Exponential Moving Average
HMA - Hull Moving Average
VWMA - Volume Weighted Moving Average
2-pole Super Smoother - 2-pole Super Smoother by John F. Ehlers
3-pole Super Smoother - 3-pole Super Smoother by John F. Ehlers
Filt11 -a variant of 2-pole Super Smoother with error averaging for zero-lag response by John F. Ehlers
Triangle Window - Triangle Window Filter by John F. Ehlers
Hamming Window - Hamming Window Filter by John F. Ehlers
Hann Window - Hann Window Filter by John F. Ehlers
Lowpass - removes cyclic components shorter than length (Price - Highpass)
DSSS - Derivation Scaled Super Smoother by John F. Ehlers
There are two Moving Averages that are drown on the chart, so length for both needs to be selected. If no Adaptation is selected ( None option), you can set Fast Length and Slow Length directly. If an Adaptation is selected, then Cycle multiplier can be selected for Fast and Slow MA.
More information on the algorithms is given in the code for the libraries used. I am also very grateful to other TradingView community members (they are also mentioned in the library code) without whom this script would not have been possible.
Ehlers Hann Moving Average [CC]The Hann Moving Average is an original script but a slightly modified version of the Hann Window Filter created by John Ehlers. I am using the same length but changed the default data source to use the new Weighted Close that tv added after I requested it awhile ago so thank you tv! The big strength of this moving average/filter is that it creates an extremely smooth filter with the added benefit of very little lag to smooth ratio. The weakness of this moving average/filter is that it does have a decent amount of lag which means it isn't as useful during choppy periods but does work well for sustained uptrends or downtrends. Feel free to experiment and let me know what settings work better for you. 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. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators or scripts you would like to see me publish!
[blackcat] L2 Hann Ehanced DMILevel: 2
Background
Among the many indicators, it can be said that DMI is the only "super turning" indicator. This indicator can alone send out risk warning signals when extreme market conditions occur in the stock market, helping us to solve some problems.
If we can operate according to the instructions of DMI, firstly, we can avoid the mistake of buying stocks at the head. Secondly, in the process of falling fear of the market, we can follow the direction signal sent by DMI and catch every time on the way down. Opportunity to rebound to unwind.
If you look at the diagram of the DMI, you will think it is very complicated, because there are four lines in its diagram, and they are intertwined, and it is difficult to distinguish the complex signals in it. But don't worry about its complex structure, we will fully dissect this indicator.
Function
These four lines are: PDI, MDI, ADX and ADXR. The scale of the table is from 0-100, which means from very weak to very strong. The PDI curve and MDI curve on some software are called +DI curve and -DI curve , all have the same meaning.
PDI: Represents the position of multiple parties in the market.
In market movements, the higher the PDI, the stronger the current market. On the contrary, it is a weak market. The A-share market is easy to go to extremes. Therefore, we can see that in the past A-share market, the PDI sometimes fell to near zero, and at this time, it often indicated that a rebound and uptrend was about to start.
MDI: Represents the position of the bears in the market.
In the market movement, the higher the MDI goes, the weaker the current market is, and vice versa, it is a strong market. Before a big bull market comes, we can see the MDI drop to a position close to zero, and at this time, the bears in the market have no power to fight back.
The relationship between PDI and MDI:
In the operation of the market, PDI and MDI are intertwined with each other. If the PDI is above the MDI, the market at this time is a strong market. The MDI is above the PDI, which is a bear market. The closer the distance between the two, the market is in a stalemate of consolidation. On the contrary, the further apart the two lines are, the more obvious the unilateral nature of the market is, whether it is a bull market or a bear market. The so-called unilateral market means that there is no midway adjustment when it rises, and there is no rebound correction when it falls.
ADX: Fast steering pullback.
The difference between ADX and other analysis indicators is that whether it is rising or falling, as long as there is a unilateral market, it runs upwards, not like other indicators, the strong market runs upwards and the weak market runs downwards.
The thread is almost entwined with PDI and MDI in general market movement, which makes no sense at this time. However, once the market breaks out of the market and starts to go to extremes, whether the market is rising or falling, ADX will start to run upwards. At this time, ADX has a clear meaning, because DMI has begun to issue early warning of impending turn!
ADXR: slow pull back.
This line is matched to ADX and is a moving average of ADX values. When ADX goes up, ADXR goes up with it, just slower.
When a round of rapid decline ends, it usually needs to be corrected by a rebound, and ADX will take the lead in turning up. Once it crosses with ADXR, it is regarded as an effective breakthrough.
Numerical division. I set an input threshold for HEDMI, and users can set the optimal threshold to buy and sell according to different TFs.
When PDI crosses the threshold, no matter how strong the bull market is, we must beware of risks from happening at any time.
In order to distinguish more clearly, I slightly modified the formula of the system, and when this happens, the indicator will issue a green warning label, so as to avoid risks in time.
Comprehensive use of four lines:
If the four lines in the steering indicator DMI are intertwined below 50, it usually means that the market is in a state of mild consolidation at this time. The DMI indicator at this time is useless because it does not generate a strong pullback force. Don't worry about an unexpected turnaround in the market. As for the consolidation, it's not a turnaround, it's a breakout.
When PDI and MDI gradually separate, at this time, ADX and ADXR will also rise. At this time, the DIM that is usually messy like twine will be clearly separated. When rising, PDI rises along with ADX and ADXR, while MDI sinks weakly. On the contrary, when the market starts to fall, MDI will rise along with ADX and ADXR, and PDI will sink helplessly. At this time, the DMI will be like a "tiger's mouth", gradually opening its bloody mouth. The bigger the opening, the more lethal the bite.
Here comes a tactic, or technical trend, called double hooves, that is, PDI and MDI split, ADX and ADXR upward to produce golden forks, PDI and MDI are like the double front hooves of a horse, ADX and ADXR The golden fork is like the rear hooves of a steed ready to take off, and this trend of the four lines is like the four legs of a steed that is about to run.
If you think it is too complicated to look at DMI like this, then I can tell you the easiest way to judge, that is, just look at the PDI line. When the PDI line falls below 10, boldly buy the dip, because it is a dip, so you need to calculate the rebound At this time, combined with the golden section theory I often talk about, you can easily find the selling point by making the golden section of the downward trend for the previous trend.
This kind of bottom-hunting method uses the golden section theory, and basically there will be no losses. Remember that one thing is not to be greedy and strictly enforce discipline. This is bottom-hunting, and advancing with both hooves is chasing up. The two styles are different, and the operation styles are different. You also need to explore more in actual combat. Any kind of trick, if you practice it proficiently, it is a unique trick.
Remark
Hanning Window Enhanced DMI
Free and Open Source Indicator
Ehlers Hann Relative Strength Index [CC]The Hann Relative Strength Index was created by John Ehlers (Stocks and Commodities Jan 2022 pgs 26-28) and this indicator builds upon his Hann Window Indicator to create an unique rsi indicator that doesn't rely on overbought or oversold levels to determine a reversal point and also provides a very superior smoothing without any of the lag associated with traditional smoothing. A much more useful RSI than the standard version in my honest opinion. Short term you buy when the line turns green and sell when it turns red. Medium to long term you buy when the indicator rises above the 0 line and sell when it falls below the 0 line. 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 indicators or scripts you would like to see me publish!
TASC 2022.01 Improved RSI w/Hann█ OVERVIEW
TASC's January 2022 edition Traders' Tips includes the "(Yet Another Improved) RSI Enhanced With Hann Windowing" article authored by John Ehlers. Once again John Ehlers revolutionizes the RSI indicator. This is TradingView's Pine Script code for the indicator.
█ CONCEPTS
By employing a Hann windowed finite impulse response filter ( FIR ), John Ehlers has enhanced the "Relative Strength Indicator" ( RSI ) to provide an improved oscillator with exceptional smoothness.
█ NOTES
Calculations
The method of calculations using "closes up" and "closes down" from Welles Wilder's RSI described in his 1978 book is still inherent to Ehlers enhanced formula. However, a finite impulse response (FIR) Hann windowing technique is employed following the closes up/down calculations instead of the original Wilder infinite impulse response averaging filter. The resulting oscillator waveform is confined between +/-1.0 with a 0.0 centerline regardless of chart interval, as opposed to Wilder's original formulation, which was confined between 0 and 100 with a centerline of 50. On any given trading timeframe, the value of Ehlers' enhanced RSI found above the centerline typically represents an overvalued region, while undervalued regions are typically found below the centerline.
Background
The original RSI indicator was designed by J. Welles Wilder and presented in his "New Concepts in Technical Trading Systems" book published in 1978.
Join TradingView!
TASC 2021.12 Directional Movement w/Hann█ OVERVIEW
Presented here is code for the "Directional Movement w/Hann" indicator originally conceived by John Ehlers. The code is also published in the December 2021 issue of Trader's Tips by Technical Analysis of Stocks & Commodities (TASC) magazine.
Ehlers continues here his exploration of the application of Hann windowing to conventional trading indicators.
█ FEATURES
The rolling length can be modified in the script's inputs, as well as the width of the line.
█ NOTES
Calculations
The calculation starts with the classic definition of PlusDM and MinusDM. These directional movements are summed in an exponential moving average (EMA). Then, this EMA is further smoothed in a finite impulse response (FIR) filter using Hann window coefficients over the calculation period.
Background
The DMI and ADX indicators were designed by J. Welles Wilder and presented in his "New Concepts in Technical Trading Systems" book published in 1978.
Join TradingView!
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 Hann Window Indicator [CC]The Hann Window Indicator was created by John Ehlers (Stocks & 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 3 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!
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.