# get_exchanges_quotation **Repository Path**: googlejun/get_exchanges_quotation ## Basic Information - **Project Name**: get_exchanges_quotation - **Description**: 获取国内各交易所行情信息 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2025-01-16 - **Last Updated**: 2025-01-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # get_exchanges_quotation 获取国内各交易所行情信息 ## 运行环境 依赖python3,需要如下三方库: - requests - Beautifulsoup4 ## 使用方式 每天需要从郑商所官网下载最新的历史行情数据文件,期货期权分别为`FutureDataHistory.txt`、`OptionDataHistory.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页就是需要的数据。