1 Star 0 Fork 0

ragnaros27 / bsv

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

主要功能

下载国内四大期货交易所历史持仓与成交排名数据。

脚本执行时间

如果进行每日更新,则更新脚本的启动时间设置在当日下午五点之后,非交易日无数据。

交易所数据区别

  • CFFEX同一交易日所有品种持仓排名数据不在同一个页面呈现,以各自品种分开呈现;
  • INE暂无SC品种成交持仓排名数据公布;
  • DCE通过下载压缩包并解析txt文件来获取单个交易日数据,但部分交易日压缩包无数据;
  • CZCE网页结构不统一,需要区别对待,公布品种级别的汇总数据。

交易所公布标准

  • SHFE http://www.shfe.com.cn/statements/decl/911319239.html
  • CFFEX 单边持仓达到1万手以上(含)和当月合约前20名结算会员的成交量、持仓量
  • DCE 根据相关规则,期货品种信息公布活跃月份(双边持仓量大于、等于2万手)合约,期权品种信息公布活跃月份(标的期货合约双边持仓量大于、等于2万手)合约系列 。
  • CZCE 暂无,待补充

变量名称

交易所

abbr fullname
SHFE Shanghai Futures Exchange
CFFEX China Financial Futures Exchange
DCE Dalian Commodity Exchange
CZCE Zhengzhou Commodity Exchange

代码字段

代码 字段
hp 持仓量
v 成交量
b 买持
s 卖持

返回字段

代码 字段 格式
tday 交易日 str
ex 交易所 str
code 品种代码 str
product 品种中文 str
contract 合约代码 str
symbol 成交/买持/卖持 str
rank 排名 int
member 会员单位 str
value 合约手数 int
Change 变化量 int

部署运行

  1. 创建虚拟环境

    virtualenv venv
  2. 使用豆瓣源,安装python依赖,以windows为例

    venv\Scripts\activate.bat
    pip install --index-url https://pypi.doubanio.com/simple --trusted-host pypi.doubanio.com bsv
  3. 运行测试代码,如果遇到模块导入问题,可以尝试在venv\Lib\site-packages\目录下新建.pth文件夹,将绝对路径

    python .\tests\bundle.py print-bsv -s 20210428 -e 20210428 -x DCE
MIT License Copyright (c) 2019 ragnaros27 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
Python
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/ragnaros27/bsv.git
git@gitee.com:ragnaros27/bsv.git
ragnaros27
bsv
bsv
master

搜索帮助