same  
Actually human is just a Instantiation object merely 实际上人也只不过是一个实例化的对象而已
from lee 感谢他!  
钱龙
3.0版数据存储格式
  
   上海日线存储路径为:\ml30\data\shase\day,文件扩展名为:.day
   上海周线存储路径为:\ml30\data\shase\week,文件扩展名为: .wek
   上海月线存储路径为:\ml30\data\shase\month,文件扩展名为: .mnt
   深圳日线存储路径为:\ml30\data\sznse\day
   深圳周线存储路径为:\ml30\data\sznse\week
   深圳月线存储路径为:\ml30\data\sznse\month
  
   以深发展日线为例:
   1A76:0100 D6 CD 2F 01 52 07 01 00-52 07 01 00 52 07 01 00
   1A76:0110 52 07 01 00 86 0F 00 00-4D 02 00 00 00 00 00 00
   1A76:0120 00 00 00 00 00 00 00 00-D7 CD 2F 01 60 03 01 00
   1A76:0130 60 03 01 00 60 03 01 00-60 03 01 00 82 05 00 00
   1A76:0140 D4 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
  
   每一条记录的长度为40字节:
   1-4字节为日期,D6 CD 2F 01转换为十进制是:19910102
   5-8字节为开盘价*1000
   9-12字节为最高价*1000
   13-16字节为最低价*1000
   17-20字节为收盘价*1000
   21-24字节为成交量()
   25-28字节为成交金额
   其余12字节未使用
  
   :周线,月线格式与日线格式一致.
  
   下面是我用C语言编的一个显示深发展日线的小程序,运行时要将000001.day拷到当前目录.
  
   #include <stdio.h>
   #include <conio.h>
   #include <stdlib.h>
  
   typedef struct {
   unsigned long date;
   unsigned long open;
   unsigned long high;
   unsigned long low;
   unsigned long close;
   unsigned long travl;
   unsigned long traca;
   char unuse[12];
   } RECORD;
  
   RECORD reco;
   int readrec(FILE *);
  
   void main()
   {
   FILE *fp;
   if((fp = fopen("000001.day","rb")) == NULL) // 打开深发展日线
   { printf("Error: Can^t open 000001.DAY !\n");
   exit(0); }
   readrec(fp);
   fclose(fp);
   if(getch()==0) getch();
   exit(0);
   }
  
   int readrec(FILE *fp)
   {
   float fn;
   while (! feof(fp)) {
   fread(&reco,sizeof(RECORD),1,fp);
   printf("%10lu ",reco.date);
   fn=float(reco.open)/1000;
   printf("%8.2f ",fn);
   fn=float(reco.high)/1000;
   printf("%8.2f ",fn);
   fn=float(reco.low)/1000;
   printf("%8.2f ",fn);
   fn=float(reco.close)/1000;
   printf("%8.2f ",fn);
   printf("%8lu ",reco.travl);
   printf("%8lu\n",reco.traca);
   }
   printf("\n");
   return 0;
   }
posted on 2006-08-18 13:06  郭胜群  阅读(2675)  评论(1)    收藏  举报