捕获雅虎金融股票数据符号以了解每日突破、领先者等?
我想弄清楚是否有办法使用免费的雅虎财经股票数据来捕获: 1. 每日“领先者”,包含股票代码、ETF、期权等。 2. 有使用任何经典技术分析指标的突破符号吗? 3. 这可以实时完成吗? 有谁知道一种使用编程或自动化方式来做到这一点的方法?我使用了经典的“wget”或 C# 请求方法。任何网址都会有帮助。我只想将实际符号输出为文本、XML 或 CSV 格式。 非常感谢
I am trying to figure out if there is a way to capture using free Yahoo Finance stock data:
1. Daily 'leaders' with stock symbols, ETFs, options, etc.
2. Any breakout symbols using any classic tecnical analysis indicatoras?
3. Can this be done in real time?
Does any one know of a way to do this using programmatic or automated way? I have used the classic 'wget' or C# request methods. Any URLs would be helpful. I just want to output the actual symbols into a text, XML, or CSV format.
Many Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
上次我使用Yahoo的数据是大约一年前,他们没有API,所以我不得不通过修改URL来请求所有数据。您可以在我的博客上找到所有信息。
据我所知,没有任何查询会导致“每日领先者”,但如果它是报价的一部分(可能是),那么您应该能够得到它。
再说一遍,我不知道有什么方法可以向您显示突破符号来查询技术指标。但是,如果它是报价的一部分,那么您应该能够获取它。
是和否...您可以经常查询数据,但雅虎仅每 15 分钟更新一次数据。他们确实会“实时”更新一些符号,因此您可以在访问雅虎时以及雅虎刷新信息时获得更新。
Gummy stuff 在查询雅虎数据时提供了非常丰富的信息。您可以查询雅虎财经上显示的大部分数据。请注意,除了开盘价、最高价、最低价和收盘价之外,还有很多内容被视为“报价”的一部分,因此您可能能够获得所需的所有信息。
您可以获取 CSV 格式的报价: http://finance.yahoo.com/d/ quote.csv?s= + STOCK_SYMBOL(S) + &f= + TAG(S)
您还可以获取 CSV 格式的历史数据:http://www.google.com/finance/historical?q= STOCK_SYMBOL(S) + & + 输出=csv
Last time I used Yahoo's data was about a year ago and they didn't have an API, so I had to request all the data by modifying the URL. You can find all of the information on my blog.
As far as I know, there is no query which would result in "daily leaders", but if it's part of the quote (which it may be), then you should be able to get it.
Again, I don't know of any way to query for technical indicators in a manner that would show you the breakout symbols. However, if it's part of a quote, then you should be able to get it.
Yes and no... you can query the data frequently, but Yahoo only updates the data every 15 minutes. They do update some of the symbols in "real time", so you can get updates as frequently as you hit up Yahoo and as frequently as Yahoo refreshes the information.
Gummy stuff is VERY informative when it comes to querying Yahoo data. You can query most of the data shown on yahoo finance. Note that there are a lot more things that are considered as part of the "quote" than just the Open, High, Low and Close, so you might be able to get all the information that you need.
You can get quotes in CSV format: http://finance.yahoo.com/d/quotes.csv?s= + STOCK_SYMBOL(S) + &f= + TAG(S)
You can also get historical data in CSV format: http://www.google.com/finance/historical?q= STOCK_SYMBOL(S) + & + output=csv
以下是如何从雅虎财经获取 CSV 格式的历史每日股票价格:
[在下面的 URL 示例中将 ... 替换为 http://]
...ichart.finance.yahoo.com/table.csv?s=STOCK
,其中 STOCK 是股票代码。
您可以使用一些附加参数来限制返回的内容:
请注意,参数应使用 & 符号分隔,如下例所示:
http://icart.finance.yahoo.com/table.csv ?s=AAPL&g=m
示例:
...ichart.finance.yahoo.com/table.csv?s=AAPL&g=m
按月返回 Apple 股票价格
[尝试一下:将该值放入浏览器的地址栏中,然后按回车键。
您会发现 .csv 文件 {table.csv?} 已下载并保存到您的首选下载中
保存目录。]
另请注意,如果您希望使用程序代码来获取此数据,这是没有问题的:
您可以在下载时使用 WebClient 对象和该对象的
DownloadStringAsync() 方法 [我认为这就是该方法的名称]。
...icart.finance.yahoo.com/table.csv?s=AAPL&c=2010&a=10&b=22&f=2010&d=10&e=23
返回 2010 年 10 月 22 日的 Apple 股票数据(该示例中的参数
指定开始日期为 2010-10-22,结束日期为 2010-10-23)。
而且,您可以使用更多参数从 Yahoo 中提取信息
财经网站。例如(首先请注意,我们正在访问“引号”而不是
“table”{如上所述}此处):
...finance.yahoo.com/d/quotes.csv?s=GOOG+AAPL+MSFT+YHOO&f=snl1d1t1cv
将获取 Google、Apple、Microsoft 和 Yahoo 的股票数据。
它将获取以下参数的数据:-
提供以下 url(从代码以及浏览器?)
...finance.yahoo.com/d/quotes.csv?s=AAPL&f=l1
将导致下载包含以下内容的“逗号分隔”ASCII 流
单一值,即苹果股票的最后交易价格
(数据可能是 30 分钟左右的,但是哇,这太棒了,不是吗?)。
Here's how to grab historical daily stock prices from Yahoo Finance in CSV format:
[replace ... with http:// in the url examples below]
...ichart.finance.yahoo.com/table.csv?s=STOCK
where STOCK is the ticker symbol.
You can limit what that returns with some additional parameters:
Note that parameters should be separated with an ampersand, as in this example:
http://ichart.finance.yahoo.com/table.csv?s=AAPL&g=m
Examples:
...ichart.finance.yahoo.com/table.csv?s=AAPL&g=m
returns Apple stock prices by month
[give it a whirl: put that value in the address bar of your browser and hit return.
you'll find a .csv file {table.csv?} is downloaded and saved to your preferred download
save directory.]
Note also that should you wish to use progam code to grab this data that's no problem:
you can grab it as a stream as it downloads using the WebClient object and that object's
DownloadStringAsync() method [I think that's what the method is called].
...ichart.finance.yahoo.com/table.csv?s=AAPL&c=2010&a=10&b=22&f=2010&d=10&e=23
returns Apple stock data for 2010 October 22nd (the parameters in that example
specifying a start date of 2010-10-22 and an end date of 2010-10-23).
And, you can use many more parameters to pull out information from the Yahoo
Finance site. For example (note first that we're accessing "quotes" rather than
"table" {as above} here):
...finance.yahoo.com/d/quotes.csv?s=GOOG+AAPL+MSFT+YHOO&f=snl1d1t1cv
will fetch stock data of Google, Apple, Microsoft and Yahoo.
It will fetch data for the following parameters:-
provision the following url (from code as well as from a browser?)
...finance.yahoo.com/d/quotes.csv?s=AAPL&f=l1
WILL RESULT IN THE DOWNLOADING OF A "COMMA-SEPARATED" ASCII STREAM CONTAINING
A SINGLE VALUE, NAMELY THE LAST PRICE AT WHICH APPLE SHARES WERE TRADED
(the data may be 30 minutes old or so, but wow, that's awesome, is it not?).