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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    38 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    14 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    22 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X