Discussion of article "3 Methods of Indicators Acceleration by the Example of the Linear Regression"

 

New article 3 Methods of Indicators Acceleration by the Example of the Linear Regression is published:

The article deals with the methods of indicators computational algorithms optimization. Everyone will find a method that suits his/her needs best. Three methods are described here.One of them is quite simple, the next one requires solid knowledge of Math and the last one requires some wit. Indicators or MetaTrader5 terminal design features are used to realize most of the described methods. The methods are quite universal and can be used not only for acceleration of the linear regression calculation, but also for many other indicators.

Author: Andrew

 

Honestly bajan, about this is already five years as known on the fourth forum.

But I think it will be interesting for beginners.

The article once again shows that statistical methods implemented in standard indicators rule, do not underestimate them.

 
Author's dialogue. Alexander Smirnov. this is the second discussion of this topic, the first one was somewhere in 2006.
. by the way, there are also formulas of second-order regression through mashki.
Диалог автора. Александр Смирнов. - MQL4 форум
  • www.mql5.com
Диалог автора. Александр Смирнов. - MQL4 форум
 
Urain:

Honestly bajan, about this is already five years as known on the fourth forum.

But I think newcomers will be interested.

Yes, the article is oriented more on beginners.

The article once again shows that statistical methods implemented in standard indicators rule, you should not underestimate them.

That's for sure. I think that indicators built into the terminal (iMA, etc.) work fast not only due to the terminal developers' knowledge of optimisation methods, but also due to the fact that they are executed as part of an exe-file. That is, unlike external indicators, it is a full-fledged compilation, not some pi-code. Well, perhaps, they have some direct high-speed access to timers, which is unavailable for external indicators.

I have tried to use non-embedded mashas for convolution method - although they are optimised well, they are much slower than the embedded ones.

Urain:
Author's dialogue. Alexander Smirnov. this is the second discussion of this topic, the first one was somewhere in 2006.
. by the way, there are also formulas for second-order regression via mashki.

Yes, I have seen similar topics. But nowhere was it clear step-by-step how the convolution was obtained. I had to derive all the formulas myself (I wrote several sheets of drafts) to tell all the nuances in the article. There is a tricky point with bar numbering for LWMA, for example.

 
ds2: Yes, I've seen similar threads. But nowhere was it clear step-by-step how the convolution turned out. I had to output all the formulas myself (I wrote several sheets of drafts) to tell all the nuances in the article. There is a tricky moment with bar numbering for LWMA, for example.

Here is the proof. That is, a bit earlier than Urain gave the link.

I don't claim priority :). It is, generally speaking, almost a trivial fact.

P.S. If I haven't forgotten everything, the result of the comparison of velocities was still in favour of the classical calculation - but significantly optimised (the difference is not great, but still; see Candid' a's posts). However, a similar technique applied to higher-order regressions (quadratic, cubic, etc.) seems to be able to show the advantage of the "convolution" method over the classical one.

Диалог автора. Александр Смирнов. - MQL4 форум
  • www.mql5.com
Диалог автора. Александр Смирнов. - MQL4 форум
 

Very good and usefull article but I have one question.

If we use the Moving Totals method is true that the indicator gain a lot of speed but this mean to add 4 auxiliary buffers wich will increase memory consumption.

So the question is wich method is better the Standard method wich use less memory or the Moving Totals method wich use more memory but is faster?

 

Something is wrong in the implementation:

When LRMethod == LR_M_Sum

it turns out that Sx and Sxx are constants:

Sxx = ExtBufSxx[prevbar];

ExtBufSxx [bar] = Sxx;

If this is the case, why the buffers?


Perhaps it will be even faster if you count SMA and LWMA using the moving sum method and count the result as a convolution.

Moreover, it would be good to know the slope of the regression, which can also be calculated via SMA and LWMA.

I implemented it on 4: https://www.mql5.com/en/code/10642

Быстрая LRMA
Быстрая LRMA
  • votes: 3
  • 2012.03.08
  • Vladislav Eremeev
  • www.mql5.com
Написан под впечатлением от статьи "3 метода ускорения индикаторов на примере линейной регрессии". Считает очень быстро.
 

Hi,

,,It creates regression function at each bar (according to the defined number of the last bars) and shows what value should it have at that bar''

But how can I calculate slope of the latest regression line (I know the last point only, which forms the curve)...


Thanks for help

Petr

 

Hello

Thanks for this article. But Could you please tell me how to call your methods inside my MQL5 code? I do not understand how to do it, i don't understand the list of parameters inside your methods. how can i get the value returned by the linear regression at a given moment inside my code after integrating yours?