Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

get_exchanges_quotation

获取国内各交易所行情信息

运行环境

依赖python3,需要如下三方库:

  • requests
  • Beautifulsoup4

使用方式

每天需要从郑商所官网下载最新的历史行情数据文件,期货期权分别为FutureDataHistory.txtOptionDataHistory.txt,放在本脚本同级目录,若无上述文件,郑商所的年累计数据为0;若两个文件不是最新,则数据统计不正确。

如需要测试或者获取某个特定交易日的数据,修改run.bat中的strDate,将其设置为某交易日期,例如20181112,参考:

@echo off
::set strDate=%Date:~0,4%%Date:~5,2%%Date:~8,2%
set strDate=20181112
python get_data.py %strDate%
pause

如正常使用,需要修改run.bat中的strDate,参考:

@echo off
set strDate=%Date:~0,4%%Date:~5,2%%Date:~8,2%
::set strDate=20181112
python get_data.py %strDate%
pause

双击run.bat执行脚本。

脚本执行完成且不报错的情况下打开template.xlsx,粘贴至【源数据】的B2,确认各字段有值;将大商所年度数据粘贴至固定单元格。excel公式会自动计算所有字段,两个sheet页就是需要的数据。

Comments ( 0 )

Sign in for post a comment

About

获取国内各交易所行情信息 spread retract
Cancel

Releases

No release

Contributors

All

Activities

load more
can not load any more