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)




"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
"Thank God for your Data Feed as the only Zippers I see are on my pants (LOL), and no more 200 pip spikes to mess up charts." - Comment from Spiro via Email
"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
"Thank you so much - awesome feed, awesome service!" - Comment from Greg via Email
"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've been using IQFeed 4 in a multi-threaded situation for the last week or two on 2600 symbols or so with 100 simultaneous daily charts, and I have had 100% responsiveness." - Comment from Scott
"I've been using Neoticker RT with IQFeed for two months, and I'm very happy with both of the products (I've had IQFeed for two years with very few complaints). The service from both companies is exceptional." - Comment from Public Forum
"I am very pleased with the DTNIQ system for quotes and news." - Comment from Larry
"Everything is working great ! Very impressive client. The news refreshes better and is more pertinent than the ******* feed I paid $ 100/month for. I Also like the charts a lot." - Comment from Leon
"You have an excellent feed. Very few spikes for Spot Forex." - Comment from Public Forum Post
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 3:57 AM CFBB v1.2.0 10 ms.
© AderSoftware 2002-2003