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)




"I just wanted to tell you what a fine job you have been doing. While *******, from what I hear, has been down and out, off and on, IQ feed has held like a champ this week." - Comment from Shirin
"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
"Can I get another account from you? I am tired of ******* going down so often" - Comment from George
"I was with ******* for 4 years at $230 a month, this is a huge savings for me, GOD BLESS YOU PEOPLE," - Comment from T.S. via Email
"I like you guys better than *******...much more stable and a whole lot fewer issues." - Comment from Philip
"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
"I use IQ Feed, Great stuff as far as data analysis information, storage and retrieval is concerned." - Comment from Public Forum
"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
"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
"You have an excellent product !!!!!!" - Comment from Arely
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: Sat May 18, 2024 6:03 PM CFBB v1.2.0 8 ms.
© AderSoftware 2002-2003