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)




"DTN feed was the only feed that consistently matched Bloomberg feed for BID/ASK data verification work these past years......DTN feed is a must for my supply & demand based trading using Cumulative Delta" - Comment from Public Forum Post
"There is no doubt that IQFeed is the best data provider. I am very satisfied with your services. And IQFeed is the only one that I would recommend to my friends. Now, most of them are using your product in China." - Comment from Zhezhe
"IQ feed works very well, does not have all of the normal interruptions I have grown used to on *******" - Comment from Mark
"Excellent datafeed !!!" - Comment from Arely
"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
"After all the anxiety I had with my previous data provider it is a relief not to have to worry about data speed and integrity." - Comment from Eamonn
"I had always used ******* but for the past 2 weeks have been trying DTN IQFeed. Customer support has been extraordinary. They call just to make sure your problem hasn't recurred." - Comment from Public Forum
"I ran your IQFeed DDE vs. my broker vs. a level II window for some slow-moving options. I would see the level II quote change, then your feed update instantaneously. My broker's DDE, however, would take as much as 30 seconds to update. I am not chasing milliseconds, but half a minute is unacceptable." - Comment from Rob
"I cannot believe what a difference it makes trading with ProphetX!" - Comment from Bruce in Los Angeles
"Its working FABULOUSLY for me!! Holy cow...there has been so much I've been missing lately, and with this feed and Linnsoft software...I'm in the game now." - Comment from Chris R.
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: Tue April 23, 2024 8:48 AM CFBB v1.2.0 8 ms.
© AderSoftware 2002-2003