Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Default Font for Draw.Text

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Default Font for Draw.Text

    Hello,
    I created a custom indicator that identifies certain chart characteristics and labels bars accordingly. I use a Draw.Text statement in the form
    Code:
    Draw.Text(NinjaScriptBase owner, string tag, string text, int barsAgo, double y, Brush textBrush)
    On my charts the text displays in a standard font, which I assume is the default, but when a colleague uses the indicator on his chart, it displays with a large, bold font. Where are the parameters for the default draw text font held, so that he can change them to a normal size?

    Thanks

    #2
    Just use own font instead of default.
    ninjatrader.com/support/helpGuides/nt8/draw_text.htm

    Code:
    NinjaTrader.Gui.Tools.SimpleFont myFont2 = new NinjaTrader.Gui.Tools.SimpleFont("Courier", 20) { Bold = true };
    Draw.Text(this, CurrentBar.ToString(), false, "test", 1, High[1] + 5 * TickSize, 0, Brushes.Linen, myFont2, TextAlignment.Center, null, Brushes.Magenta, 20);

    Comment


      #3
      Thanks.
      Yes I'm aware I can do that, but I would still like to know where the default font parameters are stored and how they can be modified.

      Comment


        #4
        Hello Scotty33,

        The default fonts that NinjaTrader uses are part of the skin. You can customize the charts fonts using the charts properties window. If you want to specify settings like bold you need to use the overload shown in post 2 to supply a new font with those settings to the drawing object.

        Comment


          #5
          Hello Jesse,
          Thanks for your reply.
          I guess my basic question is that there are several users of the indicator in its current form (i.e. using the overload I mentioned in post 1) but only one user where the Draw.Text uses a much larger, bold font and I would like to understand why.
          If the fonts are part of the skin, are they subject to change with different versions of NinjaTrader? If not, can you explain how he might have acquired a different default Draw.Text font and, more importantly, if it's possible to modify it?

          Comment


            #6
            Hello Scotty33,

            You can have the user change their skin to see if that affects the result. It may also be that they set defaults in the chart and saved those as default. They may have additionally saved a default for the text drawing tool which is being used.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            558 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            324 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            545 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            547 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X