Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Global lines and rectangles with RenderTarget?

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

    Global lines and rectangles with RenderTarget?

    I am looking for the optimal way to draw a line via script and assign it globally to all charts for the instrument. I currently use RenderTarget for some lines, but do not see a way to make those lines global using the SharpDX toolset. Do I need to use the drawing tool for Draw.Line then? And if so, does that need to go in OnBarUpdate, instead of OnRender?

    I am calculating an SMA on an hourly chart. I tried adding the Draw.Line to an existing script (which calculates and plots the values I want on the hourly chart), and at first it seemed to work. But then the global line failed to update as the SMA updated for the next hour, even though the Draw.Line command was in OnBarUpdate. Can you provide some guidance?

    #2
    Hello jculp,

    Thanks for your post.

    Yes, you would need to use the Draw methods, in OnBarUpDate() using the overloads that provide the IsGlobal parameter. Note that you will likely want to do that in conjunction with templates that will allow you to configure the draw object characteristics that the methods using IsGlobal will not allow.

    If a template is not available when the script runs, it will then use the defaults for the particular draw object.

    Comment


      #3
      Thanks, Paul. I do use templates, and after I worked through my DateTime issues, everything is updating and drawing as intended. I appreciate your quick response.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      657 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      373 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      109 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      574 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      579 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X