钱龙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
以深发展日线为例:
每一条记录的长度为40字节:
1-4字节为日期,D6 CD
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("%
fn=float(reco.high)/1000;
printf("%
fn=float(reco.low)/1000;
printf("%
fn=float(reco.close)/1000;
printf("%
printf("%8lu ",reco.travl);
printf("%8lu\n",reco.traca);
}
printf("\n");
return 0;
}

浙公网安备 33010602011771号