My goal is to chart a line consisting of the last points for each bar of the LinearRegression() function. This can be done using, for example, the ema() function.
LinearRegression() function behaves differenly. Examples:
middleLinearReg(20,1) returns a line of 20 poits ending with bar 0
middleLinearReg(20,1,0) returns nothing
middleLinearReg(20,1,-15) returns a line of 20-15=5 points ending with bar 0
middleLinearReg(20,1,-19) returns a single point for bar 0
middleLinearReg(20,1,10) returns a line of 20 points ending with bar -10.
How can I construct a stetement that will achieve my goal?
contrary to what the functional reference says about this function, the function does not return a single value for a bar specified in the nBarIndex parameter.
Thank you
dtrosty
LinearRegression() function behaves differenly. Examples:
middleLinearReg(20,1) returns a line of 20 poits ending with bar 0
middleLinearReg(20,1,0) returns nothing
middleLinearReg(20,1,-15) returns a line of 20-15=5 points ending with bar 0
middleLinearReg(20,1,-19) returns a single point for bar 0
middleLinearReg(20,1,10) returns a line of 20 points ending with bar -10.
How can I construct a stetement that will achieve my goal?
contrary to what the functional reference says about this function, the function does not return a single value for a bar specified in the nBarIndex parameter.
Thank you
dtrosty
Comment