Adaptive lookback indicators - page 8

 

Mrtools thanks for the great indicator, but it is CPU intensive ,any chance to fix this?Thanks.

 

As promised, here is the Dual differentiator too

There are some thing that has to be told :

I do not know if it is just my edition of "Rocket Science for Trades", but in my edition there are 2 errors in the tradestation code for Dual differentiator. First one regards one step of smoothing :
I2 = .15*I2+.75*I2[1]; Q2 = .15*Q2+.75*Q2[1];
That is an error - either the 0.15 is wrong or the 0.75 is wrong. From the rest of the code I decided to use 0.15 and 0.85 (since in the rest of the code that smoothing was used - it is an equivalent of EMA smoothing with period (filter) set to 12.3333...)

Also, a couple of lines later, condition : Value1 > .01 it will never be true (values of Value1 are much less than .01) so instead decided to add one more parameter (the minimalTestValue which is set to 0 by default in which case the condition is always true, but if one wants to experiment with it through the minimalTestValue parameter now it is possible)

After these changes, this is what Dual differentiator looks like

and compared to Homodyne discriminator

Files:
dd.gif  24 kb
dd_-_hd.gif  24 kb
 
biddick:
Mrtools thanks for the great indicator, but it is CPU intensive ,any chance to fix this?Thanks.

Not having that problem here, and usimg it on a bunch of pairs along with some other things but will look into it some more, did find one problem though, the Linear weighted ma wasn't working, but fixed that in this version.

 

Mladen ,

A suggestion: I was analysing this Metastock add on product it says ; dynamic look-back functionality based on volatility, cycle, or a combination of both. So can you add volatility look back functionality based on jurik bands(actually it looks very similar to your asymmetric ema bands) ?Just an idea.Thanks

Files:
 

spotforex

The non lag ma first. Try it out.

I added the adaptive lookback period calculation to igorads version (so did not change the rest of the code) Tried to make it not so processor hungry (there is a rather good part of code executed whenever the period changes) and as far as I see it works OK. Also, due to the nature of NonLagMA minimum period is (internally) limited to 3, otherwise a zero divide error is generated and NonLagMA calculation is not possible
Compare it - I am not sure that the result is what you expected (here is an example of an 1 hour chart where at a certain period there was a strong trend - since the alb will adapt and the values tend to be long in trends - here is a comparison of alb NonLagMA with (orange) 25 period NonLagMa (blue - since the period for 5 swing alb varies from 6 to 33 (at the bottom it is visible) I compared these lengths instead of default 9 that NonLagMa uses))
If there is no such a long trend then the speed of the alb version is as fast or faster in some cases as the original 9 period (so actually very fast) NonLagMA. So if you wanted the one that will slow down in trends, you got it if in other hand you expected it to be faster all the time - it will be sometimes, but not all the time. It depends on price changes and trends
regards

Mladen

spotforex:
Hi mladen,

Would you kindly convert these two NonLagMAs into alb indicators with speed control. Now there's an oxymoron, nonlag with speed control!

I noticed in igorad's version (NonLagMA_V7.1) that he has a filter option and the histogram version (NonLagMA-H) does not. Could you add that option too.

Thanks, as always, for all your wonderful work.

-spotforex
Files:
 

And now the histo version :

There was a reason why the percent filter was left out. There is a difference in calculation compared to igorads version : for long Lengths the difference tends to be very small but for shorter Lengths it can grow. Anyway made 2 new indicators : the "new" versions of nonlagma with percent filters added and 2 new ones with adaptive look-back period calculation and percent filter (here are a 1 hour 1 pct ones on a 15 minute chart)
regards

Mladen

 

Mladen,

another way to get variable look-back is with Empirical Mode Decomposition. I have seen that you coded it already on this post (at least the translation into mql4 of the Ehlers interpretation). Now.. I've done a bit of reading on this interesting topic, and the author of the HHT (Hilbert-Huang Transform: what EMD is based on) claims that this spectral analysis method works better than classic Fourier analysis because contrary to the DFT it doesn't need linearity and stationarity.

Here's an interesting video where Norden E. Huang (the inventor) explains it: in short, he does a basis expansion with a technique he calls Intrinsic Mode Function, on which he applies the Hilbert Transform to get instantaneous frequency: wikipedia

If possible I would like you to do a modification showing the Period, Amplitude and Phase (like you did with HT.mq4). The only difference between these 2 will be the basis expansion with IMF's. This can be a good way to see if this expansion works better than only a HT. If you want I can send you some information on EMD & IMF's. Ideally you would be able to decide the number of iterations also (# IMF's). Can this be done?

And also: can you edit the HT.mq4 so that it has a fourth mode showing the in-phase and quadrature components?

 

alb & NonLagMA

mladen,

Thank you for your quick response! You've gone beyond what I had expected.

With Affection,

-spotforex

 
MrM:
Mladen,

another way to get variable look-back is with Empirical Mode Decomposition. I have seen that you coded it already on this post (at least the translation into mql4 of the Ehlers interpretation). Now.. I've done a bit of reading on this interesting topic, and the author of the HHT (Hilbert-Huang Transform: what EMD is based on) claims that this spectral analysis method works better than classic Fourier analysis because contrary to the DFT it doesn't need linearity and stationarity.

Here's an interesting video where Norden E. Huang (the inventor) explains it: in short, he does a basis expansion with a technique he calls Intrinsic Mode Function, on which he applies the Hilbert Transform to get instantaneous frequency: wikipedia

If possible I would like you to do a modification showing the Period, Amplitude and Phase (like you did with HT.mq4). The only difference between these 2 will be the basis expansion with IMF's. This can be a good way to see if this expansion works better than only a HT. If you want I can send you some information on EMD & IMF's. Ideally you would be able to decide the number of iterations also (# IMF's). Can this be done?

And also: can you edit the HT.mq4 so that it has a fourth mode showing the in-phase and quadrature components?

Here Intrinsic time-scale decomposition: time–frequency–energy analysis and real-time filtering of non-stationary signals — Proceedings A is improvement of the EMD method...

 

Thank you for posting that link....very interesting. It would be nice to have a full featured spectrum analyzer for metatrader that would avoid some of the problems of FFT. I used to use a tool many years ago called the cycle pack by Chris Kryza written for E-signal which worked very well (within the limitations of FFT) for trading ES minis. It was very easy to chose and fix the starting point and the projections were useful, especially with daily and weekly data.

I have played around with this Spectrometr_Separate - MQL4 Code Base over the last week and setting the start date 46 days back to the November 4 high produced a decent map of the price action on EURUSD D1. Could be by chance I have no idea. Regardless, the problem I have with tools that attempt to extract the dominant cycle when there are so many cycles at play is that the dominant cycle might not be the most tradable cycle at any one time. The best fit often happens when two or more smaller cycles peak at the same time and this is lost with tools like mesa etc that try and extract an ideal cycle from a noisy time series.

Reason: