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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    44 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    58 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    35 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    95 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    59 views
    0 likes
    Last Post PaulMohn  
    Working...
    X