大智慧新一代 2.08.07.0907 数据格式

日线数据文件day.dat
                     case DataTypes.hq:
                         fileName = "DAY.DAT";
                         startAddress = 0x41000;
                         blockSize = 8192;
                         recordSize = 32;
                         codeIsLong = false;
                         fieldString =
"dm,代码,code,10,0,0,;" +
"rq,日期,date,4,1,0,;" +
"kp,开盘,single,4,2,4,B;" +
"zg,最高,single,4,3,8,B;" +
"zd,最低,single,4,4,12,B;" +
"sp,收盘,single,4,5,16,B;" +
"sl,成交数量,single,4,6,20,A;"+
"je,成交金额,single,4,7,24,";

  


数据格式几乎与分析家相同

起止地址   数据内容                 数据含义       数据类型
00 - 03   F4 9B 13 FC             文件标志 int
04 - 07   00 06 00 00             未知           int
08 - 0B   00 00 00 00             保留           int
0C - 0F   97 04 00 00             证券总数       int
10 - 13   00 18 00 00             未知           int需添加之起始块号
14 - 17   DB 17 00 00             未知           int当前最后空块号
18 - 21   31 41 30 30 30...FF     证券代码       byte[10]
22 - 25   B0 09 00 00             日线记录数     int
26 - 57   00 00 25 04...FF FF     记录块号       char[25]
......
记录块开始于0x41000
41000 - 41003 80 47 B2 2B         日期           int
41004 - 41007 B9 1E 25 41         开盘价         float
41008 - 4100B CD CC 4C 41         最高价         float
4100C - 4100F EC 51 18 41         最低价         float
41010 - 41013 9A 99 41 41         收盘价         float
41014 - 41017 80 06 B2 47         成交量         float
41018 - 4101B 40 1C BC 4C         成交金额       float
4101C - 4101D 00 00               上涨家数       char
4101E - 4101F 00 00               下跌家数       char

注:
   1)起止地址、数据内容为十六进制,数据类型为 Delphi 下之定义。
   2)从18h开始至40017h每64byte为一条股票数据分配记录,含义如上表18h - 57h所示;
   3)从41000h开始每8KB为一股票数据存储块,每个股票数据存储块共存储256条日线记录,
    每一条记录的长度为32 byte(含义如上表;上涨家数及下跌家数只对指数有效);
   4)从41000h开始的8KB为第0号数据存储块,以后类推;
   5)系统对每个股票日线数据存储以存储块为单位进行分配。
   6)具体应用实例分析家数据管理程序。
   7) 日期字段的意义为:实际日期 = StrToDate(^1970-01-01^)+(日期字段 div 86400);
    即“日期字段”除以86400所得数为实际日期距1970年01月01日的天数。


有关块号计算方法,请参见分笔成交数据格式
日期字段的意义为:实际日期 = StrToDate(^1970-01-01^)+(日期字段 div 86400);
 即“日期字段”除以86400所得数为实际日期距1970年01月01日的天数


1分钟数据文件min1.dat
                     case DataTypes.hq1:
                         fileName = "MIN1.DAT";
                         startAddress = 0x41000;
                         blockSize = 12288;//8192
                         recordSize = 32;
                         codeIsLong = false;
                         fieldString =
"dm,代码,code,10,0,0,;" +
"rq,日期,datetime,4,1,0,;" +
"kp,开盘,single,4,2,4,B;" +
"zg,最高,single,4,3,8,B;" +
"zd,最低,single,4,4,12,B;" +
"sp,收盘,single,4,5,16,B;" +
"sl,成交数量,single,4,6,20,A;"+
"je,成交金额,single,4,7,24,";

5分钟数据文件min.dat
                     case DataTypes.hq5:
                         fileName = "MIN.DAT";
                         startAddress = 0x41000;
                         blockSize = 8192;
                         recordSize = 32;
                         codeIsLong = false;
                         fieldString =
"dm,代码,code,10,0,0,;" +
"rq,日期,datetime,4,1,0,;" +
"kp,开盘,single,4,2,4,B;" +
"zg,最高,single,4,3,8,B;" +
"zd,最低,single,4,4,12,B;" +
"sp,收盘,single,4,5,16,B;" +
"sl,成交数量,single,4,6,20,A;" +
"je,成交金额,single,4,7,24,";

最新行情STKINFO60.dat
                     case DataTypes.hq0:
                         fileName = "STKINFO60.DAT";
                         startAddress = 0x68A8A6;
                         blockSize = 0;
                         recordSize = 273;
                         codeIsLong = false;
                         isIndexDataStruct = false;
                         fieldString =
