How to get Angle value at given Index bar from OBJ_TRENDBYANGLE
-
Read the documentation. You create the object by setting the angle. You read back the angle the same way.
-
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!
-
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.
-
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.)
-
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
-
Hi
anyone can please guide me how to get angle value of the trend line drawn using OBJ_TRENDBYANGLE ?
I did search the forum but failed to get any article on this.
You should know you need to post your attempt if you need coding help ;-)
And "Trend by angle" has been discussed a lot of time on this forum.
-
Read the documentation. You create the object by setting the angle. You read back the angle the same way.
-
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!
-
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.
-
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.)
-
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
-
Thanks William
Seems going for Angle will be more complicated then my present skills. I will stay with your suggestion of Slope :)
Hi
anyone can please guide me how to get angle value of the trend line drawn using OBJ_TRENDBYANGLE ?
I did search the forum but failed to get any article on this.