本站首页    管理页面    写新日志    退出


«August 2025»
12
3456789
10111213141516
17181920212223
24252627282930
31


公告
================

注会练习软件
http://www.cpasoft.com.cn
我的注会软件官网

http://blog.163.com/abc7105@126/

 

 


哈哈,热爱快“过气”的DELPHI


我的分类(专题)

日志更新

最新评论

留言板

链接

Blog信息
blog名称:注册会计师(注会)练习软件
日志总数:398
评论数量:116
留言数量:27
访问次数:3265907
建立时间:2005年6月6日




[delpih编程]取股票日线代码
软件技术

吕向阳 发表于 2012/9/19 20:14:15

unit USTOCKS; interface uses system.IO;const HS = 85;type  dayline = record    date: double;    startj: double;    maxj: double;    minj: double;    endj: double;    a6: double;    totalsl: double;    a8: double;  end; type  xSTOCKS = class  private    { Private Declarations }    fcount: integer;    fmax, fmin: double;  public    lines: array of dayline;    procedure GETFROMFILE();    property count: integer read fcount ;    property max: double read fmax;    property min: double read fmin;    function  GETMC(DM:STRING):string;  end; implementation procedure xSTOCKS.GETFROMFILE;var fs: filestream;  myreader: binaryreader;  i: integer;  length: integer;begin  fmax := 0;   fs := filestream.Create('C:\同花顺核新\history\shase\day\600806.day', filemode.Open, fileaccess.Read);  myreader := binaryreader.Create(fs); //  length := convert.ToInt16((fs.get_Length - 64) / 48);  length := convert.ToInt16((fs.get_Length - 72) / 56);  fcount:=length;  fs.Seek(72, SeekOrigin.&Begin);   if length >= HS then  begin    setlength(lines, HS);    fs.seek((length - HS) * 56, seekorigin.Current);    fcount := HS;  end  else  begin    setlength(lines, length);    fcount := length;  end;   for I := 0 to fcount - 1 do  begin    //读取数据    lines[i].date := myreader.ReadInt32;    lines[i].startj := (myreader.ReadInt32 shl 8 shr 8) / 1000;    lines[i].maxj := (myreader.ReadInt32 shl 8 shr 8) / 1000;     if (fmax < lines[i].maxj) then      fmax := lines[i].maxj;     lines[i].minj := (myreader.ReadInt32 shl 8 shr 8) / 1000;    if (i = 0) then      fmin := lines[i].minj    else      if (fmin > lines[i].minj) then        fmin := lines[i].minj;     lines[i].endj := (myreader.ReadInt32 shl 8 shr 8) / 1000;    fs.Seek(36, SeekOrigin.Current);  //  end;  myreader.Close;  fs.Close;end;   function xSTOCKS.GETMC(DM: STRING):string;var fs: filestream;  myreader: binaryreader;  i: integer;  length: integer;  GPDM,GPNAME:STRING; begin  {fmax := 0;   fs := filestream.Create('C:\同花顺核新\realtime\shase\STOCKNOW.DAT', filemode.Open, fileaccess.Read);  myreader := binaryreader.Create(fs);   length := convert.ToInt16((fs.get_Length - 64) / 48);  fs.Seek(176, SeekOrigin.&Begin); //  for I:=0 to LENGTH - 1 do  BEGIN //   fs.Seek(1, SeekOrigin.Current);    GPDM:=copy(MYREADER.ReadString,0);  end;   myreader.Close;  fs.Close;}  result:='';end; end.


阅读全文(2892) | 回复(0) | 编辑 | 精华
 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.184 second(s), page refreshed 144758582 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号