can a degree be measured?

 

I am wondering is it possible to measure the degree in mql4, I mean I have a moving average that draws dots, connected with a line, I need to be able to measure the degree the line is going up or down? Is that possible ?

Thanks!

 
It's possible with the trigonometric functions.
 

I doubt it's possible... Because the meaning of the angle is pure graphical. And the graphics depend on the window setup.

For example, if you cut a window to half width an angle of an uptrend may go up from 30 degrees to 60 degrees., and if you cut the height to a quarter probably the angle might be smaller than 10 degrees.

What's the right angle then ? There is none.

But you can, however, establish a setup. Use highest and lowest for last N bars,  then find out where the  prices of the 2 points are on this, as percentage. These are the Y values. For the X values, convert the time of the bars into a percentage, to find where the bar is within the last N bars. Once you have the X and Y values you find out the angle. Then lock the indicator, not to update the highest and lowest anymore as the last N bars change... You will get pretty ugly results, but at least the coordinate system won't change...

 

A second meaning of "the angle" is in terms of the time/price grid which may or may not match a visual angle.

Reason: