Indicator Text
Indicator Text
23 Jun 2021, 09:29
How to draw indicator output as text in the indicator area?
ChartObjects.DrawText("text", indicator_output, StaticPosition.Center, Colors.Black);
works perfectly but is obsolete and states to use Chart.DrawStaticText but this
Chart.DrawStaticText("text", indicator_output, VerticalAlignment.Center, HorizontalAlignment.Center, Color.Black);
draws the text on the chart...
Thanks
Replies
amusleh
23 Jun 2021, 16:50
Hi,
Use IndicatorArea instead of Chart for drawing:
IndicatorArea.DrawStaticText("text", indicator_output, VerticalAlignment.Center, HorizontalAlignment.Center, Color.Black);
@amusleh
Xammo
23 Jun 2021, 19:10
ThankYOU!! I did see IndicatorArea but couldn't get it to work but just tried it again after seeing your reply by replacing the word Chart leaving the .drawstatictext there and I see now there are two IndicatorArea options to chose from and the other one only gives .Equals and something else but whatever it works! Thank you (spent far to long trying/failing to figure that out!)
Also thanks khoshroomahdi I did see your post and was hoping it might help but ended up wondering why you had gone to such lengths to draw text on the chart when it is a one liner but am sure you have your reasons why you want to do it that way :) which I've never considered before/might come in useful in the future and all good knowledge to have for different ways of doing things - thanks!
@Xammo
IRCtrader
23 Jun 2021, 12:17
look atthis post. i use this code to to add text with parameter on main chart not indicator area. but it might be a clue for you.
cTDN Forum - show text on chart (user select color and position of text) (ctrader.com)
@IRCtrader