GetSessionOpen() returns exchange's official open?
Author: kazuna
Creation Date: 7/19/2020 8:22 AM
profile picture

kazuna

#1
Does GetSessionOpen() returns exchange's official open when it is called at the first bar (9:31) of the day when running on intraday streaming data?

I know the implementation is vary from provider to provider, so my question is about Fidelity and IQFeed providers.

If GetSessionOpen() returns exchange's official open, it could be different from the intra bar data (Open[bar - Bars.IntradayBarNumber(bar)])?

I got this question when I found the open price at 9:31 intra bar is different from the open price of daily bar with IQFeed. I guess this is because IQFeed has pre-market bar data. I think I have never seen it with Fidelity, probably because of the data correction?

For backtesting, I fixed it by using the open price from the daily bar instead.

But for live streaming, I wonder if I should use GetSessionOpen() instead of Open[bar - Bars.IntradayBarNumber(bar).
profile picture

Eugene

#2
QUOTE:
I got this question when I found the open price at 9:31 intra bar is different from the open price of daily bar with IQFeed. I guess this is because IQFeed has pre-market bar data. I think I have never seen it with Fidelity, probably because of the data correction?


Starting from client v6.1, IQFeed started including premarket and aftermarket data. Later we may consider providing an interface to include/exclude it on demand via a Data Manager tab.

Cone can tell for sure if the open price can be attributed to this reason or it is something else.
profile picture

kazuna

#3
Any idea about GetSessionOpen() whether or not it's coming from exchange's official open?
profile picture

Cone

#4
The "official open" is the primary exchange's opening trade. Data providers do not report this trade as they do for settled close.

Settled Close:
All EOD providers will return the same value for the settled close. Note that this trade often occurs several minutes after 4pm for NYSE stocks and often differs from the intraday data last trade/close before 4pm.

Official Open:
All providers, except one, that I know of returns the first full-lot trade (100 shares or more) as the opening price. This price won't (or is unlikely to) vary between EOD and intraday data. There is only one provider that I know of that returns the "primary exchange's opening trade", and that's Wealth-Data. Note that Wealth-Data is limited to S&P 500 and Nasdaq 100 stocks (and a handful of other symbols), and it doesn't currently support GetSessionOpen().. we could work on that if it would be helpful.

.. crud.. edited the above and lost what I had below.. I think I said something like ...

Nasdaq stocks almost invariable open with the primary market at 09:30:00.

The primary exchange open for NYSE stocks, however, most often occurs within seconds of the opening bell, but not uncommonly can occur several minutes after - even after thousands of shares have traded hands on other exchanges.
profile picture

kazuna

#5
So what's the issue I'm observing with IQFeed?

The intraday open price at 9.31 is different from the daily open price.

Fidelity doesn't seem to have this problem.

Is the difference coming from the pre-market data with IQFeed?
profile picture

Cone

#6
Give me a specific example. The opening price for 5 stocks that I just checked were precisely the same between intraday and daily data.

It's possible that IQFeed has started reporting odd-lot trades (fewer than 100 shares). Until recently, odd-lot trades did not influence chart data.
profile picture

kazuna

#7
Here is an example:

SOXX @ 2020/07/17 09/31

IQFeed - 1 Minute
O:280.56
H:281.00
L:280.31
C:280.64

IQFeed - Daily
O:280.33

Fidelity - 1 Minute
O:280.33
H:281.00
L:280.31
C:280.64

Fidelity - Daily
O:280.33

Thank you for your help.
profile picture

Cone

#8
Well, crud. You found an extended trade that occurred after 093000. The IQFeed provider gives you all trades (extended hours too) and then you can filter by time using the Market Manager. The problem in this case is that this extended hours trade occurred after 093000.



Maybe in the future, we can provide an option to only download regular session trades, then your intraday data would be more like that from the Fidelity provider.

Note that the first trade at 280.33 on EDGE just happened to match the official opening price on NYSE/ARCA.

p.s., From your DTN/IQFeed installation folder, you can run this and other apps too.
profile picture

kazuna

#9
Any idea what would have happened with the real streaming bar at that time?
The IQFeed streaming bar @ 9:31 would have filtered the extended trade?

I'm also curious what GetSessionOpen() would have returned at 9:31.
The same open price as the streaming data or the official open price?

QUOTE:
Maybe in the future, we can provide an option to only download regular session trades, then your intraday data would be more like that from the Fidelity provider.
May I submit a feature request via Ticket Center?
profile picture

Eugene

#10
QUOTE:
May I submit a feature request via Ticket Center?

It won't hurt. Let's put this on our growing list of enhancements of the IQFeed provider.
profile picture

Cone

#11
QUOTE:
The IQFeed streaming bar @ 9:31 would have filtered the extended trade?
Presumably no. The provider does not filter trades - you should be able to monitor pre-market activity in a chart. Currently, the Market Manager filters will filter by time, not trade condition.

QUOTE:
I'm also curious what GetSessionOpen() would have returned at 9:31.
It depends on the DataSet. If you requested it from an IQFeed EOD DataSet, then it would have been the EOD data open - which is NOT NECESSARILY THE OFFICIAL OPEN. Look at the image again. 280.33 just happened to be the first full-lot trade (reported by most providers) and it matched the primary market (official) open several trades later (although I'm stumped why the trade volume is showing 0 there.) Remember, no provider will give you the Official (primary market) Open every time except Wealth-Data.
profile picture

kazuna

#12
Even if IQFeed provider is updated to download regular session trades only, those extended trades at 9:30 won't be filtered?
profile picture

kazuna

#13
Fidelity Deta Provider supports GetSessionOpen but IQFeed Data Provider doesn't support it?
I'm testing IQFeed Data Provider for streaming and GetSessionOpen returns ZERO.
GetSessionOpen has been working flowlessly with Fidelity Data Provider.
profile picture

Eugene

#14
No, it's not supported currently.
profile picture

kazuna

#15
Could you consider your IQFeed Data Provider to support GetSessionOpen() to return the price from the trade that has the trade condition marked as Official Open?
profile picture

Eugene

#16
We'll mark to look into it later. The list of IQFeed requests is getting big.
profile picture

kazuna

#17
After testing IQFeed realtime data on WLD this morning, so far I concluded that my daytrade strategies don't work with the current implementation. Unless IQFeed Data Provider gets updated with handling either intraday only filter that is to filter out extended hours trades after 09:30 or suppoting GetSessionOpen() that is to honor the Official Open trade condition, I just cannot daytrade with WLD/IQFeed.

On the other hand, WLP is still running on the same desktop and it's working flawlessly. I confirmed the open price on WLP matches to the other trading platform but the open price on WLD/IQFeed doesn't.
profile picture

Eugene

#18
Can you use GetSessionOpen() on a Yahoo! DataSet with "Always return data with partial bar" activated in Data Manager's Yahoo tab?
profile picture

kazuna

#19
I will give it a shot but GetSessionOpen works only for the primary symbol selected for the chart window, correct?
For intraday, I want to use IQFeed realtime data, so it's going to be a little complicated.
profile picture

Eugene

#20
QUOTE:
I will give it a shot but GetSessionOpen works only for the primary symbol selected for the chart window, correct?

Can't remember such limitation. The call should simply translate to the static provider's underlying method. Give it a try.

QUOTE:
Unless IQFeed Data Provider gets updated with handling either intraday only filter that is to filter out extended hours trades after 09:30 or suppoting GetSessionOpen() that is to honor the Official Open trade condition, I just cannot daytrade with WLD/IQFeed.

I've marked your suggestions for review. Please note that our list of feature requests grows in general as the WLP/D transition continues so an immediate resolution is unlikely.
profile picture

kazuna

#21
QUOTE:
Can't remember such limitation. The call should simply translate to the static provider's underlying method. Give it a try.
You mean I should try using Yahoo! DataSet as the realtime data for the streaming chart?

My understanding is that Yahoo! is for EOD but it may return partial open price if accessed during the day, so I may be able to obtain the official open price from Yahoo!. But my strategy requires intraday data from IQFeed, so the streaming window is connected to IQFeed dataset. If the streaming window calls GetSessionOpen(), which data provder whether IQFeed or Yahoo! is used? I think it is IQFeed in this case. So the solution doesn't really work well.
profile picture

Eugene

#22
Good point. The workaround seems kludgy if possible. A SetContext(DataSet name, symbol, sync) could help but it doesn't exist.

Maybe it could work if you requested the Yahoo symbol's data with GetExternalSymbol (which accepts dataSetName as a param) and then used Open.PartialValue for this Bars object?

How can indicators use PartialValue?

Of course, "Always return data with partial bar" should be enabled in Yahoo! settings. Disclaimer: I haven't tested it.
profile picture

kazuna

#23
Unfortunately, Yahoo's Open.PartialValue returns NaN.

profile picture

Eugene

#24
Right. :\ Well, here's some undocumented way to get there using internal methods. The trick is to instantiate Yahoo static data provider and call the method which drives GetSessionOpen's implementation:

CODE:
Please log in to see this code.


Hope this helps.
profile picture

kazuna

#25
Does it also work for IQFeed Data Provider?
profile picture

Eugene

#26
No, not yet: GetSessionOpen is not implemented there. And once it will be, there'll be no need in this workaround.
profile picture

kazuna

#27
Yahoo Data Provider implemented it but the workaround is needed, why is that?
profile picture

Eugene

#28
Because you're using IQFeed.
profile picture

kazuna

#29
OK so I use IQFeed as primary symbol and Yahoo as secondary symbol, because GetSessionOpen() doesn't work for secondary symbol, thus the workaround is required for Yahoo symbol to get GetSessionOpen() to work?
profile picture

Eugene

#30
Right.

1. GetSessionOpen is not implemented in IQFeed yet.
2. GetSessionOpen doesn't work for secondary symbol (Yahoo).
3. Code above peeks into Yahoo's own GetSessionOpen (internal method) while working with IQFeed as the primary data.

It's all in the code:
CODE:
Please log in to see this code.
profile picture

kazuna

#31
I tried it out today but unfortunately this Yahoo! solution doesn't work well.
For the first 20 minutes to 30 minutes since market opened, GetSessionOpen() returns something other than the opening price.
It may be coming from the previous day or the extended hours, I have no idea exactly where it is coming from.
Eventually, at around 09:40 - 09:59 ET, the open price gets updated with the official open price.

You never know when the open price is updated and because of the stale open price for the first tens of minutes, you just cannot rely on it.
profile picture

Eugene

#32
Hmm this looks like the effect of delayed price.
profile picture

kazuna

#33
Yeah, it sounds like that. So we really need to get the official open from IQFeed data provider (an account with realtime data subscription), then.
profile picture

kazuna

#34
Any other alternatives you can think of?

WLD+IQFeed is working great so far for backtesting but not for realtime trading because of the open price.
profile picture

Eugene

#35
Well, it sounds like we need to add an option to only download regular session trades for you. It's on the list of IQFeed provider enhancements along with other 6, and half of them look like medium to large effort.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).