Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawText enhancement

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

    DrawText enhancement

    Hi everyone

    I only recently discovered that you can make DrawText a lot more sophisticated. The following code works very nicely in an indicator of mine:

    DrawText("Text0", true, 0.ToString(), -2, P0, 0, Color.Black, new Font ("Arial", 10, FontStyle.Bold),
    StringAlignment.Center, Color.Black, Color.Yellow, 10);

    This produces a box, with a yellow background, into which the digit just fits.

    What I'd like to do is widen the box, effectively putting a 'space' on either side of the '0' so the box is widened. I've experimented but to no avail.

    I'd much appreciate any suggestions as to how to do this.
    Last edited by arbuthnot; 03-13-2015, 01:06 PM.

    #2
    Hello Arbuthnot,

    This is not possible with the DrawText() but possible with your own custom plotting using the Plot() method.

    You can view a sample of this by going to Tools -> Edit NinjaScript -> CustomPlotSample
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thanks very much, Cal, as always.

      I've had a look at 'CustomPlotSample' and it is super-sophisticated but at least I now know how it can be done - at least, in theory!

      Cheers,

      Ed

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by llanqui, Today, 03:53 AM
      0 responses
      3 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      10 views
      0 likes
      Last Post burtoninlondon  
      Started by AaronKoRn, Yesterday, 09:49 PM
      0 responses
      14 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Yesterday, 08:42 PM
      0 responses
      11 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Yesterday, 07:51 PM
      0 responses
      14 views
      0 likes
      Last Post strategist007  
      Working...
      X