• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawRegion seems to be inefficient

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

    DrawRegion seems to be inefficient

    I have an indicator that colors the regions between 13, 50, 100 and 200 EMAs. All works fine except when market moves very fast, I can see that NT7 has trouble keeping up and locks up for a few seconds. With some experiments, I've realized, the DrawRegion is causing the issue. Is there anyway to color between EMA more efficiently?

    #2
    Hello afshinmoshrefi,

    Thanks for your question.

    The DrawRegion drawing tool would be the easiest and supported way to color a region between EMA's.

    You could try coloring the region yourself through custom plotting, but I would not be able to provide further direction for doing so other than pointing out the "CustomPlotSample" example indicator that is included with NinjaTrader 7. The method used for custom plotting is undocumented. I also would not be able to comment on the significance of performance changes you could achieve as the drawing tools in NT7 are closed source.

    If there is anything else I can do to assist, please let me know.
    JimNinjaTrader Customer Service

    Comment


      #3
      Afshinmoshrefi. I experienced the same problem. It's very heavy on the CPU if the regions are run OnBarClose=False. There are a couple of ways I use to lighten the load. You can try using OnBarClose=False only on the smallest region e.g. 13/50. For 50/100 and 100/200 you could set it to TRUE. Another possibility is to determine which EMAs in a 5Min DataSeries correspond to the 1Min ones. There's a formula for EMAs somewhere in the forum from Harry that lays out how to convert EMAs from one timeframe into another. Then use the colored regions of the 5Min DataSeries in a 1Min chart, set OnBarClose=TRUE. Hope this gives you at least a couple of ideas if you had not thought of these yet.

      sandman

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by learningnt, Today, 08:47 AM
      0 responses
      28 views
      0 likes
      Last Post learningnt  
      Started by alikair, 12-08-2016, 07:28 AM
      4 responses
      1,555 views
      0 likes
      Last Post vjsworld  
      Started by Pooh123, Today, 05:06 AM
      0 responses
      5 views
      0 likes
      Last Post Pooh123
      by Pooh123
       
      Started by joemiller, Today, 03:32 AM
      0 responses
      2 views
      0 likes
      Last Post joemiller  
      Started by joemiller, Today, 03:30 AM
      0 responses
      0 views
      0 likes
      Last Post joemiller  
      Working...
      X