When I draw horizontal line on my chart I'd like to see Y-value too

Created at 10 Aug 2019, 13:01
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
VO

volkov.alexandro

Joined 01.02.2019

When I draw horizontal line on my chart I'd like to see Y-value too
10 Aug 2019, 13:01


Couldnt find such a feature in API.

Can you give me any hint, please

Thanks in advance,

Alexander


@volkov.alexandro
Replies

PanagiotisCharalampous
12 Aug 2019, 09:22

Hi Alexander,

Thanks for posting in our forum. To achieve this you can use Chart.DrawText() function and print the Y Value as text. 

Best Regards,

Panagiotis


@PanagiotisCharalampous

volkov.alexandro
12 Aug 2019, 10:06

Thanks for your reply, Panagiotis.

That's not exactly what I want. When I draw horizontal line, I dont care about time bars. I'd prefer to see Y-value somewhere in the middle of the chart, not connected to any bars. For example, just above the line, adjusted horizontally in the middle, left or right of my chart


@volkov.alexandro

PanagiotisCharalampous
12 Aug 2019, 10:10

Hi Alexander,

There is no out of the box feature for this. You will need to develop it yourself. This is why I proposed Chart.DrawText(). If you want the text to be printed in a static position, you can use Chart.DrawStaticText.

Best Regards,

Panagiotis


@PanagiotisCharalampous

volkov.alexandro
12 Aug 2019, 10:34

But DrawStaticText doesnt support X-Y coordinates, just alignment from sides of the whole chart.

I cant realize, how can I develop it without API.


@volkov.alexandro