.

Re: Adaptive Indicators' PaFilter, PaCycles Options & Dominant Cycle

#81
Hi Mladen, Mr. Tools, Jimmy and All,

Within Mladen's indicator, "Dynamic zone pa adaptive Rsx nrp_alerts_lines_divergence nmc.mq4" that I attached below there is the iHilbertPhase() function that calculates the Length variable then the Kg and Hg variables are derived as below.

Code: Select all

double Length = iHilbertPhase(wrkBuffer[r][12],PaFilter,PaCycles,i);
double Kg     = (3.0)/(2.0+Length);
double Hg     = 1.0-Kg;
However, I would like to know what is the instantaneous amplitude, momentum as shown in the image below, plus the phase and the length in bars of the dominant cycle that is calculated by your "Dynamic zone pa adaptive Rsx nrp_alerts_lines_divergence nmc.mq4" indicator. It may be that all those values are already calculated by the iHilbertPhase() function in this indicator but with variable names I don't understand so I don't know what the variables such as Length, Kg and Hg are referring to. So if those values are already calculated then please let me know which variables are actually referring to these 4 values: the instantaneous amplitude, the momentum, the phase and the length in bars of the dominant cycle. Otherwise, can you please add these 4 values to the iHilbertPhase function so the current 4 values can be displayed as a comment, or better than that, as 4 additional buffers so we can know these 4 values at any bar in the past?

My idea is to use these 4 values to understand how much of the current amplitude we have already traveled so far within the current dominant cycle, or more important, how much amplitude is left before we reach the full amplitude so we can know if there are enough pips left to make a good profit, or at least for our trailing stop to break even plus a small profit. Also, with the amplitude and momentum values we can know whether the market is in cycling or trending mode and if trending by how much.

amplitude-momentum.png

Thank you very much Mladen for writing the attached indicator and we hope you or one of your associates can add those 4 values or post the code to add those values to the iHilbertPhase() function. We are looking forward to hearing from you all. Thanks.

Regards,
global
mrtools wrote:
Mon Dec 24, 2018 11:42 am
global wrote:
Mon Dec 24, 2018 8:21 am
Hi Mladen, Mr. Tools, Jimmy and All,

Can someone please explain or point to where I can find an explanation of the indicator options, PaFilter and PaCycles for example in the indicator, "Dynamic Zones pa adaptive SMI correct 2.01" posted previously in this thread here:
viewtopic.php?p=1295127752&sid=ba20b04e ... 1295127752

and in the attached indicator by Mladen dynamic_zone_pa_adaptive_rsx_nrp_alerts_lines_divergence_nmc.mq4

Those two options, PaFilter and PaCycles also appear in many adaptive indicators but unless we understand exactly what they do then it would be just speculation to try to use them effectively. Also do these adaptive indicators automatically find the dominant cycle as explained in Elher's Model in the article "Advanced Adaptive Indicators Theory and Implementation": and in the attached pdf file Elher's Rocket Science Made Easy?

Or, do we have to adjust the two options, PaFilter and PaCycles by trial and error to get the indicator in sync with the dominant cycle? If so, then how can we go about adjusting those two options to sync with the dominant cycle and do we confirm when it's in sync?

The explanations in the article and pdf file are over my head but I would really like to know what relation PaFilter and PaCycles have to those explanations so I can use them with understanding. In other words, exactly what are we adjusting with those two options. Please forgive me for my ignorance on these things but we have to start from somewhere. Thanks.

dz_pa_rsx.gif
Can't explain it better than Mladen, this is his explanation:::

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: Ehlers 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

And more from him

Theory :

The Hilbert Transform itself, is an all-pass filter used in digital signal processing. By using present and prior price differences, and some feedback, price values are split into their complex number components of real (inPhase) and imaginary (quadrature) parts.

This version :

We are using the Hilbert transform in a phase accumulation mode in order to calculate how many bars are needed to accumulate enough one bar "inPhases" to reach the desired cycle. That way it adjusts / adapts to the market conditions. As such you can not adjust the parameters to get a "classical" counterpart - simply it is not going to be as anything based on fixed periods and one should forget classical periods term for this one and get used to the cycles term
Image
Dynamic zone pa adaptive Rsx nrp_alerts_lines_divergence nmc.mq4
(27.04 KiB) Downloaded 102 times


