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)




"Thanks for following up with me. You guys do a great job in tech support." - Comment from Phelps
"Very impressed with the quality of your feed - ******* is a real donkey in comparison." - Comment from A.C. via Email
"You have an excellent feed. Very few spikes for Spot Forex." - 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
"I just wanted to let you know how fast and easy I found it to integrate IQFeed into our existing Java code using your JNI client. In my experience, such things almost never go so smoothly - great job!" - Comment from Nate
"If someone needs the best quality data and backfill beyond what their broker provides at a rate that is the best in the industry, I highly recommend IQFeed." - Comment from Josh via Public Forum
"I noticed that ******* quotes locked up shortly after the interest rate announcement yesterday while yours stayed stable." - Comment from Ron in Utah
"I use IQ Feed, Great stuff as far as data analysis information, storage and retrieval is concerned." - 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
"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
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 3rd Party Software Support »Bar Watch Help
Author Topic: Bar Watch Help (8 messages, Page 1 of 1)

Roberts
-Interested User-
Posts: 52
Joined: Mar 26, 2008


Posted: Dec 1, 2020 09:57 AM          Msg. 1 of 8
I've got 2 different implementations in 2 applications performing Bar Watches (BW) without any problem. But I'm having trouble with a new, 3rd implementation, and I'm looking for clues.

1. I'm connecting to the Derivative port 9400.
2. IQFeed returns "S,SERVER CONNECTED" in the socket's callback
3. Example: "BW,IBM,60,,,,,,req1,,,0
... and then nothing else is returned in the callback. No errors, nothing.

I've played around with the optional fields in the BW message, but nothing changes. Any ideas?

DTN_Gary_Stephen
-DTN Guru-
Posts: 394
Joined: Jul 3, 2019


Posted: Dec 1, 2020 11:50 AM          Msg. 2 of 8
Your command is correct and should return data. Port 9400 doesn't need the S,SET PROTOCOL command. Are you sending /n/r at the end of your command?

Sincerely,
Gary Stephen
DTN IQFeed Implementation Support Specialist

Roberts
-Interested User-
Posts: 52
Joined: Mar 26, 2008


Posted: Dec 1, 2020 01:26 PM          Msg. 3 of 8
Oh my gosh, thank you. You hit the nail on the head!

In these initial tests, I'm watching just 2 symbols, AAPL and TTD, at 1 minute intervals. Very commonly, I'll see AAPL update 1 or 2 seconds after the end of interval (good), but TTD's update for the same bar interval will come maybe to 60 seconds later (not good). I'm just looking at the Debug prints from the callback, so I'm not sure how my program could create that delayed effect. Does that sound like something to expect?

Roberts
-Interested User-
Posts: 52
Joined: Mar 26, 2008


Posted: Dec 1, 2020 01:33 PM          Msg. 4 of 8
I actually think I see what's happening. TTD doesn't print it's complete interval until a full lot trade occurs in the next interval. There's got to be a way around that, right?

altmany
-Interested User-
Posts: 73
Joined: Jul 30, 2018

IQML - IQFeed-MATLAB connector


Posted: Dec 1, 2020 03:04 PM          Msg. 5 of 8
Set a non-default UpdateInterval parameter in your BW command to get interim bars.
See http://forums.iqfeed.net/index.cfm?page=topic&topicID=4341 and http://www.iqfeed.net/dev/api/docs/Derivatives_StreamingIntervalBars_TCPIP.cfm

Yair Altman
IQML - IQFeed-MATLAB connector
https://UndocumentedMatlab.com/IQML

I am not a DTN employee; my post reflects my personal opinion

Roberts
-Interested User-
Posts: 52
Joined: Mar 26, 2008


Posted: Dec 2, 2020 02:49 AM          Msg. 6 of 8
Thanks for the link. Now I understand BU much better, because that was unclear too. (If I had requested 15 second updates, I was expecting updates at :00, :15, :30 and :45 seconds every minute, which is not how that works either.)

Quoting Tim Walter from your first link, "The answer, due to the impossibility of syncing all clocks involved and the random latencies between connections, was to say that a bar complete message is only sent when a new message, with a time that is outside of the current bar, is received. So that is why BC messages are not timely."

It's understandable that DTN wants the data to match perfectly, but it sure doesn't seem like a good design decision based on the tradeoffs that require the consumer to use a work-around that is even less perfect and that still doesn't provide a timely bar without building one ourselves using updates. IQFeed already provides a TimeMessage that we use as a heartbeat to "close" intervals precisely on time so that strategies can be executed. We've used this design for 20 years in streaming charts and sure seems like an easy solution to implement for a "BC" message too. If the 99% of the user base expects this, what's the problem?

Our solution may be to toss the whole concept and simply subscribe to hundreds of streams instead. That's worse for the user's cpu and has gotta be worse for the DTN backend.

DTN_Gary_Stephen
-DTN Guru-
Posts: 394
Joined: Jul 3, 2019


Posted: Dec 2, 2020 06:55 AM          Msg. 7 of 8
Here's what the UpdateInterval parameter does in the BW command: it gives you something to check for to ensure that your most recent message is current. If it's turned on, you'll get an incomplete BU message whenever a new tick has a trade in it. If you're watching a symbol, and no such new message has come in, you'll know that the most resent BC message is the most recent one. Or you can use the contents to update.

But yes, the interval bars work as described in the Tim Walter message, even I think he was talking about historical bars in general and not the BW feature. A new bar is not sent until completed, unless you turn on UpdateInterval and look for new data before the bar has been finalized.

Sincerely,
Gary Stephen
DTN IQFeed Implementation Support Specialist

Roberts
-Interested User-
Posts: 52
Joined: Mar 26, 2008


Posted: Dec 2, 2020 07:46 AM          Msg. 8 of 8
If it's turned on, you'll get an incomplete BU message whenever a new tick has a trade in it.

.. but you'll get that message only after the Update Interval. Sure, we can put that at 1 second and have at most a 1 second delay, which is acceptable, but it certainly complicates the adapter. Instead of just passing along the final result when it arrives, we'll have store the last BU message, and, if the BC message doesn't come in before 1 second after the interval, we use the last BU data, and, later have to ignore the next BC message. Not joy, but it is what it is.
 

 

Time: Thu April 25, 2024 12:21 PM CFBB v1.2.0 12 ms.
© AderSoftware 2002-2003