用Java实现股票历史接口数据采集代码分享

今天小编要分享的是用Java实现股票历史接口数据采集,其实在项目代码的xml文件表结构中,还有一个历史信息,就是一次性获取所有历史Json文本存储,避免重复抓取Json数据。结构很简单,就不贴了。

<Table Name="StockDayData" Description="股票日数据" ConnName="stock_day">

    <Columns>

      <Column Name="ID" DataType="String" PrimaryKey="True" Description="编号。code+日期" />

      <Column Name="Code" DataType="String" Description="股票编码" />

      <Column Name="StatDate" DataType="DateTime" Description="数据日期" />

      <Column Name="StartPrice" DataType="Double" Description="开盘价格" />

      <Column Name="EndPrice" DataType="Double" Description="收盘价格" />

      <Column Name="ChangePrice" DataType="Double" Description="涨跌金额" />

      <Column Name="ChangeRatio" DataType="Double" Description="涨跌幅度" />

      <Column Name="LowPrice" DataType="Double" Description="最低价格" />

      <Column Name="HighPrice" DataType="Double" Description="最高价格" />

      <Column Name="TotalHand" DataType="Int32" Description="总手" />

      <Column Name="TotalAmount" DataType="Double" Description="总金额(万)" />

      <Column Name="HandRate" DataType="Double" Description="换手率" />

      <Column Name="UpdateDate" DataType="DateTime" Description="更新日期" />

    </Columns>

</Table>

其实股票历史接口是掠2行情接口的一种,也具备有除了 查询历史数据功能之外的十档行情功能,如下:

  1. StockQuoteRecord(十档行情快照)

字段名

类型

备注

stock_exchange

uint32

证券市场,见数据字典

stock_code

string

证券代码

created_at

int64

快照日期时间戳(毫秒)

status

uint32

状态:0-开盘前,1-开盘集合竞价,2-集合竞价至连续竞价,3-连续竞价, 4-中午休市,5-收盘集合竞价,6-闭市

prev_close_price

uint32

前收盘价

open_price

uint32

开盘价

latest_price

uint32

最新价

high_price

uint32

最高价

low_price

uint32

最低价

limit_up_price

uint32

涨停价

limit_down_price

uint32

跌停价

order_quantity

uint32

成交笔数

volume

uint64

成交数量

amount

uint64

成交金额

bid_volume

uint64

委托买入数量

bid_price

uint32

委托买入加权平均价

ask_volume

uint64

委托卖出数量

ask_price

uint32

委托卖出加权平均价

bid_price_detail

repeated uint32

委托买入价格明细(十档)

bid_volume_detail

repeated uint32

委托买入数量明细(十档)

ask_price_detail

repeated uint32

委托卖出价格明细(十档)

ask_volume_detail

repeated uint32

委托卖出数量明细(十档)

返回示例:

 

 以上便是小编今天对股票历史接口的相关描述了,有并不明白的地方可以通过下方名片给小编留言(qq)!


版权声明:本文为alandu_1113原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。