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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      70 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      152 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      100 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      288 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X