![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Dec 2007
Location: Atlanta
Posts: 281
Thanks: 0
Thanked 4 times in 3 posts
|
The links for the "The type of Font used (reference)" are broken for both DrawText and DrawTextFixed. So I went searching for some examples on the MSDN site and came up empty (my lack of knowledge).
What is the correct syntax for the Font Parameters in DrawText(.............., Color textColor, Font font, StringAlignment .....); Thanks. |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Something like this
private Font textFont = new Font("Arial", 12);
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Aug 2007
Posts: 38
Thanks: 0
Thanked 0 times in 0 posts
|
if i try print something with this new Font variable i get an invalid expression term, can you complete the code segment for me:
DrawText("My text" + CurrentBar, "Hello World", 0, Low[0] -20 * TickSize, Color.Red, Font textFont); |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
try something like
... , textFont);
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Oct 2007
Location: Florida
Posts: 94
Thanks: 0
Thanked 0 times in 0 posts
|
Hello:
I have tried the suggestions in this Thread to get Color, Font, etc. to compile. However, I continually get the dreaded: "No overload for method 'DrawTextFixed' takes '4', '5', etc. arguments. Should the line "Private Font textFont..." be in just the Variable section, or also Initialize, etc. Please advise. Thanks. Tony. |
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
tonyh,
Please post up everything you have. We have no idea what you have typed out right now. Thanks.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Member
Join Date: Oct 2007
Location: Florida
Posts: 94
Thanks: 0
Thanked 0 times in 0 posts
|
Hello Josh:
After experimenting, I found out that all options in DrawTextFixed must be included. I was leaving out things such as opacity in the statement. I had assumed one could just include the options that were desired. Thanks. Tony. |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Jun 2008
Posts: 28
Thanks: 0
Thanked 0 times in 0 posts
|
I am trying to get the following example to work on my chart.
I get an error message that 10 is out of range, so I change to 0, and nothing happens. DrawText("tag1", "Text to draw", 10, 1000, Color.Black); Could someone please explain exactly what 10 is? and how is the Y coordinate defined? I mean is it a pixel location on the chart, or or based on price? Sorry, I just confused. Thanks |
|
|
|
|
|
#9 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
10 is on which bar back you want to draw on. Y-coordinate is based on price.
http://www.ninjatrader-support.com/H.../DrawText.html If you call 10 bars back you need to ensure you have 10 bars on your chart first. Please see this tip: http://www.ninjatrader-support2.com/...ead.php?t=3170
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DrawTextFixed() requests | Lost Trader | General Programming | 2 | 04-27-2008 05:00 PM |
| DrawTextFixed | BradB | Indicator Development | 4 | 04-18-2008 08:12 PM |
| DrawTextFixed not update as expected | goover | General Programming | 2 | 03-04-2008 08:19 PM |
| DrawTextFixed | rt-trader | General Programming | 5 | 01-21-2008 10:46 PM |
| DrawTextFixed | Lost Trader | General Programming | 6 | 01-20-2008 12:32 AM |