Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Changing a draw object's second x anchor

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

    Changing a draw object's second x anchor

    Hello, I have an automated strategy that, currently, draws highlights at the significant levels. However, I would like to make them rectangle objects that anchor at creation, and constantly adjust their ending x anchor to bar[0]. Is there some way to change a draw objects second x anchor in this manor? Or if someone has a better idea to achieve this, please let me know.

    Best,

    Ryan Beckmann

    #2
    Hello rbeckmann05,

    That would not be possible in the builder because you cannot use variables for a drawing objects anchors. In order to extend a rectangle would require that you make a variable for the first anchor and then call the drawing method again to update the existing object. You would need to pass in the original anchor so it stays at the original location and then use a new value for the second anchor so it updates the rectangle to be the size you wanted. Calling a drawing object with the same tag name will update the existing drawing object. The builder does not have the ability to use variables for bars ago in the drawing tools menu so this would only be able to be accomplished by unlocking the code.

    Comment

    Latest Posts

    Collapse

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