"dm,代码,code,10,0,0,;" +
"jc,简称,string,32,1,10,;" +
"rq,更新时间,datetime,4,5,60,;" +
"zs,昨收,single,4,7,68,;" +
"kp,今开,single,4,8,72,;" +
"zg,最高,single,4,9,76,;" +
"zd,最低,single,4,10,80,;" +
"sp,最新,single,4,11,84,;" +
"sl,总手数,single,4,12,88,;" +
"je,金额,single,4,13,92,;" +
"xss,现手数,single,4,14,96,;" +
"ztj,涨停价,single,4,27,184,;" +
"dtj,跌停价,single,4,28,188,;" +
"np,内盘,single,4,27,192,;" +
"wp,外盘,single,4,28,196,;" +
"mrjg1,买一价,single,4,15,100,;" +
"mrsl1,买一量,single,4,18,120,;" +
"mrjg2,买二价,single,4,16,104,;" +
"mrsl2,买二量,single,4,19,124,;" +
"mrjg3,买三价,single,4,17,108,;" +
"mrsl3,买三量,single,4,20,128,;" +
"mrjg4,买四价,single,4,32,112,;" +
"mrsl4,买四量,single,4,34,132,;" +
"mrjg5,买五价,single,4,33,116,;" +
"mrsl5,买五量,single,4,35,136,;" +
"mcjg1,卖一价,single,4,21,140,;" +
"mcsl1,卖一量,single,4,24,160,;" +
"mcjg2,卖二价,single,4,22,144,;" +
"mcsl2,卖二量,single,4,25,164,;" +
"mcjg3,卖三价,single,4,23,148,;" +
"mcsl3,卖三量,single,4,26,168,;" +
"mcjg4,卖四价,single,4,36,152,;" +
"mcsl4,卖四量,single,4,38,172,;" +
"mcjg5,卖五价,single,4,37,156,;" +
"mcsl5,卖五量,single,4,39,176,";
//"jd,精度,int,4,3,52,;" +
//"scbz,删除标志,int,4,4,56,";
//"unknown,(未知),int,4,31,164,;" +
//",(未知),,48,40,200,;"

分笔成交数据文件report.dat(结构同day.dat,但其中一些数据不是直接保存)
                     case DataTypes.hqmb:
                         fileName = "REPORT.DAT";
                         startAddress = 0x41000;
                         blockSize = 12272;
                         recordSize = 52;
                         codeIsLong = false;
                         isIndexDataStruct = false;//不完全等同于day.dat结构,因此单独处理
                         fieldString =
"dm,代码,code,10,0,0,;" +
"rq,日期,datetime,4,0,0,;" +
"zjcj,最近成交价,single,4,1,4,;" +
"zss,总手数,single,4,2,8,calc;" +
"je,金额,single,4,3,12,;" +
"xss,现手数,single,4,2,8,;" +
"mm,内外盘,string,2,16,21,;" +
"mr1jg,买一价,single,1,10,42,;" +
"mr1sl,买一量,single,2,4,22,;" +
"mr2jg,买二价,single,1,11,43,;" +
"mr2sl,买二量,single,2,5,24,;" +
"mr3jg,买三价,single,1,12,44,;" +
"mr3sl,买三量,single,2,6,26,;" +
"mr4jg,买四价,single,1,12,45,;" +
"mr4sl,买四量,single,2,6,28,;" +
"mr5jg,买五价,single,1,12,46,;" +
"mr5sl,买五量,single,2,6,30,;" +
"mc1jg,卖一价,single,1,13,47,;" +
"mc1sl,卖一量,single,2,7,32,;" +
"mc2jg,卖二价,single,1,14,48,;" +
"mc2sl,卖二量,single,2,8,34,;" +
"mc3jg,卖三价,single,1,15,49,;" +
"mc3sl,卖三量,single,2,9,36,;"+
"mc4jg,卖四价,single,1,14,50,;" +
"mc4sl,卖四量,single,2,8,38,;" +
"mc5jg,卖五价,single,1,14,51,;" +
"mc5sl,卖五量,single,2,8,40,;" +
"bs,总笔数,int,2,0,16,"
;
                         //以上数据类型不是存储类型,程序中不直接用实际数据类型:买/卖X量为short,买/卖X价为byte
                         //现手数通过当总手数计算而得,应该放在总手数后面
大智慧新一代Level-2 分笔成交数据格式

