IQFeed's Close price of daily bars is different from intraday
Author: Gamba
Creation Date: 1/21/2016 4:27 PM
profile picture

Gamba

#1
I have an issue with the close price of daily bars, e.g for SPY. Please see attached chart of close prices for the 19. of January 2016. Intraday close (5-minute data) is 188.02 the correct end of day close is 188.06. I am using IQFeed as data provider. Yahoo has the same 188.06 closing price.

I would like to trade at the daily close with the daily close price of 188.06. I don't need to trade automatically but I need the nearby close price for my calculations at 4pm or 4:05 pm.

Intraday I did not get the real price, why?

End-of-day I get not the last day in my strategy becuase it is an partial bar and not available at 4pm or 3:55pm?

profile picture

Eugene

#2
QUOTE:
Intraday I did not get the real price, why?

Have you already asked IQFeed why their intraday close is not equal to the daily close?
What was their answer?
profile picture

Gamba

#3
Of course I did. This was my first action.

One minute ago they told me, that the closing price of 188.06 was the right one.
Her software DTNIQ showed the correct prices they send me two screenshots with 1-Minute
and daily prices and both showed 188.06.

This is the answer:

"The exchange will publish a Closing Price at 16:00 which may not be picked up by the software you are using. Ie: when an incremental minute chart is requested, the last value at 15:59 seconds is the end of the bar. Then the following bar will start at 16:00 "

That is not the only day, where price differences occur.

And they told me to ask my software vendor support :-)

Please see the attached image

profile picture

Eugene

#4
Differences between intraday and daily prices can happen because intraday data do not use the "official close", the settle price, or EOD Auction price on the primary exchange. It's not a bug.

Let's check if your settings interfere with the actual data. Please disable Market Manager (open the MM, click on the yellow ribbon, uncheck "IQFeed", OK), then reload your intraday chart. Does this have any effect on the intraday chart?
profile picture

Gamba

#5
No changes for the close price after disabling the Market Manager.
I tried with other session times but there is no close around 4pm with 188.06 only in tick modus you can see a tick at 188.06.
I aks why the software DTNIQ shows the correct prices.

So I guess I cannot be safe to get the EOD close price and therefore my daily indicator calculation with SetScaleDaily() are not very safe.
I tested my strategy with daily and intraday prices and get different results because if the daily indicators based on close price of the day.

What else could I do to trade an daily close with correct prices form EOD data?
Is it possible to add a synthetic bar after 4pm to the EOD to get close price and indicator values after 4pm the closes?
profile picture

Eugene

#6
We'll take a look into the data. Will keep you posted.
profile picture

Cone

#7
QUOTE:
Differences between intraday and daily prices can happen because intraday data do not use the "official close", the settle price, or EOD Auction price on the primary exchange. It's not a bug.
Precisely correct.

If you scale Intraday to daily, the last trade is the closing price; but on a daily basis, it's very unlikely that you participate in that trade.

On the other hand, the official close is part of an auction process in the primary market, and this trade can occur at 4:00pm or even minutes later. The official close is the price that you receive for MOC (Market On Close) orders, which must be placed before 3:50pm to participate.

See what it looks like in the attached Time of Sales.

QUOTE:
What else could I do to trade an daily close with correct prices form EOD data?
You can change the last bar of your intraday data to the EOD close on the fly (write a method). You might have to adjust the High or Low of the intraday bar too.

profile picture

Cone

#8
This should do it:

CODE:
Please log in to see this code.


Be sure to update your Daily DataSet before calling this method!
profile picture

Eugene

#9
We've looked into the data and found no error. The nearby minute and 10-second bars in IQFeed data do not have a 188.06 close. The difference comes from their data (which we distribute as is) regardless of what you're being told.
profile picture

Cone

#10
If it's not clear in the TOS image I posted, the official closing trade occurred dozens of prints after the first one at 16:00:00.

For AMEX and NASDAQ, the closing print generally occurs at or very near 16:00:00. For NYSE stocks, it may occur minutes later.
profile picture

Gamba

#11
Ok, I guess I understand it. Thank you for the method to compute the daily prices.

But is it possible to trade live on the the next tick after the closing price, e.g. on SPY?

If I understand it right then I have to wait for the daily data. IQFeed has to update their daily data right after the close.
I will ask them, when it will be available.... so I guess it isn't possible to compute some calculations for day x
(based on the close) and then trade with MOC or some ticks after the close ...

So every computed indicator with daily close and every strategy which trades OnClose is a kind of peeking?
profile picture

Cone

#12
QUOTE:
But is it possible to trade live on the the next tick after the closing price, e.g. on SPY?
No. Not even if the Daily data were available on the last tick. Here's how it goes:

1. The last tick occurs at or before 15:59:59.999
2. 16:00:00 rolls around 1 ms later, and if everything is in sync, the bar closes.
3. The strategy executes.
4. Alerts may be generated.. but it's probably at least 16:00:00.020 now.

Disregarding any other delays (there are a few), this is already too late to enter an order into the regular market. While trading 1-minute bars, the options for MOC orders (as I see it) are:

Option 1. On the 15:49:00 bar (or earlier), collect all the MOC orders and enter them manually with your broker as MOC orders before 15:50 (10 minutes before the close).

Option 2: On the 15:59:00 bar, Sell or BuyAtMarket as your pseudo MOC order. Sometimes it will be better than waiting for 16:00, sometimes it will be worse.

profile picture

Gamba

#13
IQFeed says that daily closes of SPY will be available between 4:00pm and 4:15 pm.

So I guess, that with daily data I have to wait and BuyAtMarket after 4pm ... like you said, sometimes it will be better, sometimes it will be worse.... we will see.
profile picture

Cone

#14
QUOTE:
...BuyAtMarket after 4pm...
Not 4pm, but 1 minute before at 15:59:00. (And this you can backtest realistically.) Market orders are not allowed pre or post market hours.
profile picture

Gamba

#15
Is ist possible to add a synthetic bar manually to a chart or by program code?
The daily close is avaiable throu DTNIQ at 4:05 but arrives in Wealth-Lab at 4:15

I would like to calculate on SPY and trade on ES.
profile picture

Cone

#16
QUOTE:
The daily close is avaiable throu DTNIQ at 4:05 but arrives in Wealth-Lab at 4:15
In what timeframe? It's 'available' in what way?

QUOTE:
Is ist possible to add a synthetic bar manually to a chart or by program code?
No, you can't add or remove bars from the chart's Bars (or change Dates), but you could create a duplicate Bars object, delay everything by1 bar, and then change the values of the last bar to whatever you like.
profile picture

Gamba

#17
It is available through their software. Where I can see every Tick. The last Tick has a close some milliseconds or seconds after 4pm
and arrives earlier there than in Wealth-Labs daily timeframe.

I will give it a try with the additional Bars object ...
profile picture

Cone

#18
Okay, but it's clear now that "the last tick" is not necessarily the official closing price (the daily close), right? (Remember, the official close is the result of the closing auction on the primary market and is the price at which MOC orders are executed.)
profile picture

Gamba

#19
Yes Cone, that's clear. Creating an own Bars object seems to work. With some additional manual work I can now trade on the last close price rigth after the intraday close. Thank you for the hint.