PDA

View Full Version : DrawText


maitreja
08-18-2009, 02:02 AM
Hi,
please help.
I need to fix some text in the possition CenterRight of a chart, as you can see on attached image - possition is marked by red arrow. It must be at right possition of the last bar. Possitions TopRight and BottomRight (TextDrawFixed) are already in use.
How to fix the text if I cannot know, what price will be in the middle of chart?
Thank you
Jaroslav

NinjaTrader_Bertrand
08-18-2009, 06:50 AM
Jaroslav, perhaps it would be better then to work with the DrawText method, as you have then the needed control where the text should be placed exactly - http://www.ninjatrader-support.com/HelpGuideV6/DrawText.html

maitreja
08-18-2009, 07:58 AM
Hi Betrand,
yes, I know this help site and I know I must use DrawText method (see name of topic)
But:

DrawText(string tag, bool autoScale, string text, int barsAgo, double y, double yPixelOffset, Color textColor, Font font, StringAlignment alignment, Color outlineColor, Color backColor, int opacity)

double y - I tried it. It is price on the chart. Ok, if in the middle of my displayed chart is e.g. 1500 today, I can write there 1500. But this price can be 1600 tomorow. How can I recognize, what price is in the middle of displayed chart to change it in indicator?

maitreja
08-18-2009, 08:00 AM
This text must be fixed in the middle of displayied chart not depending on actual price. Fixed like in the method DrawTextFixed

NinjaTrader_Bertrand
08-18-2009, 08:11 AM
Then I would suggest working with DrawTextFixed and using trial and error with those custom string formatting options - http://www.ninjatrader-support2.com/vb/showthread.php?t=4749

maitreja
08-19-2009, 03:08 AM
I am afraid it cannot help. DrawTextFixed positions on the right side are in use by another indicator and I cannot join two indicators together to use "\n" operator.
Jaroslav