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 port119, Today, 02:43 PM
      0 responses
      1 view
      0 likes
      Last Post port119
      by port119
       
      Started by Philippe56140, Today, 02:35 PM
      0 responses
      2 views
      0 likes
      Last Post Philippe56140  
      Started by 00nevest, Today, 02:27 PM
      0 responses
      1 view
      0 likes
      Last Post 00nevest  
      Started by Jonafare, 12-06-2012, 03:48 PM
      5 responses
      3,986 views
      0 likes
      Last Post rene69851  
      Started by Fitspressorest, Today, 01:38 PM
      0 responses
      2 views
      0 likes
      Last Post Fitspressorest  
      Working...
      X