Hello Askrali, I have answers for your questions:
Quote: what time stamp should be used?
Most recent time or time stamp in T messages?
The "T" messages are provided by the IQFeed server. The timestamps messages within each tick are provided by the change, and they reflect the time the tick actually happened. For example:
These ticks occurred at 10:49:42.839858, but were not sent out as API messages until after the local server time was 10:49:43. Ticks take some time to travel through the internet, and the synchronization may not be exact.
You probably want to use the timestamps in the tick messages, because these reflect the actual time the tick occurred.
Quote: To form 5 min candles from update message
By the way, yhe IQFeed API has a command that will build 5-minute intervals for you. You can connect to port 9400 and send a command like:
300 is the number of seconds in the bar, so 5 minutes. This will give you historical bars as far back as you specify, and will built live ones for you. The response will be like:
"BH" means the message was built from historical data, while "BC" means the message was built from live data. "BU" means a past bar has been updated.
Quote: To create the timeframes, would it be good to use local time in EST time-zone?
All IQFeed timestamps for all exchanges use the US Eastern time zone. This includes exchanges that are not based in that time zone.
Quote: But there are fields “Last” and “Most Recent Trade” for price.
Which one can be used as a close price?
The difference between the "Last" and "Most Recent Trade" fields is this: "Last" includes only "last-eligible" trades. This means trades for more than 100 units. Such trades are allowed to set a high, low, open, or close.
"Most Recent" includes non-eligible trades. They may be for less than 100 units. Such trades cannot set an official high, low, open, or close. If the current High is $8.00 and I buy 99 units for $8.01, the High does not change to $8.01.
You can whichever of the two you want, just understand the difference. If your close price you calculate must match the offical close price, then use Last. If you want to calculate your own close price, and you want it to include all trades, use Most Recent. By the way, these are two different fields in Level 1 and you can watch both of them.
DTN IQFeed Implementation Support SpecialistEdited by DTN_Gary_Stephen on Aug 25, 2021 at 04:43 PM