Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

RemoveDrawObject

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

    RemoveDrawObject

    I have a first "if" that according to a bar closure draws me some pictures. Then I have another "if" independent of this with other conditions. I have added this sequence to erase these two squares that have been generated before and when some conditions are not met, but now to load a chart that has two historical days and that used to take 1 minute now takes 15 minutes ... there are some option to make it faster?

    if ( DrawObjects["PR" + (CurrentBar-1)] == null && DrawObjects["PH" + (CurrentBar-2)] != null && DrawObjects["PH" + (CurrentBar-3)] != null)
    {
    RemoveDrawObject("PH" + (CurrentBar-2));
    RemoveDrawObject("PH" + (CurrentBar-3));
    }

    #2
    Hello anmir55,

    Thanks for your post.

    There will be an expected delay when using RemoveDrawObject which can be exacerbated when called multiple times during historical processing. Heavy use of Drawing objects is also prone to performance issues. I may suggest using SharpDX rendering instead to improve performance.

    I have attached an example that can be used for demonstration. Custom rendering routines would be needed for other kinds of drawings.

    For an introductory look at using SharpDX, I recommend viewing our SampleCustomRender indicator and the documentation below.

    Using SharpDX for Custom Rendering - https://ninjatrader.com/support/help..._rendering.htm

    Please let us know if we can be of further assistance.
    Attached Files

    Comment

    Latest Posts

    Collapse

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