How-to profile NinjaTrader code with Visual Studio 2010 - futures trading

Go Back

> Trading Wiki > Help, Tutorials, and How-Tos

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.
This article is a stub. Please edit the article to improve it and add additional details.

Attached Images
Register to download File Type: png profileinit.png (110.3 KB, 216 views)
Register to download File Type: png profileinitCT.png (100.3 KB, 204 views)
Register to download File Type: png profrendering.png (110.5 KB, 181 views)
Register to download File Type: png profrenderingshshowhot.png (84.4 KB, 164 views)
Created by  Big Mike , July 6th, 2010 at 10:39 PM
0 Comments, 3,897 Views
Page Tools
Search this Page

Posting Rules
You may not create new articles
You may not edit articles
You may not protect articles

You may not post comments
You may not post attachments
You may not edit your comments

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 09:11 AM.

Copyright © 2016 by 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.

Page generated 2016-10-21 in 0.08 seconds with 28 queries on phoenix via your IP