Anyone have any hints for optimizing C# code? - NinjaTrader Programming | futures io social day trading
futures io futures trading


Anyone have any hints for optimizing C# code?
Updated: Views / Replies:24,825 / 111
Created: by ZTR Attachments:14

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 90,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

Reply
 14  
 
Thread Tools Search this Thread
 

Anyone have any hints for optimizing C# code?

  #11 (permalink)
 R.I.P. 1960-2010 
 
Futures Experience: Advanced
Platform: NinjaTrader7
Broker/Data: Mirus RCG/Zen-Fire
Favorite Futures: CL & 6e, looking at ES, ZB and AU again.
 
ZTR's Avatar
 
Posts: 2,099 since Nov 2009
Thanks: 1,104 given, 1,390 received

NetTecture,

When is you package coming out?

I'm going to look at Equtec, ScoobyStoo,

Downloaded it last night, but it might be a while before I actually get to optimizing Zondor's & I's indy's

R.I.P. Andy Zektzer (ZTR), 1960-2010.
Please visit this thread for more information.
Reply With Quote
 
  #12 (permalink)
Membership Revoked
Szczecin
 
Futures Experience: Intermediate
Platform: Ninja, writing own now
 
Posts: 212 since Mar 2010
Thanks: 47 given, 102 received

No idea. Some months maybe. SO far the goal is to have something that I can use for trade control and some visualization. It was on a backburner for some months, not it goes in full speed again. Working fulltime on it. I hope to put out a usable internal version of WHATEVER FUNCTIONALITY I CAN GET mid of next week. Working on the client/server part now (news: this is not ninja - it will be a client server tool running against a real sql server as data store, allowing multiple users to connect - the idea is something that has the power of ninja and is also usable in a prop shop style of environment).

Reply With Quote
The following user says Thank You to NetTecture for this post:
 
  #13 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,238 since Jun 2009
Thanks: 29,350 given, 83,221 received

Answer
This post has been selected as an answer to the original posters question Answer


Good advice here.

[soap box on]

But let me also say, you are likely to see a better improvement in overall performance by just eliminating all the crap people fall for on Windows installs.

Don't install all the registry cleaning crap, all the fancy program uninstallers, all the extra special haxx0r stuff that promises to increase speed. All this stuff is loaded down bloatware, worse even a lot of it is spyware.

Latency is a big issue for trading systems. So if you are really looking for performance, you need to run a wired connection (not wifi), make sure you aren't playing any internet music or downloading torrents, etc.

Personally, I don't install the crap people fall for, but I don't worry so much about the latency side on the internet connection. If I can only be successful trader by entering a trade 250ms faster, then I am not a good trader.

Also, let me state the obvious --- it seems many people have really old computers. If you don't have a quad core CPU, it is old. You can't get blood from a turnip, and you can't make an out of date computer fast. You should buy a new system. If you don't build it yourself, then the first thing you should do when you get the system is blow away everything and reformat the partition, reinstall your OS from scratch. Most tier 1/2/3 system manufacturers load up their installs with crap, crap and more crap because people that don't know any better just can't get enough crap!



[/soap box off]

Mike

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.
6)
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.

Reply With Quote
The following user says Thank You to Big Mike for this post:
 
  #14 (permalink)
Membership Revoked
Szczecin
 
Futures Experience: Intermediate
Platform: Ninja, writing own now
 
Posts: 212 since Mar 2010
Thanks: 47 given, 102 received

Amen to that. Seriously. It is called "Crapware" for a reason. I love our company internal Widows installs - yes, it is not bare bone (office etc.), but no - no damn crapware on it

And I TRADE from a pure windows virtual machine sitting in a data center I Dont trust neither my office power supply nore my internet connection

Reply With Quote
 
  #15 (permalink)
 R.I.P. 1960-2010 
 
Futures Experience: Advanced
Platform: NinjaTrader7
Broker/Data: Mirus RCG/Zen-Fire
Favorite Futures: CL & 6e, looking at ES, ZB and AU again.
 
ZTR's Avatar
 
Posts: 2,099 since Nov 2009
Thanks: 1,104 given, 1,390 received

Recently purchased a system built around an Intel i7 Quad Core Processor 860, 2.80GHz, 1333 MHz clock speed memory with RAID 1 & Nvidia Quadpro 450

Guaranteed to come with nothing but Windows 7 pro.

Will be using my old system in Global Simulation mode for testing/
development of indicators and strategies, and as a backup Gom & Zondor recorder.


R.I.P. Andy Zektzer (ZTR), 1960-2010.
Please visit this thread for more information.
Reply With Quote
 
  #16 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,238 since Jun 2009
Thanks: 29,350 given, 83,221 received

Very nice, enjoy the new system

Mike

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.
6)
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.

Reply With Quote
The following user says Thank You to Big Mike for this post:
 
  #17 (permalink)
Elite Member
USA
 
Futures Experience: Beginner
Platform: NinjaTrader
 
Posts: 26 since Jul 2009
Thanks: 4 given, 17 received


NetTecture View Post
... My only concern would be that all Ninja code is heavily crypted to make decompiling impossible (most likely to stop people from posting emabarassing bad code samples?). I am not sure how wel lthat will run together with a profiler. It SHOULD - as the resulting classes etc. still have to be legal in the .NET framework - but they may be hard to read, confusing and possibly crash something in the profiler.

Ninja's assemblies are not encrypted just don't have the IL in them, RemoteSoft protector takes the IL out but LEAVES the metadata, so basically he should have no problem seeing how much time each method in ninja took.

