Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

"Undraw"a dot?

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

    "Undraw"a dot?

    Hello,

    I am using a Wingding dot to signify something occurring. However, because I'm using update "on price change," sometimes the thing which occurs doesn't stay there for very long, and it actually disappears by the time the bar closes.

    My code:

    NinjaTrader.Gui.Tools.SimpleFont wingdings = new NinjaTrader.Gui.Tools.SimpleFont("Wingdings", 20) { Size = 20, Bold = true };

    if ((slo[0] + slh[0])/2 > 0 && (slo[1] + slh[1])/2 < 0)
    {
    Draw.Text(this, "up arrow"+CurrentBar, true, "l", 0, Low[0] - ATR(14)[0], 0, Brushes.GhostWhite, wingdings, TextAlignment.Center, Brushes.Transparent, Brushes.Transparent, 100);
    }

    [the letter "l" in Wingdings is a dot.]

    Is there a way for me to "undraw" this dot? Would you have any recommended approach?

    [I was thinking about using some type of time signal to determine if the event reverses in the same bar and then drawing a black dot or something to cover up the ghost-white dot.]

    Please let me know if there is a way to undraw the dot and your thoughts. Thanks!

    #2
    Hello catinabag,

    Thanks for your post.

    You can remove an individual draw object with RemoveDrawObjects("tagname"); Reference: https://ninjatrader.com/support/help...drawobject.htm

    What you could do is use IsFirstTickOfBar as a trigger to evaluate the conditions that the just closed bar [1] ended up with and draw or remove as the data at that point would not change (just like OnBarClose). Reference: https://ninjatrader.com/support/help...ttickofbar.htm

    Comment


      #3
      Thanks! This helps a lot.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      647 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
      572 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      573 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X