How to check your code using Visual Studio and FxCop
futures io futures trading

How to check your code using Visual Studio and FxCop


Created May 12th 2010 by gomi
Updated July 17th 2012 by GridKing
looks_onegomi with 2 posts (19 thanks)
looks_twoGridKing with 1 posts (1 thanks)
looks_3Big Mike with 1 posts (1 thanks)
trending_up7,836 views
thumb_up21 thanks given
forum4 replies
attach_file4 attachments

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Thread Tools Search this Thread

How to check your code using Visual Studio and FxCop

  #1 (permalink)
Trading Experience: None
Platform: NinjaTrader
Posts: 1,234 since Oct 2009
Thanks: 262 given, 4,342 received

How to check your code using Visual Studio and FxCop

On the .net platform there are code analysis stuff that help you to find errors in code. Most well-known is FxCop

To use them, first you must build a projet using Visual Studio.
EDIT : Actually it's not true : you can run FxCop without using VS : see post #4

For that, create a new project, type dll, target .Net 3.0 for NT6.5, and target .Net 3.5 for NT7.

Then basically you need to add references to NinjaTrader.Core and WilsonOrMApper (in NT binaries folder). (cf picture)

Then add the indicator files, using "Add as Link" (cf Picture).
You must add
  • your indicators,
  • @ADX and @Indicator(Indicator folder),
  • @Column(Market Analyzer folder)
  • @and Strategy (Strategy Analyzer)

Then you can compile your project as dll.

You can make changes to the source, they will be done on the NT file as well because of the link.

If you are using a high version of VS2010, code analysis tools are included in Analyze menu.
Results are shown in the IDE : it's clear I forgot to Dipose of a Font object. (see Picture)

If you do not have an included code analyzer in the VS you use, you can use the FxCop tool free from MS : in Fxcop Open the dll (Add Targets... from the menu) you just created, and tada, from here too I can see I forgot the Font disposal.

Hope it might help someone.

Attached Thumbnails
How to check your code using Visual Studio and FxCop-addaslink.png   How to check your code using Visual Studio and FxCop-vs2010.png   How to check your code using Visual Studio and FxCop-fxcop.png  

Last edited by gomi; May 13th, 2010 at 09:20 AM.
Reply With Quote
The following 12 users say Thank You to gomi for this post:

Can you help answer these questions
from other members on futures io?
How to detach charts and save chart position
Trailing stop order in MotiveWave?
Platforms and Indicators
Float Study in Easy Language code but need help converting to thinkscript
Highlighting Oscillators in Sierra Charts
Sierra Chart
Follow Big MM for profit
Traders Hideout
Best Threads (Most Thanked)
in the last 7 days on futures io
ES futures Spoo-nalysis SP500/SPX
217 thanks
Recession? Depression? Bailout!
214 thanks
Coronavirus COVID-19
161 thanks
Understanding Footprint Charts / Number bars
71 thanks
What's your "comfort" number?
40 thanks
  #2 (permalink)
Site Administrator
Manta, Ecuador
Trading Experience: Advanced
Platform: My own custom solution
Favorite Futures: SPX, Emini Futures
Big Mike's Avatar
Posts: 48,195 since Jun 2009
Thanks: 30,783 given, 92,142 received

Thx Gomi, this is now a sticky.


Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member (see why)

Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to Big Mike for this post:
  #3 (permalink)
Trading Experience: None
Platform: NinjaTrader
Posts: 1,234 since Oct 2009
Thanks: 262 given, 4,342 received

Thks Mike. Actually it occured to me that you don't need Visual Studio at all to use FxCop.

Just open FxCop, Add Target... the NinjaTrader.Custom.dll which is the dll NT builds when it compiles. It's located in MyDocuments/NinjaTrader/bin/Custom folder.

It will ask to locate the NT Core dll, which is in Program Files/NinjaTrader/bin folder

Then run Analyze : all the Indicators are run through FxCop (see pic)

Attached Thumbnails
How to check your code using Visual Studio and FxCop-fxcop2.png  
Reply With Quote
The following 7 users say Thank You to gomi for this post:
  #4 (permalink)
San Diego, CA USA
Trading Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES
GridKing's Avatar
Posts: 3,650 since May 2011
Thanks: 584 given, 879 received

Thanks @gomi again!

I've just been reading mostly and trying to understand it a bit more... can you please answer a question or two when you have the time, or anyone...thanks in advance

I would like to know what might be the least intrusive or demanding form of communication to get at raw data, is it possible to use only part or less of NT and get results for some things? I am trying to figure out how to use a lot more data and less stuff , but not really sure what I am looking for... I read some of the different languages , just the basics , I want something simple and fast like dde but the way it is supposed to be so that everything works together smoothly and still have plenty of room for other things as well to build on as I learn and have it all work together...


"Successful trading is one long journey, not a destination" Peter Borish Former Head of Research for Paul Tudor Jones speaking on conversations with John F. Carter
Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to GridKing for this post:


futures io Trading Community Platforms and Indicators NinjaTrader > How to check your code using Visual Studio and FxCop

Upcoming Webinars and Events (4:30PM ET unless noted)

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now

$250 Amazon Gift Cards with our "Thanks Contest" challenge!

Right now

Social Media Predictive Data for Traders w/Joe Gits @ SMA [and Lime Brokerage]

Apr 9

Similar Threads
Thread Thread Starter Forum Replies Last Post
Profile your code using Visual Studio 2010 gomi NinjaTrader 21 January 13th, 2014 09:08 AM
Using Visual Studio (Express) w/ NT LostTrader NinjaTrader 3 July 28th, 2010 07:48 PM
How-to profile NinjaTrader code with Visual Studio 2010 Big Mike Help, Tutorials, and How-Tos 0 July 6th, 2010 10:39 PM
Visual Studio 08 NT programming symphys NinjaTrader 5 March 8th, 2010 04:45 AM
Will Visual Studio 2008(5, 10?) help? MXASJ NinjaTrader 2 November 8th, 2009 07:55 AM

All times are GMT -4. The time now is 05:33 PM. (this page content is cached, log in for real-time version)

Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
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.
no new posts