Chart.DrawText on each candle

Created at 29 Jun 2019, 12:00
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!
stuart's avatar

stuart

Joined 24.01.2018

Chart.DrawText on each candle
29 Jun 2019, 12:00


I am trying to get Chart.DrawText()  to draw text under each candle. 

but i only get text on the most recent candle  [index]

in Calculate() i have

Chart.DrawText("UPDOWN", i.ToString(), i, MarketSeries.Low[i] - 5, "#8fb300");

 

how do i get it to work on each candle?

 

 


@stuart
Replies

stuart
29 Jun 2019, 12:53

RE:

stuart said:

I am trying to get Chart.DrawText()  to draw text under each candle. 

but i only get text on the most recent candle  [index]

in Calculate() i have

Chart.DrawText("UPDOWN", i.ToString(), i, MarketSeries.Low[i] - 5, "#8fb300");

 

how do i get it to work on each candle?

 

 

I tried the Obsolete ChartObjects.DrawText  and it works as expected.

so why does the new Chart.DrawText not work the same way?

i feel like we are in the dark with these updates.

 

 


@stuart

igorjrmedeiros
18 Jul 2019, 17:13

RE: RE:

stuart said:

stuart said:

I am trying to get Chart.DrawText()  to draw text under each candle. 

but i only get text on the most recent candle  [index]

in Calculate() i have

Chart.DrawText("UPDOWN", i.ToString(), i, MarketSeries.Low[i] - 5, "#8fb300");

 

how do i get it to work on each candle?

 

 

I tried the Obsolete ChartObjects.DrawText  and it works as expected.

so why does the new Chart.DrawText not work the same way?

i feel like we are in the dark with these updates.

 

 

Hi stuart,

Try to do it:

 

Chart.DrawText("UPDOWN" + i, i.ToString(), i, MarketSeries.Low[i] - 5, "#8FB300");

The first parameter is the name to your instance. Try it.

I am considering that your index is the "int i".

 

Best Regards,


@igorjrmedeiros

john_7ko
26 May 2020, 10:00

RE: RE: RE:

how do you get the "#8fb300" number? 


@john_7ko

PanagiotisCharalampous
26 May 2020, 11:52

Hi john_7ko,

You can use this site to get color hex codes.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous