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 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 bmartz, 03-12-2024, 06:12 AM
      5 responses
      32 views
      0 likes
      Last Post NinjaTrader_Zachary  
      Started by Aviram Y, Today, 05:29 AM
      4 responses
      13 views
      0 likes
      Last Post Aviram Y  
      Started by algospoke, 04-17-2024, 06:40 PM
      3 responses
      28 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by gentlebenthebear, Today, 01:30 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by cls71, Today, 04:45 AM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X