NexusFi: Find Your Edge


Home Menu

 



How-to profile NinjaTrader code with Visual Studio 2010

You can profile your NinjaTrader C# NinjaScript code (indicators and strategies) to fine tune their performance using Visual Studio 2010. You will need the full version of Visual Studio 2010.


  • In VS2010, launch the Performance Wizard in Anaylze menu.
  • Use standard settings (CPU Sampling), and select the NinjaTrader.exe file.
  • This starts the profiler, which in turn starts NinjaTrader.


Then test your code in NinjaTrader, and stop profiling in VS2010 when you're done. Be advised, it will kill/terminate your NinjaTrader session. You will get a graph showing CPU usage, you can select parts of the graph and click "Filter on Selection" to narrow in on a specific part.

If you click on "Show Hot Lines" you get a more detailed view of the methods where most of the CPU cycles were spent (use "column 3 exclusive samples %"). You can also use "Call Tree" to show the most extensive Call Tree.

Attached are a few screenshots with an optimization idea as an example.[1]

These instructions were courtesy Gomi.
[top]Stub
This article is a stub. Please edit the article to improve it and add additional details.
[top]Links
[top]References

Attached Thumbnails
Click image for larger version

Name:	profileinit.png
Views:	729
Size:	110.3 KB
ID:	16580   Click image for larger version

Name:	profileinitCT.png
Views:	661
Size:	100.3 KB
ID:	16581   Click image for larger version

Name:	profrendering.png
Views:	522
Size:	110.5 KB
ID:	16582   Click image for larger version

Name:	profrenderingshshowhot.png
Views:	624
Size:	84.4 KB
ID:	16583  


© 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