[blackcat] L2 Ehlers Early Onset TrendLevel: 2
Background
John F. Ehlers introuced Early Onset Trend Indicator in Aug, 2014.
Function
In “The Quotient Transform” in Aug, 2014, John Ehlers described an early trend detection method, the idea of the quotient transform, that was designed to reduce the lag often found in other trend indicators. I provided a script with pine v4 code here for the early-onset trend-detection indicator and also describes an approach for creating a strategy based on this indicator as an example.
The entry points displayed in blue on the price chart are defined by the top Onset Trend Detector upper quotient crossing above a threshold value e.g zero or 0.25/-0.25 here in this script. In the article, Ehlers suggested using a different K value for the exit, so the exit points are determined by the lower Onset Trend Detector quotient crossing below a threshold e.g. zero or -0.25/0.25 here in this script.
Key Signal
Quotient1 --> upper quotient in yellow which determines long entry
Quotient2 --> lower quotient in fuchsia which determines short entry
long ---> long entry signal
short ---> short entry signal
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 82th 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.
Ehlers
[blackcat] L2 Ehlers Super Smooth Stoch StrategyLevel: 2
Background
John F. Ehlers introuced Super Smooth Stochastic Indicator in Jan, 2014.
Function
In “Predictive And Successful Indicators” of in, 2014, John Ehlers presented another innovative way to eliminate noise from classic indicators and introduces some new smoothing indicators: the SuperSmoother filter, which is superior to moving averages for removing aliasing noise, and the MESA Stochastic oscillator, a stochastic successor that removes the effect of spectral dilation through the use of a roofing filter.
John Ehlers described a new method for smoothing market data while reducing the lag that most other smoothing techniques have. Ehlers had provided an approach for creating a strategy. For convenience, I made the same code available at tradingview pine v4 as well as an example strategy based on Ehlers’ description. Ehlers introduced a simple countertrend system that goes long when MESA Stochastic crosses below the oversold value and reverses the trade by taking a short position when the oscillator exceeds the overbought threshold.
Key Signal
MyStochastic --> Super Smooth Stochastic line
long ---> long entry signal
short ---> short entry signal
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 81th 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.
SAK-MPI: Stochastic & RSIDescription : This SwissArmyKnife - MultiPurposeIndicator allows user to modify the conventional indicator smoothing method Stochastic(SMA)/RSI(RMA) to one of filtering tools proposed by John F. Ehlers .
Details of each filtering type can be read in Ehlers Technical Papers: Swiss Army Knife Indicator,
I'm still very new with Digital Signal Processing (DSP) concept and this is my first attempt to help visualize one of Ehlers tools and its practicality (Read: Its experimental).
Any ideas to further improve this indicator are welcome :)
Disclaimer:
I always felt Pinescript is a very fast to type language with excellent visualization capabilities, so I've been using it as code-testing platform prior to actual coding in other platform.
Having said that, these study scripts was built only to test/visualize an idea to see its viability and if it can be used to optimize existing strategy.
While some of it are useful and most are useless, none of it should be use as main decision maker.
[blackcat] L3 Ehlers Market Mode IndicatorLevel: 3
Background
John F. Ehlers introuced Market Mode Indicator on April, 2012.
Function
This indicator is used to determine whether the market is in a trending or a cyclical mode. This is accomplished by comparing the average value of price, after being filtered to the peaks and valleys of that filtered price. The filter used in this indicator is a second order butterworth filter. For more information on this calculation see "Introducing SwamiCharts" (March 2012) and "Empirical Mode Decomposition" (March 2010) from Technical Analysis of Stocks and Commodities by Dr. Ehlers.
Key Signal
MeanCalc --> short term fast line
MeanCalc(2) --> short term slow line
long ---> long entry signal
short ---> short entry signal
Pros and Cons
NOT 100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 80th script for Blackcat1402 John F. Ehlers Week publication.
I kept the core of Ehlers market mode indicator, but add conditons for long and short entries which i think they are reasonable.
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] L3 Ehlers Enhanced Corona Swing PositionLevel: 3
Background
John F. Ehlers introuced Enhaced Corona Swing Position Indicator in April, 2012.
Function
John Ehlers's corona indicators, "Corona Charts," provide a "multidimensional" view of market activity. In the article "Corona Charts" in Nov, 2008, John Ehlers further developed his earlier work on market cycles. A new kind of indicator was presented that uses a glow-like effect to present another dimension of data. Implementation of corona charts in pine v4 helps detect dominant cycles in data. It provides a corona chart for swing positions indicator. He made an enhanced version of corona chart after 4 years, which could be used as a range filter to detect sideways and trends. Dr . Ehlers claims that a corona is displayed when the market is in a trend and there is little cyclic component. The swing position indicator shows the phasing of the data within the dominant cycle. In a pure cycle the Swing Position will trace out the shape of a sine wave.
Key Signal
DomCyc ---> Dominant Cycle
Raster ---> Corona Raster Array
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 79th 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 SwamiCharts StochasticLevel: 2
Background
John F. Ehlers introuced SwamiCharts Stochastic Indicator in Mar, 2012.
Function
In the late 1950s, George Lane developed stochastics, an indicator that measures the relationship between an issue's closing price and its price range over a predetermined period of time. To this day, stochastics is a favored technical indicator because it is easy to understand and has a high degree of accuracy in indicating whether it's time to buy or sell a security. In “Introducing SwamiCharts” in Mar, 2012, authors John Ehlers & Ric Way presented the use of SwamiCharts to better visualize market activity using an indicator that presents a heatmap visualization. The authors provided descriptions for the construction of SwamiCharts using Stochastic indicator.
Key Signal
Stochastic ---> Stochastic array
Plot2~48 ---> SwamiCharts Stochastic Heat Map
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 78th 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 SwamiCharts AroonLevel: 2
Background
John F. Ehlers introuced SwamiCharts Aroon Indicator in Mar, 2012.
Function
The Aroon indicator is a technical indicator that is used to identify trend changes in the price of an asset, as well as the strength of that trend. In essence, the indicator measures the time between highs and the time between lows over a time period.
In “Introducing SwamiCharts” in Mar, 2012, authors John Ehlers & Ric Way presented the use of SwamiCharts to better visualize market activity using an indicator that presents a heatmap visualization. The authors provided descriptions for the construction of SwamiCharts using Aroon indicator.
Key Signal
Aroon ---> Aroon array
Plot4~33 ---> SwamiCharts Aroon
short ---> Short entry signal
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 77th 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 Empirical Mode TraderCircumstance Remarks: Because of my carelessness, the script of the same name that I posted before was banned and hidden because the description contained content that violated the TradingView House Rule. After communicating with the MOD, I corrected the description and obtained permission to publish it again. I hereby declare. Sorry for the inconvenience!
Level: 2
Background
John F. Ehlers introuced Empirical Mode Trader Indicator in Mar, 2010.
Function
In his article “Empirical Mode Decomposition,” John Ehlers and Ric Way suggest using methods based on bandpass filtering to distinguish trending from cycling markets. The article’s trading suggestions were used to create the Empirical Mode strategy given here for pine v4 script. If the strategy determines that the marke is in trending mode, then the strategy is allowed to trade with the trend — either long, in uptrends, or short, in downtrends. If the indicator determines that the market is in cycling mode, then the strategy allows trading cycle extremes, using Bollinger bands to trigger entries. You can do this by Choosing either cycle or trend mode at inputs.
Key Signal
Trend ---> Trend signal
FracAvgPeak ---> Upper band signal
FracAvgValley ---> Lower band signal
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 75th 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-lag EMACircumstance Remarks: Because of my carelessness, the script of the same name that I posted before was banned and hidden because the description contained content that violated the TradingView House Rule. After communicating with the MOD, I corrected the description and obtained permission to publish it again. I hereby declare. Sorry for the inconvenience!
Level: 2
Background
John F. Ehlers introuced Zero-lag EMA Indicator in Nov, 2010.
Function
In “Zero Lag (Well, Almost)” article, authors John Ehlers and Ric Way presented their zero-lag exponential moving average indicator and strategy. They have adapted their zero-lag EMA by extending the functionality in an additional chart indicator named “Zero-Lag EMA”. Labels were added so that the user can be alerted when a crossing of the averages occurs.
The authors created an error-correcting filter for an exponential moving average ( EMA ) that seeks to minimize the lag effect of increasing periods. Increasing the gain parameter from zero changes the filter from an EMA with lag to effectively zero lag (albeit with zero smoothing also). The crossover of these lines can be used to form a trading strategy, with the addition of some threshold value for the difference between the Price and error-correcting line.
Key Signal
ZLEMA ---> Zero-lag EMA fast line
Trigger ---> Zero-lag EMA slow line
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 76th 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] L3 Ehlers Corona Charts Swing PositionLevel: 3
Background
John F. Ehlers introuced Corona Charts Swing Position Indicator in Nov, 2008.
Function
John Ehlers's corona indicators, "Corona Charts," provide a "multidimensional" view of market activity. In the article "Corona Charts" in Nov, 2008, John Ehlers further developed his earlier work on market cycles. A new kind of indicator was presented that uses a glow-like effect to present another dimension of data. Implementation of corona charts in pine v4 helps detect dominant cycles in data. It provides a corona chart for swing positions indicator.
Dr. Ehlers claims that a corona is displayed when the market is in a trend and there is little cyclic component. The swing position indicator shows the phasing of the data within the dominant cycle. A value of -5 means the cycle is at its valley. A value of +5 means the cycle is at its peak. In a pure cycle the Swing Position will trace out the shape of a sine wave. However, I normalized it to overlay it together with Corona Chart heat maps.
Key Signal
DomCycle--> Ehlers Dominant Cycle
Plot2~Plot50--> Ehlers Corona Charts Swing Position Heat Map
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 74th 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] L3 Ehlers Spectrogram IndicatorLevel: 3
Background
John F. Ehlers introuced Dominant Cycle and Spectrogram Indicator in Mar, 2008.
Function
In "Measuring Cycle Periods" in Mar, 2008, John Ehlers presented a very interesting technique of measuring dominant market cycle periods by means of multiple bandpass filtering. By utilizing an approach similar to audio equalizers, the signal (here, the price series) is fed into a set of simple second-order infinite impulse response bandpass filters. Filters are tuned to 8,9,10,...,50 periods. The filter with the highest output represents the dominant cycle. This script implements a high-pass filter and a six-tap low-pass Fir filter on input, then 42 parallel Iir band-pass filters. Finally, it plots the Ehlers spectrogram as a heat map.
Ehlers Spectrogram indicates market power status:
With high market power, the spectrogram become fuzzy;
With low market power, the spectrogram become distinct.
It also discloses market dominant cycles and subcycles, which indicates the major rhythm. Regarding the rhythm of the market, Chinese and Western cultures have reached a consensus: Dr. Ehlers can find the main harmonic components of the market through DSP analysis via spectrum; Master Zen compares the market rhythm to Bach’s fugue from a philosophical perspective, where there is a rhythm of life.
Finally, please allow me to quote Master Zen’s statement on market rhythm:
"The market is cruel. For those who try to violate the market rhythm, the market is their death place; the market is beautiful, and the market is Bach’s fugue. There is a rhythm of life. Rhythm is always the rhythm of the market. A market participant without a sense of rhythm is always torturing. Put aside your greed and fear and listen to the rhythm of the market. In the weekend, let go of everything, but listen to the rhythm of nature, the rhythm of life, the rhythm of music, and then come back to listen to the rhythm of the market. Dancing with the market, your greed and fear are peeled off one by one, you will become very bright."
Key Signal
DomCyc--> Ehlers Dominant Cycle
Plot2~Plot60--> Ehlers Spectrum Heat Map
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 73th 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 Dominant Cycle Tuned Bandpass FilterLevel: 2
Background
John F. Ehlers introuced his Dominant Cycle Tuned Bandpass Filter Strategy in Mar, 2008.
Function
In "Measuring Cycle Periods", author John Ehlers presents a very interesting technique of measuring dominant market cycle periods by means of multiple bandpass filtering. By utilizing an approach similar to audio equalizers, the signal (here, the price series) is fed into a set of simple second-order infinite impulse response bandpass filters. Filters are tuned to 8,9,10,...,50 periods. The filter with the highest output represents the dominant cycle. A full-featured formula that implements a high-pass filter and a six-tap low-pass Fir filter on input, then 42 parallel Iir band-pass filters.
I've coded John Ehlers' filter bank to measure the dominant cycle (DC) and the sine and cosine filter components in pine v4 for TradingView, based on John Ehlers' article in this issue, "Measuring Cycle Periods." The CycleFilterDC function plots and returns the DC series and its components, so it's a trivial matter to make use of them in a trading strategy.
Based on John Ehlers' article, "Measuring Cycle Periods," he chose to implement the dominant cycle-tuned bandpass filter response to test Ehlers' suggestion to use the sine and cosine crossovers as buy and sell signals. If the sine closely follows the price pattern as suggested, and the cosine is an effective leading function of the sine, then it seems to make sense that a crossover implementation would work well (Personally, what I observed this is not so accurated as his claims).
What he discovered in his tests was that crossovers happened at frequent intervals, even when price has not moved significantly. This leads to a higher percentage of losing trades, particularly when spread, slippage, and commissions are accounted for. Nevertheless, the cosine crossover was quite effective at identifying reversals very early in many cases, so this indicator could prove quite effective when used alongside other indicators. In particular, the use of an indicator to confirm a certain level of recent volatility, as well as an indicator to confirm significant rate of change, could prove quite helpful.
Key Signal
CosineLine--> Ehlers Dominant Cycle Tuned Bandpass Filter Strategy fast line
SineLine--> Ehlers Dominant Cycle Tuned Bandpass Filter Strategy slow line
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 72th script for Blackcat1402 John F. Ehlers Week publication.
NOTE: Although Dr. Ehlers think high of Cosine and Sine wave indicator and trading strategy, my study and trading experience indicated it did not work that well as many other oscillator indicators. However, I would like to keep the original code of Dr. Ehlers for anyone who want to make a deep dive into this kind of indicator or strategy with Cosine and Sine wave.
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 DFT-Adapted RSILevel: 2
Background
John F. Ehlers introuced his DFT-ADAPTED RELATIVE STRENGTH INDEX (RSI) in Jan, 2007.
Function
In "Fourier Transform For Traders" in Jan, 2007, John Ehlers presented an interesting technique of improving the resolution of spectral analysis that could be used to effectively measure market cycles. Better resolution is obtained by a surprisingly simple modification of the discrete Fourier transform. John Ehlers suggests using the discrete Fourier transform (DFT) to tune indicators. Here, I demonstrate this by building a DFT-adapted relative strength index (RSI) strategy.
Rather than display the RSI for a single cycle length across the entire chart, Ehlers DFT adaptive RSI value reflects the DFT-calculated dominant cycle length RSI. If the dominant cycle changes from 14 to 18 bars, the RSI length parameter changes accordingly. Computationally, this requires the strategy to continuously update values for all possible RSI cycle lengths via a "for" loop and array.
In details, a full-featured formula that implements a high-pass filter (HP) and a six-tap low-pass finite impulse response (FIR) filter on input, then does discrete Fourier transform calculations. I has taken liberty of adding extra parameters so the user can modify the analysis window length and the high-pass filter cutoff frequency in real time using the parameters window. Once the suite of possible RSI values is calculated, we use the DFT to select the relevant RSI for the current bar. The strategy then trades according to J. Welles Wilder's original rules for the RSI.
Key Signal
fastline--> DFT-ADAPTED RELATIVE STRENGTH INDEX (RSI) fast line
slowline--> DFT-ADAPTED RELATIVE STRENGTH INDEX (RSI) slow line
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 71th script for Blackcat1402 John F. Ehlers Week publication.
Based on original work of Ehlers, I added ALMA smoothing on DFT-adapted relative strength index (RSI) so that clearer trend can be observed.
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 Stochastic RSILevel: 2
Background
John F. Ehlers introuced his Stochastic RSI in August, 2006.
Function
John Ehlers' article in August, 2006, "Modeling The Market = Building Trading Strategies," describes a process for extracting trend and cyclic elements from market data, then recombining them for trading purposes. He used the Stochastic RSI denoted the cyclic elements.
Key Signal
StochRSI--> Ehlers Stochastic RSI fast line
Trigger--> Ehlers Stochastic RSI slow line
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 70th 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 Inverse Fisher Cyber CycleLevel: 2
Background
John F. Ehlers introuced the Inverse Fisher Transform of Cyber Cycle in May, 2004.
Function
"The Inverse Fisher Transform ," describes the calculation and use of the inverse Fisher transform by Dr . Ehlers in 2004. The transform is applied to any indicator with a known probability distribution function, but this script offers a sample transforms: Cyber Cycle . I have created inputs for the trigger levels for entry and exit so that the user may adjust these levels as desired.
In his article, Dr . Ehlers states the inverse Fisher transform can work with any oscillator, and that values between -1 and 1 are more suited for the transform calculations. Here is one version of the inverse Fisher transform of Cyber Cycle . This version takes the highest and lowest value of the Cyber Cycle and normalizes the scale to a range of -1 to 1. John Ehlers shows how to use the inverse Fisher transform ( IFT ) to compress oscillator-type indicators to give clear trading indications of when to buy or sell. The IFT is a nonlinear transformation that changes the probability distribution, so for example, unbounded indicators can be transformed into bounded indicators with a high probability of being either +1 or -1.
Key Signal
ICycle--> Inverse Fisher Transform of Cyber Cycle fast line
Trigger--> Inverse Fisher Transform of Cyber Cycle slow line
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 69th 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 Inverse Fisher RSILevel: 2
Background
John F. Ehlers introuced the Inverse Fisher Transform of RSI in May, 2004.
Function
"The Inverse Fisher Transform," describes the calculation and use of the inverse Fisher transform by Dr. Ehlers in 2004. The transform is applied to any indicator with a known probability distribution function, but this script offers a sample transforms: RSI. I have created inputs for the trigger levels for entry and exit so that the user may adjust these levels as desired.
In his article, Dr. Ehlers states the inverse Fisher transform can work with any oscillator, and that values between -1 and 1 are more suited for the transform calculations. Here is one version of the inverse Fisher transform of RSI. This version takes the highest and lowest value of the RSI and normalizes the scale to a range of -1 to 1. John Ehlers shows how to use the inverse Fisher transform (IFT) to compress oscillator-type indicators to give clear trading indications of when to buy or sell. The IFT is a nonlinear transformation that changes the probability distribution, so for example, unbounded indicators can be transformed into bounded indicators with a high probability of being either +1 or -1.
Key Signal
IFish--> Ehlers Inverse Fisher RSI fast line
Trigger--> Ehlers Inverse Fisher RSI slow line
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 68th 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-lag SmootherLevel: 2
Background
John F. Ehlers introuced Zero-Lag Data Smoothers in Jul, 2002.
Function
John Ehlers introduced "Zero-Lag Data Smoothers", the infinite impulse response (IIR) filter and finite impulse response (FIR) filter.
In his article this issue on zero-lag smoothing, John Ehlers notes that his favorite filter is the symmetrically weighted six-bar finite impulse response (FIR) filter. This is also known as a triangular moving average, and can be conveniently implemented as a double-smoothed simple moving average. Per Ehlers, since this filter has six elements, its lag is 2.5 bars. Via further processing, this lag can be reduced to zero, but this produces too much overshoot. As a compromise, Ehlers suggests reducing the lag to one bar. To enable a user to adjust the lag easily, I provide the pine v4 code for an Adjustable Lag Filter indicator below. The first input, Price, should typically be set to OHLC, hl2, hl3, ohlc4 etc. The second input, LagReduction, should be set to a value in the zero-to-2.5 range. Setting it to zero will result in no adjustment, and the output will match that of the raw triangular average. Setting it to 2.5 will reduce the lag to zero. Setting it to 1.5 will reduce the lag to one bar.
Key Signal
Filter--> Zero-Lag Data Smoother fast line
Trigger--> Zero-Lag Data Smoother slow line
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 67th 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 Hilbert Channel Breakout Trading SystemLevel: 2
Background
John F. Ehlers introuced Hilbert Channel Breakout Trading System in Nov, 2000.
Function
This indicator will show how the adaptive filter is being applied to a trading strategy. After the Hilbert Channel Breakout Signal is optimized, set the inputs for this indicator to match the corresponding inputs for the signal.
In the March 2000 STOCKS & COMMODITIES, John Ehlers published a algorithm for the Hilbert cycle period, an indicator that plots the length of the current market cycle. The Hilbert transform achieved computational efficiency by using a two-dimensional numbering system. Unfortunately, this introduces amplitude error in calculating the quadrature component. Dr. Ehlers compensated for this error. He have updated the method of compensating for the amplitude error by applying a straight-line compensation term using the frequency calculation from one bar ago. This is possible because the cycle period cannot change drastically from bar to bar. The slowly varying cycle period is adequate to do a good job of amplitude compensation.
In addition, Dr. Ehlers have used a different way to compute the cycle period. He used a homodyne discriminator because it exhibits superior performance in a low signal-to-noise environment. Homodyne means he used the signal multiplied by itself one bar ago to produce a zero-frequency beat note. This beat note carries the phase angle of the one-bar change. Still using the basic definition of a cycle, the one-bar rate of change of phase is exactly the cycle period.
Here is the pine v4 code to generate the signals in the Hilbert channel breakout trading system, as discussed in Dr. Ehlers article in this issue, "Optimizing With Hilbert Indicators." The signal itself is a simple channel breakout system that generates buy and exit signals, that shows whether the system is long or flat; the high of the bar and the value of the entry channel; and the low of the bar and the value of the exit channel. This helps you see on a bar-by-bar basis exactly how the system is behaving.
Key Signal
longcond--> when high breakouts EntryChannel to long
shortcond--> when low breakouts ExitChannel to short
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 66th script for Blackcat1402 John F. Ehlers Week publication.
I tested it and believe it work better in small time frame e.g. 15m than large time frames.
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 Squelch IndicatorLevel: 2
Background
John F. Ehlers introuced the squelch indicator in Sep, 2000.
Function
This the squelch indicator code is identical to the Hilbert period code , with the addition of the squelch threshold and the display being implemented as a paintbar -- that is, a bar on the chart being colored, depending on the squelch threshold value.
The Pine v4 code for displaying the squelch control as a paintbar for John Ehlers's article, "Squelch Those Whipsaws," can be reproduced in Tradingview by breaking the steps into separate functions. For example, functions can be written to calculate the "InPhase" and "Quadrature" variables, which can then be used in the calculation of the "Phase," "DeltaPhase," and "InstPeriod."
Although paintbars are not a feature of Tradingview, a similar effect can be displayed in a chart by writing a function to determine whether the period is less than 20. This function can then be displayed in main chart to highlight whether the price is in a trend mode or a cycle mode. The squelch period should also prove useful as an input for neural network predictions.
Key Signal
Plot1--> Highlight Period smaller than Squelch Threshold
Plot2--> Highlight Period smaller than Squelch Threshold
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 65th 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 Swiss Army KnifeLevel: 2
Background
John F. Ehlers introuced swiss army knife (SAK)indicator in 2005.
Function
The swiss army knife (SAK)indicator does all the common functions of the usual indicators, such as smoothing and momentum generation. It also does some unusual things, such as band stop and band reject filtering. Once you program this indicator into your trading platform you can do virtually any technical analysis technique with it. This unique general indicator results from general Digital Signal Processing (DSP) concepts for discrete signal networks that appear in various forms in technical analysis .
The description of this indicator involves Z Transforms. Z Transforms are a convenient way of solving difficult difference equations in much the same way as LaPlace Transforms are used to solve differential equations in calculus. Difference equations arise from the use of sampled data, such as we have in technical analysis . That is, daily bars sample price data once a day. Intraday bars sample price data every minute, hour, or whatever. The concept is the same regardless of the sampling rate. In Z Transforms, Z^(-1) stands for one sample period of delay. For simplicity, I will always refer to daily bars as the sample rate.
It includes,
1. Exponential Moving Average ( EMA )
2. Simple Moving Average ( SMA )
3. Two Pole Gaussian Filter
4. Two Pole Butterworth Filter
5. High Pass Filter
6. Two Pole High Pass Filter
7. BandPass Filter
8.BandStop Filter
The Swiss Army Knife Indicator is a versatile approach that creates a wide variety of responses that range from smoothers to oscillators. Novel BandPass and BandStop filters can also be produced. All of this can be done with one line of code in most platforms. The various responses come from the coefficients that can be called – as functions if you prefer.
Key Signal
Filt --> swiss army knife (SAK)indicator fast line
Trigger --> swiss army knife (SAK)indicator slow line
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 64th 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 FRAMALevel: 2
Background
John F. Ehlers introuced Fractal Adaptive Moving Average (FRAMA) in 2004.
Function
The objective of using filters is to separate the desired signals from the undesired signals (or noise). The practical application of moving averages often involves a tradeoff between the amount of smoothness required and the amount of lag that can be tolerated. Moving averages have this problem because the price data is not stationary, and may have different bandwidths over different time intervals. Various momentum-adaptive filtering techniques have been developed to take advantage of the nonstationary structure of prices. Adaptive filters have also been developed based on price statistics and the cyclic content of the price data . Dr. Ehlers described a different class of filters that monitor a different measure of temporal nonstationarity and alters their bandwidth in response to this measure.
There is no argument that market prices are fractal. Fractal shapes are self-similar because they tend to have the same roughness and sparseness regardless of the magnification used to view them. If you remove the labels from a 5 minute chart, a daily chart, and a weekly chart you would have difficulty telling them apart. This is the characteristic that makes them fractal. The self-similarity can be defined by the fractal dimension that describes the sparseness at all magnification levels.
To determine the fractal dimension of a generalized pattern, Dr. Ehlers cover the pattern with a number “N” of small objects of several various sizes “s”. As with any moving average, we are forced to compromise between responsiveness and smoothness. FRAMA can be a valuable weapon in your arsenal of technical indicators. It rapidly follows significant changes in price but becomes very flat in congestion zones so that bad whipsaw trades can be eliminated.
Key Signal
Filt --> FRAMA fast line
Trigger --> FRAMA slow line
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 63th 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 SwamiCharts RSILevel: 2
Background
John F. Ehlers introuced SwamiCharts RSI in his "Cycle Analytics for Traders" chapter 16 on 2013.
Function
SwamiCharts retain the core functionality of the technical indicators with which you're already familiar, while packing much more information into an easy-to interpret heat map chart. With SwamiCharts, you now visualize each indicator over a range of lookback periods
to reveal a better view of the indicator's truer meaning in context. SwamiCharts provide a better solution because you can now visualize context over a wide range of lookback periods. Trends and cycles emerge more succinctly, while continuation patterns and reversals become
easier to identify. SwamiCharts solves the data lookback problem by enabling you to view market conditions at a glance, a feature that will dramatically facilitate your trading.
Since the MyRSI is computed for all values over the range of lookback periods, it must be an array in Pine v4.0 rather than a variable. The RSI is computed relative to the output of the roofing filter rather than price closes to eliminate the effects of Spectral Dilation. After the computation of the ratio, the indicator is smoothed in a SuperSmoother filter, so we must create the three most recent instances ourselves in the code. This is because Pine v4.0 retains historical values for variables but not for arrays. In fact, ratio must be an array also for the same reasons. The coefficients for the 10-bar SuperSmoother filter are computed and are the same for all lookback periods, and so can be outside the lookback loop to make the calculations a little more efficient.
Key Signal
MyRSI1 --> Modified RSI by John Ehlers
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 62th 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 Fisher Adaptive RSILevel: 2
Background
John F. Ehlers introuced adding the Fisher Transform to the Adaptive RSI in his "Cycle Analytics for Traders" chapter 15 on 2013.
Function
The purpose of the Fisher transform is to take any indicator having a nominally zero mean and bounded between the limits of −1 to +1 and convert the amplitude so that the transformed indicator has an approximate normal probability distribution. The variable MyRSI ranges between zero and one, and therefore to accommodate the conditions for the Fisher transform, this variable must be translated and dilated to range between −1 and +1. If the MyRSI variable does not range fully between zero and one, you can shorten the RSI lookback period to be less than half the measured dominant cycle, or you can simply multiply it by a magnification factor as Dr. Ehlers have done in the code fragment. The amplifying factor was selected to make the indicator rarely exceed the two sigma points in the output. The amplified RSI is then limited to be within the range of −0.999 to +0.999 to avoid a computer crash, and then is used to compute the Fisher transform. The plus and minus two standard deviation levels are included in the indicator display.
Key Signal
Fish --> Fisher Adaptive RSI fast line
Trigger --> Fisher Adaptive RSI slow line
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 61th 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.