Setting font size for Text using ninjascript with Simplefont and Draw.Text

I am getting a run around from ninjascript and am constantly getting error messages. Is there a way to set font size when drawing text on a chart?

I keep getting errors trying to set a font size in ninjascript. I tried everything and keep getting errors saying none of 6 / 7/ 8/9/ 10/ 11/ 12 arguments is not good.

I even followed these: https://ninjatrader.com/support/helpguides/nt8/NT%20HelpGuide%20English.html?draw_text.htm but get compile errors.

I tried this: https://ninjatrader.com/support/helpguides/nt8/NT%20HelpGuide%20English.html?simplefont_class.htm and code compiles, but no change in font size when I try different value.

This is the latest error after trying what was suggested on the draw_text web page for NT8 documentation.

NinjaScript File Error Code Line Column
JKHTFHiLoOnLTF.cs No overload for method ‘Text’ takes 9 arguments CS1501 269 23

Here’s the documentation for Draw.Text() which I’m sure you already know. You need to match one of the exact syntaxes provided. If you’re trying to pass the font (not just font size), you’ll need to match one of the last two syntaxes. Otherwise, you’ll get an error.

https://ninjatrader.com/support/helpGuides/nt8/draw_text.htm

Maybe if you post your line 269, I can tell you what’s wrong with it.

1 Like