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

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.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by llanqui, Today, 03:53 AM
    0 responses
    4 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    10 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    14 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    14 views
    0 likes
    Last Post strategist007  
    Working...
    X