Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to Update a Line already drawn via a Strategy?

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

    How to Update a Line already drawn via a Strategy?

    Hi,

    Hoping you may be able to help please.

    When certain criteria are met, I draw a dotted line to the Chart and store the Y value and CurrentBar for when the line begins into variables:

    Code:
    Draw.Line(this, "NewLine"+CurrentBar, false, 0, NewLineValue, (0-120),NewLineValue, Brushes.Blue, DashStyleHelper.Solid, 4);
    In subsequent bars when certain conditions are met, I wish to "go back" and update the line to end sooner than the originally planned 120 bars. E.g. 15 bars later something happens, and I wish to cut the already added 120 bar line down to 15 bars.

    Is it possible to update/edit a line that has already been drawn to the chart?

    Many thanks in advance

    ChainsawDR

    #2
    Hello ChainsawDR,

    Thanks for your post.

    Yes, you can redraw the line with new parameters. To do so you would want to save the tag name of the line when it is created and then if/when you update later you can reuse the tag name and this will automatically remove the older line and replace it with the new line with the new properties.

    Comment


      #3
      Works a treat, thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      71 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      43 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      25 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      28 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      56 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X