浏览 14650 次
锁定老帖子 主题:2行代码获取股票历史交易数据
精华帖 (0) :: 良好帖 (3) :: 新手帖 (0) :: 隐藏帖 (9)
|
|
---|---|
作者 | 正文 |
发表时间:2011-09-23
#------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: bruce.lin.chn # # Created: 23/09/2011 # Copyright: (c) bruce.lin.chn 2011 # Licence: <your licence> #------------------------------------------------------------------------------- #!/usr/bin/env python import ystockquote #print ystockquote.get_price('002250.sz') #print ystockquote.get_all('002250.sz') print ystockquote.get_historical_prices('002500.sz', "20110919","20110923") 运行结果: *** Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32. *** >>> 21.20 {'stock_exchange': '"Shenzhen"', 'market_cap': 'N/A', '200day_moving_avg': '31.6461', '52_week_high': '42.30', 'price_earnings_growth_ratio': 'N/A', 'price_sales_ratio': 'N/A', 'price': '21.20', 'earnings_per_share': '0.00', '50day_moving_avg': '26.1162', 'avg_daily_volume': '1022660', 'volume': '1067959', '52_week_low': '20.57', 'short_ratio': 'N/A', 'price_earnings_ratio': 'N/A', 'dividend_yield': '0.93', 'dividend_per_share': '0.20', 'price_book_ratio': 'N/A', 'ebitda': '0', 'change': '-0.41', 'book_value': '0.00'} >>> [['Date', 'Open', 'High', 'Low', 'Close', 'Volume', 'Adj Clos'], ['2011-09-22', '22.05', '22.77', '21.60', '21.61', '836000', '21.6'], ['2011-09-21', '21.47', '22.17', '21.17', '22.11', '1505400', '22.1'], ['2011-09-20', '21.33', '22.09', '21.22', '21.70', '1206900', '21.7'], ['2011-09-19', '21.62', '21.90', '21.43', '21.52', '508600', '21.5']] >>> 详细用法参考: http://www.goldb.org/ystockquote.html https://github.com/diehl/Stock-Price-Time-Series-Analysis 感谢 Corey Goldberg! 002500.sz今天涨了 ^_^ 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2011-10-06
是python?
|
|
返回顶楼 | |
发表时间:2011-10-07
jieming 写道 是python?
是python。 |
|
返回顶楼 | |
发表时间:2011-10-09
两行代码???忽悠接着忽悠
|
|
返回顶楼 | |
发表时间:2011-10-09
忽悠谁呢,ystockquote有多少行代码
|
|
返回顶楼 | |
发表时间:2011-10-09
最后修改:2011-10-09
doublefloat 写道 忽悠谁呢,ystockquote有多少行代码
明显忽悠你嘛,楼上小朋友是X-2>=0的解集,鉴定完毕! |
|
返回顶楼 | |