Re: Adaptive Indicators' PaFilter, PaCycles Options & Dominant Cycle

#82
I am not able to pick up the divergence areas via the thin lines on chart (because of other chart indicators ). I have tried to get the divergence price and indicator trendlines to be thicker but cannot see how to do it.
These, I believe, are the line of code involved.
Thanks
TEAMTRADER

Code: Select all

 if (divergenceOnChartVisible)  DrawPriceTrendLine("h",Time[currentPeak],Time[lastPeak],High[currentPeak],High[lastPeak],divergenceBearishColor,STYLE_SOLID);
         if (divergenceOnValuesVisible) DrawIndicatorTrendLine("h",Time[currentPeak],Time[lastPeak],values[currentPeak],values[lastPeak],divergenceBearishColor,STYLE_SOLID);
      }
      if(values[currentPeak] > values[lastPeak] && High[currentPeak] < High[lastPeak])
      {
         if (divergenceOnChartVisible)  DrawPriceTrendLine("h",Time[currentPeak],Time[lastPeak],High[currentPeak],High[lastPeak], divergenceBearishColor, STYLE_SOLID);
         if (divergenceOnValuesVisible) DrawIndicatorTrendLine("h",Time[currentPeak],Time[lastPeak],values[currentPeak],values[lastPeak], divergenceBearishColor, STYLE_SOLID);
      }
Dynamic zone pa adaptive Rsx nrp_alerts_lines_divergence nmc.mq4
(27.06 KiB) Downloaded 28 times

Re: Adaptive Indicators' PaFilter, PaCycles Options & Dominant Cycle

#83
TEAMTRADER wrote:
Tue Oct 01, 2019 1:56 am
I am not able to pick up the divergence areas via the thin lines on chart (because of other chart indicators ). I have tried to get the divergence price and indicator trendlines to be thicker but cannot see how to do it.
These, I believe, are the line of code involved.
Thanks
TEAMTRADER

Code: Select all

 if (divergenceOnChartVisible)  DrawPriceTrendLine("h",Time[currentPeak],Time[lastPeak],High[currentPeak],High[lastPeak],divergenceBearishColor,STYLE_SOLID);
         if (divergenceOnValuesVisible) DrawIndicatorTrendLine("h",Time[currentPeak],Time[lastPeak],values[currentPeak],values[lastPeak],divergenceBearishColor,STYLE_SOLID);
      }
      if(values[currentPeak] > values[lastPeak] && High[currentPeak] < High[lastPeak])
      {
         if (divergenceOnChartVisible)  DrawPriceTrendLine("h",Time[currentPeak],Time[lastPeak],High[currentPeak],High[lastPeak], divergenceBearishColor, STYLE_SOLID);
         if (divergenceOnValuesVisible) DrawIndicatorTrendLine("h",Time[currentPeak],Time[lastPeak],values[currentPeak],values[lastPeak], divergenceBearishColor, STYLE_SOLID);
      }
On this one you can change the width,style and color, just remember if you want to use something instead of STYLE_SOLID your width will have to be 0 or 1.
Dynamic zone pa adaptive Rsx nrp alerts lines divergence nmc.mq4
(27.57 KiB) Downloaded 69 times


  1. Similar Topics

    1. Blau- TSI (mtf+ diver+ alerts) Crashes

      2 Replies 492 Views

      by forexdemogod, Wed Dec 19, 2018 3:54 am in Trading Platform Discussion

      2 Replies
      492 Views
    2. TDI indicators for MT5

      0 Replies 1935 Views

      by Jimmy, Wed Feb 20, 2019 8:50 pm in MT5 Indicators

      0 Replies
      1935 Views

Return to “MT4 Indicators”

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], CommonCrawl [Bot], Facebook [Bot], FLEXI2202, Forex, Google [Bot], kam44, mrtools, okolitrem, schumdl, slingamc, talaate, teodosy87, tiatatta, waleed060 and 59 guests