找回密码
 注册
搜索
查看: 4486|回复: 45

[灌水] 求助:需要一个能够提供实时全景数据的数据源

[复制链接]
发表于 2010-7-28 11:05 AM | 显示全部楼层 |阅读模式


需要一个稳定的数据源能够在收盘前给出所有股票的open, high, low, close, volume。我需要这些数据来筛选股票。因为最后会对选中的股票market buy at close,所以需要实时数据,而且越接近收盘越好,比如收盘前1分钟。用6000个股票计算,这些数据(8 bytes [symbol] + 4 bytes x 4 [open, high, low, close] + 4 bytes [close] ~ 30 bytes per symbol)不超过200K,所以下载所需的带宽和时间都不是问题。可是我看了若干家数据供应商,似乎都不提供这种功能。最常见的是500 symbol stream data,这个功能我当然也需要,用来监视所持股票的日内波动。不过500 symbol太少了,没法用来做market-wide scan。
发表于 2010-7-28 11:26 AM | 显示全部楼层
我不知道。但可以帮你顶顶。 :(13):

评分

1

查看全部评分

回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-28 11:40 AM | 显示全部楼层
需要一个稳定的数据源能够在收盘前给出所有股票的open, high, low, close, volume。我需要这些数据来筛选股 ...
Diffusion 发表于 2010-7-28 13:05



    IB API

评分

1

查看全部评分

回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-28 11:41 AM | 显示全部楼层
我不知道。但可以帮你顶顶。
Poo 发表于 2010-7-28 13:26



    haha, 谢谢。

顺便自己顶一下。
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-28 11:42 AM | 显示全部楼层
IB API
black 发表于 2010-7-28 13:40


