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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    54 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    25 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    17 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    24 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X