ChartTrendLine getting angle
ChartTrendLine getting angle
28 Oct 2024, 04:08
Would it be possible for us to get the algo of how the ChartTrendLine calculates the angle it shows. I can set ShowAngle to true and it gives me the exact angle I want, but for the life of me I cant seem to create code that will produce the same results. I would rather not have to draw a trendline and then remove it and even if I could do that, the angle is not a property that is exposed. Any help with this would be wonderful. Thank you!
Replies
firemyst
29 Oct 2024, 06:55
Keep in mind that regardless of how Spotware/cTrader calculate the angle, the angle will vary depending on the chart's zoom level horizontally / vertically.
It will also change as more bars appear to the right or if you scroll the chart back to the left as cTrader automatically scales the chart.
@firemyst
jstewartcenter
29 Oct 2024, 22:29
RE: ChartTrendLine getting angle
PanagiotisCharalampous said:
Hi there,
There is no way get this information via the API. The angle is calculated based on the screen's pixels
Best regards,
Panagiotis
Thank you. This is very helpful.
@jstewartcenter
PanagiotisCharalampous
29 Oct 2024, 06:49
Hi there,
There is no way get this information via the API. The angle is calculated based on the screen's pixels
Best regards,
Panagiotis
@PanagiotisCharalampous