Get Angle in CChartObjectTrendByAngle

 

Hi Guys,

Metatrader 5 

Version: 5.00 Build 1940

02 nov 2018


I Created a trend line by angle like it:

#include <ChartObjects\ChartObjectsLines.mqh>

CChartObjectTrendByAngle trend;

trend.Create(0,"HowGetAngle",0,time1, price1, time2, price2));

When I try get a angle:

double trend_angle = trend.Angle();

I get 90.0 even if I change points coordinates like it.

trend_angle.SetPoint(0,new_time1,new_price1);
trend_angle.SetPoint(2,new_time2,new_price2);

I read many times this documentation: https://www.mql5.com/en/docs/standardlibrary/chart_object_classes/obj_lines/cchartobjecttrendbyangle

Thanks

Documentation on MQL5: Standard Library / Graphic Objects / Line Objects / CChartObjectTrendByAngle
Documentation on MQL5: Standard Library / Graphic Objects / Line Objects / CChartObjectTrendByAngle
  • www.mql5.com
Standard Library / Graphic Objects / Line Objects / CChartObjectTrendByAngle - Reference on algorithmic/automated trading language for MetaTrader 5
 
MT4 but should be similar. Please check if that helps.
Is there a solution to get angle value on OBJ_TRENDBYANGLE by code?
Is there a solution to get angle value on OBJ_TRENDBYANGLE by code?
  • 2018.04.08
  • www.mql5.com
Dear experts, @Alain Verleyen @whroeder1 To this day, I am still wondering why the angle value remains zero when I create the OBJ_TRENDBYANGLE obje...
 
Alain Verleyen:
MT4 but should be similar. Please check if that helps.

Excellent, Thanks