Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issue With Global Drawing Object

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

    Issue With Global Drawing Object

    I've developed a drawing tool that essentially draws a horizontal ray. Once the DrawingState for the tool is set to Normal (indicating the tool is finished being built), I initiate a BarsRequest to subscribe to a data feed. The data feed is monitored, and the horizontal ray stops extending to the right when the market price "hits" it. This functionality works perfectly when the tool is added to the chart.

    However, if I change the properties of the drawing tool to make it global, it appears that the original object is terminated, and a new global instance is created. This results in the loss of the subscription to the data feed, and the functionality of monitoring the ray is disrupted.

    How can I manage the transition to a global object while maintaining the subscription and ensuring the tool continues to function as intended?

    #2
    Hello SystemTrading,

    Drawing objects are only intended to be used with the bars array they are attached to so doing more complex steps like you are would not be supported.

    The correct method to use to subscribe to data would be to use GetAttachedToChartBars. That allows you to connect with the bar series the object is attached to in order to get prices.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    571 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    331 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
    549 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    550 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X