Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting drawing objects associated/anchored to current bar?

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

    Getting drawing objects associated/anchored to current bar?

    Hi everyone - I've been using the streamwriter to print the OHLC and other indicator values to a text file. However, I also have custom drawing objects anchored to some of my bars. From the documentation I've seen on drawing objects it seems to be all dealing with getting drawing objects and THEN finding info about it (i.e. anchor price, time, etc.). Is it possible to do the reverse? For example, for a specific bar (such as the current bar), check to see if a drawing object is anchored to it and if so, get the drawing object name and info?

    Example
    sw.WriteLine(Time[0] + "," + Open[0] + "," + High[0] + "," + Low[0] + "," + Close[0] + "," + EMA(21)[0] + "," + DrawObjects[0]);

    Adding the DrawObjects[0] doesn't work since it expects the tag name but hopefully that illustrates what I am trying to do. Any help would be appreciated. Thanks!

    #2
    Hello veetotheone,

    Thank you for your post.

    No, you would need to loop through the drawing objects collection and check the properties of the drawing objects retrieved. There would not be a way to check a specific bar directly to see if there are drawing objects anchored on it.

    Please let us know if we may be of further assistance to you.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    566 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    547 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X