Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawText being placed behind Bars

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

    DrawText being placed behind Bars

    Using DrawText at shown below

    DrawText("MP" + CurrentBar, false,"-", 1, ((High[1] + Low[1]) /2),0, Color.Blue, new Font("Verdana", 20.0f), StringAlignment.Center,Color.Transparent,Color.Tra nsparent, 0);

    To draw a "-" at the midpoint of a bar. But the +-+ is being placed behind the bars so you can barely see it, as shown below

    World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


    How do you get it to be drawn in front of the bars

    #2
    Hello,

    Thank you for the question.

    This is known as the ZOrder.

    Essentially the chart bars are actually drawing on top of the indicators drawing object, to resolve this there is actually no supported way of setting the ZOrder from script but there is a quick fix in the chart.

    Simply select either the chart bars or the indicators plot so it is selected. Next using the Shift key and scroll wheel, hold shift and scroll with your mouse. You should see a small text box appear next to the cursor listing the z level. You can scroll until you see the bars go behind the other objects.

    Please let me know if I may be of additional assistance.

    Comment


      #3
      Originally posted by rwbil View Post
      Using DrawText at shown below

      DrawText("MP" + CurrentBar, false,"-", 1, ((High[1] + Low[1]) /2),0, Color.Blue, new Font("Verdana", 20.0f), StringAlignment.Center,Color.Transparent,Color.Tra nsparent, 0);

      To draw a "-" at the midpoint of a bar. But the +-+ is being placed behind the bars so you can barely see it, as shown below

      World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.

      How do you get it to be drawn in front of the bars
      Perhaps I remember this correctly. Please try making ZOrder a very big number. For example, in Initialize():
      ZOrder = 40000;
      Try changing the number until you have topmost texts.

      Cheers,
      Pi
      ninZa
      NinjaTrader Ecosystem Vendor - ninZa.co

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      142 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      81 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      125 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      119 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      98 views
      0 likes
      Last Post CarlTrading  
      Working...
      X