Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change Font Size for DrawText

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

    Change Font Size for DrawText

    Hi,
    I use an indicator which draw a line and text for the NYSE Closing Hour. I would like to change the font size of the drawed text to arial 10 (at the moment it delivers the text with font size 14).
    Any idea where and how to set the right parameter?

    Here is the specified passage in the code:

    public class ClosingPrice : Indicator
    {NinjaTrader.Gui.Tools.SimpleFont myFont = new NinjaTrader.Gui.Tools.SimpleFont("Arial", 10) { Size = 10, Bold = false };

    _______________

    if ( close >= 0 ) //Time at or past the Close
    {
    Draw.Text(this, "NYSE Close", userText, (CloseTextHorizontal), o+(CloseTextCenter*TickSize),PlotBrushes[0][0]);
    // Draw.Text(this, "NYSE Close", "Close", (CloseTextHorizontal), o+(CloseTextCenter*TickSize),PlotBrushes[0][0]);
    }
    if ( close <= 0 ) //Time at or past the Close
    {
    Draw.Text(this, "NYSE Close", userText, (CloseTextHorizontal), o+(CloseTextCenter*TickSize), Brushes.Purple);
    }

    Thanks,
    Andre


    #2
    Hello Andre,
    You can use below syntax:
    1. Draw.Text(NinjaScriptBaseowner,stringtag,boolisAut oScale,stringtext,intbarsAgo,doubley,intyPixelOffs et,BrushtextBrush,SimpleFontfont,TextAlignmentalig nment,BrushoutlineBrush,BrushareaBrush,intareaOpac ity)
    2. Draw.Text(NinjaScriptBaseowner,stringtag,boolisAut oScale,stringtext,DateTimetime,doubley,intyPixelOf fset,BrushtextBrush,SimpleFontfont,TextAlignmental ignment,BrushoutlineBrush,BrushareaBrush,intareaOp acity)
    Hope it helps!

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    68 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    150 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    100 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    288 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X