Linear regression channel - page 2

 
Nikolai Semko:

HH I wrote that the loop is only needed once during initialisation.

Initially it is about the channel. Ring buffers allow you to calculate the middle of a channel in a single pass. But not the width.

 
fxsaber:

Initially, it is about the channel. Ring buffers allow you to calculate the middle of a channel in a single pass. But not the width.

Implemented with width as well

 
Nikolai Semko:

Don't believe it at all.
Rashid has dumped the articles. Read them carefully. There is a link to another article there:
https://www.mql5.com/ru/articles/270

If you use your 7th-8th grade maths skills, you can get the standard deviation to get the channel, not just the sliding average, in a similar way without a cycle. I have this implemented for a polynomial of any degree, not just the first degree (linear regression). You can feel it in the demo version on the marketplace.

SZY I wrote that loop is needed once at initialization.

Thousands of times faster - this includes the calculation of the standard deviation (i.e. channel width)

Again and read the question carefully.

 
"Nikolai Semko:

implemented with width as well.

Let's take a classical LR. Let a[i] and b[i] be the coefficients of the LR line. These values are obtained via "previous" through rings.

But RMS[i] is not obtained through the rings in any way.

 
Dmitry Fedoseev:

Read the question again and carefully.

Define it:

Dmitry Fedoseev:

And even without the x*y summation loop? What if x and y are not straight lines?

 
fxsaber:

Let us take the classical LR. Let a[i] and b[i] be the coefficients of the LR line. These values are obtained through the previous ones through the rings.

But RMS[i] is not obtained through the rings in any way.

Yes. That too.

It's possible to cheat in calculations. Calculating squares of difference between ma and data we can use difference between data and our ma... how can I explain this quickly)) The end result is like a true RMS... The same can be done with correlation. But it wouldn't be the same formulas.

 
Nikolai Semko:

Decipher that:

This is what should have been proved

 
fxsaber:

Let us take the classical LR. Let a[i] and b[i] be the coefficients of the LR line. These values are obtained through "previous" through rings.

But RMS[i] is not obtained through the rings in any way.

they do.
I can't link to Market products according to forum rules, but download the free DEMO version. Press shift and move the mouse to change the period and you will see what you get. Even ifthe number of bars in the window is unlimited.

 
Dmitry Fedoseev:

This is what should have been proved

how can a variable be a straight line?
Please express yourself correctly.

 
Dmitry Fedoseev:

Yes. That too.

When calculating, you can cheat. By calculating the squares of the difference between ma and data use the difference between the data and your ma... how do I explain this quickly)) The end result is like a true RMS... The same can be done with correlation. But it wouldn't be the same formulas.

Pearson, indeed, is easily accelerated. But not the width of the LR channel, unfortunately.

Reason: