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

Slope Differentiation



PureBytes Links

Trading Reference Links

I need a small bit of help. I know how to code the slope of a moving
average by direction
up or down. i.e.. through the following:

Slope=X-X[1];

If X > X[1] then Slope=1;
If X < X[1] then Slope=-1;

What I would like to know is how do I make further differentiation in
the slope change, such that if the slope is greater or less than a
specific angle (for example  say 30 degrees ) than that Slope change
will define my slope direction?

I have tried the following but  think there might be a more efficient
and precise way to do this.

If Slope > PctgUp then Slope=1;
If Slope < PctgDn then Slope=-1;
If Slope < PctgUp and Slope> PctgDn then Slope=0;

Thanks in advance.