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 CaptainJack, 05-29-2026, 05:09 AM
          0 responses
          51 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 05-29-2026, 12:02 AM
          0 responses
          32 views
          0 likes
          Last Post CaptainJack  
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          99 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          177 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          170 views
          0 likes
          Last Post CarlTrading  
          Working...
          X