Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

erasing Draw objects

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

    erasing Draw objects

    I have an indicator that plots text and an entry line on the current bar when there is a possible entry.

    if (blaa blaa blaa)

    {
    DrawText(
    "MyText"+CurrentBar, "possible", 0, High[0] - (TickSize*Bars.Period.Value + (TickSize*2)), Color.Blue);
    DrawLine(
    "MyLine"+CurrentBar, 1, High[0] - (TickSize*Bars.Period.Value + TickSize), 0, High[0] - (TickSize*Bars.Period.Value + TickSize), Color.Blue, DashStyle.Solid, 4);
    }


    Once the bar completes, how do I erase the above line and text from displaying on the chart?

    Thanks


    #2
    Originally posted by velocity View Post
    I have an indicator that plots text and an entry line on the current bar when there is a possible entry.

    if (blaa blaa blaa)

    {
    DrawText(
    "MyText"+CurrentBar, "possible", 0, High[0] - (TickSize*Bars.Period.Value + (TickSize*2)), Color.Blue);
    DrawLine(
    "MyLine"+CurrentBar, 1, High[0] - (TickSize*Bars.Period.Value + TickSize), 0, High[0] - (TickSize*Bars.Period.Value + TickSize), Color.Blue, DashStyle.Solid, 4);
    }


    Once the bar completes, how do I erase the above line and text from displaying on the chart?

    Thanks

    Velocity,

    Can you do something like "if first tick of new bar", update text and line to "empty".

    RJay
    RJay
    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

    Comment


      #3
      Something like:

      if (new blaa blaa blaa)

      {
      RemoveDrawObject("MyText");
      RemoveDrawObject("MyLine");
      }

      Comment


        #4
        Originally posted by terratec View Post
        Something like:

        if (new blaa blaa blaa)

        {
        RemoveDrawObject("MyText");
        RemoveDrawObject("MyLine");
        }
        Correct, but only if you first use:

        DrawText("MyText", "possible", 0, High[0] - (TickSize*Bars.Period.Value + (TickSize*2)), Color.Blue);

        instead of:

        DrawText("MyText"+CurrentBar, "possible", 0, High[0] - (TickSize*Bars.Period.Value + (TickSize*2)), Color.Blue);
        eDanny
        NinjaTrader Ecosystem Vendor - Integrity Traders

        Comment


          #5
          thanks guys, It worked like a charm.
          Last edited by velocity; 08-22-2009, 12:55 PM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          648 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          369 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          573 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          575 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X