Finding coordinates for a trendline

14 Mar 2019, 08:14Finding coordinates for a trendline#1
iulianalinchiruposts: 10since: 28 Mar 2017

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

14 Mar 2019, 09:47#2
Panagiotis Charalampousposts: 2721since: 13 Jan 2017

Hi iulianalinchiru,

Trend line coordinates are kept in Time1, Time2 and Y1, Y2 properties. See here.

Best Regards,

Panagiotis


Head of Community Management at cTrader
14 Mar 2019, 10:41#3
iulianalinchiruposts: 10since: 28 Mar 2017

Yes, but I get only this options for the found objects

https://ctrader.com/api/reference/chartobject

I am doing something wrong... 

14 Mar 2019, 10:47#4
Panagiotis Charalampousposts: 2721since: 13 Jan 2017

Hi iulianalinchiru,

You need to cast the object to a ChartTrendLine. See below

var trendline = (chartObject as ChartTrendLine);

Best Regards,

Panagiotis


Head of Community Management at cTrader
14 Mar 2019, 10:48#5
iulianalinchiruposts: 10since: 28 Mar 2017

Done while you writting. :)

Thx mate! Great support!