Linear Regression Slope Oscillator

Category: Indicators By: TradingDeckard Created: February 7, 2016, 1:48 PM
February 7, 2016, 1:48 PM
Indicators
0 Comments

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.

TradingDeckard Junior
I like scalping SPY, Nature and watch scifi movies :)
Author’s Profile

Comments

Logo Logo
Loading...