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 SantoshXX, Today, 03:09 AM
      0 responses
      6 views
      0 likes
      Last Post SantoshXX  
      Started by DanielTynera, Today, 01:14 AM
      0 responses
      2 views
      0 likes
      Last Post DanielTynera  
      Started by yertle, 04-18-2024, 08:38 AM
      9 responses
      41 views
      0 likes
      Last Post yertle
      by yertle
       
      Started by techgetgame, Yesterday, 11:42 PM
      0 responses
      12 views
      0 likes
      Last Post techgetgame  
      Started by sephichapdson, Yesterday, 11:36 PM
      0 responses
      2 views
      0 likes
      Last Post sephichapdson  
      Working...
      X