This oscillator is made of the slope of a linear regression over “Length” period. It can be use to measure strength and exhaustion of a trend (actual histogram bar plus or minus the last one).
Slope of LR is also a good short momentum identifier when the slope is at a turning point.
// parameters
// Length = 14
SumBars = Length * (Length-1) * 0.5
SumSqrBars = (Length-1) * Length * (2 * Length-1) / 6
if(barindex>Length) then
Sum1 = 0
SumY=0
MA = average[1](close)
for i=0 to Length-1 do
Sum1 = Sum1+(i*MA[i])
SumY = SumY+(MA[i])
next
Sum2 = SumBars * SumY
Num1 = Length * Sum1 - Sum2
Num2 = SumBars * SumBars - Length * SumSqrBars
endif
RegSlope = 100*Num1/Num2
RETURN RegSlope
No files found.