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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      70 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      152 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
      100 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      288 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X