Finding coordinates for a trendline
Finding coordinates for a trendline
14 Mar 2019, 08:14
Hi,
After drawing a trendline on chart, I can find the object with chartobject.findallobjects. But I can't find it's coordinates, starting point and final point (bar number and price value). I've tryed some functions but I'm not so good in programming... :(
Any idea how can I do this?
thx
Replies
iulianalinchiru
14 Mar 2019, 10:41
Yes, but I get only this options for the found objects
https://ctrader.com/api/reference/chartobject
I am doing something wrong...
@iulianalinchiru
PanagiotisCharalampous
14 Mar 2019, 10:47
Hi iulianalinchiru,
You need to cast the object to a ChartTrendLine. See below
var trendline = (chartObject as ChartTrendLine);
Best Regards,
Panagiotis
@PanagiotisCharalampous
iulianalinchiru
14 Mar 2019, 10:48
Done while you writting. :)
Thx mate! Great support!
@iulianalinchiru
PanagiotisCharalampous
14 Mar 2019, 09:47
Hi iulianalinchiru,
Trend line coordinates are kept in Time1, Time2 and Y1, Y2 properties. See here.
Best Regards,
Panagiotis
@PanagiotisCharalampous