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 SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      35 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      12 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      18 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      20 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X