Author's dialogue. Alexander Smirnov. - page 32

 

I double-checked the formulas for the quadratic regression (in a different, more reliable way). Everything fits, the formulas are correct (apart from my mistake with the formula for QWMA, which I already corrected). Frankly, Korey, I'm stressed by its specific overlaps at extrema. I'll try to draw it myself.

2 Candid: you should overlay 3*LWMA - 2*SMA next to each other and check if they converge. But your code is obviously very smart, it's just like in school.

P.S. So, who is interested in formulas for cubic regression? In general - it's time to introduce new mashups with polynomial weights. Only recurrence formulas to calculate them are not so simple anymore.

 
Mathemat:

2 Candid: you should overlay 3*LWMA - 2*SMA next to each other and see if they match. But your code is obviously not weak like that, it's all fair and square, just like you learned at school.

Then you should take into account that my LR is (High+Low)/2
 
Well yes, you've got it all clearly calculated. I put another buffer in there with a 3*LWMA - 2*SMA difference. It's a match. I still think my way of calculation should be faster, although I haven't checked it... By the way, your value is not drawn on the last bar.
Files:
 
Mathemat:

I double-checked the formulas for quadratic regression (in a different, more reliable way). Everything fits, the formulas are correct (apart from my mistake with the formula for QWMA, which I have already corrected)...


Where can I see the correct formulas?
 
Mathemat:

I double-checked the formulas for the quadratic regression (in a different, more reliable way). Everything fits, the formulas are correct (apart from my mistake with the formula for QWMA, which I already corrected). Frankly, Korey, I'm stressed by its specific overlaps at extrema. I'll try to draw it myself....


Overshoots at large periods from (implicit) differentiation,
if there are no these loops at extrema
- the group phase velocity will suffer.
The advantage is the effect that the accumulation in the indexer is quadratic in nature,
i.e. the overshoots at extrema are smoothed out noticeably and approach a parabola.
The cure for the overlaps is to play with coefficients which are now constant at 10-15/(N+2).
It is time to introduce variables in an adaptive way, separately: period of integration, period of differentiation.
And this may require a smoothness criterion.

 
I don't get it... The HMA seems to be smoother and has less emissions...
 

What is HMA, pisara?

P.S. Found it: 'HMA'. What's the idea behind it?

 
Mathemat:
I still think my way of calculation should be faster, although I haven't checked... By the way, your value is not drawn on the last bar.
I checked it :). On about a million bars your way takes 1844 ms, mine takes 2797. I must admit the result was quite unexpected. Kudos to you! However, I modified Moving Averages.mq4 code to check it, so I, like a true paranoid, insured myself against using native code for embedded nodes.

I don't calculate the zero bar :)
 

2 zigan:

For linear regression, the formula is: LRMA = 3*LWMA - 2*MA

For quadratic regression:

Quadratic Regression MA = 3 * SMA + QWMA * ( 10 - 15/( N + 2 ) ) - LWMA * ( 12 - 15/( N + 2 ) )

Here N is the period of the averages,

QWMA( i; N ) = 6/( N*(N+1)(2*N+1) ) * sum( Close[i] * (N-i)^2; i = 0...N-1 ) (the square-weights machine).

for cubic: oops, still can't get it out of Trading Solutions, my formula is too wild there.

2 Candid: you're really paranoid, I wouldn't have thought of it...

 
Mathemat:

2 Candid: you're a true paranoid, I wouldn't have thought of that...

To finish it off, I added time control to MovingLR_1 and got 1360 and 282828 msec. So, assumption about native code is not groundless.