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 gravdigaz6, Today, 11:40 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by MarianApalaghiei, Today, 10:49 PM
      3 responses
      10 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by XXtrader, Today, 11:30 PM
      0 responses
      4 views
      0 likes
      Last Post XXtrader  
      Started by love2code2trade, Yesterday, 01:45 PM
      4 responses
      28 views
      0 likes
      Last Post love2code2trade  
      Started by funk10101, Today, 09:43 PM
      0 responses
      9 views
      0 likes
      Last Post funk10101  
      Working...
      X