Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

My indicator is keep adding Rectangle into the chart

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

    My indicator is keep adding Rectangle into the chart

    Hello, my indicator is adding a Rectangle into chart when the last bar closed. But later, I found that every time the bar got updated, my indicator add a new Rectangle in the same place. It is slow down the system after a while.

    I tried to use " RemoveDrawObjects();", but it didn't help. Maybe I put it in wrong place. How to fix it?



    protected override void OnBarUpdate()
    {

    if (CurrentBar == ChartBars.Count - 2)
    {
    Draw.Rectangle(,,,,,,,,,, Brushes.Yellow, Brushes.Yellow, 5);
    }
    }

    #2
    Hello LadGta2018,

    Thank you for your post.

    Could you provide your entire Draw.Rectangle statement? Without seeing that there's no way to tell what's occurring.

    Thanks in advance; I look forward to assisting you further.

    Comment


      #3
      Originally posted by NinjaTrader_Kate View Post
      Hello LadGta2018,

      Thank you for your post.

      Could you provide your entire Draw.Rectangle statement? Without seeing that there's no way to tell what's occurring.

      Thanks in advance; I look forward to assisting you further.


      Thanks for your help, I figured it out by my self.

      I need to use List.clear() to clear my list.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      44 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      56 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      35 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      95 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      57 views
      0 likes
      Last Post PaulMohn  
      Working...
      X