Yahoo 提供了針對全球不同市場的Finance API, 是打造股市板塊異動監察的利器. Google 以前也有一套Finance API, 但自去年開始已不再支援, 因此Yahoo那套可說是目前市場上最完善的.一來不單有一般的報價資訊, 在一些常用的技術指標以及基本指標亦有相當支援,可以透過一句簡單的API 語句便可以更快地從Yahoo網站一次過獲取最多200只證券的資料 (可包括美股期權!) , 再透過自己開發的Excel VBA 程式來產生異動信號. 資料獲取的速度會比之前的通用版本為快, 可以更頻密的監察. 配合像IB, ETrade等的下單介面便可以構建一套"板塊異動交易系統".
API 的一般格式為 http://finance.yahoo.com/d/quotes.csv?s= 1 或多個股票號 &f = 相關欄位的標記
例如要找出Apple Inc, Google 及Yahoo 的股票號, 名稱, 交易日期, 即市價位, 周息率及P/E , 相關API為
http://finance.yahoo.com/d/quotes.csv?s=AAPL+GOOG+YHOO&f=snd1l1yr
相應結果如下
部分常用欄位標記如下
a Ask
a2 Average Daily Volume
a5 Ask Size
b Bid
b2 Ask (Real-time)
b3 Bid (Real-time)
b4 Book Value
b6 Bid Size
c Change & Percent Change
c1 Change
c3 Commission
c6 Change (Real-time)
c8 After Hours Change (Real-time)
d Dividend/Share
d1 Last Trade Date
d2 Trade Date
e Earnings/Share
e1 Error Indication (returned for symbol changed / invalid)
e7 EPS Estimate Current Year
e8 EPS Estimate Next Year
e9 EPS Estimate Next Quarter
f6 Float Shares
g Day’s Low
h Day’s High
j 52-week Low
k 52-week High
g1 Holdings Gain Percent
g3 Annualized Gain
g4 Holdings Gain
g5 Holdings Gain Percent (Real-time)
g6 Holdings Gain (Real-time)
i More Info
i5 Order Book (Real-time)
j1 Market Capitalization
j3 Market Cap (Real-time)
j4 EBITDA
j5 Change From 52-week Low
j6 Percent Change From 52-week Low
k1 Last Trade (Real-time) With Time
k2 Change Percent (Real-time)
k3 Last Trade Size
k4 Change From 52-week High
k5 Percebt Change From 52-week High
l Last Trade (With Time)
l1 Last Trade (Price Only)
l2 High Limit
l3 Low Limit
m Day’s Range
m2 Day’s Range (Real-time)
m3 50-day Moving Average
m4 200-day Moving Average
m5 Change From 200-day Moving Average
m6 Percent Change From 200-day Moving Average
m7 Change From 50-day Moving Average
m8 Percent Change From 50-day Moving Average
n Name
n4 Notes
o Open
p Previous Close
p1 Price Paid
p2 Change in Percent
p5 Price/Sales
p6 Price/Book
q Ex-Dividend Date
r P/E Ratio
r1 Dividend Pay Date
r2 P/E Ratio (Real-time)
r5 PEG Ratio
r6 Price/EPS Estimate Current Year
r7 Price/EPS Estimate Next Year
s Symbol
s1 Shares Owned
s7 Short Ratio
t1 Last Trade Time
t6 Trade Links
t7 Ticker Trend
t8 1 yr Target Price
v Volume
v1 Holdings Value
v7 Holdings Value (Real-time)
w 52-week Range
w1 Day’s Value Change
w4 Day’s Value Change (Real-time)
x Stock Exchange
y Dividend Yield
如果要監察的股數多於200, 那只要多發另一個API也就解決問題.
當然這個API也不是解決所有問題, 除了美股以外市場並非實時外(一般有約15-30分鐘延後), 有些寶貴的資訊也不可由API直接獲得, 像分析員買賣意見統計, 一些基於Financial Statement 的深入分析 (像現金流增長). 這就需要回歸基本技巧去獲取 (一般這些資訊的有效期比較長, 並不需天天獲取, 故對電腦資源要求並不高)
有關各市場的延後可看下表
Country | Exchange | Suffix | Delay | Data Provider |
United States of America | BATS Exchange | N/A | Real-time | Direct from Exchange |
United States of America | Chicago Board of Trade | .CBT | 10 min | Interactive Data Real-Time Services |
United States of America | Chicago Mercantile Exchange | .CME | 10 min | Interactive Data Real-Time Services |
United States of America | Dow Jones Indexes | N/A | Real-time | Interactive Data Real-Time Services |
United States of America | NASDAQ Stock Exchange | N/A | Real-time* | Direct from Exchange |
United States of America | New York Board of Trade | .NYB | 30 min | Interactive Data Real-Time Services |
United States of America | New York Commodities Exchange | .CMX | 30 min | Interactive Data Real-Time Services |
United States of America | New York Mercantile Exchange | .NYM | 30 min | Interactive Data Real-Time Services |
United States of America | New York Stock Exchange | N/A | Real-time* | Direct from Exchange |
United States of America | NYSE Mkt | N/A | Real-time* | Direct from Exchange |
United States of America | OPRA | N/A | 15 min | Interactive Data Real-Time Services |
United States of America | OTC Bulletin Board Market | N/A | Real-time* | Direct from Exchange |
United States of America | OTC Markets Group | N/A | 15 min | NASDAQ Stock Exchange |
United States of America | S & P Indices | N/A | Real-time | Interactive Data Real-Time Services |
Argentina | Buenos Aires Stock Exchange | .BA | 30 min | Interactive Data Real-Time Services |
Austria | Vienna Stock Exchange | .VI | 15 min | SIX Financial Information |
Australia | Australian Stock Exchange | .AX | 20 min | Interactive Data Real-Time Services |
Brazil | BOVESPA - Sao Paolo Stock Exchange | .SA | 15 min | Interactive Data Real-Time Services |
Canada | Toronto Stock Exchange | .TO | 15 min | Interactive Data Real-Time Services |
Canada | TSX Venture Exchange | .V | 15 min | Interactive Data Real-Time Services |
Chile | Santiago Stock Exchange | .SN | 15 min | Interactive Data Real-Time Services |
China | Shanghai Stock Exchange | .SS | 30 min | Interactive Data Real-Time Services |
China | Shenzhen Stock Exchange | .SZ | 30 min | Interactive Data Real-Time Services |
Denmark | Copenhagen Stock Exchange | .CO | 15 min | SIX Financial Information |
France | Euronext | .NX | 15 min | SIX Financial Information |
France | Paris Stock Exchange | .PA | 15 min | SIX Financial Information |
Germany | Berlin Stock Exchange | .BE | 15 min | SIX Financial Information |
Germany | Bremen Stock Exchange | .BM | 15 min | SIX Financial Information |
Germany | Dusseldorf Stock Exchange | .DU | 15 min | SIX Financial Information |
Germany | Frankfurt Stock Exchange | .F | 15 min | SIX Financial Information |
Germany | Hamburg Stock Exchange | .HM | 15 min | SIX Financial Information |
Germany | Hanover Stock Exchange | .HA | 15 min | SIX Financial Information |
Germany | Munich Stock Exchange | .MU | 15 min | SIX Financial Information |
Germany | Stuttgart Stock Exchange | .SG | 15 min | SIX Financial Information |
Germany | XETRA Stock Exchange | .DE | 15 min | SIX Financial Information |
Greece | Athens Stock Exchange | .AT | 15 min | SIX Financial Information |
Hong Kong | Hong Kong Stock Exchange | .HK | 15 min | Interactive Data Real-Time Services |
India | Bombay Stock Exchange | .BO | 15 min | Interactive Data Real-Time Services |
India | National Stock Exchange of India | .NS | Real-time** | National Stock Exchange of India |
Indonesia | Jakarta Stock Exchange | .JK | 10 min | Interactive Data Real-Time Services |
Israel | Tel Aviv Stock Exchange | .TA | 20 min | SIX Financial Information |
Italy | Milan Stock Exchange | .MI | 20 min | SIX Financial Information |
Japan | Nikkei Indices | N/A | 30 min | Interactive Data Real-Time Services |
Mexico | Mexico Stock Exchange | .MX | 20 min | SIX Financial Information |
Netherlands | Amsterdam Stock Exchange | .AS | 15 min | SIX Financial Information |
New Zealand | New Zealand Stock Exchange | .NZ | 20 min | Interactive Data Real-Time Services |
Norway | Oslo Stock Exchange | .OL | 15 min | SIX Financial Information |
Russia | Moscow Interbank Currency Exchange (MICEX) | .ME | 15 min | SIX Financial Information |
Singapore | Singapore Stock Exchange | .SI | 20 min | Interactive Data Real-Time Services |
South Korea | Korea Stock Exchange | .KS | 20 min | Interactive Data Real-Time Services |
South Korea | KOSDAQ | .KQ | 20 min | Interactive Data Real-Time Services |
Spain | Barcelona Stock Exchange | .BC | 15 min | SIX Financial Information |
Spain | Bilbao Stock Exchange | .BI | 15 min | SIX Financial Information |
Spain | Madrid Fixed Income Market | .MF | 15 min | SIX Financial Information |
Spain | Madrid SE C.A.T.S. | .MC | 15 min | SIX Financial Information |
Spain | Madrid Stock Exchange | .MA | 15 min | SIX Financial Information |
Sweden | Stockholm Stock Exchange | .ST | 15 min | SIX Financial Information |
Switzerland | Swiss Exchange | .SW | 30 min | SIX Financial Information |
Taiwan | Taiwan OTC Exchange | .TWO | 20 min | Interactive Data Real-Time Services |
Taiwan | Taiwan Stock Exchange | .TW | 20 min | Interactive Data Real-Time Services |
United Kingdom | FTSE Indices | N/A | 15 min | SIX Financial Information |
United Kingdom | London Stock Exchange | .L | 20 min | SIX Financial Information |
United Kingdom | London Stock Exchange | .IL | 20 min | SIX Financial Information |
沒有留言:
張貼留言