Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Removing last draw object, but not all of them?

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

    Removing last draw object, but not all of them?

    Hi, How would I be able to remove just my last draw object, but not all of them.

    If ( User Defined)
    {
    Draw.Text(this, "PVolD" + CurrentBar.ToString(), false,
    Convert.ToString(PowerPlay(Brushes.Transparent, Brushes.Transparent)[1]), 0,
    High[0]+2*TickSize, 0, Brushes.Black, myFont, TextAlignment.Center,
    Brushes.Transparent, Brushes.Transparent, 2);

    RemoveDrawObject("PVolD"+ (????????));
    }


    Thanks, Woody.

    #2
    Hello Woody,

    Thanks for your post.

    When you write your text, store the current bar number in another int variable (maybe called myLastBar).

    For example:

    DrawText (all your stuff....);
    myLastBar = CurrentBar;


    Then to remove:

    RemoveDrawObject ("PVold"+myLastBar);

    Alternatively, instead of you using CurrentBar to create a unique tag name, create and use an integer counter that is increment each time you draw text to create the unique tag name and this way the integer counter will have the last value used.

    Comment


      #3
      Thanks Paul. That did the trick. Very, Very helpful. Thanks again, Woody!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      24 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      15 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      9 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      10 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      17 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X