문제

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

도움이 되었습니까?

해결책

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.

  1. Daily 'leaders' with stock symbols, ETFs, options, etc.

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.

  1. Any breakout symbols using any classic tecnical analysis [indicators]?

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.

  1. Can this be done in real time? Does any one know of a way to do this using programmatic or automated way?

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.

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

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

다른 팁

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

  s - Ticker symbol. This is the only parameter that isn't optional.
    [eg Apple's ticker symbol is AAPL]

  Start date for historical prices:

  a - Month number, starting with 0 for January.

  b - Day number, eg, 1 for the first of the month.

  c - Year.

  End date for historical prices (default is the most current available closing price):

  d - Month number, starting with 0 for January.

  e - Day number, eg, 1 for the first of the month.

  f - Year.

  And finally, the frequency of historical prices:

  g - Possible values are 'd' for daily (the default), 'w' for weekly, and 'm' for monthly.

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:-

s = Symbol
n = Name
l1 = Last Trade (Price Only)
d1 = Last Trade Date
t1 = Last Trade Time
c = Change and Percent Change
v = Volume

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?).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top