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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      50 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      69 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      36 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      96 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      59 views
      0 likes
      Last Post PaulMohn  
      Working...
      X