Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawRegion vs Indicator plot overlaid

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

    DrawRegion vs Indicator plot overlaid

    hi, I'm using DrawRegion to plot a shaded area on my chart the boundaries of which are given by two different Timeseries. Is it significantly more computationally intensive than to use, lets say, just indicator plots ?

    I'm trying to improve the overall performance of my indicator suite and checking everything I can think of.

    thanks in advance for your help

    #2
    buylosellhi, adding more visuals with the drawn region would impact performance comparing to plots solely, but as long as you update the newly drawn region using the same tag id, you should be fine.

    Comment


      #3
      hi Bertrand, thanks for your reply. this may be the reason why my charts are slow and my ninja session under 'Processes' (in Windows Task Manager) seems to 'grow' as the day moves on. Currently, this is how I'm doing it

      if (line1[0]>=line2[0])
      {
      DrawRegion(CurrentBar.ToString()+"Shaded Up",1,0,line1,line2,upColor,upColor,5);
      }

      so does this mean its drawing another region on top of existing regions ?

      Comment


        #4
        Correct, this would create a # of DrawRegions as you use a new tag for each then thus having more and more objects in memory. If you modify this to update the existing one going forward it would be better for your performance.

        Comment


          #5
          yes, thanks for that.
          just verified it as well - ugh !!

          Comment


            #6
            now I'm having a different issue - its only plotting a slice of the region for the current bar. I've taken off the "CurrentBar.ToString()" from DrawRegion(...) command so I think its making only one object but how do I see as a region going back all the bars ?
            thanks again for your help...

            Comment


              #7
              Yes, that would be expected unfortunately as you basically created the historical portion with lots of 'mini' draw regions tied together in your old code, you would need to update the current draw region for every bar that the condition is true and so minimize the # of regions used to accomplish this task - a sample technique is shown here - http://www.ninjatrader.com/support/f...ead.php?t=3419

              Comment

              Latest Posts

              Collapse

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