Adaptive lookback indicators - page 7

 

With MrTools, we have been going through Homodyne discriminator (the HT indicator from few posts ago) and we found that there are a couple of problems with it. So here is the results of cleaning it up and some extras

____________________

There is already one more version of Homodyne discriminator in the "All John Ehlers indicators" but it is even heavier on resources than the HT (it calculates all the bars for every tick) and it has a deviation from the original indicator in the part where the price is concerned : it uses 4 period linear weighted price instead of "pure" price. This one does solves all those issues
 

Mladen

This group of indicators are affected by this new calculation of HT (let's say more favorable)

adaptive Gann High-Low activator jma Heiken Ashi arrows.mq4 (14.3 KB, 16 views)

HT.mq4 (5.3 KB, 17 views)

adaptive Gann High-Low activator jma Heiken Ashi arrows-1.mq4 (17.8 KB, 10 views)

 

And now the reason for posting at this thread :

John Ehlers made also an indicator called Phase accumulation. I did not find a working version of it for metatrader 4 (the ones I found are with too much deviations from the original, so the usage of those is rather limited) so made one. The idea (in short) is to find how many bars does it take to add up every bars phases and to reach certain cycle (Ehlers uses only 1 full cycle but I decided to make it as a parameter where you can choose for how many cycles do you want to check the phases for - the "why" I did it will be explained later)
So, the way it is calculated, it gives a kind of a "perfect" period that should be applied to some indicator. And now the "why" variable cycles parameter : if we test just 1 full cycle then the speed of an indicator can not be changed (it will depend solely on data) and that way some indicators that could use this way of calculating periods could not benefit from it : averages, MACD, and so on ... But with variable cycles they become "controllable" and in that way, much more usable. So here are two offsprings of the Phase accumulation : Phase accumulation EMA (so adaptive) and Phase accumulation MACD (adaptive again). On the picture : Half cycle EMA and full cycle EMA, and the same cycles MACD
PS: Ehlres uses default value 7 for filter (smoothing) but I decided to set it to no smoothing (when filter is set to 1 or less there is no smoothing)) in order to make it clearer what exactly does the Phase accumulation do
 

bebeshel

Use the "adaptive Gann High-Low activator jma Heiken Ashi arrows-1.mq4" MrTools already implemented the corrected Homodyne discriminator in it

bebeshel:
This group of indicators are affected by this new calculation of HT (let's say more favorable)

adaptive Gann High-Low activator jma Heiken Ashi arrows.mq4 (14.3 KB, 16 views)

HT.mq4 (5.3 KB, 17 views)

adaptive Gann High-Low activator jma Heiken Ashi arrows-1.mq4 (17.8 KB, 10 views)
 

Mladen

this changed just in:

adaptive Gann High-Low activator jma Heiken Ashi arrows-1.mq4

this and the other does not:

adaptive Gann High-Low activator jma Heiken Ashi arrows.mq4 ?

Thanks.

 

phase accumulation

mladen:
John Ehlers made also an indicator called Phase accumulation. ... The idea (in short) is to find how many bars does it take to add up every bars phases and to reach certain cycle (Ehlers uses only 1 full cycle but I decided to make it as a parameter. So, the way it is calculated, it gives a kind of a "perfect" period that should be applied to some indicator. ...

Ehlers measures the instantaneous phase within a quadrant by taking the ArcTangent of the ratio of the Quadrature (Q1) and the InPhase (I1) components. He smoothes the Q1 & I1 with an ema (alpha=0.15) and resolves the ArcTangent ambiguity for quadrants. He then takes the difference of the ratio and calculates the number of bars it takes to add up to 360 degrees (1 cycle). He then smooths this again with an ema (alpha=0.25) to make it look better (introducing a 3 bar lag).

Phase (waves) - Wikipedia, the free encyclopedia

https://ccrma.stanford.edu/~jos/st/In_Phase_Quadrature_Sinusoidal.html

Total lag through the phase accumulation cycle period measurement consists of 6 bars for the first EMA, 7 bars lag to compute the original InPhase and Quadrature components and one full cycle of this accumulation process. Therefore the total lag is 16 bars plus one full-cycle period. Since the dominant cycle period is a relatively slowly varying function of time, this lag may be acceptable in many situations.

Mladen can you make a display mode that shows the Quadrature and InPhase components? (a bit like display mode 2 of the iPolyCycle).

16 bars + 1 cycle is a bit too much... Let's try to gather some ideas to reduce this delay: differencing, nonlag, integrals, slopes...

 

And maybe while we are back in Ehlers' cycles territory, seeing the Dual Differentiator would be nice...

 

MrM

That is the exact formula used in Phase accumulation (from the 2 pages you attached)

The only deviation in code (apart from adjustable number of cycles - introduced to make it more flexible) is that Ehlers limits phases addition loop to 40 while I don't do that, and that he uses EMA 3 smoothing at the end (my bad when I said 7, you are right the final smoothing is EMA 3) but I decided not to use any smoothing at all as default (filter set to 1) so no additional lag in the default settings To use smoothing he uses simply set the filter to 3. All the rest is the same as in the original

And yes, dual differentiator will be nice (when finished)

 

Mladen

In the photo are:

2 Phase accumulation ema.mq4

o

1 Phase accumulation ema.mq4 and 1 Phase accumulation.mq4

Files:
 

avgs

Phase accumulation avgs. sw just the avgs. indicator controlled by phase accumulation!In the gbpjpy have the cycles set at 8 and 4 using LSMA and filter=7. Pretty much the same for gbpusd except cycles at 9.5 and 4.75 and filter=10.

Files:
Reason: