Download MetaTrader 5

How can I know CChartObjectTrend 's angle?

To add comments, please log in or register
HongDi s& t development co.,ltd.
1606
hongbin fei  
I create CChartObjectTrend by code, How can I know CChartObjectTrend 's angle?
Andriy Moraru
1261
Andriy Moraru  
What do you mean by "angle"? And how do you plan to use it? Do you understand that the angle you see on the chart between trend line and horizontal line depends on such things as vertical scale and horizontal zoom levels?
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Types - Documentation on MQL5
Alain Verleyen
Moderator
32008
Alain Verleyen  
codeidea:
I create CChartObjectTrend by code, How can I know CChartObjectTrend 's angle?

From documentation :

Properties

 

Angle

Gets/Sets property "Angle"

HongDi s& t development co.,ltd.
1606
hongbin fei  
Angle one for this class: CChartObjectTrendByAngle , I use class CChartObjectTrend
Documentation on MQL5: Standard Library / Classes for Graphic Objects / Objects Lines / CChartObjectTrendByAngle
Documentation on MQL5: Standard Library / Classes for Graphic Objects / Objects Lines / CChartObjectTrendByAngle
  • www.mql5.com
Standard Library / Classes for Graphic Objects / Objects Lines / CChartObjectTrendByAngle - Documentation on MQL5
Alain Verleyen
Moderator
32008
Alain Verleyen  
codeidea:
Angle one for this class: CChartObjectTrendByAngle , I use class CChartObjectTrend
And why not use the first one if you need to work with angle ?
HongDi s& t development co.,ltd.
1606
hongbin fei  
angevoyageur:
And why not use the first one if you need to work with angle ?
only know the price and time to create CChartObjectTrend, I need the angle as result
Alain Verleyen
Moderator
32008
Alain Verleyen  
codeidea:
only know the price and time to create CChartObjectTrend, I need the angle as result
For the last time, please read the documentation and try it, you have to use CChartObjectTrendByAngle !
HongDi s& t development co.,ltd.
1606
hongbin fei  

I have got it:

atan((price1-price2)/Bars(time1 to time2))

To add comments, please log in or register