[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Linear Regression Slope



PureBytes Links

Trading Reference Links

Thanks to all who suggested the Linear Regression Slope to determine the
angle at which a moving average is rising or falling.

FYI, I use a proprietary MA that turns "sideways" during a price channel and
trends up or down during price trends.  Using the Linear Regression Slope
was an attempt to define "sideways".

I came up with the following EL formula that defines "sideways" as a
difference of less than .03 points between the previous close and the
current close.  When the MA is trending up or down with prices, the MA is
Yellow.  When the MA is trending sideways, the MA is black.

    If ((Value1[1] + .03) < Value1) or ((Value1[1]-.03) > Value1) then
        SetPlotColor(2, Yellow)
        Else

    If (Value1[1]>= Value1 [2]-.03 and Value1[1] <= (Value1 + .03)) then
    SetPlotColor(2, Black);

It seems to work well.

Gerald Marisch