现在的位置: 首页 > 综合 > 正文

matlab提取A股市场数据

2013年10月05日 ⁄ 综合 ⁄ 共 384字 ⁄ 字号 评论关闭

可以用matlab计算:如下

>> clear
>> c=yahoo

c =

     url: 'http://finance.yahoo.com'
      ip: []
    port: []

>> D=fetch(c,'601006.ss','Close','03/01/08','04/01/08');%获得大秦铁路3月份收盘价
>> p=D(:,2)

p =

   16.8000
   17.3000
   17.7700
   16.7400
   17.0100
   17.1900
   17.4800
   17.5000
   16.5600
   15.8000
   16.5400
   17.1000
   18.0400
   18.8400
   18.2600
   19.6000
   19.4500
   18.6100
   19.4600
   20.0800

>> length(find(diff(p)>0))%计算上涨天数

ans =

    13

抱歉!评论已关闭.