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 NullPointStrategies, Today, 05:17 AM
      0 responses
      41 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      124 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      64 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      41 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X