股票数据获取处理和显示的开发笔记
2015-01-11 14:10
169 查看
IDE :jetbraints webstorm 5.0.1
jdk :jdk1.6.0_31
3d :three.js
目的:获取股市数据,以3d的方式展示出来。
目的1:获取股票名称列表、代码列表和总股本列表
目的2:获取每一只股票的历史收盘数据,日线。
目的3:以频率 天/间隔 刷新以总股本为面积的,以收盘价为立方体
2015-01-11
这里都是取得实时数据所需要了解的东西。http://www.gummy-stuff.org/Yahoo-data.htm 可能关于雅虎的数据格式比较详细的介绍都来自这里,但是我打开链接一看,被雅虎干了
。可以理解,人家是混pv的嘛,大家都搞了后台数据刷刷啥的肯定不行了。不过应该雅虎犯不着改代码,代价太大了,而且尝试了一下网页取数据没问题。
I've deleted this web page after having received the following email:
Dear Peter Ponzo,
I serve as copyright counsel for Yahoo and write to you with respect to your site http://gummy-stuff.org, specifically the page located at http://www.gummy-stuff.org/Yahoo-data.htm.
Yahoo offers certain services on its website, including the Yahoo Finance service available at finance.yahoo.com, subject to its Terms of Service, located at https://info.yahoo.com/legal/us/yahoo/utos/utos-173.html. It has come to our attention, through a data partner, that your page located at http://www.gummy-stuff.org/Yahoo-data.htm provides a tool and instructions for using the tool to enable users to hack the Yahoo Finance site.
......
Sincerely,
继续寻找相关的格式介绍啦。
http://www.financialwisdomforum.org/gummy-stuff/Yahoo-data.htm 吼吼这里有哦。
直接无牙的直接引用了,不需要一声感谢。怎么调行高?全靠空格 翻译几个咱需要的
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(代码 沪市+.ss 深市+.sz) | 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 |
查询请求范例:http://download.finance.yahoo.com/d/quotes.csv?s=601727.ss&f=as
这里有一个合集可以参考参考:
http://thesimplesynthesis.com/article/finance-apis
关于实时的获取qutes.csv已经了解了大概了,但关于table.csv获取的历史数据还是搞不清楚参数是什么标准:直到,我找到了这个
https://community.jaspersoft.com/wiki/building-custom-datasource-yahoo-finance-data
看上去很详细的哦样子哦。研究下。
遇到了一个问题,因为我使用js,试图从本地向雅虎的服务器发请求,导致了跨域访问错误。一度尝试更换一个3d引擎,但是想想就麻烦。还有没有其他路线可以走呢?
2015-01-13 00:59
找到个办法哦 ,唉,其实很土的办法了,从服务器上使用jsp页面先从服务器上抓数据下来,等待js页面上的请求去使用一个很牛的jsonp方法,到我自己建设的服务器上搞定。
原理自己再复习一下哦,因为js标签 <script> 的 src属性是可以从服务器上取回值的。可以在服务器上设置一个暗号,一旦有一个客户端的js中都有一个src是需要到某一个特定的url,则替换成为一段json。也就把所有的内容都搞到客户端上去了。
测试使用:
http://ichart.finance.yahoo.com/table.csv?s=002001.SZ&a=0&b=1&c=2014&d=0&e=13&f=2015&g=d
BufferedInputStream bis = new BufferedInputStream( new URL(Url).openStream());
</pre><span style="font-size:32px;color:#3333ff;">2015-01-14 23:52</span>
服务器从雅虎的服务器上获取股票信息的时候,历史数据,出问题,总是在取回2000左右的时候,变得无法继续下去了。
不知道是不是服务器端的控制,只有多扫几遍了。
依然还有几只股票获取不到信息。就这样吧。
002160 404
002318 Connection reset
002319 Connection reset 002710 404
002720 Connection reset 002724 404
002730 404
002731 404
002733 Connection reset 002734 Connection reset 002735 404
002736 404
002738 404
002739 404
002740 404
300318 [code]300361
300364
300388
300389
300392
300396
300397
300400
300402
300403
300405
300406
300409
300411
以上皆是 Connection reset
[/code]
2015-01-18
这几天时间花费在如何整理获取回来的一大堆数据上面,虽然只取得了一年的数据,但是体量还是很大。为了在后期,查询的时候速度快,把以股票为单位的文件中的按照时间排列的价格文件,取出来,转换为一个整体文件。在这个整体文件中,每一行都是一个gson字符串,表示的是每一个天为时间单位,的所有股票的价格。
这样在服务器为外部提供检索的时候,就可以根据时间,进行快速的获取当前所有股票的close收盘价格。
2015-01-26
three.js scene更新children的时候,最好是在渲染之后,就直接把所有的模型都删除掉,否则,很容易出现长期占有内存不释放,当重复的时候,容易出错。而且要对多边形、材质、和模型,都调用dispose()。
无图无真相,,上个截屏为证。
黄色的条,是股市的总体量,天文数字哦。[/code]
相关文章推荐
- Kinect开发学习笔记之(四)提取颜色数据并用OpenCV显示
- Kinect开发学习笔记之(四)提取颜色数据并用OpenCV显示(转)
- Kinect for Windows V2和V1对比开发___彩色数据获取并用OpenCV2.4.10显示
- Kinect for Windows V2和V1对照开发___彩色数据获取并用OpenCV2.4.10显示
- SilverLight商业应用程序开发---学习笔记(6)从服务器中获取数据之二
- oc开发笔记3 录音时频率获取 以及声像显示
- Kinect for Windows V2和V1对比开发___骨骼数据获取并用OpenCV2.4.10显示
- IOS开发学习笔记028-UITableView单组数据显示代码优化
- Qt实战之开发软件数据获取助手(eventFilter处理鼠标按下,event处理鼠标松开)
- Windows Phone 开发学习笔记(十一) RSS阅读器之显示数据
- Kinect for Windows V2和V1对比开发___骨骼数据获取并用OpenCV2.4.10显示
- [开发笔记]-获取天气数据接口
- 从php获取json数据使用js读取显示到网页笔记
- Kinect开发学习笔记之(四)提取颜色数据并用OpenCV显示
- 合肥公交换乘模块开发实录 -- 获取/处理数据
- kinect sdk开发入门WPFdemo笔记[2] 获取深度数据
- Kinect开发笔记之(五)提取颜色数据并用OpenCV显示
- SPRING IN ACTION 第4版笔记-第五章BUILDING SPRING WEB APPLICATIONS-006-处理表单数据(注册、显示用户资料)
- ZP的EXTJS学习笔记(三)——邮箱功能的开发(按钮事件、下拉框、分页、record小图标、整条数据格式处理、定时刷新、record复选删除、分组)
- 微信企业号开发:获取数据权限错误如何处理