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

  • sandman
    replied
    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

    Leave a comment:


  • NinjaTrader_Jim
    replied
    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.

    Leave a comment:


  • afshinmoshrefi
    started a topic DrawRegion seems to be inefficient

    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?

Latest Posts

Collapse

Topics Statistics Last Post
Started by benmarkal, Yesterday, 12:52 PM
3 responses
22 views
0 likes
Last Post NinjaTrader_Gaby  
Started by helpwanted, Today, 03:06 AM
1 response
17 views
0 likes
Last Post sarafuenonly123  
Started by Brevo, Today, 01:45 AM
0 responses
11 views
0 likes
Last Post Brevo
by Brevo
 
Started by aussugardefender, Today, 01:07 AM
0 responses
6 views
0 likes
Last Post aussugardefender  
Started by pvincent, 06-23-2022, 12:53 PM
14 responses
244 views
0 likes
Last Post Nyman
by Nyman
 
Working...
X