PDF下载 下载

数据类

阅读 29885

Tick - Tick结构

逐笔行情数据

  1. struct Tick
  2. {
  3. char symbol[LEN_SYMBOL];
  4. double created_at; ///<utc时间,精确到毫秒
  5. float price; ///<最新价
  6. float open; ///<开盘价
  7. float high; ///<最高价
  8. float low; ///<最低价
  9. double cum_volume; ///<成交总量
  10. double cum_amount; ///<成交总金额/最新成交额,累计值
  11. long long cum_position; ///<合约持仓量(期),累计值
  12. double last_amount; ///<瞬时成交额
  13. int last_volume; ///<瞬时成交量
  14. int trade_type; ///(保留)交易类型,对应多开,多平等类型
  15. Quote quotes[DEPTH_OF_QUOTE]; ///报价, 下标从0开始,0-表示第一档,1-表示第二档,依次类推
  16. };

报价Quote

  1. struct Quote
  2. {
  3. float bid_price; ///本档委买价
  4. long long bid_volume; ///本档委买量
  5. float ask_price; ///本档委卖价
  6. long long ask_volume; ///本档委卖量
  7. };

Bar - Bar结构

bar数据是指各种频率的行情数据

  1. struct Bar
  2. {
  3. char symbol[LEN_SYMBOL];
  4. double bob; ///bar的开始时间
  5. double eob; ///bar的结束时间
  6. float open; ///<开盘价
  7. float close; ///<收盘价
  8. float high; ///<最高价
  9. float low; ///<最低价
  10. double volume; ///<成交量
  11. double amount; ///<成交金额
  12. float pre_close; ///昨收盘价,只有日频数据赋值
  13. long long position; ///<持仓量
  14. char frequency[LEN_FREQUENCY]; ///bar频度
  15. };

L2Transaction - L2Transaction结构

L2行情的逐笔成交

  1. struct L2Transaction
  2. {
  3. char symbol[LEN_SYMBOL];
  4. double created_at; ///成交时间,utc时间
  5. float price; ///成交价
  6. long long volume; ///成交量
  7. char side; ///内外盘标记
  8. char exec_type; ///成交类型
  9. };

L2Order - L2Order结构

L2行情的逐笔委托

  1. struct L2Order
  2. {
  3. char symbol[LEN_SYMBOL];
  4. double created_at; ///委托时间,utc时间
  5. float price; ///委托价
  6. long long volume; ///委托量
  7. char side; ///买卖方向
  8. char order_type; ///委托类型
  9. };

L2OrderQueue - L2OrderQueue结构

L2行情的委托队列

  1. struct L2OrderQueue
  2. {
  3. char symbol[LEN_SYMBOL];
  4. double created_at; ///行情时间,utc时间
  5. float price; ///最优委托价
  6. long long volume; ///委托量
  7. char side; ///买卖方向
  8. int queue_orders; ///委托量队列中元素个数(最多50)
  9. int queue_volumes[LEN_MAX_ORDER_QUEUE]; ///委托量队列(最多50个,有可能小于50, 有效数据长度取决于queue_orders)
  10. };
0 篇笔记