All the results from the AB geometric(math) functions return
radians. To convert, use a constant
or use what DTsokakis used in the routine
below . The tan of 45 deg is 1, right? - the ratio of
the
two equal leg lengths. So in Amibroker
the atan(1) - the inverse function, is the equivalent of 45 in
radians.
So 45/atan(1) will give you the constant to multiply your
results in radians to give you degrees.
angle(in radians) * 45/atan(1), or angle(in
radians) * 45/.7854 or angle in radians*
57.30 degrees/radians
Let me know if this works. 57.30 *
linregslope( ) ? Looks reasonable?
BUT, as Graham pointed out before all is not as meets the eye, because your axis scaling on the indicator
chart will significant change the slope you see
visually.
Hope this helps
JOE
(Abbr. tan) Mathematics. The
trigonometric function of an acute angle in a right triangle that is the ratio
of the length of the side opposite the angle to the length of the side adjacent
to the angle.
========================== DT's Code
============================================
/* Suppose you START 50 bars before the last bar AND the END is 20 bars
ago.
for any ARRAY, the angle is
*
/
Start =
Param("Starting Bar", 50,10,122,1);
End =
Param("Ending Bar",30,10,122,1);
// START=50;END=30;
ARRAY=
RSI();
L1=
LastValue(Cum(1));
X0=L1-START;X1=L1-END;
Y0=ARRAY[X0];Y1=ARRAY[X1];
Plot
(ARRAY,"",1,1);
Plot
(LineArray(X0,Y0,X1,Y1),"",4,1);
Plot
(LineArray(X0,Y0,X1,Y0),"",4,1);
ANGLE=
atan((Y1-Y0)/(X1-X0));
Title=
"ANGLE="+WriteVal(ANGLE)+" RADS"+", ["+WriteVal(45*ANGLE/atan
(
1),1.0)+" DEGS]";