Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 alifarahani, Today, 09:40 AM
          3 responses
          15 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by RookieTrader, Today, 09:37 AM
          4 responses
          17 views
          0 likes
          Last Post RookieTrader  
          Started by PaulMohn, Today, 12:36 PM
          0 responses
          2 views
          0 likes
          Last Post PaulMohn  
          Started by love2code2trade, 04-17-2024, 01:45 PM
          4 responses
          38 views
          0 likes
          Last Post love2code2trade  
          Started by junkone, Today, 11:37 AM
          3 responses
          22 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X