Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change color drawing tools

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

    Change color drawing tools

    Hi!

    How can I change the color of the text, this is not working

    HTML Code:
                    DrawingTools.Text textDrawing = Draw.Text(this, "Stop" + CurrentBar, "⚫", 0, Close[0]);
                    textDrawing.TextBrush = Brushes.Yellow; // this is not working
                    textDrawing.AreaBrush = Brushes.Transparent;
                    textDrawing.Font = new SimpleFont("Arial", 7);​
    Thanks!

    #2
    Hello xtremel,

    Thanks for your post.

    To set the color of a text drawing object, you could use the Draw.Text() syntax that allows you to specify the Brush textBrush argument.

    Draw.Text(NinjaScriptBase owner, string tag, string text, int barsAgo, double y, Brush textBrush)

    Or, you could create a SimpleFont font object and then use that SimpleFont in the Draw.Text() syntax that allows you to pass in a SimpleFont argument and Brush textBrush argument.

    The syntax that allows you to specify a SimpleFont could be seen below and in the help guide documentation linked below.

    Draw.Text(NinjaScriptBase owner, string tag, bool isAutoScale, string text, int barsAgo, double y, int yPixelOffset, Brush textBrush, SimpleFont font, TextAlignment alignment, Brush outlineBrush, Brush areaBrush, int areaOpacity)

    Draw.Text(NinjaScriptBase owner, string tag, bool isAutoScale, string text, DateTime time, double y, int yPixelOffset, Brush textBrush, SimpleFont font, TextAlignment alignment, Brush outlineBrush, Brush areaBrush, int areaOpacity)


    See the help guide documentation below for more information and sample code.​

    Draw.Text(): https://ninjatrader.com/support/help.../draw_text.htm
    SimpleFont: https://ninjatrader.com/support/help...font_class.htm
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      566 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      330 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
      547 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      548 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X