Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Implement Draw.Rectangle condition on the entire graph

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

    Implement Draw.Rectangle condition on the entire graph

    Hi everyone!

    I have implemented a condition using a instruction in a OnBarUpdate, I want each time a specific condition is repeated, draw a rectangle.

    The problem is only draws it, on the last candle, I can´t get it to repeat the instruction on the entire graph backwards.

    Any ideas to help me.?

    Thanks in advance.

    #2
    Hello BIOK.NT,

    Thanks for your post.

    To accomplish this you would need to provide a unique name for the Tag parameter when calling Draw.Rectangle(). CurrentBar could be used to make a Tag name unique.

    For example: the Tag name could be something like "rectangle" + CurrentBar.

    Draw.Rectangle(this, "rectangle" + CurrentBar, 10, Low[10] - TickSize, 5, High[5] + TickSize, Brushes.Blue);

    From the Draw.Rectangle() help guide page:

    Tag: A user defined unique id used to reference the draw object.

    For example, if you pass in a value of "myTag", each time this tag is used, the same draw object is modified. If unique tags are used each time, a new draw object will be created each time.


    See this help guide page for more information about Draw.Rectangle(): https://ninjatrader.com/support/help..._rectangle.htm
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    650 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
    577 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X