Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by fx.practic, 10-15-2013, 12:53 AM
    5 responses
    5,406 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by Shai Samuel, 07-02-2022, 02:46 PM
    4 responses
    98 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by DJ888, Yesterday, 10:57 PM
    0 responses
    8 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    160 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Yesterday, 09:29 PM
    0 responses
    9 views
    0 likes
    Last Post Belfortbucks  
    Working...
    X