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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      83 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      45 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      65 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      69 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      58 views
      0 likes
      Last Post CarlTrading  
      Working...
      X