Also, I wouldn't bash WinForms so much, it is true the msft put their efforts on WPF but still WinForms is a good thing. Ninja, for saving development time, uses Infragistics UI controls which are cool, but with "cool" may come overkill and performance issues (not saying anything bad about Infragistics, they have great controls, but might be misused).

If I understood correctly ZTrade is talking about indicators that has heavy(?) I/O to disk, I guess that it might take some time to read a file full of ticks, not talking about the recording.

Reply With Quote
 
  #18 (permalink)
 R.I.P. 1960-2010 
 
Futures Experience: Advanced
Platform: NinjaTrader7
Broker/Data: Mirus RCG/Zen-Fire
Favorite Futures: CL & 6e, looking at ES, ZB and AU again.
 
ZTR's Avatar
 
Posts: 2,099 since Nov 2009
Thanks: 1,104 given, 1,390 received

It was suggested by one the the Ninja_Traders that code optimizations was necessary, I asked how? This is what I was told by another:

If you want someone to professionally evaluate your code and make recommendations you could try one of the 3rd party NinjaScript Consultants here: Online Trading. NINJATRADER. NinjaScript Consultants. They make a business out of programming scripts for people and if you ask some of them they can provide you with code evaluations too.


The recording indicators can cause long load times - Especially earlier versions of BuySellVolume.

Wanted to find some way to understand what was happening and avoid duplication of effort. Any time something is changed another long wait is required, as the data must be reloaded from disk.

Zondor has added some clean up code but load times are still very, very long. I'll let him explain that part, but it is basically lifted from the indicators that Ninja Trader has built in.

R.I.P. Andy Zektzer (ZTR), 1960-2010.
Please visit this thread for more information.
Reply With Quote
 
  #19 (permalink)
Membership Revoked
Szczecin
 
Futures Experience: Intermediate
Platform: Ninja, writing own now
 
Posts: 212 since Mar 2010
Thanks: 47 given, 102 received


YuvalW View Post
Ninja's assemblies are not encrypted just don't have the IL in them, RemoteSoft protector takes the IL out but LEAVES the metadata, so basically he should have no problem seeing how much time each method in ninja took.

Also, I wouldn't bash WinForms so much, it is true the msft put their efforts on WPF but still WinForms is a good thing. Ninja, for saving development time, uses Infragistics UI controls which are cool, but with "cool" may come overkill and performance issues (not saying anything bad about Infragistics, they have great controls, but might be misused).

If I understood correctly ZTrade is talking about indicators that has heavy(?) I/O to disk, I guess that it might take some time to read a file full of ticks, not talking about the recording.

Well...
* RemoteSoft protector. Interesting. This, though, seriously sucks - with all respect for the attempts of RemoteSoft, I dont see them coming up with efficient assembly level optimizations. Ouch.
* NinjaTrader6.5 does NOT use Infragistics, and the 7.0 uses such an outdated version I dont wonder they have performance problems - a lot of performance optimizations was done recently by infragistics. Their version is ancient (makes me wonder whether they care at all about bugfixes etc.). Add that to the usual "program quality focus" we all know from Ninja and "crapware" gets a ninja meaning Seriously - never seen a program with so many brain dead decisions. Just to make things true- the version they use is like 2 years old (8.3, now we are at 10.1). Thhe 9 version had a lot of UI optimizations, especially in grids etc.
* Winforms - sorry, winforms DESERVES A bashing for charting etc. It simply is not modern enough. MS has put up a tremendous amount of groundwork towards being able to offload higher functions to the GPU - which really will shine when you have lot of interactive updates (I.e. real time charts). Even text rendering is now part of a DirectX method call - instead of the CPU working. The performane gains are pretty fantastic. NO way to get that out of Winforms. Espeicalyl the new 4.0 version (why the heck will NinjaTrader 7 not be .NET 4.0? I moved my own code over within days) with the cache hinting that allows arbitrary elements to be GPU-cached is REALLY a godsent. I could se a ton of really nice stuff one could do with charts to allow more control

IO indicators are always an issue - file IO is not that simple. If you do a lot of reading and writing, try using BufferedStreams around the files - with a buffer good enough to actually be relevant (2-4mb maybe). After that, a better disc subsystem is needed

Reply With Quote
The following 3 users say Thank You to NetTecture for this post:
 
  #20 (permalink)
Elite Member
Paris
 
Futures Experience: None
Platform: NinjaTrader
 
Posts: 1,173 since Oct 2009
Thanks: 227 given, 4,090 received



NetTecture View Post
On my own T&S implemntation I actually manage to offload a lot of stuff onto the GPU and avoid redrawing the text - without any written code. WPF just is SO much more powerfull

I started to develop a visualization app for trading with WPF but quickly went back to GDI because it was impossible to draw a 1 pixel width line (the whole "dpi independant" paradigm...", and fonts were blurry. I think now you can draw 1 pixel lines, but aren't fonts still blurry ?


Last edited by gomi; April 23rd, 2010 at 05:58 AM.
Reply With Quote

Reply



futures io > > > > > Anyone have any hints for optimizing C# code?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hints, Tips & Gocthas NW27 MultiCharts 2 August 7th, 2011 04:11 PM
Can someone code this ? skyfly NinjaTrader Programming 8 April 25th, 2011 01:40 PM
Japan's Intervention Hints Fail to Stall Yen's Strength Quick Summary News and Current Events 0 September 8th, 2010 03:20 AM
Optimizing Range Bar Settings? daedalus Traders Hideout 3 February 1st, 2010 01:00 AM
Does anyone esle find Ninja problematic for optimizing strategies? rsi77 NinjaTrader 3 June 17th, 2009 09:32 PM


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

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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
Page generated 2017-12-13 in 0.20 seconds with 40 queries on phoenix via your IP 54.82.56.95