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 Mindset, 04-21-2026, 06:46 AM
            0 responses
            44 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            54 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            34 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            95 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            57 views
            0 likes
            Last Post PaulMohn  
            Working...
            X