Return the LinearRegression value of selected price over the last N periods.
Syntax:
1 |
LinearRegression[N](price) |
This indicator represents the buyers and sellers who trade away from the equilibrium price.
The equilibrium could be compared to this lenearRegression line.
In order to limit extreme prices relative to thisequilibrium price it is worth plotting the raff channel which will represent the straight Linear Regression line and two supposed extreme lines to represent maximum variations.
Suggestion:
You could use this script in ProBuilder to display the Linear Regression Oscillator. You should make a copy pasting in ProBuilder REM Linear Regression
a=LinearRegression[10](close)
REM close
b=close
REM linear Regression Oscillator
c=b-a
return c
Example:
1 2 3 4 5 6 7 |
lasthigher = Highest[20](high) higherB = LinearRegression[20](lasthigher) lastlower = Lowest[20](low) lowerB = LinearRegression[20](lastlower) center = (higherB+lowerB) / 2 RETURN higherB as "Higher Band", lowerB as "Lower Band", center as "Center" |