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

Efrain's formula request



PureBytes Links

Trading Reference Links

A few days ago Efrain Pertales asked about calculating if an angle was
greater or less than 90 degrees.

Here are formulas to do that.

Angle at c1 is greater than 90 degrees.

(180-(If(Atan(C-Ref(C,-1),1)>180,(360-Atan(C-Ref(C,-1),1))*-1,Atan(C-Ref
(C,-1),1))+If(Atan(Ref(C,-2)-Ref(C,-1),1)>180,(360-Atan(Ref(C,-2)-Ref(C,
-1),1))*-1,Atan(Ref(C,-2)-Ref(C,-1),1))))>90

Angle at c1 is less than 90 degrees.

(180-(If(Atan(C-Ref(C,-1),1)>180,(360-Atan(C-Ref(C,-1),1))*-1,Atan(C-Ref
(C,-1),1))+If(Atan(Ref(C,-2)-Ref(C,-1),1)>180,(360-Atan(Ref(C,-2)-Ref(C,
-1),1))*-1,Atan(Ref(C,-2)-Ref(C,-1),1))))<90



In order to calculate the angle I had to assign a numerical value for
the difference between dates.  I assigned a one for simplicity.  If you
wish this to be something else then you can change all number 1's,
except those within the Ref statements.  You may want to use (H-L) in
place of the 1's.  This would allow the formulas to match to different
issues easier.  We wrote them with 1's for generic reasons.

Both the indicators will plot a one or a zero if they are true or not.


Equis Support