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 cmoran13, 04-16-2026, 01:02 PM
      0 responses
      51 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      31 views
      0 likes
      Last Post PaulMohn  
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      165 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      100 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      160 views
      2 likes
      Last Post CaptainJack  
      Working...
      X