ChartObjects.DrawText Obsolete

Created at 16 May 2019, 12:32
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!
sifneos4fx's avatar

sifneos4fx

Joined 15.11.2017

ChartObjects.DrawText Obsolete
16 May 2019, 12:32


Hello Panagiotis

The code bellow prints text on top center of the screen. 

ChartObjects.DrawText("Buy", buy_score.ToString() + "  ▲", StaticPosition.TopCenter, Colors.Green);

However I got some warings:

Error CS0618: 'cAlgo.API.Internals.Algo.ChartObjects' is obsolete: 'Use Chart instead.'

Error CS0618: 'cAlgo.API.Internals.ChartObjects.DrawText(string, string, cAlgo.API.StaticPosition, cAlgo.API.Colors?)' is obsolete: 'Use Chart.DrawStaticText instead.'

Error CS0618: 'cAlgo.API.Internals.ChartObjects.DrawText(string, string, cAlgo.API.StaticPosition, cAlgo.API.Colors?)' is obsolete: 'Use Chart.DrawStaticText instead.'

Any suggestions?

Thank you 

Patrick


@sifneos4fx
Replies

PanagiotisCharalampous
16 May 2019, 12:39

Hi Patrick,

I am not sure what suggestions do you need. The warnings are clear. You shoud use  Chart.DrawStaticText() instead.

Best Regards,

Panagiotis


@PanagiotisCharalampous

sifneos4fx
16 May 2019, 12:43

RE:

oops, sorry about that, somehow I missed this "Use Chart.DrawStaticText"!

Thank you

PAtrick

 

 

Panagiotis Charalampous said:

Hi Patrick,

I am not sure what suggestions do you need. The warnings are clear. You shoud use  Chart.DrawStaticText() instead.

Best Regards,

Panagiotis

 


@sifneos4fx