Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw.Text Info Being Removed OnBarUpdate

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

    Draw.Text Info Being Removed OnBarUpdate

    I am drawing text (double value) above the previous bar. The text gets removed when a new bar is created OnBarUpdate and I want the text to remain. This is something that I have fixed in the past by putting in a counter. That fix is not working this time. Do you have any suggestions?
    Thanks
    Les P

    Draw.Text(this, "tag10"+countGrn, false, " "+CBoxDelta[1] , 1, High[0] + 2*TickSize, -2, PlotBrushes[0][0], myFont , System.Windows.TextAlignment.Center, Brushes.Transparent, null, 1);

    #2
    Hello lesterboles,

    Thanks for your post.

    There can only be one draw object per tag name on the chart, when you reuse the tag name the function is to remove the previous version and replace it with the latest version of the draw object. This is the design of the system.

    You can keep all your objects on the chart by assigning a unique tag name which is what you are doing with your counter.

    I would suggest using a Print statement prior to the draw statement to ensure that the counter is actually counting. Print (Time[0]+" Counter value = "+countGrn);

    An alternate way to create unique tag names, on a once per bar basis, is to use +CurrentBar, IE: "tag10"+CurrentBar.

    Comment


      #3
      Thanks Paul_H, will give it a shot.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      67 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      150 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      99 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      287 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X