Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        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
              BertrandNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Waxavi, Today, 02:00 AM
              0 responses
              2 views
              0 likes
              Last Post Waxavi
              by Waxavi
               
              Started by elirion, Today, 01:36 AM
              0 responses
              4 views
              0 likes
              Last Post elirion
              by elirion
               
              Started by gentlebenthebear, Today, 01:30 AM
              0 responses
              4 views
              0 likes
              Last Post gentlebenthebear  
              Started by samish18, Yesterday, 08:31 AM
              2 responses
              9 views
              0 likes
              Last Post elirion
              by elirion
               
              Started by Mestor, 03-10-2023, 01:50 AM
              16 responses
              391 views
              0 likes
              Last Post z.franck  
              Working...
              X