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 rc5781, Today, 06:40 AM
    5 responses
    26 views
    0 likes
    Last Post backtester831  
    Started by tkaboris, Yesterday, 01:42 PM
    5 responses
    13 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by llanqui, Today, 05:56 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by setardiff, Yesterday, 04:07 PM
    3 responses
    21 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by goodknight777, Today, 07:09 AM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X