NexusFi: Find Your Edge


Home Menu

 





Profile your code using Visual Studio 2010


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one gomi with 7 posts (23 thanks)
    2. looks_two Taddypole with 3 posts (0 thanks)
    3. looks_3 Big Mike with 2 posts (0 thanks)
    4. looks_4 DrMatt with 2 posts (0 thanks)
      Best Posters
    1. looks_one gomi with 3.3 thanks per post
    2. looks_two merc with 2 thanks per post
    3. looks_3 whitmark with 1 thanks per post
    4. looks_4 bnichols with 1 thanks per post
    1. trending_up 42,440 views
    2. thumb_up 27 thanks given
    3. group 18 followers
    1. forum 21 posts
    2. attach_file 11 attachments




 
Search this Thread
  #1 (permalink)
 gomi 
Paris
Legendary Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,506

Of course you will need a full blown version of VS2010 to use included profiler.
You can also use a demo version of a commercial product, usually they install as add-ons of Visual Studio.

In VS2010, launch Performance Wizard in Analyze menu.

Use standard settings(CPU Sampling), and select NinjaTrader .exe file.

This starts the profiler, which starts Ninjatrader.

Then do you stuff in NinjaTrader, and stop profiling in VS2010 when you're done. Careful, it will kill your NT session.

You get a graph showing CPU usage ; you can select parts of the graph and click "Filter on Selection" to narrow on a specific part.

If you click on "Show Hot Lines" you get a more detailed view of the methods where most CPU was spent. (use "column 3exclusive samples %")

You can also use "Call Tree" to show the most exensive Call Tree

Here's a few charts with an optimization idea example.


Attached Thumbnails
Click image for larger version

Name:	profileinit.png
Views:	2258
Size:	110.3 KB
ID:	13305   Click image for larger version

Name:	profileinitCT.png
Views:	1740
Size:	100.3 KB
ID:	13306   Click image for larger version

Name:	profrendering.png
Views:	1530
Size:	110.5 KB
ID:	13307   Click image for larger version

Name:	profrenderingshshowhot.png
Views:	1425
Size:	84.4 KB
ID:	13309  
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
No book, only a stair: journaling fills where price move …
Cryptocurrency
Datafeed for Atas
Platforms and Indicators
Daytrading to swingtrading
Traders Hideout
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
Trump Media to sell instant access to market-moving soci …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
Afternoon-close session
1 thanks
Franks Trading Journey
1 thanks
Denied 20K payouts: Alpha Futures
1 thanks
FootPrintV2 Chart for NT8
1 thanks
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 R.I.P. 1977-2026 
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,586


Sticky

Mike




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 X Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 gomi 
Paris
Legendary Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,506

Update : I was having some performance problems and was willing to be able to get a full symbol profiling.

So tried a few things and here's a solution : when in profile mode, open an indicator, select debug mode an recompile. This will recreate the debugger symbol file the profiler needs.

Then run your time-consuming task and stop profiling ; you'll be able access something like the attached screen : oops, looks like i'm spending 23,6 % of my time doing useless time calculations....


Attached Thumbnails
Click image for larger version

Name:	profiler.png
Views:	1034
Size:	91.7 KB
ID:	25938  
Started this thread Reply With Quote
Thanked by:
  #5 (permalink)
Zchartist
Chicago, IL. USA
 
Posts: 19 since Nov 2010
Thanks Given: 2
Thanks Received: 5

Do you find the new NT version 7 to be more user-friendly ?


Reply With Quote
  #6 (permalink)
 gomi 
Paris
Legendary Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,506

As far as debugging is concerned, I had lots of problems with NT 6.5 and VS 2008. Debugger never wanted to attach to process, VS always crashed on NT exceptions etc...
But NT 7 with VS 2010 works perfectly well.


Started this thread Reply With Quote
  #7 (permalink)
 
sam028's Avatar
 sam028 
Site Administrator
 
Posts: 3,767 since Jun 2009
Thanks Given: 3,836
Thanks Received: 4,691


gomi View Post
As far as debugging is concerned, I had lots of problems with NT 6.5 and VS 2008. Debugger never wanted to attach to process, VS always crashed on NT exceptions etc...
But NT 7 with VS 2010 works perfectly well.

Don't you have NT7 crashing during debugging session ? I have some crash sometimes; it seems that NT7 don't like to be frozen during more than few minutes.


Success requires no deodorant! (Sun Tzu)
Reply With Quote
  #8 (permalink)
 gomi 
Paris
Legendary Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,506

Well I'm not sure I freeze it during several minutes to do data inspection, till now it has never crashed on me.


Started this thread Reply With Quote
Thanked by:
  #9 (permalink)
DrMatt
Newcastle NSW Australia
 
Posts: 8 since Aug 2012
Thanks Given: 46
Thanks Received: 3


gomi View Post
Of course you will need a full blown version of VS2010 to use included profiler.
You can also use a demo version of a commercial product, usually they install as add-ons of Visual Studio.

In VS2010, launch Performance Wizard in Analyze menu.

Use standard settings(CPU Sampling), and select NinjaTrader .exe file.

This starts the profiler, which starts Ninjatrader.

Then do you stuff in NinjaTrader, and stop profiling in VS2010 when you're done. Careful, it will kill your NT session.

You get a graph showing CPU usage ; you can select parts of the graph and click "Filter on Selection" to narrow on a specific part.

If you click on "Show Hot Lines" you get a more detailed view of the methods where most CPU was spent. (use "column 3exclusive samples %")









You can also use "Call Tree" to show the most exensive Call Tree

Here's a few charts with an optimization idea example.

I have a free version of VS 2010. I guess this will work?


Reply With Quote
  #10 (permalink)
 gomi 
Paris
Legendary Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,506


Pretty sure you don't have any profiler in VS 2010 express, so no, it won't work.


Started this thread Reply With Quote
Thanked by:




Last Updated on January 13, 2014


© 2026 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 - Downloads - Top
no new posts