Join the 80,000 other DTN customers who enjoy the fastest, most reliable data available. There is no better value than DTN!

(Move your cursor to this area to pause scrolling)




"Interactive Brokers tick data was inconsistent, so I have switched to using DTN exclusively. It is great to no longer have to worry about my datafeed all day long." - Comment from Philippe
"Previously I was using *******. IQFeed is WAY more economical, and for my charting needs is just as good, if not better." - Comment from Public Forum Post
"With HUGE volume on AAPL and RIMM for 2 days, everyone in a trading room was whining about freezes, crashes and lag with *******, RealTick, TS and Cyber. InvestorRT with IQFeed was rock solid. I mean SOLID!" - Comment from Public IRC Chat
"I "bracket trade" all major news releases and I have not found one lag or glitch with DTN.IQ feed. I am very comfortable with their feed under all typical news conditions (Fed releases, employment numbers, etc)." - Comment from Public Forum
"Thank you so much - awesome feed, awesome service!" - Comment from Greg via Email
"If you are serious about your trading I would not rely on IB data for serious daytrading. Took me a while to justify the cost of IQ Feed and in the end, it's just a 2 point stop on ES. Better safe than sorry" - Comment from Public Forum
"Version 4.0.0.2 has been working well for me and I appreciate that it is now a much tighter client to work with. I feel I can go to press with my own application and rely on a stable platform" - Comment from David in IA.
"For anyone considering using DTN.IQ for a data feed, my experience with the quality of data and the tech support has been very positive." - Comment from Public Forum
"I am keeping IQFeed, much better reliabilty than *******. I may refer a few other people in the office to switch as well." - Comment from Don
"I am a hedge fund manager here. It’s funny, I have a Bloomberg terminal and a Bridge feed, but I still like having my DTN feed!" - Comment from Feras
Home  Search  Register  Login  Recent Posts

Information on DTN's Industries:
DTN Oil & Gas | DTN Trading | DTN Agriculture | DTN Weather
Follow DTNMarkets on Twitter
DTN.IQ/IQFeed on Twitter
DTN News and Analysis on Twitter
»Forums Index »Archive (2017 and earlier) »IQFeed Developer Support »datafeed optimization
Author Topic: datafeed optimization (3 messages, Page 1 of 1)

d_allen
-Interested User-
Posts: 29
Joined: Nov 5, 2008


Posted: Nov 26, 2008 12:51 PM          Msg. 1 of 3
hello my fellow iqFeeders,
i'm a newbie/novice and i was wondering if someone could me give advice on optimizing the IQFeed? i'm currently watching over 500 equity options and simultaneously parsing and saving (sql insert) the messages to a MySQL data base. i'm using the IQFeed activeX control to receive message and the language i'm using is vb.net. if anyone has any solutions, advice, recommendations, etc please share them with me...

thanks
Edited by d_allen on Feb 21, 2010 at 05:05 PM

jimc
-Interested User-
Posts: 35
Joined: Jan 22, 2008


Posted: Nov 26, 2008 02:41 PM          Msg. 2 of 3
Donald, I have a couple suggestions for you. First, I used the ActiveX feed with a .NET-based program (C#) for many months. The ActiveX overhead was too much for my computer (a reasonably fast dual CPU machine); when volume spiked, my program fell progressively further behind receiving and processing the feed. I'm only watching about 65 symbols, too. I recently switched to the socket interface, and it's much, much faster for me. (I think this big performance difference might not necessarily be there if one was writing a non-.NET program.) So rather than beat your head against the wall trying to get your ActiveX-based code running as fast as possible, you may want to switch to the socket interface. It's probably the biggest single thing you can do to speed things up.

Also, the socket interface lets you specify which fields you want to receive, and that can drastically reduce the amount of bandwidth and parsing it takes to receive the feed. The ActiveX interface doesn't support this feature yet.

Second, if your database can't keep up with so many inserts, you could:
1). Let the data build up for awhile (e.g., at least a few seconds), then have a separate thread go do an insert
2). Spend some time optimizing your database configuration for your needs; I use Oracle, so I don't know much about mySQL, but I'm sure there are plenty of things you can do to optimize it for an insert-heavy load like yours.
3). Run your database on a separate computer on your network
4). Instead, write the data to a file, and write a small program to run at the end of the day to insert it all into your database
5). Write the data to a file and read it back from a file, rather than into/out of a database

Third, when optimizing a program, usually a little bit of work goes a long way at first. In other words, look first for places where you're storing a value that's actually unchanged, or recalculating an indicator when the underlying data hasn't changed yet.

Fourth, once you've gotten the low-hanging fruit in terms of optimization, you may find it useful to use a third-party optimization tool. I use and like the Ants Profiler, but I'm sure there are many others.

One other thing: compile your program with using the "Release" configuration instead of the "Debug" configuration, if that's an option in VB. It makes a big difference in C#.

Good luck.

Jim

jimc
-Interested User-
Posts: 35
Joined: Jan 22, 2008


Posted: Dec 1, 2008 11:31 AM          Msg. 3 of 3
One other thing: allocating memory is usually a relatively expensive operation. So look for places where you're allocating memory many times (e.g., string creation) and change them to avoid so many allocations (e.g., use the StringBuilder class).

Jim
 

 

Time: Thu May 16, 2024 11:10 PM CFBB v1.2.0 8 ms.
© AderSoftware 2002-2003