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)




"Thank you so much - awesome feed, awesome service!" - Comment from Greg via Email
"IQFeed version 4 is a real screamer compared to anything else I have seen." - Comment from Tom
"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
"Thanks for the great product and support. During this week of high volume trading, my QuoteTracker + IQ Feed setup never missed a beat. Also, thanks for your swiftness in responding to data issues. I was on ******* for a few years before I made the switch over early this year, and wish I had done it a long time ago." - Comment from Ken
"I used to have *******, but they are way more money for the same thing. I have had no probs with data from DTN since switching over." - 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've never had DTN go out on me since switching. ******* would go down a couple times every month when I was using them." - Comment from Bryce in AL.
"Just a quick one to say I'm very impressed so far :) The documentation for developers is excellent and I've quickly managed to get an app written to do historical downloads. The system is very robust and pretty quick considering the extent of data that's available. The support guys have been very helpful too, in combination with the forums it's been plain sailing so far!" - Comment from Adam
"I started a trial a few weeks back before the market went wild. DTN.IQ didn’t miss anything and beat my other provider. I decided to stay with you because of the great service through all the volatility." - Comment from Mike
"This beats the pants off CQG, I am definitely switching to the ProphetX 3.0!" - Comment from Stephen
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 »C# sample program for Leve1Socket
Author Topic: C# sample program for Leve1Socket (6 messages, Page 1 of 1)

Lav2018
-Interested User-
Posts: 10
Joined: Mar 15, 2018


Posted: Apr 4, 2018 08:55 PM          Msg. 1 of 6
I've found all of the sample C# programs very helpful and the comments make for easy following. I have one question about the Level1Socket program.

In Level1SocketForm.cs, lines 201-202 are:

 
// move on to the next message. This isn't very efficient but it is simple (which is the focus of this example).
sData = sData.Substring(sLine.Length + 1);


Do you have any examples showing more efficient ways? If not, can you please point me towards a better solution. Thank you.

DTN_Tim Walter
-DTN Guru-
Posts: 1238
Joined: Apr 25, 2006


Posted: Apr 5, 2018 08:06 AM          Msg. 2 of 6
You would want to do something that doesn't involve creating additional strings whenever possible. Anything that does a string copy like this can be costly. I did some looking and substring and split both have this kind of behavior, so I would probably look into MemoryStreams or a StringReader as possible alternatives, but I have not done any testing of those options to confirm their performance.

https://msdn.microsoft.com/en-us/library/system.io.stringreader(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/system.io.memorystream(v=vs.110).aspx

Tim

Lav2018
-Interested User-
Posts: 10
Joined: Mar 15, 2018


Posted: Apr 5, 2018 02:51 PM          Msg. 3 of 6
Makes sense. Thanks.

mathpaquette
-Interested User-
Posts: 22
Joined: May 18, 2018


Posted: May 18, 2018 06:43 AM          Msg. 4 of 6
Hello Lav2018,

Please have a look to my open source C# IQFeed client.

https://github.com/mathpaquette/IQFeed.CSharpApiClient

Your feedbacks are welcome!
Mathieu

mathpaquette
-Interested User-
Posts: 22
Joined: May 18, 2018


Posted: May 18, 2018 07:14 AM          Msg. 5 of 6
Well, I'm still skeptical about the real performance benefit of not using .Split. I'll do some performance tests to conclude on this.

mathpaquette
-Interested User-
Posts: 22
Joined: May 18, 2018


Posted: May 22, 2018 08:06 PM          Msg. 6 of 6
 

 

Time: Fri April 26, 2024 5:05 AM CFBB v1.2.0 10 ms.
© AderSoftware 2002-2003