The distance between the frame and the main line in the default Regression Channel

 

No response in Questions from Beginners thread so I'll create a new one, sorry for that!


Hi.

Tell me, please, how is the distance between the borders and the regression line calculated in the default Regression Channel in Metatrader?


Yeah, I know, it is said clearly in the documentation:

>The distance between frame of the channel and regression line equals to the value of maximum close price deviation from the regression line.

Well, it's obviously not true.


On the first image named 'EURUSD, regression residuals by Close.png' you can see the default Regression channels (red) and the ones which I coded myself (green). In Paint, I've drawn the blue bars where the close price deviation from the regression line is maximum, so you don't have to check my code to see that it works correctly, unlike the default one. Also I've drawn the purple bars to show the maximum deviation of the open price which seems more accurate for the default channel.

Well then, maybe it's the value of maximum deviation of the open price from the regression line? On the second image named 'EURUSD, regression residuals by Open.png' you can see that it is not.

Let's remove the first open price from the calculation of residuals, third image named 'EURUSD, regression residuals by Open minus the first bar.png'. Much better, but still not.

Is the last open price redundant too? The fourth image named 'EURUSD, regression residuals by Open minus the first and the last bar.png'. Nope, will not do.

It is also not both open and close prices and definitely not 2.0 standard deviations as someone said somewhere.


So. What is it?


Thank you in advance.

Documentation on MQL5: Constants, Enumerations and Structures / Objects Constants / Object Types / OBJ_REGRESSION
Documentation on MQL5: Constants, Enumerations and Structures / Objects Constants / Object Types / OBJ_REGRESSION
  • www.mql5.com
OBJ_REGRESSION - Object Types - Objects Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 

Good question.

I removed your other duplicated post.