Calculate angle/degrees of with 2 points of an EMA on mql4

 
Hi all, i'm trying something to programmatically detect how strong/deep a trend is. The maths for it is beyond me, is there anything available within the mql4 lib?
 
Filmon Daniels:
Hi all, i'm trying something to programmatically detect how strong/deep a trend is. The maths for it is beyond me, is there anything available within the mql4 lib?
It is useless to calculate the degree because the scale is always changing so the return values of angles will be irellevant
 
Better think how to calculate the slope
 
yeah appears to be so, i had a look at the related content populated on my post. thanks for the hint!! there seems to be a wealth of info on this also.
 
After a quick dig, I came up with this composite thing

   double slope = (iMA(_Symbol,PERIOD_H1,200,0,MODE_SMMA,PRICE_CLOSE,0)-iMA(_Symbol,PERIOD_H1,200,0,MODE_SMMA,PRICE_CLOSE,1))/Point;
   
   Print("slope=",slope);
   Print("radians=",MathArctan(slope));
   Print("angle=",MathArctan(slope) * 180 / M_PI);

question is validity. I get the slope from a higher timeframe. is it correct for the slope to be a difference between 2 bars, even if it is on a higher timeframe - this doesn't quite make sense to me
 
Filmon Daniels: Calculate angle/degrees of with 2 points of an EMA on mql4
Can't be done.
  1. There is no angle from 2 anchor points. An angle requires distance divided by distance; a unit-less number. A chart has price and time. What is the angle of going 30 miles in 45 minutes? Meaningless!

  2. You can get the slope from a trendline: m=ΔPrice÷ΔTime. Changing the price scale, bar width, or window size, changes the apparent angle, the slope is constant. Angle is meaningless.

  3. You can create an angled line using one point and setting the angle (Object Properties - Objects Constants - Standard Constants, Enumerations and Structures - MQL4 Reference.) The line is drawn that angle in pixels. Changing the axes scales does NOT change the angle (and thus is meaningless.)

  4. If you insist, take the two price/time coordinates, convert them to pixel coordinates and then to apparent angle with arctan.
              How to get the angle of a trendline and place a text object to it? - Trend Indicators - MQL4 programming forum - Page 2

Reason: