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!
Roofingfilter
[blackcat] L2 Ehlers Roofing Filter IndicatorLevel: 2
Background
John F. Ehlers introuced Roofing Filter Indicator in his "Cycle Analytics for Traders" chapter 7 on 2013.
Function
The roofing filter does an excellent job of using only the frequency components between its upper and lower critical periods. All that needs to be done to create an indicator from the roofing filter is to add more generality by allowing the high-pass and low-pass critical periods be supplied as indicator inputs. The two high-pass filters have been implemented as a single two-pole high-pass filter. The ideal time to buy is when the cycle is at a trough, and the ideal time to exit a long position or to sell short is when the cycle is at a peak. These conditions are flagged by the filter crossing itself delayed by one bar, and are included as part of the indicator.
Key Signal
Filt --> Roofing Filter Indicator fast line
Trigger --> Roofing Filter Indicator slow line
Pros and Cons
100% John F. Ehlers definition translation of original work, even variable names are the same. This help readers who would like to use pine to read his book. If you had read his works, then you will be quite familiar with my code style.
Remarks
The 43th script for Blackcat1402 John F. Ehlers Week publication.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.
[blackcat] L2 Ehlers Zero Mean Roofing FilterLevel: 2
Background
John F. Ehlers introuced Zero Mean Roofing Filter in his "Cycle Analytics for Traders" chapter 7 on 2013.
Function
The HP-LP Roofing Filter output still contains all of these frequency components. The only way we can reduce the effect of these lower-frequency components is to introduce another high-pass filter, adding an additional 6 dB per octave roll-off, so that the net effect of the filter is as originally surmised. Dr. Ehlers have added Filt2 to the code in "Zero Mean Roofing Filter". Note that in addition to establishing a nominally zero mean, removal of the longer cycle components caused by spectral dilation removes lag from the roofing filter output.
Key Signal
Filt2 --> Zero Mean Roofing Filter fast line
Trigger --> Zero Mean Roofing Filter slow line
Pros and Cons
100% John F. Ehlers definition translation of original work, even variable names are the same. This help readers who would like to use pine to read his book. If you had read his works, then you will be quite familiar with my code style.
Remarks
The 42th script for Blackcat1402 John F. Ehlers Week publication.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.
[blackcat] L2 Ehlers HP-LP Roofing FilterLevel: 2
Background
John F. Ehlers introuced HP-LP Roofing Filter in his "Cycle Analytics for Traders" chapter 7 on 2013.
Function
A “roofing filter” can be used to limit the frequency content of an input before proceeding to construct an indicator. The roofing filter is composed of a highpass filter that passes only frequency components whose periods are shorter than 48 bars, for example. It also is composed of a SuperSmoother filter that passes frequency components whose periods are longer than 10 bars. Thus, the roofing filter is a wide bandwidth band-pass filter that passes only frequency components whose periods fall between 10 bars and 48 bars. This, by itself, is a simple indicator.
While the roofing filter indicator wiggles in proportion to the wiggles in the price data as you would expect, it is noticeable that the indicator is above zero for extended periods where the market is in an uptrend. In other words, the filter output does not have a zero mean as you would expect if the output consisted only of cyclic components whose periods fall between 10 bars and 48 bars.
Key Signal
Filt --> HP-LP Roofing Filter fast line
Trigger --> HP-LP Roofing Filter slow line
Pros and Cons
100% John F. Ehlers definition translation of original work, even variable names are the same. This help readers who would like to use pine to read his book. If you had read his works, then you will be quite familiar with my code style.
Remarks
The 41th script for Blackcat1402 John F. Ehlers Week publication.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.
Dynamic Equalizer [DW]This is an experimental study inspired by techniques primarily utilized in the visual and audio processing worlds.
This study is designed to serve as a pre or post processing filter designer that allows you to shape the frequency spectrum of your data on a more "in-depth" level.
First the data is fed through my Band-Shelf Equalizer function.
The EQ in this script works by dividing the input signal into 6 bands and 2 shelves using a series of roofing filters.
The bands are then gain adjusted recursively (in %) to match source as closely as possible at unity gain.
The recursive adjustment size can be changed using the "Gain Adjustment Increment" input, which will affect how tightly the resulting filter approximates source at unity.
The frequency range of each band is adjustable via the period inputs. In default settings, these are the ranges:
-> Low Shelf : 256+ Samples Per Cycle. This shelf is the largest trend component of the signal. Unlike the other bands and shelf, this shelf is not zero mean unless source data is.
-> Band 1 : 128 - 256 Samples Per Cycle. This band is a moderate trend and low cyclic component of the signal.
-> Band 2 : 64 - 128 Samples Per Cycle. This band is a mild trend and moderate cyclic component of the signal.
-> Band 3 : 32 - 64 Samples Per Cycle. This band is a high cyclic component of the signal.
-> Band 4 : 16 - 32 Samples Per Cycle. This band is a high cyclic component of the signal.
-> Band 5 : 8 - 16 Samples Per Cycle. This band is a moderate cyclic and mild to moderate noise component of the signal.
-> Band 6 : 4 - 8 Samples Per Cycle. This band is a high noise component of the signal.
-> High Shelf : 4- Samples Per Cycle. This shelf is primarily noise.
Each band and shelf can be manually gain adjusted via their respective inputs.
After EQ processing, each band and shelf is then optionally fed through my Peak Envelope Compressor function for dynamics control.
The compressor in this script works by reducing band power by a specified percentage when it exceeds a user defined percentage of the peak envelope.
The peak envelope measures maximum power of the band over its period range multiplied by a user defined integer.
There is an option included to apply Butterworth smoothing to the envelope as well, which will alter the shape of the compressor.
If you want an envelope that quickly responds to power peaks, use little to no smoothing. If you desire something more static, use a large smoothing period.
Attack and release are included in the algorithm to shape the sensitivity of the compressor.
Attack controls how many bars it takes from being triggered for attenuation to reach its target amount.
Release controls how many bars it takes from being un-triggered for attenuation to reach back to 0.
In addition, the compressor is equipped with parallel processing.
The "Parallel Mix" inputs control the amount of compressed vs non-compressed signal presence in the final output.
And of course, the compressor has a post-processing gain input (in %) to fine-tune the presence of the band.
For easy visual tuning, you can view each independent band's magnitude or power by selecting them in the display inputs.
This display setup can also be beneficial analytically if you wish to analyze specific frequency components of the source signal.
The default preset for this script is meant to show how versatile EQ filtering and compression can be for technical analysis.
The EQ preset detrends the data, moderately smooths the data, and emphasizes dominant cyclical ranges.
The compression preset provides fast, moderately heavy shaping to dial in dynamics and reduce transient effects.
The resulting curve is a great filter for responsively analyzing cyclical momentum.
The script is also fully equipped with outputs that can be used externally by other scripts.
You can integrate these external outputs with your own script by using a source input. Simply select the desired output from the dropdown tab on your script.
Multiband filtering and compression are concepts that are not conventionally used in the world of finance.
However, the versatile capabilities of these concepts make this a wonderful tool to have in the arsenal.
By surgically adjusting separate frequency components of a signal, you're able to design a wide variety of filters with unique responses for a vast array of applications.
Play around with the settings and see what kinds of filters you can design!
---------------------------------------------------------
This is a premium script, and access is granted on an invite-only basis.
To gain access, get a copy of the script overview, or for additional inquiries, send me a direct message.
I look forward to hearing from you!
---------------------------------------------------------
General Disclaimer:
Trading stocks, futures, Forex, options, ETFs, cryptocurrencies or any other financial instrument has large potential rewards, but also large potential risk.
You must be aware of the risks and be willing to accept them in order to invest in stocks, futures, Forex, options, ETFs or cryptocurrencies.
Don’t trade with money you can’t afford to lose.
This is neither a solicitation nor an offer to Buy/Sell stocks, futures, Forex, options, ETFs, cryptocurrencies or any other financial instrument.
No representation is being made that any account will or is likely to achieve profits or losses of any kind.
The past performance of any trading system or methodology is not necessarily indicative of future results.
---------------------------------------------------------
NOTE: Unlike standard tools of this nature in other applications, I scaled the signals in % rather than dB, mainly since it's proven so far to be more user-friendly to keep things linear on here.
In addition, no transitions to frequency domain are done in this script. This EQ is an experimental variant that processes in the time domain and relies on a network of roofing filters.
When changing cutoff periods, make sure they are organized in descending order with low shelf as the highest period, and high shelf as the lowest period.
Using non-descending lengths may result in an undesired output.
Lastly, when changing cutoff periods, parts of the spectrum may leak slightly differently between bands, so the "Gain Match Adjustment Increment" may need to be changed as well if you want it to match as closely as possible at unity.
Despite these shortcomings, this tool functions surprisingly well, especially with the default periods, and it's quickly become one of my favorites. I hope you all enjoy it!
Ehlers Zero Mean Roofing Filter [CC]The Zero Mean Roofing Filter was created by John Ehlers (Cycle Analytics For Traders pg 80) and this is a much more reactive roofing filter compared to Ehler's Roofing Filter which I also added for reference. Buy when the indicator rises over 0 and sell when the indicator falls below 0.
This was a special request so let me know if there are other indicators you would like to see me publish or if you want something custom done!
Ehlers Roofing Filter [CC]The Roofing Filter was created by John Ehlers (Cycle Analytics For Traders pgs 81-82) and this can be interpreted in a few ways. When the indicator crosses over its signal then it is a short term uptrend and when it crosses below its signal then it is a short term downtrend. It is also in a major uptrend or downtrend when it is above 0 and below 0 respectively. Buy when the indicator line is green and sell when the indicator line turns red.
Let me know if there are other indicators you would like to see me publish or if you want something custom done!
Ehlers HighPass-LowPass Roofing Filter [CC]The HighPass-LowPass Roofing Filter was created by John Ehlers (Cycle Analytics For Traders pg78) and this is a variation of a roofing filter that will let you know which direction the stock is trending. If it falls below 0 then the stock is in a downtrend and if it rises above 0 then it is an uptrend. Buy when the indicator line is green and sell when it is red.
Let me know if there are other scripts you would like me to publish or if you want something custom done!
Roofing Filter [DW]This is an experimental study built on the concept of using roofing filters on price data proposed by John Ehlers.
Roofing filters are a type of bandpass filter conventionally used in HF radio receivers in the first IF stage to limit the frequency spectrum passed on to later stages in the receiver.
The goal in applying roofing filters to a price signal is to simultaneously attenuate high frequency noise and low frequency distortion to pass an oscillating signal with a nearly zero mean for analysis and/or further calculation.
In this study, there are three filter types to choose from:
-> Ehlers Roofing Filter, which passes data through a 2 pole high pass filter, then through a Super Smoother filter.
-> Gaussian Roofing Filter, which passes data through a 2 pole Gaussian high pass filter, then through a 2 pole Gaussian low pass filter.
-> Butterworth Roofing Filter, which passes data through a 2 pole Butterworth high pass filter, then through a 2 pole Butterworth low pass filter.
Each filter type has different amplitude and delay characteristics, so play around with each type and see which response suits your needs best.
There is an option to normalize the scale of the output as well. The normalization process in this script is computed by comparing positive and negative outputs to the filter's moving RMS value.
The resulting oscillator can be fed through numerous conventional indicators including Stochastic Oscillator, RSI, CCI, etc. to generate smoother, less distorted indicators for a clearer view of turning points.
Alternatively, it can also act as an indicator itself, as implied by the corresponding color scheme included in the script.
Although roofing filters are not conventionally used in the analysis of market data, applying such spectral analysis techniques may prove to be quite useful for the design of more efficient indicators and more reliable predictions.
Ehlers StochasticEhlers Stochastic script.
This indicator was originally developed by John F. Ehlers (Stocks & Commodities V. 32:1: Predictive And Successful Indicators).