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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      596 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      343 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      556 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      554 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X