起止地址   数据内容                 数据含义                     数据类型
00 - 03   F4 9B 13 FC               日线文件标志                 int
04 - 07   10 02 00 00               未知                         int
08 - 0B   00 43 DF 46               1970.01.01 00:00:00始的秒数 int
0C - 0F   5D 05 00 00               证券总数                     int
10 - 13   ED 20 00 00               未知                         int
14 - 17   ED 20 00 00               未知                         int
18 - 21   30 30 30 30 30 31 00 00   证券代码                     byte[10]
22 - 25   9C 12 00 00               日分笔记录数                 int
26 - 57   00 00 BA 03...FF FF       记录块号                     char[25]

00041000           记录页起始点,

每记录长:     0x34   = 52
每页记录数:   0xEC   = 236
每页长:       每记录长0x34 * 每页记录数0xEC = 0x2FF0 = 12272


   地   址     数据内容     数据含义                             数据类型    
41000 - 41003 35 FA DF 46 1970.01.01 00:00:00 始的秒数         int
41004 - 41007 00 00 18 41 最新价                               float    
41008 - 4100B 00 80 B4 43 累计成交量                           float    
4100C - 4100F 80 46 A7 48 累计成交金额                         float

41010 - 41011 51 9C       累计成交笔数                         char
41012 - 41013 00 00       未知                                 char
41014         10           累计成交笔数的溢出标志(00|10)       byte
41015         80           买入,卖出标识(80|E0买入,C0|A0卖出)   byte

41016 - 41017 23 01       委买量1                               char      
41018 - 41019 8E 5B       委买量2                               char
4101A - 4101B 80 27       委买量3                               char
4101C - 4101D 8E 5B       委买量4                               char
4101E - 4101F B8 40       委买量5                               char

41020 - 41021 23 01       委卖量1                               char      
41022 - 41023 8E 5B       委卖量2                               char
41024 - 41025 80 27       委卖量3                               char
41026 - 41027 8E 5B       委卖量4                               char
41028 - 41029 B8 40       委卖量5                               char

4102A         16       委买价1 与成交价的差                     byte
4102B         9A       委买价2 与成交价的差                     byte
4102C         80       委买价3 与成交价的差                     byte
4102D         40       委卖价4 与成交价的差                     byte
4102E         30       委卖价5 与成交价的差                     byte

4102F         57       委卖价1 与成交价的差                     byte
41030         68       委卖价2 与成交价的差                     byte
41031         69       委卖价3 与成交价的差                     byte
41032         7A       委卖价4 与成交价的差                     byte
41033         81       委卖价5 与成交价的差                     byte

注意:
1、如有疑问请与 QQ 8588711 联系,愿与您共同挖掘股票成交数据。
2、数据类型为JAVA数据类型定义,实际读数据时应该将数据十六进制取反,如:41000 - 41003的数据为 35 FA DF 46,实际应该读成:
  0x46DFFA35 = 1189083701, 这个1189083701值就是距1970.01.01 00:00:00 始的实际秒数。其他int,float,char都是这样取反的。
3、委买卖与成交价的差,是小数点后的整数差,如果买卖标识为80或C0,成交价小数点后是两位(股票),如果买卖标识为E0或A0,
  成交价小数点后是三位(权证等)
4、累计成交笔数如果溢出,则41014位上的值不为00,而是10或者20,30等,成交笔数计算方法应为:41014位上的值反转,
  10转为01,20转为02。。。 再与41010 - 41011位上的值合并成一个16进制串。
5、记录块号计算方法:char[0] = 0x00 第一个记录块起始地址为:41000h + 0x0000 * 0x2FF0 = 41000h,char[1] = 0x03BA
  则第二个记录块起始地址为:41000h + 0x03BA * 0x2FF0 = 0x00077F78

标签: 财经  
近日发现Level-2的逐笔成交数据是缓存在dzh2/data/sh/TEMP目录下,文件名以证券代码为名,后辍是.L2D,如果重启大智慧,
L2D文件会全部被删除,而且临时文件只有在浏览过该证券的逐笔成交后才会生成,不过花的时间也不算太多。也许以后会要研究
逐笔成交数据了,这样的数据更有意义,读数据不是问题,最主要的是分析方法,当得到盘口异动数据后,还需要结合信息面来操作,
这样的成功几率非常大,我已经初尝胜果。后面,还要通过数据来分析大盘走势,还有通过行业数据异动,发现基金等大资金的中短期
目标,这点也非常之重要。这个十一假期,过得不会很闲,还有很多东西要做、、、 现在也不想接受QQ加好友请求,真正做数据盘口
分析的,发现数据格式,马上就已经投入战斗了,而且一看就会明了。在这个市场,每个人都有自己的方式生存,没有拿手绝活,那
是不要随便来玩的。逐笔成交数据格式,大概也会在不久后弄个明白。
                      
                      
                      
                      
         财务数据(简单)STKINFO60.dat
                     case DataTypes.cw0:
                         fileName = "STKINFO60.DAT";
                         startAddress = 0x4c2a;
                         blockSize = 2227;
                         recordSize = 273;//196
                         codeIsLong = false;
                         isIndexDataStruct = false;
                         fieldString =
