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

Re: EL question: Calculating slopes



PureBytes Links

Trading Reference Links

The slope of a line is the first derivative (from calculus) evaluated at
point(s) of interest. Simplistically, slope is determined by
constructing a right angle at the point of interest on the curve where
the hypotenuse is tangent to the curve. The slope is then the vertical
change (the height of the triangle) divided by the horizontal change
(the base of the triangle). Thus, slope is a real number that can range
from -Infinity to +Infinity.

That said, the slope of sampled data is a far more challenging issue.
Taking the slope accentuates high frequencies; thus, it is very much
subject to noise. If you have a price plot, you almost certainly would
want to perform some sort of averaging of the data. Also, you would need
to make a judgments about the horizontal (time) interval to be used.
Unlike calculus, which evaluates a derivative at a point of a smooth
curve, sampled data is very noisy. Thus, too short an interval will
produce a lot of noise artifact; too long an interval may average out
events of interest. Thus, only you can make a best guess (using trial
and error?) about the best interval for your data and intended use.

Using the slope of a linear regression line is one of the more popular
and useful techniques. It gives the best fit linear approximation to the
points you're interested in, in a least mean squared error sense. As you
know, linear regression is built into TS. The angle that you can get
from TS is related to the slope trigonometrically; i.e., slope =
tan(angle).

Hope this helps.

Allan
________________________________________________________

Glenn Crumpley wrote:
> 
> What is the best way to determine the slope of a plot?  I've looked at
> the LinearRegAngle and LinearRegSlope functions but I don't know what
> range of results they produce and relative to what. Is the slope a
> decimal?  Is the angle in degrees? Radians?  What angle would be
> calculated for a horizontal line?  Any help appreciated.
> 
> Regards,
> Glenn Crumpley