matlab实现实时获取股票数据.pdf

上传人:wj 文档编号:3431609 上传时间:2023-05-05 格式:PDF 页数:10 大小:88.14KB
下载 相关 举报
matlab实现实时获取股票数据.pdf_第1页
第1页 / 共10页
matlab实现实时获取股票数据.pdf_第2页
第2页 / 共10页
matlab实现实时获取股票数据.pdf_第3页
第3页 / 共10页
matlab实现实时获取股票数据.pdf_第4页
第4页 / 共10页
matlab实现实时获取股票数据.pdf_第5页
第5页 / 共10页
matlab实现实时获取股票数据.pdf_第6页
第6页 / 共10页
matlab实现实时获取股票数据.pdf_第7页
第7页 / 共10页
matlab实现实时获取股票数据.pdf_第8页
第8页 / 共10页
matlab实现实时获取股票数据.pdf_第9页
第9页 / 共10页
matlab实现实时获取股票数据.pdf_第10页
第10页 / 共10页
亲,该文档总共10页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

matlab实现实时获取股票数据.pdf

《matlab实现实时获取股票数据.pdf》由会员分享,可在线阅读,更多相关《matlab实现实时获取股票数据.pdf(10页珍藏版)》请在冰点文库上搜索。

matlab实现实时获取股票数据.pdf

%stockget.m%该代码实现了从新浪提供的股票数据网站上实时抓取数据并且的功能%抓取网页信息clcStockCode=300191;%股票代码if(StockCode=999999)symbol=strcat(sh000001);elseif(StockCode=600000)symbol=strcat(sh,num2str(StockCode);elsesymbol=strcat(sz,num2str(StockCode);endurl2Read=http:

/2数量:

result13,买2价格:

result14,买3数量:

result15,买3价格:

result16,买4数量:

result17,买4价格:

result18,买5数量:

result19,买5价格:

result20);disp(卖1数量:

result21,卖1价格:

result22,卖2数量:

result23,卖2价格:

result24,卖3数量:

result25,卖3价格:

result26,卖4数量:

result27,卖4价格:

result28,卖5数量:

result29,卖5价格:

result30);%处理时间信息time(3,6)=;timehour=str2double(time(1:

2);timeminute=str2double(time(3:

4);timesecond=str2double(time(5:

6);timereal=timehour+timeminute/60+timesecond/3600;%xlswrite(gupiao.xls,timereal,TPrice,);%写入文件%写入文档中记录实时的股票数据datawrite=num2str(timereal),num2str(TPrice),.,num2str(Vol),result11,.result12,result13,result14,.,result15,result16,result17,.,result18,result19,result20,.,result21,result22,result23,.,result24,result25,result26,.,result27,result28,result29,result30;filenote=股票,date,.txt;fid=fopen(filenote,at);%data_all_1=num2str(importdata(filenote);%data_all_2=reshape(data_all_1,1,);%bull=strfind(data_all_2,datawrite);%if(bull=0)%fprintf(fid,%sn,datawrite);%endfprintf(fid,%sn,datawrite);%fprintf(fid,%sn,datawrite);%作图fclose(fid);data_all=importdata(filenote);timenow=data_all(:

1);pricenow=data_all(:

2);chengjiaoliang=data_all(:

3);buynum=data_all(:

4,6,8,10,12);buyprice=data_all(:

5,7,9,11,13);sellnum=data_all(:

14,16,18,20,22);sellprice=data_all(:

15,17,19,21,23);subplot(2,1,1);%做出时间价格曲线plot(timenow,pricenow)xlabel(时间);ylabel(价格);gridon;subplot(2,1,2);%做出时间成交量曲线plot(timenow,chengjiaoliang)xlabel(时间);ylabel(成交量);gridon;%set(gcf,WindowButtonDownFcn,pt=get(gca,CurrentPoint);text(pt(1,1),pt(1,2),num2str(pt(1,1:

2);%figure

(2);%subplot(2,2,1);%plot(timenow,buynum(:

1),b,timenow,buynum(:

2),r,timenow,buynum(:

3),k,timenow,buynum(:

4),y,timenow,buynum(:

5),g);%title(买1到买5量变化);%gridon;%legend(买1,买2,买3,买4,买2);%subplot(2,2,2);%plot(timenow,buyprice(:

1),b,timenow,buyprice(:

2),r,timenow,buyprice(:

3),k,timenow,buyprice(:

4),y,timenow,buyprice(:

5),g);%title(买1到买5价格变化);%gridon;%subplot(2,2,3);%plot(timenow,sellnum(:

1),b,timenow,sellnum(:

2),r,timenow,sellnum(:

3),k,timenow,sellnum(:

4),y,timenow,sellnum(:

5),g);%title(卖1到卖5量变化);%gridon;%subplot(2,2,4);%plot(timenow,sellprice(:

1),b,timenow,sellprice(:

2),r,timenow,sellprice(:

3),k,timenow,sellprice(:

4),y,timenow,sellprice(:

5),g);%title(卖1到卖5价格变化);%gridon;%为了能定时运行上述程序需要用到计时器,每5秒运行一次stockget.mx1=1;tt=timer(TimerFcn,stockget,Period,5,ExecutionMode,fixedSpacing,TasksToExecute,100000);start(tt);localtime=clock;

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 求职职场 > 简历

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2