Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ageeholdings, Today, 07:43 AM
      0 responses
      2 views
      0 likes
      Last Post ageeholdings  
      Started by pibrew, Today, 06:37 AM
      0 responses
      4 views
      0 likes
      Last Post pibrew
      by pibrew
       
      Started by rbeckmann05, Yesterday, 06:48 PM
      1 response
      14 views
      0 likes
      Last Post bltdavid  
      Started by llanqui, Today, 03:53 AM
      0 responses
      6 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      12 views
      0 likes
      Last Post burtoninlondon  
      Working...
      X