NexusFi: Find Your Edge


Home Menu

 





Reducing CPU load of NinjaTrader


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 14 posts (17 thanks)
    2. looks_two aslan with 5 posts (5 thanks)
    3. looks_3 tulanch with 3 posts (0 thanks)
    4. looks_4 Big Mike with 3 posts (0 thanks)
      Best Posters
    1. looks_one RJay with 3 thanks per post
    2. looks_two Fat Tails with 1.2 thanks per post
    3. looks_3 aslan with 1 thanks per post
    4. looks_4 Tarkus11 with 0.7 thanks per post
    1. trending_up 16,364 views
    2. thumb_up 29 thanks given
    3. group 7 followers
    1. forum 37 posts
    2. attach_file 3 attachments




 
Search this Thread

Reducing CPU load of NinjaTrader

  #31 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,372

What I do for some of indicators is, I skip some cpu intensive logic if appropriate, when new bars start printing less then 1-3 seconds apart. In some indicators I only call draw methods or certain calculation methods, only when the chart is scrolled horizontally, or the scale changes vertically, or sometimes only if the chart is visible, depending on what the code does.

Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
What broker to use for trading palladium futures
Commodities
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Quantum physics & Trading dynamics
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Cheap historycal L1 data for stocks
Stocks and ETFs
 
  #32 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,470 since Jun 2009
Thanks Given: 33,249
Thanks Received: 101,669


gkinlaw View Post
Here's an image of the task mgr with 2 cpu's running, I get spike's now instead of capping off at 25%. Also yesterday I found that I was recording data in Jan 1. and I cut that off. Bet that used up some cpu.

thanks for you replies!!

Your image did not come through. Click on the word screenshot in my post to learn how to attach images.

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #33 (permalink)
 tulanch 
Salt Lake City, UT
 
Experience: Intermediate
Platform: SC, NT, MT
Broker: AMP
Trading: NQ ES YM Bonds
Posts: 265 since Mar 2010
Thanks Given: 50
Thanks Received: 387


bottom line DrawRegion is a CPU pig 256 bars or not

from Windows Resoure Monitor, CPU spike graphs ok, plateaued CPU mesa graphs bad

all I am doing is filling the area between +-2 tick offset of EMA. I ended up creating 2 new datasets to make use of DrawRegion.

I added a parm that if ture use DrawRegion if false use BackGround=color.touse

night and day difference....

while the filled regions looks kwel... I can not afford the CPU hit

to me boils down to form over function, I choose function.

Reply With Quote
  #34 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103


tulanch View Post
bottom line DrawRegion is a CPU pig 256 bars or not

from Windows Resoure Monitor, CPU spike graphs ok, plateaued CPU mesa graphs bad

all I am doing is filling the area between +-2 tick offset of EMA. I ended up creating 2 new datasets to make use of DrawRegion.

I added a parm that if ture use DrawRegion if false use BackGround=color.touse

night and day difference....

while the filled regions looks kwel... I can not afford the CPU hit

to me boils down to form over function, I choose function.

Depends on how you coded it. The impact on the CPU depends on

-> how many regions you draw, if you draw from CurrentBar to CurrentBar - 1, this is the worst solution
-> whether you perform the calculations with each incoming tick or only with the first tick of a bar

Started this thread Reply With Quote
  #35 (permalink)
 tulanch 
Salt Lake City, UT
 
Experience: Intermediate
Platform: SC, NT, MT
Broker: AMP
Trading: NQ ES YM Bonds
Posts: 265 since Mar 2010
Thanks Given: 50
Thanks Received: 387

I'm doing bar close... not every tick...

ultimately goal is to fill area between 9ema 30wma red fill area when 30 on top, green if on bottom...pull back area reminder...

how can one do this other than current bar to current bar - 1 ?

perhaps keep growing the area till it changes ie current bar to current-n thus making 1 region instead of n regions?


other ideas/concepts?

Reply With Quote
  #36 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103


tulanch View Post
I'm doing bar close... not every tick...

ultimately goal is to fill area between 9ema 30wma red fill area when 30 on top, green if on bottom...pull back area reminder...

how can one do this other than current bar to current bar - 1 ?

perhaps keep growing the area till it changes ie current bar to current-n thus making 1 region instead of n regions?

There is a coding example here, how to do it:



But then you should run it in CalculateOnBarClose = true mode. If you want to use the indicator in CalculateOnBarClose = false mode, you should probably select a displacement of 1.

Started this thread Reply With Quote
Thanked by:
  #37 (permalink)
 
RJay's Avatar
 RJay 
Hartford, CT. USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
Posts: 683 since Jun 2009
Thanks Given: 759
Thanks Received: 787


tulanch View Post
bottom line DrawRegion is a CPU pig 256 bars or not

from Windows Resoure Monitor, CPU spike graphs ok, plateaued CPU mesa graphs bad

all I am doing is filling the area between +-2 tick offset of EMA. I ended up creating 2 new datasets to make use of DrawRegion.

I added a parm that if ture use DrawRegion if false use BackGround=color.touse

night and day difference....

while the filled regions looks kwel... I can not afford the CPU hit

to me boils down to form over function, I choose function.

Hi tulanch,

I use draw region a lot. Try changing historic load setting from days to bars and only load 200 to 500 bars.

Also, remember historic data stored in NT must be manually deleted.

Same is true with market replay.

If you have not done this cleanup in a while, if ever. Take the time to streamline NT.

That helps NT run without dragging all that old data around.

Lastly, Templates. If you have like 50 templates loaded, move or delete out the ones you are not using.

Templates may be running all the time even when when not loaded to charts.

This puts a huge load on the CPU.

Lastly, do a repair database in NT to compact data.

RJay

Reply With Quote
Thanked by:
  #38 (permalink)
 tulanch 
Salt Lake City, UT
 
Experience: Intermediate
Platform: SC, NT, MT
Broker: AMP
Trading: NQ ES YM Bonds
Posts: 265 since Mar 2010
Thanks Given: 50
Thanks Received: 387

WOW! huge, did I say HUGE difference.....

1.) had it measured in days, now using bars
2.) had 15 templates...removed all but the current

lightning fast now.... can not even tell I pressed F5

thanks again..

Reply With Quote




Last Updated on November 8, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts