Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawObjects

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

    DrawObjects

    Hi everyone, I'm working with a custom DOM (Market Depth window), and I draw rectangles method using Draw.Rectangle.

    The issue is that each time Refresh() runs, all existing drawings are removed, and unless the conditions are re-triggered exactly, my rectangles are lost.

    Since the DOM doesn't use OnBarUpdate(), I can't use a more persistent drawing strategy.

    Is there any way to preserve the drawings across Refresh() calls, or re-draw them automatically?

    Here's an example of the code inside Refresh():

    Draw.Rectangle(this, CurrentBar + ".DeepBuyRec", false, 10, Open[0] - TickSize, -200, Close[0] + TickSize, Brushes.Aquamarine, Brushes.Azure, 6);

    Attached Files

    #2
    Hello fersanmito,

    The SuperDOM isn't designed for drawing objects.

    This can show plots from indicators as lines.

    If you have a SuperDOMColumn script you can use the rendering space to custom render WPF shapes.
    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.


    An example of using the render space can be found in the User App Share.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    558 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X