Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing Rectangle on Bar

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

    Drawing Rectangle on Bar

    Hi,

    Im hoping someone can assist here. I'm currently using Renko bars for trading.
    I've developed a simple indicator that shows how much a bar would need to move to get a new renko bar (green or red). It includes the Pips required to move and the Price that a new bar will be created on.

    Here's my issue, while the indicator logic works fine, the visual part of it is misaligned with the current bar.

    I've tried several approaches:
    Using "bars ago" draws the rectangle from the middle of the previous bar to the current bar
    Using "Start/End Date" allows me more control but I still cant get it the full width of the bar and it also does not resize.

    I've attached a screenshot of both issues and my desired result. I'm sure it must be something simple I'm missing - can anyone point me in the right direction?

    Thanks.
    Attached Files

    #2
    Hello spook202,

    Likely you are using Draw.Rectangle() which is designed to be drawn from the center of a bar to the center of another bar.

    To draw a rectangle the way you are presenting, this would require custom rendering in OnRender() using custom x and y values converted from the bar times.

    Below is a link to an example called ClickDraw to assist in getting started with custom rendering.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chelsea, got it working with your links

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      649 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      370 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      109 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      574 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      576 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X