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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    68 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    151 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    100 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    288 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X