[blackcat] L2 Ehlers Adaptive Commodity Channel IndexLevel: 2
Background
John F. Ehlers introucedAdaptive Commodity Channel Index in his "Rocket Science for Traders" chapter 21 on 2001.
Function
The Commodity Channel Index (CCI) computes the average of the median price of each bar over the observation period. It also computes the Mean Deviation (MD) from this average. The CCI is formed as the current deviation from the average price normalized to the MD. With a Gaussian probability distribution, 68 percent of all possible outcomes are contained within the first standard deviation from the mean. The CCI is scaled so that values above +l00 are above the upper first
standard deviation from the mean and values below -100 are below the lower first standard deviation from the mean. Multiplying the MD in the code by 0.015 implements this normalization. Many traders use this indicator as an overbought/oversold indicator with 100 or greater indicating that the market is overbought, and -100 or less that the market is oversold. Since the trading channel is being formed by the indicator, the obvious observation period is the same as the cycle length. Since the complete cycle period may not be the universal answer, Dr. Ehlers includes a CycPart input as a modifier. This input allows you to optimize the observation period for each particular situation.
Key Signal
CCI ---> Adaptive Commodity Channel Index fast line
CCI ---> Adaptive Commodity Channel Index 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 20th 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.
Johnehlers
[blackcat] L2 Ehlers Adaptive StochasticLevel: 2
Background
John F. Ehlers introuced Adaptive Stochastic in his "Rocket Science for Traders" chapter 21 on 2001.
Function
The Stochastic measures the current closing price relative to the lowest low over the observation period. It then normalizes this to the range between the highest high and the lowest low over the observation period. If the current closing price is equal to the highest high over the observation period, then the Stochastic has a value of 1. If the current closing price is equal to the lowest low over the observation period, then the Stochastic has a value of zero. These are the limits over which the Stochastic can range. To optimize the Stochastic for the measured cycle, the correct fraction of the cycle to use is one-half, as the Stochastic can
range from its minimum to its maximum on each half cycle of the period. As before, the code for the optimized Stochastic measures the cycle period using the Homodyne Discriminator algorithm and then uses that period as the basis for finding HH and LL and computing the Stochastic. Since half the cycle period may not be the universal answer, we include a CycPart input as a modifier. This input allows you to optimize the observation period for each particular situation. The optimized Stochastic tends to be in phase with the original price data. This suggests a way to turn a good indicator into a great one. If we subtract 50 from the optimized Stochastic, we would get a zero mean and thus tend to have Poisson-like statistics on the Stochastic’s zero crossings. If that were the case, we could smooth the optimized Stochastic and make an Optimum Predictive filter from it. That way we could anticipate signals rather than wait for signals to cross the 20 percent and 80 percent marks for confirmation as is done with the standard indicator. I will leave it to you to decide which method best suits your needs and purposes.
Key Signal
Stochastic ---> Stochastic fast line
Stochastic ---> Stochastic 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 19th 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 Adaptive Relative Strength IndexLevel: 2
Background
John F. Ehlers introuced Adaptive Relative Strength Index in his "Rocket Science for Traders" chapter 21 on 2001.
Function
The concept of taking a difference of lagging line from the original function to produce a leading function suggests extending the concept to moving averages. There is no direct theory for this, but it seems to work pretty well. If taking a 7-bar WMA of prices, that average lags the prices by 2 bars. If taking a 7-bar WMA of the first average, this second average is delayed another 2 bars. If taking the difference between the two averages and add that difference to the first average, the result should be a smoothed line of the original price function with no lag. Sure, Dr. Ehlers tried to use more lag for the second moving average, which
should produce a better predictive curve. However, remember the lesson of Chapter 3 of the book. An analysis curve cannot precede an event. You cannot predict an event before it occurs. If then taking a 4-bar WMA of the smoothed line to create a 1-bar lag, this lagging line becomes a signal when the lines cross. This is as close to an ideal indicator as we can get.
Key Signal
Predict ---> moving average fast line
Trigger ---> moving average 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 17th 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 Predictive AverageLevel: 2
Background
John F. Ehlers introuced Predictive Average in his "Rocket Science for Traders" chapter 20 on 2001.
Function
The concept of taking a difference of lagging line from the original function to produce a leading function suggests extending the concept to moving averages. There is no direct theory for this, but it seems to work pretty well. If taking a 7-bar WMA of prices, that average lags the prices by 2 bars. If taking a 7-bar WMA of the first average, this second average is delayed another 2 bars. If taking the difference between the two averages and add that difference to the first average, the result should be a smoothed line of the original price function with no lag. Sure, Dr. Ehlers tried to use more lag for the second moving average, which
should produce a better predictive curve. However, remember the lesson of Chapter 3 of the book. An analysis curve cannot precede an event. You cannot predict an event before it occurs. If then taking a 4-bar WMA of the smoothed line to create a 1-bar lag, this lagging line becomes a signal when the lines cross. This is as close to an ideal indicator as we can get.
Key Signal
Predict ---> moving average fast line
Trigger ---> moving average 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 17th 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 Optimum PredictorLevel: 2
Background
John F. Ehlers introuced Optimum Predictor in his "Rocket Science for Traders" chapter 20 on 2001.
Function
As we have seen before, the majority of the code involves the computation of the period using the Homodyne Discriminator algorithm. Once the period has
been computed, the Optimum Predictor is found in just a few lines of code. First, the minimum-length Hilbert Transformer is used to compute the Detrender2 value from the prices that have been smoothed by the 4-bar Weighted Moving Average (WMA). Detrender2 is smoothed in the 4-bar WMA to produce Smooth2. The alpha of the EMA is computed from the computed period, and the EMA of Smooth2 is taken using that alpha and is called the DetrendEMA. The difference between Smooth2 and the
DetrendEMA is multiplied by 1.4 to produce the Predict phasor. Finally, the Smooth2 and Predict phasors are plotted as indicators.
The Optimum Predictor is plotted as the subgraph below the price chart. Buy and sell signals occur when the Predict and Smooth2 lines cross. Based on Dr. Ehlers comments, most of these signals are indeed prescient. The Optimum Predictor could probably work best in trading systems when used in conjunction with other
rules to eliminate the false signals.
Key Signal
Smooth --> 4 bar WMA w/ 1 bar lag
Detrender --> The amplitude response of a minimum-length HT can be improved by adjusting the filter coefficients by
trial and error. HT does not allow DC component at zero frequency for transformation. So, Detrender is used to remove DC component/ trend component.
Q1 --> Quadrature phase signal
I1 --> In-phase signal
Period --> Dominant Cycle in bars
SmoothPeriod --> Period with complex averaging
Predict --> fast line of optimum predictor
Smooth2 --> slow line of optimum predictor
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 16th 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 The Distance Coefficient Ehlers FilterLevel: 2
Background
John F. Ehlers introuced the Distance Coefficient Ehlers Filter in his "Rocket Science for Traders" chapter 18 on 2001.
Function
Dr. Ehlers considered the gray shading levels as distances, he had away of computing filter coefficients in terms of sharpness of the edge. White is the maximum distance in one direction from the median gray, and black is the maximum distance in the other direction. In this sense, distance is a measure of departure from the edge, taking into account the edge sharpness. Transitioning to price charts, the difference in prices can be imagined as a distance. Recalling the Pythagorean Theorem (which the length of the hypotenuse of a triangle is equal to the sum of the squares of the lengths of the other two sides), Dr Ehlers applied it to the needs and say that a generalized length at any data sample is the square root of the sum of the squares of the price difference between that price and each of the prices back for the length of the filter window. The distances squared at each data point are the coefficients of the Ehlers filter.
Key Signal
Coef --> Ehlers filter coefficients array
Distance2 --> Distance array
Filt --> Ehlers filter output
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 15th 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 FilterLevel: 2
Background
John F. Ehlers introuced Ehlers Filter in his "Rocket Science for Traders" chapter 18 on 2001.
Function
blackcat L2 Ehlers Filter is used to follow trend. The filters Dr. Ehlers have invented are nonlinear FIR filters. It turns out that they provide both extraordinary smoothing in sideways markets and aggressively follow major price movements with minimal lag. The development of Ehlers filters starts with a general
class of FIR filters called Order Statistic (OS) filters. These filters are well-known for speech and image processing, to sharpen edges, increase contrast, and for robust estimation. In contrast to linear filters, where temporal ordering of the samples is preserved, OS filters base their operation on the ranking of samples
within the filter window. The data are ranked by their summary statistics, such as their mean or variance, rather than by their temporal position.
Among OS filters, the Median filter is the best known. In a Median filter, the output is the median value of all the data values within the observation window. As opposed to an averaging filter, the Median filter simply discards all data except the median value. In this way, impulsive noise spikes and extreme price data are eliminated rather than included in the average. The median value can fall at the first sample in the data window, at the last sample, or anywhere in between. Thus, temporal characteristics are lost. The Median filter tends to smooth out short-term variations that lead to whipsaw trades with linear filters. However, the lag of a Median filter in response to a sharp and sustained price movement is substantial --- it necessarily is about half the filter window width.
Key Signal
Coef --> Ehlers filter coefficients array
Filt --> Ehlers filter output
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 14th 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 MAMALevel: 2
Background
John F. Ehlers introuced MESA Adaptive Moving Average-a.k.a "MAMA" in his "Rocket Science for Traders" chapter 17. Forgive the whimsy of the name Dr. Ehlers attached to this unique indicator, but with that name he is sure you will always remember it, like KAMA and VIDYA.
Function
blackcat L2 Ehlers MESA Adaptive Moving Average-a.k.a "MAMA" is used to follow trend. The concept of MAMA is to relate the phase rate of change to the EMA alpha, thus making the EMA adaptive. The cycle phase goes from 0 through 360 degrees in each cycle. The phase is continuous, but is usually drawn with the snap back to 0 degrees as the beginning of each cycle. Thus the phase rate of change is 360 degrees per cycle. The shorter the cycle, the faster the phase rate of change. For example, a 36-bar cycle has a phase rate of change of 10 degrees per bar, while a 10-bar cycle has a rate of change of 36 degrees per bar. The cycle periods tend to be longer when the market is in a Trend Mode.
The cycle phase is computed from the arctangent of the ratio of the Quadrature component to the Inphase component. Dr. Ehlers obtain the phase rate of change values by taking the difference of successive phase measurements. The arctangent function only measures phase over a half cycle, from -90 degrees to +90 degrees. Since the phase measurement snaps back every half cycle, a huge negative rate change of phase every half cycle results from the computation of the rate change of phase. Measured negative rate changes of phase can also occur when the market is in a Trend Mode. Any negative rate change of phase is theoretically impossible because phase must advance as time increases. Dr. Ehlers therefore limit all rate change of phase to be no less than unity.
Key Signal
Smooth --> 4 bar WMA w/ 1 bar lag
Detrender --> The amplitude response of a minimum-length HT can be improved by adjusting the filter coefficients by
trial and error. HT does not allow DC component at zero frequency for transformation. So, Detrender is used to remove DC component/ trend component.
Q1 --> Quadrature phase signal
I1 --> In-phase signal
Period --> Dominant Cycle in bars
SmoothPeriod --> Period with complex averaging
alpha ---> coefficient
MAMA ---> MESA Adaptive Moving Average-a.k.a "MAMA"
FAMA ---> slow line of MAMA
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 13th 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 ZeroLag Intraday Trading SystemLevel: 3
Background
John F. Ehlers introuced ZeroLag Intraday Trading System in his "Rocket Science for Traders" chapter 16.
Function
blackcat L3 EhlersZeroLag Intraday Trading System is used to find proper long and short entries. Dr. Ehlers developed a completely automatic ZeroLag Intraday Trading System. The concepts of the Instantaneous Trendline and the ZeroLag EMA are very powerful. To demonstrate just how profound these concepts are, Dr. Ehlers designed an intraday trading system. An intraday trade is defined as any active trade that is traded and then closed at the end of the day.
Key Signal
Smooth --> 4 bar WMA w/ 1 bar lag
Detrender --> The amplitude response of a minimum-length HT can be improved by adjusting the filter coefficients by
trial and error. HT does not allow DC component at zero frequency for transformation. So, Detrender is used to remove DC component/ trend component.
Q1 --> Quadrature phase signal
I1 --> In-phase signal
Period --> Dominant Cycle in bars
SmoothPeriod --> Period with complex averaging
DCPeriod ---> Dominant Cycle Period
Trendline ---> IT fast line
ZeroLag ---> Zero Lag Filter
long ---> long entry signal
short ---> short entry signal
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.
NOTE: This version of Trading System has better preformance than "Automatic SineTrend Trading System".
Remarks
The 12th 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 Automatic SineTrend Trading SystemLevel: 2
Background
John F. Ehlers introuced Automatic SineTrend Trading System in his "Rocket Science for Traders" chapter 12.
Function
blackcat L2 Ehlers Automatic SineTrend Trading System is used to find proper long and short entries.Dr. Ehlers developed a completely automatic trading system called the SineTrend Automatic System based on the rules in his book. His fundamental approach is to trade using the Trend Mode rules when the market is in a Trend Mode and trade using the Cycle Mode rules when the market is in a Cycle Mode.
Key Signal
Smooth --> 4 bar WMA w/ 1 bar lag
Detrender --> The amplitude response of a minimum-length HT can be improved by adjusting the filter coefficients by
trial and error. HT does not allow DC component at zero frequency for transformation. So, Detrender is used to remove DC component/ trend component.
Q1 --> Quadrature phase signal
I1 --> In-phase signal
Period --> Dominant Cycle in bars
SmoothPeriod --> Period with complex averaging
DCPeriod ---> Dominant Cycle Period
Trendline ---> IT fast line
SmoothPrice ---> IT slow line
Trend ---> Trend identifier: 1 for trend; 0 for cycle.
LeadSine ---> Lead Sine Wave signal
DCSine ---> Sine Wave signal
long ---> long entry signal
short ---> short entry signal
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.
NOTE: Due to limited performance oberved from "Market Mode Identification" part, this trading system I observed was not so powerful.
Remarks
The 11th 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 Market Mode IdentifierLevel: 2
Background
John F. Ehlers introuced Market Mode Identifier in his "Rocket Science for Traders" chapter 11. The simplified model of the market, derived from the Drunkard's Walk problem, has only two modes-the Cycle Mode and the Trend Mode. Through the derivation of the Sinewave Indicator and the Instantaneous Trendline, Ehlers had shown several ways to estimate which mode the market may have for a given moment. As with most technical indicators, the decision point between modes is not clear-cut. In fact, trying to automate the decision often leads to a great deal of chatter and rapid back and
forth switching of decisions.
Function
blackcat L2 Ehlers Market Mode Identifier is used to identify market status is in Trend Mode or Cycle Mode.Since the Cycle Mode exists for the smallest fraction of time and since most traders make the most money following a trend rather than a cycle, it is best to assume that the market is in a Trend Mode unless some very specific criteria are met. There are only two criteria to establish a Cycle Mode. First, a Cycle Mode exists for the period of a half-dominant cycle after the crossing of the two Sinewave Indicator lines. Second, a Cycle Mode exists if the measured phase rate of change is more than two-thirds the phase rate of change of the dominant cycle (2*pi /Period) and is less
than 1.5 times the phase rate of change of the dominant cycle. There is another condition that defines a Trend Mode. This condition is derived from pragmatic observation, not theoretical considerations. When the market makes a major reversal, it often does this with great vigor. When this occurs, the prices have a wide separation from the Instantaneous Trendline. When the prices are widely separated from the Instantaneous Trendline, it is possible for the Cycle Mode conditions to be met-but the Cycle Mode identification is clearly incorrect. Dr. Ehlers have therefore inserted another overriding rule for these cases. That rule is that if the SmoothPrice (the 4-bar WMA of the Price) is separated by more than 1.5 percent from the Instantaneous Trendline, then the correct market mode is the Trend Mode.
Key Signal
Smooth --> 4 bar WMA w/ 1 bar lag
Detrender --> The amplitude response of a minimum-length HT can be improved by adjusting the filter coefficients by
trial and error. HT does not allow DC component at zero frequency for transformation. So, Detrender is used to remove DC component/ trend component.
Q1 --> Quadrature phase signal
I1 --> In-phase signal
Period --> Dominant Cycle in bars
SmoothPeriod --> Period with complex averaging
DCPeriod ---> Dominant Cycle Period
Trendline ---> IT fast line
SmoothPrice ---> IT slow line
Trend ---> Trend identifier: 1 for trend; 0 for cycle.
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.
NOTE: I had tried several time frames, and found it did not work well for time frame < 1W.
Remarks
The 10th 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 Instantaneous TrendlineLevel: 2
Background
John F. Ehlers introuced Instantaneous Trendline (IT) in his "Rocket Science for Traders" chapter 10. Dr. Ehlers hope IT can enable us to compute a continuous trendline from which we can rapidly assess market action.
Function
blackcat L2 Ehlers Instantaneous Trendline (IT) is used to follow trend. IT is important because the dominant cycle component is always notched out. It follows that if the composite analytic waveform consists of only a trend component and a cycle component, and if we remove the cycle component, the residual must be the trend. Of course, this is not precisely true in reality, because there will always be components other than the dominant cycle present. However, this is a workable solution for trading purposes because the secondary cycles usually have a small amplitude.
Key Signal
Smooth --> 4 bar WMA w/ 1 bar lag
Detrender --> The amplitude response of a minimum-length HT can be improved by adjusting the filter coefficients by
trial and error. HT does not allow DC component at zero frequency for transformation. So, Detrender is used to remove DC component/ trend component.
Q1 --> Quadrature phase signal
I1 --> In-phase signal
Period --> Dominant Cycle in bars
SmoothPeriod --> Period with complex averaging
DCPeriod ---> Dominant Cycle Period
Trendline ---> IT fast line
SmoothPrice ---> IT 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 9th 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 Sine Wave IndicatorLevel: 2
Background
John F. Ehlers introuced Sine Wave Indicator in his "Rocket Science for Traders" chapter 9.
Function
blackcat L2 Ehlers Sine Wave Indicator compared to conventional oscillators such as the Stochastic or Relative Strength Indicator (RSI), the Sinewave Indicator has two major advantages. These are
1. The Sinewave Indicator anticipates the Cycle Mode turning point rather than waiting for confirmation.
2. The phase does not advance when the market is in a Trend Mode. Therefore, the Sinewave Indicator tends to not give false whipsaw signals when the market is in a Trend Mode.
An additional advantage is that the anticipation signal is obtained strictly by mathematically advancing the phase. Momentum is not employed. Therefore, the Sinewave Indicator signals are no more noisy than the original signal.
Key Signal
Smooth --> 4 bar WMA w/ 1 bar lag
Detrender --> The amplitude response of a minimum-length HT can be improved by adjusting the filter coefficients by
trial and error. HT does not allow DC component at zero frequency for transformation. So, Detrender is used to remove DC component/ trend component.
Q1 --> Quadrature phase signal
I1 --> In-phase signal
Period --> Dominant Cycle in bars
SmoothPeriod --> Period with complex averaging
DCPhase ---> dominant cycle phase for sine wave
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 8th 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 OscillatorLevel: 2
Background
John F. Ehlers introuced Hilbert Oscillator in his "Rocket Science for Traders" chapter 8. The Hilbert Oscillator identifies every major turning point.
Function
blackcat L2 Ehlers Hilbert Oscillator is used to follow the trend. Although it will not be a leading indicator because of the 2-bar lag required to compute Q3, it does prove itself to be superior to most currently available oscillators. The bandwidth for the computation of Value1 is twice the bandwidth of I3. Therefore, the amplitude compensation will be less, approximately the square root of 1.57, which is about 1.25. The Hilbert Oscillator identifies every major turning point.
Key Signal
Smooth --> 4 bar WMA w/ 1 bar lag
Detrender --> The amplitude response of a minimum-length HT can be improved by adjusting the filter coefficients by
trial and error. HT does not allow DC component at zero frequency for transformation. So, Detrender is used to remove DC component/ trend component.
Q1 --> Quadrature phase signal
I1 --> In-phase signal
Value1 ---> Hilbert Oscillator fast line
I3 ---> Hilbert Oscillator 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 7th 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 Signal to Noise IndicatorLevel: 2
Background
John F. Ehlers introuced Signal to Noise Indicator in his "Rocket Science for Traders" chapter 8. Dr. Ehlers terms the case where half the average daily trading range is equal to the signal amplitude as our zero decibel Signal-to-Noise Ratio (0 dB SNR) condition. He wants the signal amplitude to be at least twice the noise amplitude (6dB SNR) so that there exists a reasonable chance to make a profit from the chart analysis.
Function
blackcat L2 Ehlers Signal to Noise Indicator is used to measure Signal-to-Noise Ratio (SNR). The SNR in decibels is calculated in a single line of code near the end. The signal power is divided by the noise power to get a power ratio. The logarithm of the power ratio. At 0 dB, the peak-to-peak noise signal is twice the amplitude of the signal. Therefore, when we compute the 0 dB case, the ratio is calculated to be 10*log(1/2)^2 = -6 dB. We must then add 6 dB back into the computation to remove this bias, establishing the definition of 0 dB SNR.
Key Signal
Smooth --> 4 bar WMA w/ 1 bar lag
Detrender --> The amplitude response of a minimum-length HT can be improved by adjusting the filter coefficients by
trial and error. HT does not allow DC component at zero frequency for transformation. So, Detrender is used to remove DC component/ trend component.
Q1 --> Quadrature phase signal
I1 --> In-phase signal
Period --> Dominant Cycle in bars
SNR --> Signal-to-Noise Ratio
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 5th 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 Dual Differential Cycle Period MeasurerLevel: 2
Background
John F. Ehlers introuced Dual Differential Cycle Period Measurer in his "Rocket Science for Traders" chapter 7. The In-phase and Quadrature components are computed with the Hilbert Transformer using procedures identical to those in the Dual Differentiator.
Function
blackcat L2 Ehlers Homodyne Discriminator Cycle Period Measurer is used to measure Dominant Cycle (DC). This is one of John Ehlers three major methods to measure DC. These components undergo a complex averaging and are smoothed in an EMA to avoid any undesired cross products in the multiplication step that follows. The period is solved directly from the smoothed Inphase and Quadrature components. The interim calculation for the denominator is performed as Value1 to ensure that the denominator will not have a zero value. The sign of Valuel is reversed relative to the theoretical equation because the differences are looking backward in time.
Key Signal
Smooth --> 4 bar WMA w/ 1 bar lag
Detrender --> The amplitude response of a minimum-length HT can be improved by adjusting the filter coefficients by
trial and error. HT does not allow DC component at zero frequency for transformation. So, Detrender is used to remove DC component/ trend component.
Q1 --> Quadrature phase signal
I1 --> In-phase signal
Period --> Dominant Cycle in bars
SmoothPeriod --> Period with complex averaging
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 4th 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 Homodyne Discriminator Period MeasurerLevel: 2
Background
John F. Ehlers introuced Homodyne Discriminator Cycle Period Measurer in his "Rocket Science for Traders" chapter 7. Homodyne means we are multiplying the signal by itself. More precise, we want to multiply the signal of the current bar with the complex conjugate of the signal 1 bar ago. The complex conjugate is, by definition, a complex number whose sign of the imaginary component has been reversed.
Function
blackcat L2 Ehlers Homodyne Discriminator Cycle Period Measurer is used to measure Dominant Cycle (DC). This is one of John Ehlers three major methods to measure DC. Mode. Dr. Ehlers conclude that the Homodyne is overall more accurate in measurement of cycles when the market is in a Trend Mode. For all these reasons Dr. Ehlers conclude that the Homodyne Discriminator is the superior approach among the three methods.
Key Signal
Smooth --> 4 bar WMA w/ 1 bar lag
Detrender --> The amplitude response of a minimum-length HT can be improved by adjusting the filter coefficients by
trial and error. HT does not allow DC component at zero frequency for transformation. So, Detrender is used to remove DC component/ trend component.
Q1 --> Quadrature phase signal
I1 --> In-phase signal
Period --> Dominant Cycle in bars
SmoothPeriod --> Period with complex averaging
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 3rd 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 Phase Accumulator Cycle Period MeasurerLevel: 2
Background
John F. Ehlers introuced Phase Accumulation technique of cycle period measurement in his "Rocket Science for Traders" chapter 7. It is perhaps the easiest to comprehend. In this technique, John Ehlers measures the phase at each sample by taking the arctangent of the ratio of the Quadrature component to the In-phase component. A delta phase is generated by taking the difference of the phase between successive samples. At each sample Dr. Ehlers then looks backward, adding up the delta phases. When the sum of the delta phases reaches 360 degrees (2*pi in tradingview), we must have passed through one full cycle, on average. The process is repeated for each new sample.
Function
blackcat L2 Ehlers Phase Accumulator Cycle Period Measurer is used to measure Dominant Cycle (DC). This is one of John Ehlers three major methods to measure DC. The Phase Accumulation method of cycle measurement always uses one full cycle’s worth of historical data. This is both an advantage and disadvantage. The advantage is the lag in obtaining the answer scales directly with the cycle period. That is, the measurement of a short cycle period has less lag than the measurement of a longer cycle period. However, the number of samples used in making the measurement means the averaging period is variable with cycle period. Longer averaging reduces the noise level compared to the signal. Therefore, shorter cycle periods necessarily have a higher output Signal-to-Noise Ratio (SNR).
Key Signal
Smooth --> 4 bar WMA w/ 1 bar lag
Detrender --> The amplitude response of a minimum-length HT can be improved by adjusting the filter coefficients by
trial and error. HT does not allow DC component at zero frequency for transformation. So, Detrender is used to remove DC component/ trend component.
Q1 --> Quadrature phase signal
I1 --> In-phase signal
Period --> Dominant Cycle in bars
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 2nd 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 TransformLevel: 2
Background
John F. Ehlers introuced Hilbert Transform in his "Rocket Science for Traders" chapter 6. The Hilbert Transform is a procedure to create complex signals from the simple chart data familiar to all traders. Once we have the complex signals, we can compute indicators and signals that are more accurate and responsive than those computed using conventional techniques. In fact, some of the indicators we will discuss cannot be calculated at all without the Hilbert Transform.
Function
blackcat L2 Ehlers Hilbert Transform indicator performs basic Hilbert Transform (HT) from chart data source and generate complex IQ data.
Key Signal
Smooth --> 4 bar wma() w/ 1 bar lag
Detrender --> The amplitude response of a minimum-length HT can be improved by adjusting the filter coefficients by
trial and error. HT does not allow DC component at zero frequency for transformation. So, Detrender is used to remove DC component/ trend component.
Q1 --> Quadrature phase output signal
I1 --> In-phase output 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 1st 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 Adaptive Commodity Channel Index V1 [CC]The Adaptive Commodity Channel Index V1 was created by John Ehlers (Rocket Science For Traders pgs 236-237) and this is the typical Commodity Channel formula with the introduction of adaptive lengths based on his earlier work with indicators such as the Mother of Adaptive Moving Averages. For longer term signals you would get a bullish signal when CCI is above 0 and a bearish signal when CCI falls below 0. For shorter term signals you would get a bullish signal when crosses over it's overbought level or when it crosses above it's oversold level or vice versa. I have included both signals to make it easier.
Let me know if you want a custom script written or if you have a special request for me
Ehlers Adaptive Relative Vigor Index [CC]The Adaptive Relative Vigor Index was created by John Ehlers (Cybernetic Analysis For Stocks And Futures pgs 140-141) and it does a pretty good job of capturing the peaks and valleys of the underlying data. There are several ways to read this particular indicator so for long term trades then buy when it goes above 0 and sell when it falls below 0 or for shorter term trades then buy when the indicator line turns green and sell when it 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 3 Pole Butterworth Filter V2 [CC]The 3 Pole Butterworth Filter was created by John Ehlers (Cybernetic Analysis For Stocks And Futures pgs 196-197) and this indicator is a moving average that also works well as a trendline. Buy when the indicator line turns green and sell when it turns red.
Let me know if you would like me to publish other indicators or if you want something custom done!
Ehlers 2 Pole Super Smoother Filter V2 [CC]The 2 Pole Super Smoother Filter was created by John Ehlers (Cycle Analytics For Traders pg 32) and this follows the price very closely and very useful because it is consistent with uptrends and falls sharply during a sudden downtrend so it should be able to help you stay more profitable. Buy when the indicator line turns green and sell when it turns red.
Let me know if there are other indicators you would like to see me publish or if you want something custom done!