cAlgo: How to drawStatictext using bot?

Created at 22 Mar 2020, 16:20
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!
ZuniSoft's avatar

ZuniSoft

Joined 11.03.2019

cAlgo: How to drawStatictext using bot?
22 Mar 2020, 16:20


I'm writing it as 

            Chart.DrawStaticText("Buylabel", "Buy: "+buyCandles, VerticalAlignment.Top, HorizontalAlignment.Left, Color.LimeGreen);
            Chart.DrawStaticText("selllabel", "Sell: "+sellCandles, VerticalAlignment.Top, HorizontalAlignment.Left,Color.Red);

but second label print on the first label, how i can assign vertical margin.

 


@ZuniSoft
Replies

PanagiotisCharalampous
23 Mar 2020, 09:01

Hi tb135qet13,

There is no such option for this method. you can try Chart.DrawText() instead which allows you to draw text at a specific bar index and price level.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

ZuniSoft
24 Mar 2020, 09:49

RE:

PanagiotisCharalampous said:

Hi tb135qet13,

There is no such option for this method. you can try Chart.DrawText() instead which allows you to draw text at a specific bar index and price level.

Best Regards,

Panagiotis 

Join us on Telegram

 

I appreciate your advice but DrawText is not my requirement it scrolls when chart scroll. I'm trying to write static text on the top left of the screen that does not scroll when chart scroll.


@ZuniSoft

PanagiotisCharalampous
24 Mar 2020, 16:30

Hi tb135qet13,

You will need to program such functionality yourself. You can use ScrollChanged event and the new Chart UI controls which are more flexible and allow you place controls in a position relative to the chart.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous