HQ.H
上传用户:bjghjy
上传日期:2007-01-07
资源大小:379k
文件大小:6k
- #define ERROR_HEAD (LPSTR)"ERROR"
- #define NOTRUN_HEAD (LPSTR)"NOTRUN"
- #define HQ00_HEAD (LPSTR)"HQ00"
- #define ZQXX_HEAD (LPSTR)"ZQXX"
- #define HQ01_HEAD (LPSTR)"HQ01"
- #define DP_HEAD (LPSTR)"DP"
- #define MMP_HEAD (LPSTR)"MMP"
- #define HQ10_HEAD (LPSTR)"HQ10"
- #define GMIN00_HEAD (LPSTR)"GMIN00"
- #define GMIN01_HEAD (LPSTR)"GMIN01"
- #define GMIN10_HEAD (LPSTR)"GMIN10"
- #define MAXMIN10_HEAD (LPSTR)"MAXMIN10"
- #define ZX_HEAD (LPSTR)"ZX"
- #define MAX_HQ_SENDCOUNT 5
- #define MAX_ZQXX_SENDCOUNT 10
- #define MAX_GMIN_SENDCOUNT 20
- #define MAX_HQFLDS_COUNT 15
- #define MAX_HQSEL_COUNT 5
- #define MAX_HQSEL_REC_COUNT 100
- #define MAX_HQ_REC_COUNT 600
- #define MAX_GMIN_REC_COUNT 500
- #define MAX_ZS_COUNT 15
- #define MAX_ZQDM_SIZE 7
- #define MAX_ZQMC_SIZE 13
- #define MAX_ZS_NAME_SIZE 15
- #define MAX_ZS_SIZE 12
- #define MAX_JG_SIZE 8
- #define MAX_CJSS_SIZE 12
- #define MAX_SL_SIZE 15
- #define MAX_CJJE_SIZE 18
- #define MAX_CJZJ_SIZE 15
- #define MAX_CJZJE_SIZE 18
- #define MAX_FLD_SIZE MAX_CJZJE_SIZE
- #define GZ_SZ 0
- #define GZ_SH 1
- #define MAX_WRITE_BUF_SIZE 2048
- #define MAX_READ_BUF_SIZE 2048
- #define HQ_FLDS_COUNT 14
- #define HQ10_FLDS_COUNT 11
- #define SZZS_CF_REC_NUM 0 //深圳成分指数记录号
- #define SSUB_INT 0
- #define SSUB_LONG 1
- #define SSUB_FLOAT 2
- #define SSUB_FLOAT100 3
- #define SORT_UP 0
- #define SORT_DOWN 1
- typedef struct tag_GPZT //股票状态
- {
- BOOL tpbz; //停牌标志
- BOOL fnew; //新股票
- int type; //股票类型: 0:A股 1:.. 2:.. 3:..4.. 5:指数
- }GPZT, FAR *LPGPZT;
- typedef struct tag_GPZT_DATA
- {
- int recCount;
- LPGPZT lpGpzt;
- }GPZT_DATA, FAR *LPGPZT_DATA;
- #define FLD_TYPE_STRING 0
- #define FLD_TYPE_FLOAT 1
- #define FLD_TYPE_LONG 2
- typedef struct tag_HQ_REF_DATA
- {
- float zgjg; //最高 2
- float zdjg; //最低 3
- float zgjm; //叫买 4
- float zdjm; //叫卖 5
- float zjjg; //成交 6
- float zdf; //涨跌 7
- long cjss; //成交手数 8
- long lc; //量差 9
- long npzl; //内盘总量 10
- float wb; //委比 11
- long cjje; //成交金额 12
- }HQ_REF_DATA, FAR *LPHQ_REF_DATA;
- #define HQ_REF_ITEM_COUNT 11
- typedef struct tag_HQ_PRE_DATA
- {
- char zqmc[MAX_ZQMC_SIZE]; //名称
- char zqdm[MAX_ZQDM_SIZE]; //代码 0
- float zrsp; //昨收盘 0
- float jrkp; //今开盘 1
- }HQ_PRE_DATA, FAR *LPHQ_PRE_DATA;
- typedef struct tag_HQ_DATA
- {
- int jys;
- int recCount;
- LPHQ_PRE_DATA lpPreData;
- LPHQ_REF_DATA lpRefData;
- BYTE *lpbChanged;
- BOOL fReadFirstOK;
- BOOL fWriteGData;
- BOOL fReadUDPData;
- }HQ_DATA, FAR *LPHQ_DATA;
- typedef struct tag_HQ_TIME
- {
- int am_min_start, am_min_end;
- int pm_min_start, pm_min_end;
- BOOL fRunning;
- }HQ_TIME, FAR *LPHQ_TIME;
- typedef struct tag_ZS
- {
- char szName[MAX_ZS_NAME_SIZE+1];
- float sp;
- float kp;
- float zg;
- float zd;
- float zj;
- float sd;
- }ZS, FAR *LPZS;
- typedef struct tag_ZS_DATA
- {
- int recCount;
- LPZS lpZs;
- }ZS_DATA, FAR *LPZS_DATA;
- typedef struct tag_MMP
- {
- float jwBuy[3];
- long slBuy[3];
- float jwSell[3];
- long slSell[3];
- }MMP, FAR *LPMMP;
- typedef struct tag_MMP_DATA
- {
- int recCount;
- LPMMP lpMmp;
- BYTE *lpChanged;
- }MMP_DATA, FAR *LPMMP_DATA;
- typedef struct tag_DP_DATA
- {
- int recCount;
- float zs[15]; //主要指数:深圳成分指数,上海综合指数
- float sp[15];
- float zd[15]; //升跌
- long cjzje; //上海成交总金额
- float npbl; //内盘比例
- long cjss; //成交手数
- int upCount, downCount, equalCount;
- }DP_DATA, FAR *LPDP_DATA;
- typedef struct tag_HQSEL_DATA
- {
- int jys;
- int recCount;
- int recNum[MAX_HQSEL_REC_COUNT+1];
- }HQSEL_DATA, FAR *LPHQSEL_DATA;
- typedef struct tag_GRA_DATA
- {
- int tim; //时间(以分钟为单位)
- float zjjg; //成交价
- long lc,zl; //量差,总量
- BYTE BS; //内外盘
- }GRA_DATA,FAR *LPGRA_DATA;
- typedef struct tag_GRA_HEAD
- {
- int dateNum; //日期(yymmdd)
- int minCount; //数据总数
- float zgjg, zdjg;
- long zglc, zdlc;
- float zrsp;
- long npzl, wpzl;
- }GRA_HEAD, FAR *LPGRA_HEAD;
- typedef struct tag_GRA_ALL
- {
- char szGraPath[128];
- LPGRA_HEAD lpGraHead;
- LPGRA_DATA lpGraData;
- //LPGREC_DATA lpGRecData;
- }GRA_ALL, FAR *LPGRA_ALL;
- typedef struct tag_MAXMIN
- {
- float zjjg;
- float zdf;
- long cjss;
- }MAXMIN, FAR *LPMAXMIN;
- #define ZDF 0
- #define ZD 1
- #define CJSS 2
- #define CJJE 3
- typedef struct tag_MAXMIN_DATA
- {
- int recNum[4][10];
- MAXMIN MaxMin[4][10];
- // int fChanged;
- }MAXMIN_DATA, FAR *LPMAXMIN_DATA;
- typedef struct tag_ZX_DATA
- {
- int curMin;
- int len;
- LPSTR lpText;
- }ZX_DATA, FAR *LPZX_DATA;
- typedef struct tag_DAY_DATA
- {
- long day;
- float kpjg, spjg, zgjg, zdjg;
- long cjss;
- double cjje;
- }DAY_DATA, FAR *LPDAY_DATA;
- typedef struct tag_HISTORY_DATA
- {
- char date[10]; //yymmddhhmi
- float ks;
- float zg;
- float zd;
- float ss;
- long cj;
- }HISTORY_DATA, FAR *LPHISTORY_DATA;
- extern HQ_DATA HqData[2];
- extern MMP_DATA MmpData[2];
- extern DP_DATA DpData[2];
- extern HQSEL_DATA HqSelData;
- extern HQ_TIME HqTime[2];
- extern GRA_ALL GraphData[2];
- extern GPZT_DATA GpztData[2];
- extern MAXMIN_DATA MaxMinData[2][2]; //jys, 0:max, 1:min
- extern ZX_DATA ZxData;
- int CheckZqdm(LPSTR);
- // To send HQ data fastly,We design the struct to decreace data amount
- typedef struct tag_HQ_REF_DATA_V202
- {
- char zqmc[MAX_ZQMC_SIZE]; //名称
- char zqdm[MAX_ZQDM_SIZE]; //代码
- long zrsp; //昨收盘 0
- long jrkp; //今开盘 1
- long zgjg; //最高 2
- long zdjg; //最低 3
- long zgjm; //叫卖 4
- long zdjm; //叫买 5
- long zjjg; //成交 6
- long cjss; //成交手数 8
- long npzl; //内盘总量 10
- long cjje; //成交金额 12
- long wb;
- }HQ_REF_DATA_V202;