"dm,代码,code,10,0,0,;" +
"rq,报告期,date,4,0,4,;" +
"gxrq,更新日期,date,4,0,0,;" +
"ssrq,上市日期,date,4,0,8,;" +
"col1,每股收益,single,4,0,12,;" +
"col2,每股净资产,single,4,0,16,;" +
"col3,净资产收益率,single,4,0,20,;" +
"col4,每股经营现金,single,4,0,24,;" +
"col5,每股公积金,single,4,0,28,;" +
"col6,每股未分配,single,4,0,32,;" +
"col7,股东权益比,single,4,0,36,;" +
"col8,净利润同比,single,4,0,40,;" +
"col9,主营收入同比,single,4,0,44,;" +
"col10,销售毛利率,single,4,0,48,;" +
"col11,调整每股净资产,single,4,0,52,;" +
"col12,总资产,single,4,0,56,;" +
"col13,流动资产,single,4,0,60,;" +
"col14,固定资产,single,4,0,64,;" +
"col15,无形资产,single,4,0,68,;" +
"col16,流动负债,single,4,0,72,;" +
"col17,长期负债,single,4,0,76,;" +
"col18,总负债,single,4,0,80,;" +
"col19,股东权益,single,4,0,84,;" +
"col20,资本公积金,single,4,0,88,;" +
"col21,经营现金流量,single,4,0,92,;" +
"col22,投资现金流量,single,4,0,96,;" +
"col23,筹资现金流量,single,4,0,100,;" +
"col24,现金增加额,single,4,0,104,;" +
"col25,主营收入,single,4,0,108,;" +
"col26,主营利润,single,4,0,112,;" +
"col27,营业利润,single,4,0,116,;" +
"col28,投资收益,single,4,0,120,;" +
"col29,营业外收支,single,4,0,124,;" +
"col30,利润总额,single,4,0,128,;" +
"col31,净利润,single,4,0,132,;" +
"col32,未分配利润,single,4,0,136,;" +
"col33,总股本,single,4,0,140,;" +
"col34,无限售股合计,single,4,0,144,;" +
"col35,A股,single,4,0,148,;" +
"col36,B股,single,4,0,152,;" +
"col37,境外上市股,single,4,0,156,;" +
"col38,其他流通股,single,4,0,160,;" +
"col39,限售股合计,single,4,0,164,;" +
"col40,国家持股,single,4,0,168,;" +
"col41,国有法人股,single,4,0,172,;" +
"col42,境内法人股,single,4,0,176,;" +
"col43,境内自然人股,single,4,0,180,;" +
"col44,其他发起人股,single,4,0,184,;" +
"col45,募集法人股,single,4,0,188,;" +
"col46,境外法人股,single,4,0,192,;" +
"col47,境外自然人股,single,4,0,196,;" +
"col48,优先股或其他,single,4,0,200,";          


     分红送配STKINFO60.dat
                     case DataTypes.cq:
                         fileName = "STKINFO60.DAT";
                         startAddress = 0x44aa;
                         blockSize = 2227;
                         recordSize = 20;
                         codeIsLong = false;
                         isIndexDataStruct = false;
                         fieldString =
"dm,代码,code,10,0,0,;" +
"rq,日期,date,4,0,0,;" +
"sgbl,送股比例,single,4,1,4,;" +
"pgbl,配股比例,single,4,2,8,;" +
"pgjg,配股价格,single,4,3,12,;" +
"fh,分红,single,4,4,16,";


代码表STKINFO60.dat
                     case DataTypes.dm:
                         fileName = "STKINFO60.DAT";
                         startAddress = 0x68A8A6;
                         blockSize = 0;
                         recordSize = 273;//fxj248
                         codeIsLong = false;
                         isIndexDataStruct = false;
                         fieldString =
"dm,代码,code,10,0,0,;" +
"jc,简称,string,32,1,10,";

你可能感兴趣的:(股票数据格式)