谢谢黑老大。
我昨天看了一遍IB API的在线文档,似乎没有找到合适的method. 还请告知method name.
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-28 11:45 AM | 显示全部楼层
谢谢黑老大。
我昨天看了一遍IB API的在线文档,似乎没有找到合适的method. 还请告知method name. {:6 ...
Diffusion 发表于 2010-7-28 13:42



    method for what?  do a scan first to get symbol, then get price for each one, then calculate, then send order.
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-28 11:51 AM | 显示全部楼层
method for what?  do a scan first to get symbol, then get price for each one, then calcula ...
black 发表于 2010-7-28 13:45



我看了遍文档,觉得IB API里面最合适的method就是reqHistoricalDataEx(),因为这个提供daily open, high, low, close, volume。可是根据文档中说法,http://www.interactivebrokers.co ... 621_Historical_Data

Also, observe the following limitation when requesting historical data:

·          Do not make more than 60 historical data requests in any ten-minute period.


所以根本没法实时的取得6000个symbol的数据。

或者black老大是说其他method?
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-28 12:00 PM | 显示全部楼层
我看了遍文档,觉得IB API里面最合适的method就是reqHistoricalDataEx(),因为这个提供daily open, h ...
Diffusion 发表于 2010-7-28 13:51



    try reqMktData(), the tickPrice(). u can also make ur program smarter, you don't need to wait till the last minute to get yesterday close and open.

评分

1

查看全部评分

回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-28 12:05 PM | 显示全部楼层
try reqMktData(), the tickPrice(). u can also make ur program smarter, you don't need to w ...
black 发表于 2010-7-28 14:00



    嗯,正在看文档,应该可以。就是不知道process 6000个symbol需要多少时间。等我试试,如果有问题在来问。

是的,历史数据可以头一天晚上都准备好。
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-28 12:08 PM | 显示全部楼层
借你两人气。IB 里有没有option historical time of sales information?
最近想开个IB账号。
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-28 12:08 PM | 显示全部楼层
嗯,正在看文档,应该可以。就是不知道process 6000个symbol需要多少时间。等我试试,如果有问题 ...
Diffusion 发表于 2010-7-28 14:05



    u seriously need to process 6k US stock symbols? a lot of them are just not tradable.
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-28 12:13 PM | 显示全部楼层
u seriously need to process 6k US stock symbols? a lot of them are just not tradable.
black 发表于 2010-7-28 14:08



    Yes I exaggerated a little bit.

I think 3000 would be enough. I said 6000 because my back testing was done on a universe of 8000 stocks, but I'm sure a lot of them were filtered out by volume / price limit.
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-28 12:16 PM | 显示全部楼层
借你两人气。IB 里有没有option historical time of sales information?
最近想开个IB账号。
Poo 发表于 2010-7-28 14:08



    似乎IB的historical data都是bar data,没有time of sales。
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-28 12:36 PM | 显示全部楼层
似乎IB的historical data都是bar data,没有time of sales。
Diffusion 发表于 2010-7-28 14:16


谢了
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-28 12:58 PM | 显示全部楼层
TD API has a method to get stock snapshot which gives you the open, high, low, and last (the level I data) but you need to have an TD account and API account. TD uses hppts to access data.

IB also has similar function  - realtimeBar(), which gives you the open, high, low, etc. IB needs ActiveX or Java runningon top of its gateway.

Hope it helps.

评分

1

查看全部评分

回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-28 02:43 PM | 显示全部楼层
I am Not that level yet.

评分

1

查看全部评分

回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-28 02:59 PM | 显示全部楼层
回复 12# Diffusion

Diffusion同学,你的要求IB应该做不到。reqMarketData or realtime bars has a limit. 超过70个,就很慢了。超过100个,IB TWS估计要crash了。historical data也不行,每10分钟只能连续发60个请求左右,而且很多股票没有数据,连SP500都收不齐,DJI+NDX倒还是有的。

你可以去试试TD,但不知道是否需要额外费用。想免费的话可以试试google finance,用portfolio page,每个portfolio可容纳200个股票。拿20个portfolio估计够用了。每抓一个算5秒的话,100秒就全部抓下来了。

大功告成之后,不要忘了给我也发个交易信号。

评分

1

查看全部评分

回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-28 03:09 PM | 显示全部楼层
回复  Diffusion

Diffusion同学,你的要求IB应该做不到。reqMarketData or realtime bars has a limit. ...
Timber 发表于 2010-7-28 16:59



    Amazingly smart!
But is it realtime? I know the close (last) price is realtime, but how about high, low, and volume?
And I just noticed that it can "download to spread sheet". Let me see see.

还有一问, reqMktDataEx有个snapshot switch, when switched on, it will return the data and automatically cancel the request. So you don't maintain the "data connection" to the server. I'm wondering when you say 100 will crash TWS, do you mean 100 concurrent "data connection", or 100 consecutive 'snapshot"?
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-28 03:10 PM | 显示全部楼层
I am Not that level yet.
ranchgirl 发表于 2010-7-28 16:43



    加5分鼓励一下.:lol
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-28 03:11 PM | 显示全部楼层
本帖最后由 Diffusion 于 2010-7-28 17:14 编辑
    reqMktDataEx()  is asyn result. It triggers event to send you a piece of price at a time. You have to put them together which might not be a snapshot though.

   I haven't done that yet. It seems IB API is slower although IB says it is real time. I guess the network traffic is quite heavy.
In general, IB is better than TD, at least for commision. Sometimes, TD's data is not very accurate. I don't have much experience in IB. You'd better ask those gurus in Hutong. I know there are lots of people use IB to do program trades. Most of apps using TD API are analysis based.
sd_engine 发表于 2010-7-28 14:58



     把老大在另外一个帖子里面的发言转过来.

As for reqMktDataEx(), I think one request will have 5 separate returns, each for one of OHLC, and volume. And I have to assemble them together to form a snapshot. According to the document, when ever any of OHLC or volume changed, it will send in an update of the one that changed. So I think I'll still have a real-time snapshot if I maintain all the rest.
回复 鲜花 鸡蛋

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|www.hutong9.net

GMT-5, 2025-8-8 01:03 AM , Processed in 0.097873 second(s), 24 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表