I can use ObjectGetValueByShift() to get the values of the channel's main line. But how do I get values of the second line? Is it possible at all?
Calculating using linear equation formula based on time yields incorrect results due to non-linear time change in the chart.
Really ? what did you expect ? code ?
"Linear Regression Channel consists of two parallel lines, equidistant up and down from the line of linear regression trend. The distance between frame of the channel and regression line equals to the value of maximum close price deviation from the regression line."
So you mean an Equidistant Channel ?
It has 3 coordinates . . . draw one on your chart manually, see what the 3rd coordinate is used for.
Thanks but I know what the 3rd coordinate is used for. It helps little in finding out the value (price) of the second line at some given shift.
It could be calculated for cases when the 3rd coordinate is located at current bar or earlier. But it seems impossible for cases when the third coordinate is placed somewhere in the future part of the chart.
The lines are parallel, so the price difference between the lines is constant. Get the price difference between the 3rd coordinate and the other coordinate that is at the same time and you have the price offset between the lines . . . . isn't that what you need ? add this offset to the value of the ObjectGetValueByShif() and you have the value of the 2nd line at a specific bar number. Job done.
All you needed to do was draw a channel manually on a chart and investigate it's "properties", where the coordinates are, how they relate to each other. It's pretty simple.