From 14b1ad3534593952d1d698ffa706f4f13a4ed156 Mon Sep 17 00:00:00 2001 From: Jing Xu Date: Wed, 15 Apr 2020 21:02:03 +0800 Subject: [PATCH] Archive pytdx --- .gitignore | 175 --------- .travis.yml | 13 - .vscode/settings.json | 3 - .vscode/temp.sql | 0 ChangeLog.md | 331 ---------------- README.md | 83 +--- bootstrap.sh | 29 -- docs/api.md | 4 - docs/batch_download_data.md | 126 ------ docs/fuquan_factor.md | 159 -------- docs/hq_price.md | 87 ---- docs/hqget.md | 179 --------- docs/hqreader.md | 42 -- docs/index.md | 63 --- docs/installation.md | 36 -- docs/pytdx_crawler.md | 96 ----- docs/pytdx_exhq.md | 220 ----------- docs/pytdx_hq.md | 370 ------------------ docs/pytdx_pool.md | 55 --- docs/pytdx_reader.md | 181 --------- docs/pytdx_trade.md | 129 ------ mkdocs.yml | 26 -- pytdx/__init__.py | 0 pytdx/base_socket_client.py | 273 ------------- pytdx/bin/__init__.py | 0 pytdx/bin/get_tdx_trader_server.py | 257 ------------ pytdx/bin/hqbenchmark.py | 156 -------- pytdx/bin/hqget.py | 256 ------------ pytdx/bin/hqreader.py | 73 ---- pytdx/config/__init__.py | 0 pytdx/config/hosts.py | 113 ------ pytdx/crawler/__init__.py | 5 - pytdx/crawler/base_crawler.py | 88 ----- pytdx/crawler/history_financial_crawler.py | 192 --------- pytdx/errors.py | 20 - pytdx/exhq.py | 163 -------- pytdx/heartbeat.py | 32 -- pytdx/helper.py | 132 ------- pytdx/hq.py | 276 ------------- pytdx/log.py | 22 -- pytdx/params.py | 51 --- pytdx/parser/__init__.py | 0 pytdx/parser/base.py | 148 ------- .../ex_get_history_instrument_bars_range.py | 122 ------ .../parser/ex_get_history_minute_time_data.py | 53 --- .../parser/ex_get_history_transaction_data.py | 130 ------ pytdx/parser/ex_get_instrument_bars.py | 102 ----- pytdx/parser/ex_get_instrument_count.py | 19 - pytdx/parser/ex_get_instrument_info.py | 65 --- pytdx/parser/ex_get_instrument_quote.py | 145 ------- pytdx/parser/ex_get_instrument_quote_list.py | 191 --------- pytdx/parser/ex_get_markets.py | 44 --- pytdx/parser/ex_get_minute_time_data.py | 56 --- pytdx/parser/ex_get_transaction_data.py | 121 ------ pytdx/parser/ex_setup_commands.py | 20 - pytdx/parser/get_block_info.py | 82 ---- pytdx/parser/get_company_info_category.py | 62 --- pytdx/parser/get_company_info_content.py | 32 -- pytdx/parser/get_finance_info.py | 135 ------- pytdx/parser/get_history_minute_time_data.py | 48 --- pytdx/parser/get_history_transaction_data.py | 63 --- pytdx/parser/get_index_bars.py | 115 ------ pytdx/parser/get_minute_time_data.py | 75 ---- pytdx/parser/get_report_file.py | 46 --- pytdx/parser/get_security_bars.py | 102 ----- pytdx/parser/get_security_count.py | 47 --- pytdx/parser/get_security_list.py | 52 --- pytdx/parser/get_security_quotes.py | 209 ---------- pytdx/parser/get_transaction_data.py | 52 --- pytdx/parser/get_xdxr_info.py | 169 -------- pytdx/parser/raw_parser.py | 14 - pytdx/parser/setup_commands.py | 34 -- pytdx/pool/__init__.py | 0 pytdx/pool/hqpool.py | 178 --------- pytdx/pool/ippool.py | 164 -------- pytdx/reader/__init__.py | 21 - pytdx/reader/base_reader.py | 21 - pytdx/reader/block_reader.py | 149 ------- pytdx/reader/c_gbbq_reader.pyx | 115 ------ pytdx/reader/daily_bar_reader.py | 138 ------- pytdx/reader/exhq_daily_bar_reader.py | 71 ---- pytdx/reader/gbbq_reader.py | 95 ----- pytdx/reader/history_financial_reader.py | 30 -- pytdx/reader/lc_min_bar_reader.py | 82 ---- pytdx/reader/min_bar_reader.py | 94 ----- pytdx/trade/__init__.py | 5 - pytdx/trade/trade.py | 309 --------------- pytdx/util/__init__.py | 7 - pytdx/util/best_ip.py | 166 -------- pytdx/util/date_util.py | 25 -- pytdx/util/trade_date.py | 247 ------------ requirement-dev.txt | 9 - setup.py | 78 ---- tests/test_crawler.py | 21 - tests/test_exhq.py | 112 ------ tests/test_hq.py | 132 ------- 96 files changed, 9 insertions(+), 9329 deletions(-) delete mode 100644 .gitignore delete mode 100644 .travis.yml delete mode 100644 .vscode/settings.json delete mode 100644 .vscode/temp.sql delete mode 100644 ChangeLog.md delete mode 100755 bootstrap.sh delete mode 100644 docs/api.md delete mode 100644 docs/batch_download_data.md delete mode 100644 docs/fuquan_factor.md delete mode 100644 docs/hq_price.md delete mode 100644 docs/hqget.md delete mode 100644 docs/hqreader.md delete mode 100644 docs/index.md delete mode 100644 docs/installation.md delete mode 100644 docs/pytdx_crawler.md delete mode 100644 docs/pytdx_exhq.md delete mode 100644 docs/pytdx_hq.md delete mode 100644 docs/pytdx_pool.md delete mode 100644 docs/pytdx_reader.md delete mode 100644 docs/pytdx_trade.md delete mode 100644 mkdocs.yml delete mode 100644 pytdx/__init__.py delete mode 100644 pytdx/base_socket_client.py delete mode 100644 pytdx/bin/__init__.py delete mode 100644 pytdx/bin/get_tdx_trader_server.py delete mode 100644 pytdx/bin/hqbenchmark.py delete mode 100644 pytdx/bin/hqget.py delete mode 100644 pytdx/bin/hqreader.py delete mode 100644 pytdx/config/__init__.py delete mode 100644 pytdx/config/hosts.py delete mode 100644 pytdx/crawler/__init__.py delete mode 100644 pytdx/crawler/base_crawler.py delete mode 100644 pytdx/crawler/history_financial_crawler.py delete mode 100644 pytdx/errors.py delete mode 100644 pytdx/exhq.py delete mode 100644 pytdx/heartbeat.py delete mode 100644 pytdx/helper.py delete mode 100644 pytdx/hq.py delete mode 100644 pytdx/log.py delete mode 100644 pytdx/params.py delete mode 100644 pytdx/parser/__init__.py delete mode 100644 pytdx/parser/base.py delete mode 100644 pytdx/parser/ex_get_history_instrument_bars_range.py delete mode 100644 pytdx/parser/ex_get_history_minute_time_data.py delete mode 100644 pytdx/parser/ex_get_history_transaction_data.py delete mode 100644 pytdx/parser/ex_get_instrument_bars.py delete mode 100644 pytdx/parser/ex_get_instrument_count.py delete mode 100644 pytdx/parser/ex_get_instrument_info.py delete mode 100644 pytdx/parser/ex_get_instrument_quote.py delete mode 100644 pytdx/parser/ex_get_instrument_quote_list.py delete mode 100644 pytdx/parser/ex_get_markets.py delete mode 100644 pytdx/parser/ex_get_minute_time_data.py delete mode 100644 pytdx/parser/ex_get_transaction_data.py delete mode 100644 pytdx/parser/ex_setup_commands.py delete mode 100644 pytdx/parser/get_block_info.py delete mode 100644 pytdx/parser/get_company_info_category.py delete mode 100644 pytdx/parser/get_company_info_content.py delete mode 100644 pytdx/parser/get_finance_info.py delete mode 100644 pytdx/parser/get_history_minute_time_data.py delete mode 100644 pytdx/parser/get_history_transaction_data.py delete mode 100644 pytdx/parser/get_index_bars.py delete mode 100644 pytdx/parser/get_minute_time_data.py delete mode 100644 pytdx/parser/get_report_file.py delete mode 100644 pytdx/parser/get_security_bars.py delete mode 100644 pytdx/parser/get_security_count.py delete mode 100644 pytdx/parser/get_security_list.py delete mode 100644 pytdx/parser/get_security_quotes.py delete mode 100644 pytdx/parser/get_transaction_data.py delete mode 100644 pytdx/parser/get_xdxr_info.py delete mode 100644 pytdx/parser/raw_parser.py delete mode 100644 pytdx/parser/setup_commands.py delete mode 100644 pytdx/pool/__init__.py delete mode 100644 pytdx/pool/hqpool.py delete mode 100644 pytdx/pool/ippool.py delete mode 100644 pytdx/reader/__init__.py delete mode 100644 pytdx/reader/base_reader.py delete mode 100644 pytdx/reader/block_reader.py delete mode 100644 pytdx/reader/c_gbbq_reader.pyx delete mode 100644 pytdx/reader/daily_bar_reader.py delete mode 100644 pytdx/reader/exhq_daily_bar_reader.py delete mode 100644 pytdx/reader/gbbq_reader.py delete mode 100644 pytdx/reader/history_financial_reader.py delete mode 100644 pytdx/reader/lc_min_bar_reader.py delete mode 100644 pytdx/reader/min_bar_reader.py delete mode 100644 pytdx/trade/__init__.py delete mode 100755 pytdx/trade/trade.py delete mode 100644 pytdx/util/__init__.py delete mode 100644 pytdx/util/best_ip.py delete mode 100644 pytdx/util/date_util.py delete mode 100644 pytdx/util/trade_date.py delete mode 100644 requirement-dev.txt delete mode 100644 setup.py delete mode 100644 tests/test_crawler.py delete mode 100644 tests/test_exhq.py delete mode 100644 tests/test_hq.py diff --git a/.gitignore b/.gitignore deleted file mode 100644 index f4d9498..0000000 --- a/.gitignore +++ /dev/null @@ -1,175 +0,0 @@ - -# Created by https://www.gitignore.io/api/pythonPeepOpenycharm - -### PyCharm ### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff: -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/dictionaries - -# Sensitive or high-churn files: -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.xml -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml - -# Gradle: -.idea/**/gradle.xml -.idea/**/libraries - -# CMake -cmake-build-debug/ - -# Mongo Explorer plugin: -.idea/**/mongoSettings.xml - -## File-based project format: -*.iws - -## Plugin-specific files: - -# IntelliJ -/out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -### PyCharm Patch ### -# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 - -# *.iml -# modules.xml -# .idea/misc.xml -# *.ipr - -# Sonarlint plugin -.idea/sonarlint - -### Python ### -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - -# dotenv -.env - -# virtualenv -.venv -venv/ -ENV/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# End of https://www.gitignore.io/api/pythonPeepOpenycharm - -.idea - -/test.py -/debug -/research - -*.c -.pytest_cache/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 175a2e8..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: python -python: - - "2.7" - # - "3.6" - - "3.7" - # - "nightly" # currently points to 3.7-dev - # - "pypy" - # - "pypy3" - -install: - - pip install -e . - -script: pytest diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 235f6f8..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "python.pythonPath": "C:\\ProgramData\\Anaconda3\\python.exe" -} diff --git a/.vscode/temp.sql b/.vscode/temp.sql deleted file mode 100644 index e69de29..0000000 diff --git a/ChangeLog.md b/ChangeLog.md deleted file mode 100644 index d41edd0..0000000 --- a/ChangeLog.md +++ /dev/null @@ -1,331 +0,0 @@ -1.72 ---- -* 给GetSecurityQuotes添加解析后的时间字段 servertime, 参考 #187, 感谢 @liuyug - -1.71 ---- -* 更新了最优ip获取部分 #217 - -1.70 ---- -* 恢复了从通达信proxy服务器获取历史财务数据的方法,可以通过 HistoryFinancialListCrawler.mode = "http" 切回使用http的方式。 - -1.69 ---- -* 修复了历史财务数据无法下载问题。 by yutiansut - -1.68 ---- -* 交易日历更新 - -1.67 ---- -* 增加`TdxTradeServer1.8.0.0`支持 -* trade模块增加 `send_orders`, `cancel_orders`, `get_quotes`, `query_datas` 支持 - -1.66 ---- -* 对`get_tts`支持`TdxTradeServer1.7.0.0`版本 -* trade模块增加 `get_active_clients` 功能 - -1.65 ---- -* 增加历史财务数据相关下载和解析方法 ,参考文档 https://rainx.gitbooks.io/pytdx/content/pytdx_crawler.html - 感谢 @datochan issue #133 - -1.64 ---- -* 增加query_history_data接口 2018-02-05 see: https://github.com/rainx/TdxTradeServer/releases/tag/v1.6.0.0 - -1.63 ---- -* fix issue #146, 股票涨速字段解析有错 @a19284 - -1.62 ----- -* Merge PR: fix bug for eol update to 1.62 #138 -1.61 ----- -* Merge pull request #136 from yutiansut/master 更新2018年交易日历 - -1.60 ----- -* Merge pull request #122, #125 from zsluedem/master : fix bugs on hqpool -* 增加指定绑定本地端口和ip地址功能 issue #119 https://github.com/rainx/pytdx/issues/119 - -1.59 ----- -* hk stock amount fix form pr https://github.com/rainx/pytdx/pull/115 -* upgrade TdxTradeServer to 1.5 version for support multi account trade - -1.58 ----- -* merge pr #110 - fix typo cacnel_order to cancel _order - -1.57 ------ -* GetSecurityList name.rstrip("\x00") Merge pull request #100 from JaysonAlbert/hotfix -* 修改财务信息 将(万元)的列 *10000 pr #102 from yutiansut:master - -1.56 ------- -* connect增加了time_out 参数 Merge pull request #99 from yutiansut/master - -1.55 ------- -* 为 get_security_quotes 增加了几种重载调用的方式:```get_security_quotes(market, code )``` -```get_security_quotes((market, code))``` -```get_security_quotes([(market1, code1), (market2, code2)] )``` -* 修正了nature_name的拼写错误(natrue), 为了保持兼容性,原有的natrue_name还会保留一段时间 - - -1.54 ------- -* Merge pull request Feature/fix nature name #91 @wopalm 修正期货和港股的nature_name解析问题 - -1.53 ------- -* Merge pull request #84 from JaysonAlbert/master 修复best_ip bug -* 在Cython编译版本增加了部分文件 -* Merge pull request #86 from yutiansut/master -* 添加新的获取扩展行情列表的接口 get_instrument_quote_list , 可以批量扩展行情获取某个市场的行情数据 - -1.52 ------- -* base_socket_client 增加了 send_raw_pkg 方法,方便调试 -* hqbenchmark命令支持端口(默认7709) - -1.51 ------- -* (注意:可能有潜在代码变更)合并 PR #83 by @nickolaslu : 沪深股票,基金,指数,债券的四价和成交量的系数是不一样的, -ie. 股票的VOLUME也要乘0.01, 基金,债券的四价是乘0.001 ... https://github.com/rainx/pytdx/pull/83 - -1.50 ------- -* 合并PR #80 去掉自定义板块读取的代码中的市场代码部分 by @JaysonAlbert - -1.49 ------- -* 合并PR #79 , 读取通达信备份的自定义板块文件夹 by @JaysonAlbert -* 增加 hqreader -d customblock 选项 - -1.48 ------- -* 增加hqbenchmark行情服务器测速工具 - -1.47 ------- -* 修复 版本1.45 修改时引发的其它数据无法匹配问题 - -1.46 ------- -* 将parser基类中的base.py里面的异常从继承BaseException改为集成Exception, 对应修复问题:https://github.com/rainx/pytdx/issues/68 - -1.45 ------- -* 修复get_finance_info总现金流不对 等问题, issue: https://github.com/rainx/pytdx/issues/73 - -1.44 ------- -* 增加 get_tts 命令,用于下载并配置TdxTradeServer服务 -* 增加了一部分通达信服务器地址到hosts.py配置文件中 - -1.43 ------- -* 修复 get_k_data 方法 的问题 https://github.com/rainx/pytdx/pull/59 -* 给hqget和hqreader增加pandas display.max_columns display.max_rows参数, 使其可以显示全部内容 - -1.42 ------- -* 增加了api.get_traffic_stats 获取当前连接的流量统计情况 - -1.41 ------- -* 增加GetBlockInfoMeta, 增加GetBlockInfo, get_and_parse_block_info 等支持直接下载并解析板块文件, 感谢 @mi-fox帮助分析协议 - -1.40 ------- -* 增加BlockReader用于读取板块列表 - -1.39 ------- -* 修复GetSecurityQuotesCmd里面一个保留位长度计算错误导致某些行情无法获取的问题。 - -1.38 ------- -* 修复抛出在auto_retry开启时TdxFunctionCallError异常时的一个小问题 - -1.37 ------- -* 增加自动重连机制 auto_retry=True 时生效,并可以自定制重连策略 -* 增加连接和接口调用时的异常处理 - -1.36 ------- -* fix bugs that break on call get_security_quotes on py2.7 -* 修复 get_security_quotes 在没有行情的时候报错 https://github.com/rainx/pytdx/issues/44 - -1.35 ------- -* 修复 exhqapi.get_transaction_data里的增仓数据不正确, 性质数据对不上 thx @zzeric -see https://github.com/rainx/pytdx/issues/31 - -1.34 ------- -* 增加了 https://github.com/rainx/pytdx/issues/38 IP寻优的简单办法 -* xdxr https://github.com/rainx/pytdx/issues/37 修改了对 11, 12, 13, 14 类别的支持, 针对13,14,增加了 fenshu xingquanjia 字段 - - -1.33 ------- -* 修复 Python2.x 无法安装的问题 https://github.com/rainx/pytdx/issues/36 - -1.32 ------- -* merge pr https://github.com/rainx/pytdx/pull/34 -* 增加对 get_security_bars 的注释:如果一个股票当天停牌,那天的K线还是能取到,成交量为0 -* 上线了trade模块,但是trade模块需配合TdxTradeServer使用(一个Windows 上的 C++ 开发的Server端) - -1.31 ------- -* 修复除息除权信息错误,增加 fenhong peigujia songzhuangu peigu suogu 字段 https://github.com/rainx/pytdx/issues/8 - -1.30 ------- -* 修复 exhqapi.get_transaction_data里的增仓数据不正确, 性质数据对不上 https://github.com/rainx/pytdx/issues/31 - -1.29 ------- -* 添加对通达信gbbq文件的解析类GbbqReader -* 可以使用 hqreader -d gbbq _path_to_gbbq_file_ -o some_output_file.csv 保存股本变迁数据 - -1.28 ------- -* 添加 get_history_instrument_bars_range 接口,可以根据一个时间范围下载历史k线信息 https://github.com/rainx/pytdx/pull/28 mifox - -1.27 ------- -* commit 新的get_k_data , 支持任意时间段 任意时间长度 任意股票 https://github.com/rainx/pytdx/pull/27 yutiansut - -1.26 ------- -* 增加了 KLINE_TYPE_EXHQ_1MIN = 7 用于获取扩展行情分钟K线 via mi-fox - -1.25 ------- -* 修复了get_k_data 因为停牌导致的时间索引错位的问题 https://github.com/rainx/pytdx/pull/26 yutiansut - -1.24 ------- -* 增加 TdxExHqDailyBarReader ,用于读取扩展行情(如期货,现货,期权等)的盘后日线数据 https://github.com/rainx/pytdx/issues/25 - -1.23 ------- -* 增加历史分时行情,分时成交,历史分时成交 https://github.com/rainx/pytdx/pull/24 wopalm - -1.22 ------- -* 解决扩展行情,无法指定数据长度的问题 https://github.com/rainx/pytdx/issues/22 wopalm - -1.21 ------- -* Reader 支持 lc1, lc5 文件格式 - -1.20 ------- -* 修复了exhq get_instrument_info(10000, 98)取不到数据, change to name = name_raw.decode("gbk", 'ignore') - -1.19 ------- -* 合并了hqpool分支,增加行情备选连接池支持 - -1.18 ------- -* 增加了扩展行情的 查询代码列表 `get_instrument_info` - -1.17 ------- -* 修正了get_instrument_bars接口的ohlc位置对应错误的bug -* 修改了对应的列名 vol, amount -> position, trade - -1.16 ------- -* 增加了扩展行情里面的获取k线接口 eg. api.get_instrument_bars(TDXParams.KLINE_TYPE_DAILY, 8, "10000843") - -1.15 ------- -* 在 get_security_list 接口中增加了 小数点位数 (decimal_point) 列 https://github.com/rainx/pytdx/issues/16 - -1.14 ------- -* 增加判断,只在heartbeat=True的时候启动heartbeat线程 - -1.13 ------- -* 增加心跳包heartbeat参数,自动创建心跳包线程 -* 将HqAPI和 ExHqAPI部分逻辑放到BaseSocketClient里 - -1.12 ------- -* pr #13 简化用户输入 https://github.com/rainx/pytdx/pull/13 - -1.11 ------- -* 追加exhq get_minute_time_data 接口 - -1.10 ------- -* 更新了reader中读取通达信1,5分钟k线的数据文件的方法, TdxMinBarReader -* try hqreader -d min ~/Downloads/sh000001.5 -* 写了一半的exhq读取,请忽略,当初应该搞个单独的分支的,懒了... - -1.9 ------- -* 更新了主机列表, 参考 issue: https://github.com/rainx/pytdx/issues/3 -* 增加了部分常量定义 https://github.com/rainx/pytdx/issues/7 -* hqget 增加了 --all 参数,以支持获取全部股票列表 - -1.8 ------- -* 修复关于除权除息信息错误的bug, 后续还有待进一步完善 issue : https://github.com/rainx/pytdx/issues/8 - -1.7 ------- -* 支持Reader类读取通达信导出的数据文件 参见 https://github.com/rainx/pytdx/issues/5 感谢 @yutiansut - -1.6 ------- -* 调整GetSecurityQuotesCmd,修复了后几个字节解析的时候的错误,使其不会再解析某些股票的时候pos计算错误,导致后续的股票无法解析 - -1.5 ------- -* 修复windows下python2中文显示和命令输入问题 - -1.4 ------- -* 修复hqget在python2下获取公司信息详情的时候的错误 - -1.3 ------- -* 去掉了一个错误的 assert : assert (reversed_bytes1 == -price) - -1.2 ------- -* 修复python2.7下整除的bug ,类似, 感谢dHydra数据群的 流水 - 流水 11:07:46 - @徐景-RainX 2.7中这个除法是有问题的 - 流水 11:08:19 - def _cal_price1000(self, base_p, diff): - return (base_p + diff)/1000 - to return float(base_p + diff)/1000 -* 将返回财务数据里的代码转化为字符串类型(bytes -> str) -* 修复了python2 在 读取 byte[pos] 的时候换个python3 行为不同的bug - -1.1 ------- -* 增加多线程支持 -* 对disconnect增加了异常捕获 - -1.0 ------- -* 初始版本 diff --git a/README.md b/README.md index 8c7051b..5e96cf0 100644 --- a/README.md +++ b/README.md @@ -1,78 +1,13 @@ -# Pytdx - Python tdx数据接口 +# pytdx 项目 archive 声明 -[![Build Status](https://travis-ci.org/rainx/pytdx.svg?branch=master)](https://travis-ci.org/rainx/pytdx) +感谢大家对 `pytdx` 项目的关注 -文档 ---- -用户文档会逐步转移到gitbook上,您可以在 +1. `pytdx` 为个人学习目的开发的项目 +1. 请不要将该项目代码用于任何商业目的。 +1. 早在 `2` 年前(2018年)我加入新的公司之后,该项目一直处于没有维护的状态,目前也没有更多精力维护此项目,项目代码已经老旧过时。 +1. 谢谢大家的关注,希望后续关注我的其他项目(目前专注于前端开发语言 `TypeScript`, `Swift`, `Kotlin`, 和一些系统级开发语言 `Rust`, `Golang`)。 +1. 关于 `Python` 的新版本,新特性,已经很久没有跟进学习了,后续会补上。希望后续与大家更多的交流。 -https://rainx.gitbooks.io/pytdx/content/ +经过慎重的考虑,决定在Github上Archive本项目。希望可以得到大家的理解。再次感谢。 -阅读使用该api接口的详细文档。 - -概述 ---- - -Pytdx 是一款纯Python语言开发的类似TradeX的行情数据接口的实现。 - -特点 ---- -* 纯python实现,无须引入动态连接库```.dll/.so```文件 -* 支持```python2.7+```/```3.5+```, 以及全平台```Windows/MacOS/Linux``` -* 可以通过设置参数提供```线程安全```接口调用 -* 实现```心跳包```机制,可以在长时间没有交互的情况下保持不断线 -* (试验)支持多连接构成的连接池机制,和failover处理机制,保证稳定性。 -* 可以自定义的自动重连策略 -* (试验)支持异步行情接口 ,由 @JaysonAlbert 提供实现, 详情查看*async*分支 - -> pytdx将重点放在底层包的解析,对于更高层的封装,建议参考或者直接使用[`Quantaxis`](https://github.com/yutiansut/QUANTAXIS/blob/master/QUANTAXIS/QAFetch/QATdx.py)的实现.. - -安装 ---- - -``` -pip install pytdx -``` - -接口实现 ---- -### 标准行情 pytdx.hq -用于读取标准行情信息 - -### 扩展行情 pytdx.exhq - -用于读取扩展行情(外盘,期权,期货等) - -### 数据文件读取 pytdx.reader -用于读取行情软件导出的k线数据 - -### 历史专业财务数据的爬取和解析 - -感谢 @datochan 根据 方法实现 - -### 交易相关 (使用TdxTradeServer(wrapper of trade.dll)) - -https://rainx.gitbooks.io/pytdx/content/pytdx_trade.html - -### pytdx.pool (试验性质) -用于实现备用连接池以及failover支持的行情接口 - - -命令行 ---- -我们提供了方便命令行调试和导出数据的命令行工具 `hqget` 以及`hqreader` 具体使用方法请参考这里。 - -缘起 ---- - -因为之前TradeX的接口是使用Python扩展的方式调用C++代码实现的,功能上有诸多的限制,如只支持32位的Python, 不支持MacOS, Linux等, -无奈我自己使用的电脑是Mac系统, 服务器又是基于Linux的,所以只能自己重新实现一份。 - -声明 ---- -此代码用于个人对网络协议的研究和习作,不对外提供服务,任何人使用本代码遇到问题请自行解决,也可以在github提issue给我,但是我不保证能即时处理。 -由于我们连接的是既有的行情软件兼容行情服务器,机构请不要使用此代码,对此造成的任何问题本人概不负责。 - -## 其它 - -欢迎对量化交易感兴趣的朋友互相交流,可以来我们的智矿社区看看 http://zhikuang.org +Peace & Love \ No newline at end of file diff --git a/bootstrap.sh b/bootstrap.sh deleted file mode 100755 index e63722a..0000000 --- a/bootstrap.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -# -# 构建基础的开发环境 (For mac) -# - -# If virtualenv not installed, install it first -which virtualenv -if [ ! $? == 0 ]; then - pip install virtualenv -fi - -if [ ! -d ./env ]; then - virtualenv env -fi - -if [ -d ./env ]; then - source env/bin/activate -fi - -# Install all requirements.txt -pip install -r requirement-dev.txt - -if [ "$(uname)"=="Darwin" ]; then - brew install pandoc -fi - -# Install local -python setup.py develop \ No newline at end of file diff --git a/docs/api.md b/docs/api.md deleted file mode 100644 index 998c6fd..0000000 --- a/docs/api.md +++ /dev/null @@ -1,4 +0,0 @@ - -# 接口 - -pytdx 实现了读取行情和数据文件等不同的接口,您可以使用 `ipython` 通过交互的方式进行调用,也可以在您的python脚本程序中使用。 diff --git a/docs/batch_download_data.md b/docs/batch_download_data.md deleted file mode 100644 index bef605d..0000000 --- a/docs/batch_download_data.md +++ /dev/null @@ -1,126 +0,0 @@ - -# 数据的批量完整下载方式代码 - -[https://github.com/rainx/pytdx/issues/21](https://github.com/rainx/pytdx/issues/21) via yutiansut - -看到有issue提出不知道如果下载完整的数据,关于数据位置指针的使用,给一个示例代码: - -``` -from pytdx.hq import TdxHq_API -api=TdxHq_API() - -with api.connect(): - data=[] - - for i in range(10): - data+=api.get_security_bars(9,0,'000001',(9-i)*800,800) -print(api.to_df(data)) - -``` - -|open|close|high|low|vol|amount|year|month|day|hour|minute|datetime -|------ -|27.70|27.80|27.90|27.60|1270.0|3.530600e+06|1991|12|23|15|0|1991-12-23 15:00 -|27.90|29.05|29.30|27.00|1050.0|3.050250e+06|1991|12|24|15|0|1991-12-24 15:00 -|29.15|29.30|30.00|29.10|2269.0|6.648170e+06|1991|12|25|15|0|1991-12-25 15:00 -|29.30|28.00|29.30|28.00|1918.0|5.370400e+06|1991|12|26|15|0|1991-12-26 15:00 -|28.00|28.45|28.50|28.00|2105.0|5.988725e+06|1991|12|27|15|0|1991-12-27 15:00 -|28.40|29.25|29.30|28.40|1116.0|3.264300e+06|1991|12|28|15|0|1991-12-28 15:00 -|29.30|28.80|29.40|28.80|1059.0|3.049920e+06|1991|12|30|15|0|1991-12-30 15:00 -|29.15|29.15|29.40|29.00|1886.0|5.497690e+06|1992|1|2|15|0|1992-01-02 15:00 -|29.20|29.10|29.30|29.00|2212.0|6.436920e+06|1992|1|3|15|0|1992-01-03 15:00 -|29.10|29.70|29.80|29.05|2634.0|7.822980e+06|1992|1|6|15|0|1992-01-06 15:00 -|29.70|29.90|30.20|29.55|2931.0|8.763690e+06|1992|1|7|15|0|1992-01-07 15:00 -|29.80|29.65|30.20|29.55|1928.0|5.716520e+06|1992|1|8|15|0|1992-01-08 15:00 -|29.70|29.70|29.80|29.30|1535.0|4.558950e+06|1992|1|9|15|0|1992-01-09 15:00 -|29.65|29.80|29.80|29.50|1525.0|4.544500e+06|1992|1|10|15|0|1992-01-10 15:00 -|29.80|29.65|29.80|29.60|1353.0|4.011645e+06|1992|1|13|15|0|1992-01-13 15:00 -|29.65|29.20|29.65|29.00|1711.0|4.996120e+06|1992|1|14|15|0|1992-01-14 15:00 -|29.20|29.10|29.40|29.00|2205.0|6.416550e+06|1992|1|15|15|0|1992-01-15 15:00 -|29.00|28.90|29.00|28.55|1268.0|3.664520e+06|1992|1|16|15|0|1992-01-16 15:00 -|28.90|28.80|28.90|28.35|1143.0|3.291840e+06|1992|1|17|15|0|1992-01-17 15:00 -|28.80|29.45|29.50|28.80|1085.0|3.195325e+06|1992|1|20|15|0|1992-01-20 15:00 -|29.50|29.30|29.80|29.20|1576.0|4.617680e+06|1992|1|21|15|0|1992-01-21 15:00 -|29.25|28.95|29.30|28.80|1592.0|4.608840e+06|1992|1|22|15|0|1992-01-22 15:00 -|28.95|29.20|29.30|28.95|1477.0|4.312840e+06|1992|1|23|15|0|1992-01-23 15:00 -|29.25|29.05|29.70|29.05|2327.0|6.759935e+06|1992|1|24|15|0|1992-01-24 15:00 -|29.55|29.40|29.60|29.30|2571.0|7.558740e+06|1992|1|27|15|0|1992-01-27 15:00 -|29.40|29.50|29.50|29.35|2336.0|6.891200e+06|1992|1|28|15|0|1992-01-28 15:00 -|29.50|30.00|30.05|29.50|2127.0|6.381000e+06|1992|1|29|15|0|1992-01-29 15:00 -|29.95|30.20|30.35|29.95|1735.0|5.239700e+06|1992|1|30|15|0|1992-01-30 15:00 -|31.15|32.00|32.00|31.15|2228.0|7.129600e+06|1992|2|1|15|0|1992-02-01 15:00 -|32.00|32.32|32.70|31.90|1735.0|5.607520e+06|1992|2|2|15|0|1992-02-02 15:00 -|...|...|...|...|...|...|...|...|...|...|...|... -|9.30|9.36|9.39|9.27|546016.0|5.091620e+08|2017|6|27|15|0|2017-06-27 15:00 -|9.35|9.43|9.49|9.33|1168796.0|1.102438e+09|2017|6|28|15|0|2017-06-28 15:00 -|9.43|9.43|9.45|9.37|488804.0|4.598104e+08|2017|6|29|15|0|2017-06-29 15:00 -|9.40|9.39|9.43|9.31|499633.0|4.680035e+08|2017|6|30|15|0|2017-06-30 15:00 -|9.40|9.40|9.43|9.34|388349.0|3.644659e+08|2017|7|3|15|0|2017-07-03 15:00 -|9.40|9.34|9.41|9.30|488362.0|4.565770e+08|2017|7|4|15|0|2017-07-04 15:00 -|9.29|9.37|9.38|9.27|567720.0|5.292941e+08|2017|7|5|15|0|2017-07-05 15:00 -|9.36|9.40|9.41|9.31|738911.0|6.913872e+08|2017|7|6|15|0|2017-07-06 15:00 -|9.37|9.47|9.48|9.34|760369.0|7.170844e+08|2017|7|7|15|0|2017-07-07 15:00 -|9.45|9.59|9.66|9.44|1360815.0|1.303090e+09|2017|7|10|15|0|2017-07-10 15:00 -|9.61|10.25|10.46|9.61|3812086.0|3.842010e+09|2017|7|11|15|0|2017-07-11 15:00 -|10.27|10.34|10.58|10.20|2998844.0|3.113681e+09|2017|7|12|15|0|2017-07-12 15:00 -|10.30|10.90|10.90|10.24|2994534.0|3.180145e+09|2017|7|13|15|0|2017-07-13 15:00 -|10.81|10.90|10.94|10.66|1722570.0|1.864449e+09|2017|7|14|15|0|2017-07-14 15:00 -|10.95|10.81|11.33|10.72|3273123.0|3.608692e+09|2017|7|17|15|0|2017-07-17 15:00 -|10.75|11.05|11.14|10.62|2349431.0|2.558434e+09|2017|7|18|15|0|2017-07-18 15:00 -|10.99|11.09|11.19|10.88|1933075.0|2.131336e+09|2017|7|19|15|0|2017-07-19 15:00 -|11.08|10.97|11.22|10.91|1537338.0|1.695061e+09|2017|7|20|15|0|2017-07-20 15:00 -|10.83|10.89|10.95|10.69|1501020.0|1.625416e+09|2017|7|21|15|0|2017-07-21 15:00 -|10.82|10.95|11.06|10.73|1692664.0|1.846887e+09|2017|7|24|15|0|2017-07-24 15:00 -|10.98|11.00|11.27|10.95|1954768.0|2.172115e+09|2017|7|25|15|0|2017-07-25 15:00 -|10.92|10.74|11.18|10.66|1697412.0|1.846282e+09|2017|7|26|15|0|2017-07-26 15:00 -|10.72|10.59|10.77|10.53|1194490.0|1.273889e+09|2017|7|27|15|0|2017-07-27 15:00 -|10.61|10.74|10.81|10.58|819195.0|8.777693e+08|2017|7|28|15|0|2017-07-28 15:00 -|10.80|10.67|10.82|10.45|1575864.0|1.671814e+09|2017|7|31|15|0|2017-07-31 15:00 -|10.64|11.04|11.08|10.60|2035709.0|2.222888e+09|2017|8|1|15|0|2017-08-01 15:00 -|11.05|11.15|11.34|10.96|2062069.0|2.307727e+09|2017|8|2|15|0|2017-08-02 15:00 -|11.14|11.01|11.22|10.97|984219.0|1.090954e+09|2017|8|3|15|0|2017-08-03 15:00 -|11.00|11.17|11.29|10.93|1353951.0|1.511390e+09|2017|8|4|15|0|2017-08-04 15:00 -|11.06|11.00|11.17|10.90|860644.0|9.469757e+08|2017|8|7|15|0|2017-08-07 15:00 - -这么做的原因很简单,改变指针的位置 - -分别是 - -``` -0-799 - -800-1599 - -1600-2399 - -.... - -``` - -依次 - -然后需要注意的是 0代表的是今天的指针 ,所以 指针获取方式要翻过来写 首先是 7200-7999的数据 - -最后才是0-799的数据 - -基本上 日线级别 8000条足够覆盖了 - -分钟线,小时线要长一点 - -封装成函数 - -``` - -from pytdx.hq import TdxHq_API -api=TdxHq_API() - - -def get_all_day_data(): - with api.connect(): - data=[] - - for i in range(10): - data+=api.get_security_bars(9,0,'000001',(9-i)*800,800) - print(api.to_df(data)) - -``` diff --git a/docs/fuquan_factor.md b/docs/fuquan_factor.md deleted file mode 100644 index 71ba5b4..0000000 --- a/docs/fuquan_factor.md +++ /dev/null @@ -1,159 +0,0 @@ - -# 同花顺的一个爬虫 可以获取前后复权因子 - -[https://github.com/rainx/pytdx/issues/20](https://github.com/rainx/pytdx/issues/20) via yutiansut - -``` -import requests -import pandas as pd -import numpy as np - -# 00 不复权 01前复权 02后复权 - -def get_k_data_year(code,year,if_fq): - data_=[] - - - url='http://d.10jqka.com.cn/v2/line/hs_%s/%s/%s.js'%(str(code),str(if_fq),str(year)) - for item in requests.get(url).text.split('\"')[3].split(';'): - data_.append(item.split(',')) - return pd.DataFrame(data_,index=list(np.asarray(data_).T[0]),columns=['date','open','high','low','close','volume','amount','factor']) - - -if __name__=='__main__': - print(get_k_data_year('000001','2016','01')) - print(get_k_data_year(600010,2016,'01')) - -``` - -``` -date open high low close volume amount factor -20160104 20160104 9.72 9.74 9.07 9.16 56349787 660376150.00 0.573 -20160105 20160105 9.11 9.36 9.01 9.22 66326995 755531350.00 0.674 -20160106 20160106 9.23 9.35 9.21 9.32 51570644 591698520.00 0.524 -20160107 20160107 9.22 9.22 8.81 8.83 17476110 194869490.00 0.178 -20160108 20160108 9.06 9.12 8.80 8.98 74752758 831334540.00 0.760 -20160111 20160111 8.88 8.95 8.62 8.68 73201399 800683640.00 0.744 -20160112 20160112 8.74 8.81 8.58 8.72 56164230 605970830.00 0.571 -20160113 20160113 8.79 8.83 8.63 8.64 39170948 424371690.00 0.398 -20160114 20160114 8.54 8.72 8.45 8.69 66631454 708535000.00 0.677 -20160115 20160115 8.60 8.72 8.40 8.43 44820214 474908140.00 0.456 -20160118 20160118 8.33 8.52 8.30 8.39 42104088 439917820.00 0.428 -20160119 20160119 8.42 8.70 8.39 8.64 50110908 532074700.00 0.509 -20160120 20160120 8.63 8.72 8.42 8.50 60375250 640968950.00 0.614 -20160121 20160121 8.45 8.67 8.32 8.32 60614511 638127880.00 0.616 -20160122 20160122 8.38 8.42 8.23 8.38 46675214 482984450.00 0.475 -20160125 20160125 8.38 8.42 8.32 8.36 37643172 390734880.00 0.383 -20160126 20160126 8.32 8.32 7.93 7.94 64790114 653561590.00 0.659 -20160127 20160127 7.99 8.03 7.72 7.95 56903705 558510640.00 0.579 -20160128 20160128 7.90 7.96 7.76 7.79 30254078 296055320.00 0.308 -20160129 20160129 7.83 8.12 7.79 8.05 54443576 540544460.00 0.554 -20160201 20160201 8.03 8.06 7.83 7.88 41773214 412635640.00 0.425 -20160202 20160202 7.88 8.07 7.87 8.01 36910416 367360500.00 0.375 -20160203 20160203 7.92 7.96 7.86 7.92 27457217 269997840.00 0.279 -20160204 20160204 7.96 8.05 7.95 8.01 37309947 370586190.00 0.379 -20160205 20160205 8.02 8.02 7.97 7.98 27089334 269184380.00 0.275 -20160215 20160215 7.77 7.92 7.76 7.87 27849946 271173370.00 0.283 -20160216 20160216 7.92 8.07 7.91 8.06 42838638 427507770.00 0.436 -20160217 20160217 8.07 8.23 8.04 8.17 58516706 590538920.00 0.595 -20160218 20160218 8.20 8.23 8.12 8.12 40617824 412337570.00 0.413 -20160219 20160219 8.12 8.17 8.04 8.08 31889825 320939650.00 0.324 -... ... ... ... ... ... ... ... ... -20161121 20161121 9.02 9.12 9.01 9.08 85024326 785475680.00 0.581 -20161122 20161122 9.08 9.20 9.07 9.20 118025694 1097408710.00 0.807 -20161123 20161123 9.18 9.40 9.18 9.29 175286940 1660465700.00 1.198 -20161124 20161124 9.28 9.36 9.26 9.31 77974884 738580570.00 0.533 -20161125 20161125 9.32 9.46 9.30 9.46 101367499 968127770.00 0.693 -20161128 20161128 9.53 9.62 9.44 9.47 127968924 1240686230.00 0.875 -20161129 20161129 9.43 9.54 9.39 9.46 88777923 854308660.00 0.607 -20161130 20161130 9.49 9.56 9.34 9.39 102596305 985758450.00 0.701 -20161201 20161201 9.41 9.47 9.39 9.44 64600437 619633750.00 0.442 -20161202 20161202 9.44 9.44 9.28 9.39 82968650 790044440.00 0.567 -20161205 20161205 9.34 9.38 9.25 9.30 76436570 723222050.00 0.522 -20161206 20161206 9.32 9.36 9.29 9.33 60290276 571585180.00 0.412 -20161207 20161207 9.32 9.33 9.25 9.32 49340476 466085500.00 0.337 -20161208 20161208 9.34 9.39 9.27 9.36 67145216 638058500.00 0.459 -20161209 20161209 9.34 9.59 9.32 9.49 151419920 1460778300.00 1.035 -20161212 20161212 9.49 9.61 9.28 9.34 125687400 1206662620.00 0.859 -20161213 20161213 9.32 9.34 9.17 9.26 64577157 607769970.00 0.441 -20161214 20161214 9.26 9.35 9.24 9.24 59770574 564787520.00 0.409 -20161215 20161215 9.21 9.25 9.05 9.09 82761287 767751840.00 0.566 -20161216 20161216 9.08 9.13 9.05 9.09 39681397 366925350.00 0.271 -20161219 20161219 9.06 9.07 9.01 9.04 49401064 453899740.00 0.338 -20161220 20161220 9.04 9.04 8.92 8.95 63663837 580118170.00 0.435 -20161221 20161221 8.96 9.00 8.95 9.00 36992065 338201450.00 0.253 -20161222 20161222 8.99 9.00 8.95 8.98 34134124 311546860.00 0.233 -20161223 20161223 8.98 8.98 8.91 8.92 38291216 348140450.00 0.262 -20161226 20161226 8.90 8.97 8.86 8.96 30205896 273934290.00 0.206 -20161227 20161227 8.96 8.97 8.91 8.92 26884124 244788270.00 0.184 -20161228 20161228 8.92 8.95 8.88 8.90 33605509 304898610.00 0.230 -20161229 20161229 8.91 8.93 8.89 8.92 33875853 307183500.00 0.232 -20161230 20161230 8.92 8.94 8.90 8.94 30260736 274882700.00 0.207 - -[244 rows x 8 columns] - date open high low close volume amount factor -20160104 20160104 2.59 2.59 2.32 2.33 69437299 242332010.00 0.618 -20160105 20160105 2.28 2.44 2.23 2.39 114924349 378947390.00 1.022 -20160106 20160106 2.41 2.61 2.37 2.59 183924160 648683940.00 1.636 -20160107 20160107 2.51 2.54 2.33 2.34 51144318 173416790.00 0.455 -20160108 20160108 2.41 2.57 2.34 2.54 269896420 947258110.00 2.400 -20160111 20160111 2.49 2.49 2.34 2.36 196359560 661641860.00 1.746 -20160112 20160112 2.36 2.39 2.24 2.31 98270625 317175040.00 0.874 -20160113 20160113 2.34 2.46 2.29 2.31 125690384 417415510.00 1.118 -20160114 20160114 2.23 2.39 2.21 2.35 98322435 316861960.00 0.874 -20160115 20160115 2.32 2.33 2.23 2.24 93528953 297474680.00 0.832 -20160118 20160118 2.23 2.27 2.20 2.24 64590691 202761380.00 0.574 -20160119 20160119 2.26 2.31 2.24 2.29 96680129 307322480.00 0.860 -20160120 20160120 2.26 2.34 2.24 2.26 101959509 324735300.00 0.907 -20160121 20160121 2.22 2.27 2.18 2.19 87420957 272307120.00 0.778 -20160122 20160122 2.22 2.26 2.16 2.24 80863272 251230110.00 0.719 -20160125 20160125 2.26 2.28 2.23 2.24 63713723 201200220.00 0.567 -20160126 20160126 2.22 2.24 2.02 2.09 113888133 344049080.00 1.013 -20160127 20160127 2.11 2.13 2.03 2.11 103701991 302859880.00 0.922 -20160128 20160128 2.08 2.09 1.90 1.92 97593135 272647830.00 0.868 -20160129 20160129 1.94 2.11 1.91 2.11 197683570 572679180.00 1.758 -20160201 20160201 2.09 2.10 1.96 2.01 131984720 375889720.00 1.174 -20160202 20160202 1.99 2.17 1.99 2.06 108175246 315234680.00 0.962 -20160203 20160203 2.04 2.06 1.99 2.02 91365909 258485030.00 0.813 -20160204 20160204 2.04 2.09 2.02 2.06 83281507 240504290.00 0.741 -20160205 20160205 2.08 2.09 2.02 2.03 52837897 151741470.00 0.470 -20160215 20160215 1.96 2.06 1.94 2.04 58809771 164621270.00 0.523 -20160216 20160216 2.03 2.10 2.01 2.09 93010401 271062480.00 0.827 -20160217 20160217 2.09 2.16 2.07 2.11 115949211 342859230.00 1.031 -20160218 20160218 2.13 2.15 2.09 2.11 99191116 294640880.00 0.882 -20160219 20160219 2.09 2.12 2.08 2.10 58237732 170913540.00 0.518 -... ... ... ... ... ... ... ... ... -20161121 20161121 2.11 2.14 2.10 2.11 114557751 339795860.00 1.019 -20161122 20161122 2.11 2.15 2.11 2.14 167943830 502591470.00 1.494 -20161123 20161123 2.14 2.16 2.11 2.12 101154491 301503020.00 0.900 -20161124 20161124 2.11 2.14 2.11 2.12 91680268 272503710.00 0.815 -20161125 20161125 2.14 2.14 2.09 2.14 172758960 512616630.00 1.536 -20161128 20161128 2.14 2.16 2.12 2.14 149050060 446304570.00 1.326 -20161129 20161129 2.14 2.19 2.13 2.16 285636000 869041780.00 2.540 -20161130 20161130 2.15 2.16 2.11 2.13 118658206 354947140.00 1.055 -20161201 20161201 2.13 2.19 2.12 2.19 187748290 569961340.00 1.670 -20161202 20161202 2.19 2.21 2.16 2.16 152353480 464076130.00 1.355 -20161205 20161205 2.13 2.16 2.11 2.11 117903892 351497450.00 1.049 -20161206 20161206 2.12 2.13 2.10 2.11 58917294 174115600.00 0.524 -20161207 20161207 2.11 2.16 2.11 2.16 156476360 469002600.00 1.392 -20161208 20161208 2.16 2.16 2.11 2.11 117791919 351791910.00 1.048 -20161209 20161209 2.11 2.15 2.11 2.12 115871897 343863510.00 1.031 -20161212 20161212 2.14 2.16 2.05 2.06 206053250 609641440.00 1.833 -20161213 20161213 2.05 2.08 2.04 2.07 83568115 241203240.00 0.743 -20161214 20161214 2.07 2.07 2.01 2.03 101446171 290766760.00 0.902 -20161215 20161215 2.01 2.04 2.01 2.04 55941526 158843460.00 0.498 -20161216 20161216 2.03 2.04 2.01 2.04 53356473 151462500.00 0.475 -20161219 20161219 2.04 2.05 2.02 2.02 55753284 158820550.00 0.496 -20161220 20161220 2.03 2.03 2.00 2.01 60642763 170695500.00 0.539 -20161221 20161221 2.01 2.03 2.01 2.03 70177026 198392800.00 0.624 -20161222 20161222 2.02 2.03 2.01 2.01 52148443 146992360.00 0.464 -20161223 20161223 2.01 2.01 1.99 2.01 51380195 144042030.00 0.457 -20161226 20161226 2.00 2.01 1.98 2.01 54378359 151634810.00 0.484 -20161227 20161227 2.00 2.01 1.99 2.00 29679659 83301045.00 0.264 -20161228 20161228 2.01 2.01 1.99 1.99 31189281 87149698.00 0.277 -20161229 20161229 1.99 2.01 1.98 1.99 31461786 87826414.00 0.280 -20161230 20161230 1.99 2.00 1.98 1.99 36529644 101796632.00 0.325 - -[244 rows x 8 columns] - -``` diff --git a/docs/hq_price.md b/docs/hq_price.md deleted file mode 100644 index 7478347..0000000 --- a/docs/hq_price.md +++ /dev/null @@ -1,87 +0,0 @@ - -# 基金价格问题 - -[https://github.com/rainx/pytdx/issues/16](https://github.com/rainx/pytdx/issues/16) - -get_minute_time_data,get_transaction_data,get_security_quotes这些函数如果传入基金代码,返回的价格都大了10倍。 - -这个是通达信的行情数据本身就给乘了10倍吗? - -wopalm: - -在证券的清单中,有"价格小数位数"的信息,可以看到,159922的小数位数是3位。pytdx证券清单的函数,舍去了这个信息,建议加上。返回的数据格式如下 - -``` -在 get_security_list 接口中增加了 小数点位数 (decimal_point) - -``` - -如: - -``` -In [11]: api.to_df(api.get_security_list(market=0, start=800)) -Out[11]: - code volunit decimal_point name pre_close -0 000978 100 2 桂林旅游 312.022500 -1 000979 100 2 中弘股份 1.960000 -2 000980 100 2 众泰汽车 616.005000 -3 000981 100 2 银亿股份 488.015000 -4 000982 100 2 *ST 中绒 4.070000 -5 000983 100 2 西山煤电 632.052500 -6 000985 100 2 大庆华科 24.670000 -7 000987 100 2 越秀金控 920.027500 -8 000988 100 2 华工科技 1864.020000 -9 000989 100 2 九 芝 堂 19.299999 -10 000990 100 2 诚志股份 17.270000 -11 000993 100 2 闽东电力 536.027500 -12 000995 100 2 皇台酒业 1608.030000 -13 000996 100 2 中国中期 1304.027500 -14 000997 100 2 新 大 陆 23.500000 -15 000998 100 2 隆平高科 23.799999 -16 000999 100 2 华润三九 27.820000 -17 001696 100 2 宗申动力 7.340000 -18 001896 100 2 豫能控股 6.690000 -19 001979 100 2 招商蛇口 19.180000 -20 002001 100 2 新 和 成 20.260000 -21 002002 100 2 鸿达兴业 200.000000 -22 002003 100 2 伟星股份 712.030000 -23 002004 100 2 华邦健康 8.040000 -24 002005 100 2 德豪润达 4.680000 -25 002006 100 2 精功科技 7.910000 -26 002007 100 2 华兰生物 29.000000 -27 002008 100 2 大族激光 64.169998 -28 002009 100 2 天奇股份 1224.050000 -29 002010 100 2 传化智联 1896.005000 -.. ... ... ... ... ... -970 101301 10 3 国债1301 103.000000 -971 101303 10 3 国债1303 99.580002 -972 101305 10 3 国债1305 100.000000 -973 101308 10 3 国债1308 99.099998 -974 101309 10 3 国债1309 100.000000 -975 101310 10 3 国债1310 100.000000 -976 101311 10 3 国债1311 98.626999 -977 101313 10 3 国债1313 99.290001 -978 101315 10 3 国债1315 99.011002 -979 101316 10 3 国债1316 100.000000 -980 101318 10 3 国债1318 100.000000 -981 101319 10 3 国债1319 100.000000 -982 101320 10 3 国债1320 100.500000 -983 101323 10 3 国债1323 100.000000 -984 101324 10 3 国债1324 100.000000 -985 101325 10 3 国债1325 100.000000 -986 101401 10 3 国债1401 100.000000 -987 101403 10 3 国债1403 101.540001 -988 101405 10 3 国债1405 100.000000 -989 101406 10 3 国债1406 100.000000 -990 101408 10 3 国债1408 100.000000 -991 101409 10 3 国债1409 100.000000 -992 101410 10 3 国债1410 100.000000 -993 101412 10 3 国债1412 99.500000 -994 101413 10 3 国债1413 101.690002 -995 101416 10 3 国债1416 100.000000 -996 101417 10 3 国债1417 100.000000 -997 101420 10 3 国债1420 100.000000 -998 101421 10 3 国债1421 100.000000 -999 101424 10 3 国债1424 100.000000 - -``` diff --git a/docs/hqget.md b/docs/hqget.md deleted file mode 100644 index 0e7244f..0000000 --- a/docs/hqget.md +++ /dev/null @@ -1,179 +0,0 @@ - -## 命令行 - -我提供了一个命令行工具来实现简单的交互和功能演示,在安装之后,应该可以直接使用 `hqget` 命令调用, hqget分为交互模式和单命令模式, -您可以随时使用 hqget --help 获取接口的使用规则。 - -### 交互模式 - -直接输入 `hqget` 即可进入交互模式,进入之后,先选择要连接的服务器类型,然后选择要执行的功能,选择菜单里面最后一项退出交互模式。 - -选择服务器 - -``` --->rainx@JingdeMacBook-Pro:~/dev/pytdx [master]$ hqget -连接中.... -请选择服务器 --------------------- -[1] :招商证券深圳行情 (119.147.212.81:7709) -[2] :华泰证券(南京电信) (221.231.141.60:7709) -[3] :华泰证券(上海电信) (101.227.73.20:7709) -[4] :华泰证券(上海电信二) (101.227.77.254:7709) -[5] :华泰证券(深圳电信) (14.215.128.18:7709) -[6] :华泰证券(武汉电信) (59.173.18.140:7709) -[7] :华泰证券(天津联通) (60.28.23.80:7709) -[8] :华泰证券(沈阳联通) (218.60.29.136:7709) -[9] :华泰证券(南京联通) (122.192.35.44:7709) -[10] :华泰证券(南京联通) (122.192.35.44:7709) --------------------- -请输入序号 [1]: - -``` - - 选择功能 - -``` -连接成功! --------------------- -功能列表: -1 : 获取股票行情 -2 : 获取k线 -3 : 获取市场股票数量 -4 : 获取股票列表 -5 : 获取指数k线 -6 : 查询分时行情 -7 : 查询历史分时行情 -8 : 查询分笔成交 -9 : 查询历史分笔成交 -10 : 查询公司信息目录 -11 : 读取公司信息详情 -12 : 读取除权除息信息 -13 : 读取财务信息 -14 : 退出断开连接 --------------------- -请输入要使用的功能: - -``` - -`1.9版本更新` : 增加了--all参数,可以获取更多服务器列表 - -输入参数并获取结果 - -``` - -参数:市场代码, 股票代码, 如: 0,000001 或 1,600300 -请输入参数 [0,000001]: --------------------- - market code active1 price last_close open high low \ -0 0 000001 2801 9.18 9.25 9.23 9.27 9.16 - - reversed_bytes0 reversed_bytes1 ... ask5 bid_vol5 ask_vol5 \ -0 [178, 174, 231, 12] -918 ... 9.23 4171 6140 - - reversed_bytes4 reversed_bytes5 reversed_bytes6 reversed_bytes7 \ -0 5689 1 17 82 - - reversed_bytes8 reversed_bytes9 active2 -0 21 65526 2801 - -[1 rows x 44 columns] - -``` - -输出结果默认会使用pandas Dataframe格式输出,在内容较多时会省略部分列或行的记录,这个时候可以使用 `--no-df` 参数,让其用原始数据格式输出。 - -如启动时 - -``` -> hqget --no-df - -``` - -然后进行之前的操作,结果为: - -``` -参数:市场代码, 股票代码, 如: 0,000001 或 1,600300 -请输入参数 [0,000001]: --------------------- -[OrderedDict([('market', 0), - ('code', '000001'), - ('active1', 2864), - ('price', 9.19), - ('last_close', 9.25), - ('open', 9.23), - ('high', 9.27), - ('low', 9.16), - ('reversed_bytes0', bytearray(b'\xbd\xc9\xec\x0c')), - ('reversed_bytes1', -919), - ('vol', 428899), - ('cur_vol', 30), - ('amount', 395218880.0), - ('s_vol', 284703), - ('b_vol', 144196), - ('reversed_bytes2', 1), - ('reversed_bytes3', 698), - ('bid1', 9.18), - ('ask1', 9.19), - ('bid_vol1', 1078), - ('ask_vol1', 5236), - ('bid2', 9.17), - ('ask2', 9.2), - ('bid_vol2', 8591), - ('ask_vol2', 3027), - ('bid3', 9.16), - ('ask3', 9.21), - ('bid_vol3', 12638), - ('ask_vol3', 3557), - ('bid4', 9.15), - ('ask4', 9.22), - ('bid_vol4', 13234), - ('ask_vol4', 2615), - ('bid5', 9.14), - ('ask5', 9.23), - ('bid_vol5', 5377), - ('ask_vol5', 6033), - ('reversed_bytes4', 5768), - ('reversed_bytes5', 1), - ('reversed_bytes6', 16), - ('reversed_bytes7', 83), - ('reversed_bytes8', 20), - ('reversed_bytes9', 0), - ('active2', 2864)])] - -``` - -### 单命令模式 - -脚本也可以使用命令模式进行, 这个时候,需要通过输入 `-f/--function` 参数来选择要执行的命令 - -如: - -``` -> hqget -f 1 - -``` - -### 保存文件 - -在但命令模式下,可以通过设定 `-o/--output` 参数来选择将命令结果保存到文件中,这个时候根据 `--df/--no-df` 参数的结果不同,会保存为不同的格式, -如果没有设置或者设置为 `--df`, 则通过pandas Dataframe保存为csv格式,如果选择了 `--no-df` 则把结果保存为Python Pickle序列化的格式。 - -如: - -``` -hqget -o all.csv -s 119.147.212.81:7709 -f 4 - -``` - -察看`all.csv` - -all.csv - -### 默认连接服务器 - -我们可以通过设定选项 `-s/--server`来指定其默认连接的服务器,格式是 [ip]:[port], 如: - -``` -> hqget -f 1 -s 119.147.212.81:7709 - -``` diff --git a/docs/hqreader.md b/docs/hqreader.md deleted file mode 100644 index 70e0e67..0000000 --- a/docs/hqreader.md +++ /dev/null @@ -1,42 +0,0 @@ - -# hqreader命令 - -`hqreader` 是一个命令行程序,目前功能比较简单,可以用来读取通达信导出的日线行情数据 - -使用方法如下: - -``` -Usage: hqreader [OPTIONS] INPUT - - 通达信数据文件读取 - -Options: - -o, --output TEXT - -d, --datatype TEXT 数据文件格式, - - daily 代表日K线 - - ex_daily 代表扩展行情的日线 - - min - 代表5分钟或者1分钟线 - - lc 代表lc1, lc5格式的分钟线 - - gbbq 股本变迁文件 - - - block 读取板块股票列表文件 - - customblock 读取自定义板块列表 - - - history_financial 或者 hf 历史财务信息 如 gpcw20170930.dat 或者 - gpcw20170930.zip - --help Show this message and exit. - -``` - -如: - -``` -(C:\Anaconda3) C:\Users\Administrator>hqreader -o f:\dt.csv -d daily C:\new_tdx\vipdoc\sz\lday\sz000001.day -写入到文件 : f:\dt.csv - -``` - -察看文件 `dt.csv`: - -dt.csv diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index c06380e..0000000 --- a/docs/index.md +++ /dev/null @@ -1,63 +0,0 @@ - -# Pytdx - Python tdx数据接口 - -## 概述 - -Pytdx 是一款纯Python语言开发的类似TradeX的行情数据接口的实现。 - -## 特点 - -- 纯python实现,无须引入动态连接库`.dll/.so`文件 -- 支持`python2.7+`/`3.5+`, 以及全平台`Windows/MacOS/Linux` -- 可以通过设置参数提供`线程安全`接口调用 -- 实现`心跳包`机制,可以在长时间没有交互的情况下保持不断线 -
  • (试验)支持多连接构成的连接池机制,和failover处理机制,保证稳定性。 -
    -pytdx将重点放在底层包的解析,对于更高层的封装,建议参考或者直接使用[`Quantaxis`](https://github.com/yutiansut/QUANTAXIS/blob/master/QUANTAXIS/QAFetch/QATdx.py)的实现.. -
    -
  • - -## 安装 - -``` -pip install pytdx - -``` - -## 接口实现 - -### 标准行情 pytdx.hq - -用于读取标准行情信息 - -### 扩展行情 pytdx.exhq - -用于读取扩展行情(外盘,期权,期货等) - -### 数据文件读取 pytdx.reader - -用于读取导出的k线数据 - -### 历史专业财务数据的爬取和解析 - -感谢 @datochan 根据 [https://github.com/rainx/pytdx/issues/133](https://github.com/rainx/pytdx/issues/133) 方法实现 - -### pytdx.pool (试验性质) - -用于实现备用连接池以及failover支持的行情接口 - -## 命令行 - -我们提供了方便命令行调试和导出数据的命令行工具 `hqget` 以及`hqreader` 具体使用方法请参考这里。 - -## 缘起 - -因为之前TradeX的接口是使用Python扩展的方式调用C++代码实现的,功能上有诸多的限制,如只支持32位的Python, 不支持MacOS, Linux等, 无奈我自己使用的电脑是Mac系统, 服务器又是基于Linux的,所以只能自己重新实现一份。 - -## 声明 - -次代码用于个人对网络协议的研究和习作,不对外提供服务,任何人使用本代码遇到问题请自行解决,也可以在github提issue给我,但是我不保证能即时处理。 由于我们连接的是既有的行情软件兼容行情服务器,机构请不要使用次代码,对此造成的任何问题本人概不负责。 - -## 其它 - -欢迎对量化交易感兴趣的朋友互相交流,可以来我们的智矿社区看看 [http://zhikuang.org](http://zhikuang.org) diff --git a/docs/installation.md b/docs/installation.md deleted file mode 100644 index 3c402a6..0000000 --- a/docs/installation.md +++ /dev/null @@ -1,36 +0,0 @@ - -# 安装pytdx - -## 普通安装命令 - -``` -> pip install pytdx - -``` - -## 升级到最新版本 - -``` -> pip install -U pytdx - -``` - -## 安装github上的最新版本 - -``` -> pip install git+https://github.com/rainx/pytdx - -``` - -或 - -``` -> git clone https://github.com/rainx/pytdx.git -> cd pytdx -> python setup.py install - -``` - -## 说明 - -根据您的python和使用的操作系统版本的不同,上述命令里的 `pip`, `python` 可能需要变为`pip3`, `python3`, 如果需要全局安装,部分Linux,MacOS 系统需要使用 `sudo`命令。 diff --git a/docs/pytdx_crawler.md b/docs/pytdx_crawler.md deleted file mode 100644 index 7752a14..0000000 --- a/docs/pytdx_crawler.md +++ /dev/null @@ -1,96 +0,0 @@ - -# 历史专业财务数据 - -## 参考 - -- issue from @datochan [https://github.com/rainx/pytdx/issues/133](https://github.com/rainx/pytdx/issues/133) -- [通达信专业财务函数文档](http://www.tdx.com.cn/products/helpfile/tdxw/chm/%E7%AC%AC%E4%B8%89%E7%AB%A0%20%20%20%E5%9F%BA%E7%A1%80%E5%8A%9F%E8%83%BD/3-3/3-3-2/3-3-2-15/3-3-2-15.html) - -## pytdx.crawler - -`crawler` 其实本来想叫做`downloader`或者`fetcher`, 专门来处理http 协议(现在也支持tcp的方式获取)的数据的下载和解析,分为两个阶段,下载阶段我们会使用urllib来下载数据,数据可以下载到临时文件(不传入`path_to_download`参数)或者下载到指定的位置(提供`path_to_download`参数),也支持指定chunk的分段下载进度的提示(使用`reporthook`传入处理函数), 下面是一个reporthook函数的例子 - -``` - -def demo_reporthook(downloaded, total_size): - print("Downloaded {}, Total is {}".format(downloaded, total_size)) - -``` - -## 获取历史专业财务数据列表 pytdx.crawler.HistoryFinancialListCrawler - -实现了历史财务数据列表的读取,使用方式 - -``` -from pytdx.crawler.history_financial_crawler import HistoryFinancialListCrawler -crawler = HistoryFinancialListCrawler() - -### 这里默认已经切换成使用通达信proxy server,如果想切回http方式,需要设置 crawler.mode = "http" -list_data = crawler.fetch_and_parse() -print(pd.DataFrame(data=list_data)) - -``` - -结果 - -``` -In [8]: print(pd.DataFrame(data=list_data)) - filename filesize hash -0 gpcw20171231.zip 49250 0370b2703a0e23b4f9d87587f4a844cf -1 gpcw20170930.zip 2535402 780bc7c649cdce35567a44dc3700f4ce -2 gpcw20170630.zip 2739127 5fef91471e01ebf9b5d3628a87d1e73d -3 gpcw20170331.zip 2325626 a9bcebff37dd1d647f3159596bc2f312 -4 gpcw20161231.zip 2749415 3fb3018c235f6c9d7a1448bdbe72281a -5 gpcw20160930.zip 2262567 8b629231ee9fad7e7c86f1e683cfb489 -.. ... ... ... - -75 gpcw19971231.zip 434680 316ce733f2a4f6b21c7865f94eee01c8 -76 gpcw19970630.zip 196525 6eb5d8e5f43f7b19d756f0a2d91371f5 -77 gpcw19961231.zip 363568 bfd59d42f9b6651861e84c483edb499b -78 gpcw19960630.zip 122145 18023e9f84565323874e8e1dbdfb2adb - -[79 rows x 3 columns] - -``` - -其中,`filename` 字段为具体的财务数据文件地址, 后面的分别是哈希值和文件大小,在同步到本地时,可以作为是否需要更新本地数据的参考 - -## 获取历史专业财务数据内容 pytdx.crawler.HistoryFinancialCrawler - -获取历史专业财务数据内容 - -使用上面返回的`filename`字段作为参数即可 - -``` -from pytdx.crawler.base_crawler import demo_reporthook -from pytdx.crawler.history_financial_crawler import HistoryFinancialCrawler - -datacrawler = HistoryFinancialCrawler() -pd.set_option('display.max_columns', None) -### 这里默认已经切换成使用通达信proxy server,如果想切回http方式,需要设置 crawler.mode = "http" - -### 如果使用默认的方式,下面的方法需要传入 filesize=实际文件大小,可以通过前面的接口获取到 -result = datacrawler.fetch_and_parse(reporthook=demo_reporthook, filename='gpcw19971231.zip', path_to_download="/tmp/tmpfile.zip") -print(datacrawler.to_df(data=result)) - -``` - -## 通过reader 读取数据 - -如果您自己管理文件的下载或者本地已经有对应的数据文件,可以使用我们的 `HistoryFinancialReader`来读取本地数据,使用方法和其它的Reader是类似的, 我们的reader同时支持`.zip`和解压后的`.dat`文件 - -``` -from pytdx.reader import HistoryFinancialReader - -# print(HistoryFinancialReader().get_df('/tmp/tmpfile.zip')) -print(HistoryFinancialReader().get_df('/tmp/gpcw20170930.dat')) - -``` - -## 通过命令行工具`hq_reader`读取并保存到csv文件 - -``` --->rainx@JingdeMacBook-Pro:/tmp$ hqreader -d hf -o /tmp/gpcw20170930.csv /tmp/gpcw20170930.dat -写入到文件 : /tmp/gpcw20170930.csv - -``` diff --git a/docs/pytdx_exhq.md b/docs/pytdx_exhq.md deleted file mode 100644 index db82573..0000000 --- a/docs/pytdx_exhq.md +++ /dev/null @@ -1,220 +0,0 @@ - -# 扩展行情接口API - -首先需要引入 - -``` -from pytdx.exhq import TdxExHq_API - -``` - -然后,创建对象 - -``` -api = TdxExHq_API() - -``` - -之后,通常是如下的格式 - -``` -if api.connect('61.152.107.141', 7727): - # ... same codes... - api.disconnect() - -``` - -当然,我们也支持with 语法,可以省略`disconnect()`语句 - -``` -with api.connect('61.152.107.141', 7727): - # some codes - -``` - -## api方法列表 - -### 参数一般性约定 - -一般来说,股票代码和文件名称使用字符串类型,其它参数都使用数值类型 - -### 1: 获取市场代码 - -可以获取该api服务器可以使用的市场列表,类别等信息 - -``` -api.get_markets() - -``` - -返回结果 `api.to_df(api.get_markets())` 一般某个服务器返回的类型比较固定,该结果可以缓存到本地或者内存中。 - -``` -2017-07-31 21:22:06,067 - PYTDX - INFO - 获取市场代码 - market category name short_name -0 1 1 临时股 TP -1 4 12 郑州商品期权 OZ -2 5 12 大连商品期权 OD -3 6 12 上海商品期权 OS -4 8 12 上海个股期权 QQ -5 27 5 香港指数 FH -6 28 3 郑州商品 QZ -7 29 3 大连商品 QD -8 30 3 上海期货 QS -9 31 2 香港主板 KH -10 32 2 香港权证 KR -11 33 8 开放式基金 FU -12 34 9 货币型基金 FB -13 35 8 招商理财产品 LC -14 36 9 招商货币产品 LB -15 37 11 国际指数 FW -16 38 10 国内宏观指标 HG -17 40 11 中国概念股 CH -18 41 11 美股知名公司 MG -19 43 1 B股转H股 HB -20 44 1 股份转让 SB -21 47 3 股指期货 CZ -22 48 2 香港创业板 KG -23 49 2 香港信托基金 KT -24 54 6 国债预发行 GY -25 60 3 主力期货合约 MA -26 62 5 中证指数 ZZ -27 71 2 港股通 GH - -``` - -### 2: 查询代码列表 - -参数, 起始位置, 获取数量 - -``` -api.get_instrument_info(0, 100) - -``` - -Demo: get_list_demo - -### 3: 查询市场中商品数量 - -``` -api.get_instrument_count() - -``` - -### 4: 查询五档行情 - -参数 市场ID,证券代码 - -- 市场ID可以通过 `get_markets` 获得 - -``` -api.get_instrument_quote(47, "IF1709") - -``` - -### 5: 查询分时行情 - -参数 市场ID,证券代码 - -- 市场ID可以通过 `get_markets` 获得 - -``` -api.get_minute_time_data(47, "IF1709") - -``` - -### 6: 查询历史分时行情 - -参数 市场ID,证券代码,日期 - -- 市场ID可以通过 `get_markets` 获得 -- 日期格式 YYYYMMDD 如 20170811 - -``` -api.get_history_minute_time_data(31, "00020", 20170811) - -``` - -### 7: 查询k线数据 - -参数: K线周期, 市场ID, 证券代码,起始位置, 数量 - -- K线周期参考 `TDXParams` -- 市场ID可以通过 `get_markets` 获得 - -``` -api.get_instrument_bars(TDXParams.KLINE_TYPE_DAILY, 8, "10000843", 0, 100) - -``` - -### 8: 查询分笔成交 - -参数:市场ID,证券代码 - -- 市场ID可以通过 `get_markets` 获得 - -``` -api.get_transaction_data(31, "00020") - -``` - -注意,这个接口最多返回`1800`条记录, 如果有超过1800条记录的请求,我们有一个start 参数作为便宜量,可以取出超过1800条记录 - -如期货的数据:这个接口可以取出1800条之前的记录,数量也是1800条 - -``` -api.get_history_transaction_data(47, "IFL0", 20170810, start=1800) - -``` - -### 9: 查询历史分笔成交 - -参数:市场ID,证券代码, 日期 - -- 市场ID可以通过 `get_markets` 获得 -- 日期格式 YYYYMMDD 如 20170810 - -``` -api.get_history_transaction_data(31, "00020", 20170810) - -``` - -## 多线程支持 - -由于Python的特性,一般情况下,不太建议使用多线程代码,如果需要并发访问,建议使用多进程来实现,如果要使用多线程版本,请在初始化时设置multithread参数为True - -``` -api = TdxExHq_API(multithread=True) - -``` - -## 心跳包 - -由于长时间不与服务器交互,服务器将关闭连接,所以我们实现了心跳包的机制,可以通过 - -``` -api = TdxExHq_API(heartbeat=True) - -``` - -设置心跳包,程序会启动一个心跳包发送线程,在空闲状态下隔一段时间发送一个心跳包,注意,打开heartbeat=True选项的同时会自动打开multithread=True - -## 抛出异常 和 重连机制 - -参考 [标准行情 pytdx.hq](pytdx_hq.html) 对应的章节 - -## 获取流量统计信息 - -``` -In [12]: api.get_traffic_stats() -Out[12]: -{'first_pkg_send_time': datetime.datetime(2017, 9, 13, 13, 42, 3, 596519), - 'recv_bytes_per_second': 116.0, - 'recv_pkg_bytes': 2759, - 'recv_pkg_num': 18, - 'send_bytes_per_second': 15.0, - 'send_pkg_bytes': 368, - 'send_pkg_num': 9, - 'total_seconds': 23.716146} - -``` diff --git a/docs/pytdx_hq.md b/docs/pytdx_hq.md deleted file mode 100644 index 59d5aab..0000000 --- a/docs/pytdx_hq.md +++ /dev/null @@ -1,370 +0,0 @@ - -# 行情接口API - -下面是如何在程序里面调用本接口 - -首先需要引入 - -``` -from pytdx.hq import TdxHq_API - -``` - -然后,创建对象 - -``` -api = TdxHq_API() - -``` - -之后,通常是如下的格式 - -``` -if api.connect('119.147.212.81', 7709): - # ... same codes... - api.disconnect() - -``` - -当然,我们也支持with 语法,可以省略`disconnect()`语句 - -``` -with api.connect('119.147.212.81', 7709): - # some codes - -``` - -我们的数据获取届接口一般返回list结构,如果需要转化为pandas Dataframe接口,可以使用 `api.to_df` 进行转化 如: - -``` -data = api.get_security_bars(9, 0, '000001', 0, 10) #返回普通list -data = api.to_df(api.get_security_bars(9, 0, '000001', 0, 10)) # 返回DataFrame - -``` - -可以使用的api方法有下列的几个。 - -## api方法列表 - -### 参数一般性约定 - -一般来说,股票代码和文件名称使用字符串类型,其它参数都使用数值类型 - -### 1 : 获取股票行情 - -可以获取**多**只股票的行情信息 - -需要传入一个列表,每个列表由一个市场代码, 一个股票代码构成的元祖构成 `[ (市场代码1, 股票代码1),(市场代码2, 股票代码2) ... (市场代码n, 股票代码n) ]` - -如: - -``` -api.get_security_quotes([(0, '000001'), (1, '600300')]) - -``` - -> -注意点:非股票品种代码,有些获取的价格不是实际价格,比如可转债获取价格为实际价格*10。这是可能是TDX为了防止浮点数错误,报价在传输和存储时实际都保存为整数,然后根据品种进行处理的结果。@solensolen - - -### 2 : 获取k线 - -
  • category-> -
    K线种类
    -0 5分钟K线 1 15分钟K线 2 30分钟K线 3 1小时K线 4 日K线
    -5 周K线
    -6 月K线
    -7 1分钟
    -8 1分钟K线 9 日K线
    -10 季K线
    -11 年K线
    -
  • -
  • market -> 市场代码 0:深圳,1:上海 -
  • -
  • stockcode -> 证券代码; -
  • -
  • start -> 指定的范围开始位置; -
  • -
  • count -> 用户要请求的 K 线数目,最大值为 800 -
  • - -如: - -``` -api.get_security_bars(9,0, '000001', 4, 3) - -``` - -### 3 : 获取市场股票数量 - -0 - 深圳, 1 - 上海 - -``` -api.get_security_count(0) - -``` - -### 4 : 获取股票列表 - -参数:市场代码, 起始位置 如: 0,0 或 1,100 - -``` -api.get_security_list(1, 0) - -``` - -### 5 : 获取指数k线 - -
  • category-> -
    K线种类
    -0 5分钟K线 1 15分钟K线 2 30分钟K线 3 1小时K线 4 日K线
    -5 周K线
    -6 月K线
    -7 1分钟
    -8 1分钟K线 9 日K线
    -10 季K线
    -11 年K线
    -
  • -
  • market -> 市场代码 0:深圳,1:上海 -
  • -
  • stockcode -> 证券代码; -
  • -
  • start -> 指定的范围开始位置; -
  • -
  • count -> 用户要请求的 K 线数目,最大值为 800 -
  • - -如: - -``` -api.get_index_bars(9,1, &apos;000001&apos;, 1, 2) - -``` - -### 6 : 查询分时行情 - -参数:市场代码, 股票代码, 如: 0,000001 或 1,600300 - -``` -api.get_minute_time_data(1, &apos;600300&apos;) - -``` - -### 7 : 查询历史分时行情 - -参数:市场代码, 股票代码,时间 如: 0,000001,20161209 或 1,600300,20161209 - -``` -api.get_history_minute_time_data(TDXParams.MARKET_SH, &apos;600300&apos;, 20161209) - -``` - -注意,在引入 TDXParams 之后, (`from pytdx.params import TDXParams`) 我们可以使用 TDXParams.MARKET_SH , TDXParams.MARKET_SZ 常量来代替 1 和 0 作为参数 - -### 8 : 查询分笔成交 - -参数:市场代码, 股票代码,起始位置, 数量 如: 0,000001,0,10 - -``` -api.get_transaction_data(TDXParams.MARKET_SZ, &apos;000001&apos;, 0, 30) - -``` - -### 9 : 查询历史分笔成交 - -参数:市场代码, 股票代码,起始位置,日期 数量 如: 0,000001,0,10,20170209 - -``` -api.get_history_transaction_data(TDXParams.MARKET_SZ, &apos;000001&apos;, 0, 10, 20170209) - -``` - -### 10 : 查询公司信息目录 - -参数:市场代码, 股票代码, 如: 0,000001 或 1,600300 - -``` -api.get_company_info_category(TDXParams.MARKET_SZ, &apos;000001&apos;) - -``` - -### 11 : 读取公司信息详情 - -参数:市场代码, 股票代码, 文件名, 起始位置, 数量, 如:0,000001,000001.txt,2054363,9221 - -``` -api.get_company_info_content(0, &apos;000001&apos;, &apos;000001.txt&apos;, 0, 100) - -``` - -注意这里的 起始位置, 数量 参考上面接口的返回结果。 - -### 12 : 读取除权除息信息 - -参数:市场代码, 股票代码, 如: 0,000001 或 1,600300 - -``` -api.get_xdxr_info(1, &apos;600300&apos;) - -``` - -### 13 : 读取财务信息 - -参数:市场代码, 股票代码, 如: 0,000001 或 1,600300 - -``` -api.get_finance_info(0, &apos;000001&apos;) - -``` - -### 14 : 读取k线信息 - -参数:市场代码, 开始时间, 结束时间 - -``` -get_k_data(&apos;000001&apos;,&apos;2017-07-03&apos;,&apos;2017-07-10&apos;) - -``` - -参考 [https://github.com/rainx/pytdx/issues/5](https://github.com/rainx/pytdx/issues/5) - -### 15 :读取板块信息 - -参数: 板块文件名称,可以取的值限于 - -``` -# 板块相关参数 -BLOCK_SZ = "block_zs.dat" -BLOCK_FG = "block_fg.dat" -BLOCK_GN = "block_gn.dat" -BLOCK_DEFAULT = "block.dat" - -``` - -``` -api.get_and_parse_block_info("block.dat") -# 或者用我们定义好的params -api.get_and_parse_block_info(TDXParams.BLOCK_SZ) - -``` - -## 多线程支持 - -由于Python的特性,一般情况下,不太建议使用多线程代码,如果需要并发访问,建议使用多进程来实现,如果要使用多线程版本,请在初始化时设置multithread参数为True - -``` -api = TdxHq_API(multithread=True) - -``` - -## 心跳包 - -由于长时间不与服务器交互,服务器将关闭连接,所以我们实现了心跳包的机制,可以通过 - -``` -api = TdxHq_API(heartbeat=True) - -``` - -设置心跳包,程序会启动一个心跳包发送线程,在空闲状态下隔一段时间发送一个心跳包,注意,打开heartbeat=True选项的同时会自动打开multithread=True - -## 抛出异常 - -我们的错误处理有两套机制,根据TdxHq_API 构造函数里的 `raise_exception` 参数来确定,如果 - -``` -# 默认情况 -api = TdxHq_API(raise_exception=False) - -``` - -如果在调用connect 的时候,失败会返回`false`, 调用普通接口时候,如果出错的情况返回`None` - -如果 - -``` -api = TdxHq_API(raise_exception=True) - -``` - -如果在调用connect 的时候,失败会抛出`TdxConnectionError`异常, 调用普通接口时候,如果出错的情况抛出`TdxFunctionCallError`异常 - -## 重连机制 - -在调用函数的时候,如果服务器连接断开或者其它的异常情况下,为了保证在偶发的连接断开下自动重连并重新请求数据。关于重试的周期和次数,我们通过一个自定义的类实现,你可以实现自己的重试策略 - -如果开启的话,需要 - -``` -api = TdxHq_API(auto_retry=True) - -``` - -下面是我们默认的重试策略 - -``` -class DefaultRetryStrategy(RetryStrategy): - """ - 默认的重试策略,您可以通过写自己的重试策略替代本策略, 改策略主要实现gen方法,该方法是一个生成器, - 返回下次重试的间隔时间, 单位为秒,我们会使用 time.sleep在这里同步等待之后进行重新connect,然后再重新发起 - 源请求,直到gen结束。 - """ - @classmethod - def gen(cls): - # 默认重试4次 ... 时间间隔如下 - for time_interval in [0.1, 0.5, 1, 2]: - yield time_interval - -``` - -你可以实现自己的重试机制并替换默认的,如永远重复, 间隔1秒一次(慎用) - -``` -class MyRetryStrategy(RetryStrategy): - @classmethod - def gen(cls): - while True: - yield 1 - -# 然后覆盖默认的 -api.retry_strategy = MyRetryStrategy() - -``` - -## 调试模式 - -如果您需要调试本代码,监控传输过程中的数据包传输情况,可以使用调试模式,使用方法是设定环境变量 TDX_DEBUG 为 1 如 - -``` -> TDX_DEBUG=1 hqget -f 1 - -``` - -## 行情服务器列表 - -为了方便连接服务器,我把一些常用的服务器列表整理到到 `hosts.py` 文件中. 在程序中可以通过 - -``` -from pytdx.config.hosts import hq_hosts - -``` - -获取列表, 列表里的数据参考了 [https://github.com/rainx/pytdx/issues/3](https://github.com/rainx/pytdx/issues/3) - -## 获取流量统计信息 - -``` -In [12]: api.get_traffic_stats() -Out[12]: -{&apos;first_pkg_send_time&apos;: datetime.datetime(2017, 9, 13, 13, 42, 3, 596519), - &apos;recv_bytes_per_second&apos;: 116.0, - &apos;recv_pkg_bytes&apos;: 2759, - &apos;recv_pkg_num&apos;: 18, - &apos;send_bytes_per_second&apos;: 15.0, - &apos;send_pkg_bytes&apos;: 368, - &apos;send_pkg_num&apos;: 9, - &apos;total_seconds&apos;: 23.716146} - -``` - -欢迎补充并发送pr diff --git a/docs/pytdx_pool.md b/docs/pytdx_pool.md deleted file mode 100644 index 5b4c7e5..0000000 --- a/docs/pytdx_pool.md +++ /dev/null @@ -1,55 +0,0 @@ - -# 行情连接池 API (实验阶段) - -连接池API只针对特定的场景下使用,它还在非常早期的开发阶段 - -# 描述 - -它即可以在普通行情api上使用,也可以在扩展行情api中使用,它的基础的逻辑为: 我们需要提供一组ip,他们被划分为3类角色 - -- 一个正在进行通讯的主连接 我们命名它为M -- 一个热备选连接,它通过心跳包和备选服务器连接, 它为 H -- 一组备选连接池,它们周期性的重拍顺序(可能是根据连接服务器的速度),始终准备替换上面两个连接。 我们命名它们为P - -当主连接P的接口调用出现问题时,我们将: - -- 热备选连接H 转化为主连接M,重发主连接的请求 -- 从连接池P中选出最快的一个连接,重新成为热备选连接H, 并通过心跳包维持服务器的链接 -- 连接M回到备选连接池P中。 - -如此,保证我们的API请求的可靠性 - -# 例子: - -``` -from pytdx.hq import TdxHq_API -from pytdx.pool.hqpool import TdxHqPool_API -from pytdx.pool.ippool import AvailableIPPool -from pytdx.config.hosts import hq_hosts -import random -import logging -import pprint - -ips = [(v[1], v[2]) for v in hq_hosts] -# 获取5个随机ip作为ip池 -random.shuffle(ips) -ips5 = ips[:5] - -## IP 池对象 -ippool = AvailableIPPool(TdxHq_API, ips5) - -## 选出M, H -primary_ip, hot_backup_ip = ippool.sync_get_top_n(2) - -print("make pool api") -## 生成hqpool对象,第一个参数为TdxHq_API后者 TdxExHq_API里的一个,第二个参数为ip池对象。 -api = TdxHqPool_API(TdxHq_API, ippool) - -## connect 函数的参数为M, H 两组 (ip, port) 元组 -with api.connect(primary_ip, hot_backup_ip): - ## 这里的借口和对应TdxHq_API 或者 TdxExHq_API里的一样,我们通过反射调用正确的接口 - ret = api.get_xdxr_info(0, &apos;000001&apos;) - print("send api call done") - pprint.pprint(ret) - -``` diff --git a/docs/pytdx_reader.md b/docs/pytdx_reader.md deleted file mode 100644 index 2da6374..0000000 --- a/docs/pytdx_reader.md +++ /dev/null @@ -1,181 +0,0 @@ - -# Reader接口 - -## 读取通达信的日K线 - -通过下面的接口,我们可以解析通达信的日K线文件,该文件可以通过读取通达信的软件本地目录导出的数据获取,也可以从通达信的官网上下载, 如果您安装了通达信的终端,可以在安装目录下找到 `vipdoc` 子目录。 - -比如我的通达信客户端安装在 `c:\new_tdx` 下, - -即 - -- `c:\new_tdx\vipdoc\sz\lday\` 下是深圳的日k线数据 -- `c:\new_tdx\vipdoc\sh\lday\` 下是上海的日k线数据 - -该目录下每个股票为一个文件,如 `sz000001.day` 为深圳的日k行情, - -读取行情的接口非常简单 - -``` -from pytdx.reader import TdxDailyBarReader, TdxFileNotFoundException -reader = TdxDailyBarReader() -df = reader.get_df("/Users/rainx/tmp/vipdoc/sz/lday/sz000001.day") - -df 是pandas 的DateFrame格式, 输出为: - - open high low close amount volume -date -1991-12-23 27.70 27.90 27.60 27.80 3.530600e+06 127000 -1991-12-24 27.90 29.30 27.00 29.05 3.050250e+06 105000 -1991-12-25 29.15 30.00 29.10 29.30 6.648170e+06 226900 -1991-12-26 29.30 29.30 28.00 28.00 5.370400e+06 191800 -1991-12-27 28.00 28.50 28.00 28.45 5.988725e+06 210500 -... ... ... ... ... ... ... -2017-06-22 9.15 9.40 9.14 9.25 1.325211e+09 142695815 -2017-06-23 9.23 9.27 9.16 9.25 5.383036e+08 58400441 -2017-06-26 9.26 9.40 9.26 9.30 6.637629e+08 71076995 - -[6031 rows x 6 columns] - -# 可以通过pandas将它保存为csv 等文件, 如: - -df.to_csv("/tmp/000001.csv") - -``` - -## 读取扩展行情的日线(如期货,期权,现货等) - -``` -In [1]: from pytdx.reader import TdxExHqDailyBarReader - -In [2]: reader = TdxExHqDailyBarReader() - -In [3]: df = reader.get_df("/Users/rainx/Downloads/lday/29#A1801.day") - -In [4]: df -Out[4]: - open high low close amount volume jiesuan -date -2017-08-07 3830.0 3936.0 3826.0 3925.0 167038 224516 3881.0 -2017-08-08 3926.0 3990.0 3921.0 3951.0 188460 256984 3958.0 -2017-08-09 3951.0 3997.0 3951.0 3982.0 194150 157330 3976.0 -2017-08-10 3978.0 4015.0 3970.0 3995.0 206944 174878 3993.0 -2017-08-11 3997.0 4017.0 3927.0 3954.0 202010 258036 3971.0 - -``` - -## 读取通达信的分钟K线(目前支持1,5分钟k线) - -分钟线有两种格式,第一种是`.1` `.5` 为后缀的 - -``` -from pytdx.reader import TdxMinBarReader, TdxFileNotFoundException -reader = TdxMinBarReader() -df = reader.get_df("/Users/rainx/Downloads/sh000001.5") - -In [2]: df -Out[2]: - open high low close amount \ -date -2015-07-09 09:35:00 3432.45 3454.14 3374.32 3423.61 6.189348e+10 -2015-07-09 09:40:00 3420.56 3424.16 3395.07 3396.33 2.341652e+10 - - volume -date -2015-07-09 09:35:00 618934736 -2015-07-09 09:40:00 234165181 - -``` - -还有一种为 `.lc1` `.lc5` 后缀的 - -``` -from pytdx.reader import TdxLCMinBarReader, TdxFileNotFoundException - -reader = TdxLCMinBarReader() -df = reader.get_df("/Users/rainx/Downloads/sz000001.lc5") -print(df) - -open high low close amount \ -date -2017-07-26 09:35:00 10.920000 10.990000 10.860000 10.940000 118572536.0 -2017-07-26 09:40:00 10.929999 10.990000 10.910000 10.969999 43107384.0 -2017-07-26 09:45:00 10.969999 11.050000 10.969999 11.050000 40586544.0 -2017-07-26 09:50:00 11.050000 11.130000 11.010000 11.120000 100486624.0 -2017-07-26 09:55:00 11.110000 11.179999 11.099999 11.179999 78094816.0 -.... -.... -... - -``` - -## 读取板块信息文件 - -文件位置参考: [http://blog.sina.com.cn/s/blog_623d2d280102vt8y.html](http://blog.sina.com.cn/s/blog_623d2d280102vt8y.html) - -样例代码: - -``` -# 默认扁平格式 -df = BlockReader().get_df("/Users/rainx/tmp/block_zs.dat") -print(df) - -blockname block_type code_index code -0 沪深300 2 0 000001 -1 沪深300 2 1 000002 -2 沪深300 2 2 000008 -3 沪深300 2 3 000009 - - -# 分组格式 -df2 = BlockReader().get_df("/Users/rainx/tmp/block_zs.dat", BlockReader_TYPE_GROUP) -print(df2) - -blockname block_type stock_count \ -0 重点沪指 2 0 -1 沪深300 2 300 -2 深证成指 2 40 -3 中小板指 2 100 - -code_list -0 -1 000001,000002,000008,000009,000060,000063,0000... -2 000001,000002,000063,000069,000100,000157,0001... -3 002001,002004,002007,002008,002010,002013,0020... - -``` - -## 读取通达信的自定义板块信息文件夹 - -在通达信客户端备份自定义板块数据,设置-->数据维护工具-->数据备份,备份后会生出类似TdxBak_20171011/blocknew的文件夹,然后使用如下代码读取: - -``` -# 默认扁平格式 -df = CustomerBlockReader().get_df(&apos;C:/Users/fit/Desktop/TdxBak_20171011/blocknew&apos;) -print(df) - - blockname block_type code_index code -0 领袖 LX 1 1600516 -1 领袖 LX 2 0300678 -2 领袖 LX 3 0300675 -3 领袖 LX 4 1600230 -4 领袖 LX 5 0002497 -5 领袖 LX 6 0002460 -6 领袖 LX 7 0000807 -7 领袖 LX 8 1600874 - -#分组格式 -df = CustomerBlockReader().get_df(&apos;C:/Users/fit/Desktop/TdxBak_20171011/blocknew&apos;, BlockReader_TYPE_GROUP) -print(df) - - blockname block_type stock_count \ -0 领袖 LX 20 -1 核心 HX 20 -2 潜力 QL 11 - - code_list -0 1600516,0300678,0300675,1600230,0002497,000246... -1 1603501,0300597,0002467,0300081,0002194,000086... -2 1600686,0300648,1600476,0300036,1603066,030062... - -``` diff --git a/docs/pytdx_trade.md b/docs/pytdx_trade.md deleted file mode 100644 index 6facb43..0000000 --- a/docs/pytdx_trade.md +++ /dev/null @@ -1,129 +0,0 @@ - -# 交易相关 - -## 说明 - -Pytdx无法直接提供交易功能,目前采用调用网上常见的`trade.dll`的方式实现,trade.dll并不是我开发的,`Please using it at your own risk` - -## TdxTradeServer ([https://github.com/rainx/TdxTradeServer](https://github.com/rainx/TdxTradeServer)) - -为了启动`trade.dll`,我们提供了TdxTradeServer, 将请求封装为 http rest api, 在使用本接口之前,需要用下面的命令 - -``` -> get_tts - -``` - -配置好trade服务(如果要配置多账号版本,建议配置多账号版本的TdxTradeServer) - -## 引入交易接口 - -``` -from pytdx.trade import TdxTradeApi - -``` - -## 接口列表 - -### 初始化客户端 - -``` -api = TdxTradeApi(endpoint="http://10.11.5.175:10092/api", enc_key=b"4f1cf3fec4c84c84", enc_iv=b"0c78abc083b011e7") - -``` - -### api返回数据基本格式 - -成功 - -``` -{ - "success": true, - "data": { - ... - } -} - -``` - -失败 - -``` -{ - "success": false, - "error": "...." -} - -``` - -### ping 可用来检测连通性 - -``` -api.ping() - -``` - -### 登入 - -``` -result = api.logon(ip, port, version, yyb_id, account_id, trade_account, jy_passwrod, tx_password) -if result["success"]: - client_id = result["data"]["client_id"] - -``` - -### 登出 - -``` -api.logoff(client_id): - -``` - -### 查询信息 - -``` -api.query_data(client_id, category) - -``` - -### 查询历史信息 - -``` -api.query_history_data(client_id, category, begin_date, end_date) - -``` - -### 创建订单 - -``` -api.send_order(client_id, category, price_type, gddm, zqdm, price, quantity) - -``` - -### 撤销订单 - -``` -api.cancel_order(client_id, exchange_id, hth) - -``` - -### 获取行情 - -``` -api.get_quote(client_id, code) - -``` - -### 融资融券账户直接还款 - -``` -api.repay(client_id, amount) - -``` - -### 获取所有正在登录的client账号列表 - -``` -api.get_active_clients() - -``` diff --git a/mkdocs.yml b/mkdocs.yml deleted file mode 100644 index fe042c5..0000000 --- a/mkdocs.yml +++ /dev/null @@ -1,26 +0,0 @@ -site_name: Pytdx -site_description: Python tdx数据接口 - -theme: readthedocs - -pages: - - 文档概述: 'index.md' - - 快速安装: 'installation.md' - - - '行情接口': - - '标准行情': 'pytdx_hq.md' - - '扩展行情': 'pytdx_exhq.md' - - '数据读取': 'pytdx_reader.md' - - '财务数据': 'pytdx_crawler.md' - - '交易相关': 'pytdx_trade.md' - - '连 接 池': 'pytdx_pool.md' - - '命令行工具': - - '行情工具': 'hqget.md' - - '数据工具': 'hqreader.md' - - - 常见问题和解决方案整理FAQ: - - '同花顺的一个爬虫 可以获取前后复权因子': 'fuquan_factor.md' - - '数据的批量完整下载方式代码': 'batch_download_data.md' - - '基金价格问题': 'hq_price.md' - - diff --git a/pytdx/__init__.py b/pytdx/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/pytdx/base_socket_client.py b/pytdx/base_socket_client.py deleted file mode 100644 index 8e7c374..0000000 --- a/pytdx/base_socket_client.py +++ /dev/null @@ -1,273 +0,0 @@ -# coding=utf-8 - -# -# Just for practising -# - - -import os -import socket -import sys -import pandas as pd - -if __name__ == '__main__': - sys.path.insert(0, os.path.dirname( - os.path.dirname(os.path.realpath(__file__)))) - -from pytdx.log import DEBUG, log -from pytdx.errors import TdxConnectionError, TdxFunctionCallError - -import threading -import datetime -import time -from pytdx.heartbeat import HqHeartBeatThread -import functools -from pytdx.parser.raw_parser import RawParser - - -CONNECT_TIMEOUT = 5.000 -RECV_HEADER_LEN = 0x10 -DEFAULT_HEARTBEAT_INTERVAL = 10.0 - - -""" -In [7]: 0x7e -Out[7]: 126 - -In [5]: len(body) -Out[5]: 8066 - -In [6]: len(body)/126 -Out[6]: 64.01587301587301 - -In [7]: len(body)%126 -Out[7]: 2 - -In [8]: (len(body)-2)/126 -Out[8]: 64.0 -""" - - -def update_last_ack_time(func): - @functools.wraps(func) - def wrapper(self, *args, **kw): - self.last_ack_time = time.time() - log.debug("last ack time update to " + str(self.last_ack_time)) - current_exception = None - try: - ret = func(self, *args, **kw) - except Exception as e: - current_exception = e - log.debug("hit exception on req exception is " + str(e)) - if self.auto_retry: - for time_interval in self.retry_strategy.gen(): - try: - time.sleep(time_interval) - self.disconnect() - self.connect(self.ip, self.port) - ret = func(self, *args, **kw) - if ret: - return ret - except Exception as retry_e: - current_exception = retry_e - log.debug( - "hit exception on *retry* req exception is " + str(retry_e)) - - log.debug("perform auto retry on req ") - - self.last_transaction_failed = True - ret = None - if self.raise_exception: - to_raise = TdxFunctionCallError("calling function error") - to_raise.original_exception = current_exception if current_exception else None - raise to_raise - """ - 如果raise_exception=True 抛出异常 - 如果raise_exception=False 返回None - """ - return ret - return wrapper - - -class RetryStrategy(object): - @classmethod - def gen(cls): - raise NotImplementedError("need to override") - - -class DefaultRetryStrategy(RetryStrategy): - """ - 默认的重试策略,您可以通过写自己的重试策略替代本策略, 改策略主要实现gen方法,该方法是一个生成器, - 返回下次重试的间隔时间, 单位为秒,我们会使用 time.sleep在这里同步等待之后进行重新connect,然后再重新发起 - 源请求,直到gen结束。 - """ - @classmethod - def gen(cls): - # 默认重试4次 ... 时间间隔如下 - for time_interval in [0.1, 0.5, 1, 2]: - yield time_interval - - -class TrafficStatSocket(socket.socket): - """ - 实现支持流量统计的socket类 - """ - - def __init__(self, sock, mode): - super(TrafficStatSocket, self).__init__(sock, mode) - # 流量统计相关 - self.send_pkg_num = 0 # 发送次数 - self.recv_pkg_num = 0 # 接收次数 - self.send_pkg_bytes = 0 # 发送字节 - self.recv_pkg_bytes = 0 # 接收字节数 - self.first_pkg_send_time = None # 第一个数据包发送时间 - - self.last_api_send_bytes = 0 # 最近的一次api调用的发送字节数 - self.last_api_recv_bytes = 0 # 最近一次api调用的接收字节数 - - -class BaseSocketClient(object): - - def __init__(self, multithread=False, heartbeat=False, auto_retry=False, raise_exception=False): - self.need_setup = True - if multithread or heartbeat: - self.lock = threading.Lock() - else: - self.lock = None - - self.client = None - self.heartbeat = heartbeat - self.heartbeat_thread = None - self.stop_event = None - self.heartbeat_interval = DEFAULT_HEARTBEAT_INTERVAL # 默认10秒一个心跳包 - self.last_ack_time = time.time() - self.last_transaction_failed = False - self.ip = None - self.port = None - - # 是否重试 - self.auto_retry = auto_retry - # 可以覆盖这个属性,使用新的重试策略 - self.retry_strategy = DefaultRetryStrategy() - # 是否在函数调用出错的时候抛出异常 - self.raise_exception = raise_exception - - def connect(self, ip='101.227.73.20', port=7709, time_out=CONNECT_TIMEOUT, bindport=None, bindip='0.0.0.0'): - """ - - :param ip: 服务器ip 地址 - :param port: 服务器端口 - :param time_out: 连接超时时间 - :param bindport: 绑定的本地端口 - :param bindip: 绑定的本地ip - :return: 是否连接成功 True/False - """ - - self.client = TrafficStatSocket(socket.AF_INET, socket.SOCK_STREAM) - self.client.settimeout(time_out) - log.debug("connecting to server : %s on port :%d" % (ip, port)) - try: - self.ip = ip - self.port = port - if bindport is not None: - self.client.bind((bindip, bindport)) - self.client.connect((ip, port)) - except socket.timeout as e: - # print(str(e)) - log.debug("connection expired") - if self.raise_exception: - raise TdxConnectionError("connection timeout error") - return False - except Exception as e: - if self.raise_exception: - raise TdxConnectionError("other errors") - return False - - log.debug("connected!") - - if self.need_setup: - self.setup() - - if self.heartbeat: - self.stop_event = threading.Event() - self.heartbeat_thread = HqHeartBeatThread( - self, self.stop_event, self.heartbeat_interval) - self.heartbeat_thread.start() - return self - - def disconnect(self): - - if self.heartbeat_thread and \ - self.heartbeat_thread.is_alive(): - self.stop_event.set() - - if self.client: - log.debug("disconnecting") - try: - self.client.shutdown(socket.SHUT_RDWR) - self.client.close() - self.client = None - except Exception as e: - log.debug(str(e)) - if self.raise_exception: - raise TdxConnectionError("disconnect err") - log.debug("disconnected") - - def close(self): - """ - disconnect的别名,为了支持 with closing(obj): 语法 - :return: - """ - self.disconnect() - - def get_traffic_stats(self): - """ - 获取流量统计的信息 - :return: - """ - if self.client.first_pkg_send_time is not None: - total_seconds = (datetime.datetime.now() - - self.client.first_pkg_send_time).total_seconds() - if total_seconds != 0: - send_bytes_per_second = self.client.send_pkg_bytes // total_seconds - recv_bytes_per_second = self.client.recv_pkg_bytes // total_seconds - else: - send_bytes_per_second = None - recv_bytes_per_second = None - else: - total_seconds = None - send_bytes_per_second = None - recv_bytes_per_second = None - - return { - "send_pkg_num": self.client.send_pkg_num, - "recv_pkg_num": self.client.recv_pkg_num, - "send_pkg_bytes": self.client.send_pkg_bytes, - "recv_pkg_bytes": self.client.recv_pkg_bytes, - "first_pkg_send_time": self.client.first_pkg_send_time, - "total_seconds": total_seconds, - "send_bytes_per_second": send_bytes_per_second, - "recv_bytes_per_second": recv_bytes_per_second, - "last_api_send_bytes": self.client.last_api_send_bytes, - "last_api_recv_bytes": self.client.last_api_recv_bytes, - } - - # for debuging and testing protocol - def send_raw_pkg(self, pkg): - cmd = RawParser(self.client, lock=self.lock) - cmd.setParams(pkg) - return cmd.call_api() - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_val, exc_tb): - self.close() - - def to_df(self, v): - if isinstance(v, list): - return pd.DataFrame(data=v) - elif isinstance(v, dict): - return pd.DataFrame(data=[v, ]) - else: - return pd.DataFrame(data=[{'value': v}]) diff --git a/pytdx/bin/__init__.py b/pytdx/bin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/pytdx/bin/get_tdx_trader_server.py b/pytdx/bin/get_tdx_trader_server.py deleted file mode 100644 index 24e4bfc..0000000 --- a/pytdx/bin/get_tdx_trader_server.py +++ /dev/null @@ -1,257 +0,0 @@ -#coding: utf-8 - -from __future__ import unicode_literals - -import os -import tempfile -import click -import struct -import six -import zipfile -import uuid -import shutil - -if six.PY2: - from urllib import urlretrieve -else: - from urllib.request import urlretrieve - - - -TRADE_DLL_KEY = "http://rainx1982.coding.me/tts/Trade.dll" -TDX_TRADE_SEVER_KEY = "http://rainx1982.coding.me/tts/TdxTradeServer-Release-1.8_20180326103850.zip" - - - -def main(): - - # 1 give me a tmp dir - - base_dir = tempfile.gettempdir() - dll_path = os.path.join(base_dir, "dll") - download_path = os.path.join(base_dir, "download") - try: - if not os.path.isdir(dll_path): - os.makedirs(dll_path) - finally: - pass - - try: - if not os.path.isdir(download_path): - os.makedirs(download_path) - finally: - pass - - # 2 确认是否要安装 - - to_say = """ -你好,您执行本命令将会启动TdxTradeServer程序的安装流程,安装程序会安装TdxTradeServer以及配置好其依赖的trade.dll, - -注意: trade.dll来源于网络,TdxTradeServer仅对trade.dll做简单的封装,使其可以用于rest api ,并提供pytdx调用。 -本程序没有对通达信的传输协议做任何研究,所有trade.dll和其绑定方式来源于网络。 - -[rest ] TdxTradeServer : https://github.com/rainx/TdxTradeServer -[client api ] pytdx : https://github.com/rainx/pytdx - -是否继续,将下载对应的trade.dll并配置。 - -Created by rainx with love! - - """ - click.secho(to_say, fg='green') - - yes_to_continue() - - se("开始下载trade.dll...") - trade_dll_template = os.path.join(dll_path, "trade.dll") - urlretrieve(TRADE_DLL_KEY, trade_dll_template) - se("下载完成....") - - se("为了可以使用trade.dll,需要绑定账号") - acc = click.prompt("请输入您的账号") - se("您输入的账号是 {}".format(acc), fg="green") - sig = make_sig(acc) - se("正在生成可用的trade.dll绑定:sig is [{}]".format(sig)) - with open(trade_dll_template, 'rb') as f: - content = f.read() - - real_trade_dll_name = "trade_pytdx_{}.dll".format(acc) - real_trade_dll_path = os.path.join(dll_path, real_trade_dll_name) - lenof_sig = len(sig) - - with open(real_trade_dll_path, "wb") as f: - start_offset = 1132713 - f.write(content[:start_offset]) - f.write(sig) - f.write(content[start_offset + lenof_sig:]) - se("写入完成,文件名称为 : {}".format(real_trade_dll_path)) - - se("开始下载TdxTradeServer....") - download_and_setup_tdx_trade_server(download_path, dll_path, real_trade_dll_name) - - -def download_and_setup_tdx_trade_server(download_path, dll_path, real_trade_dll_name): - zip_file_path = os.path.join(download_path, "tts.zip") - urlretrieve(TDX_TRADE_SEVER_KEY, zip_file_path) - print(download_path) - - if os.path.isfile(zip_file_path): - se("下载完成") - else: - raise SystemExit("下载失败") - - se("开始解压") - zf = zipfile.ZipFile(file=zip_file_path) - zf.extractall(dll_path) - zf.close() - se("解压完成") - - config_file_content, bind_ip, bind_port, enc_key, enc_iv = gen_config_file(real_trade_dll_name) - - config_file_name = "TdxTradeServer.ini" - with open(os.path.join(dll_path, config_file_name), "w") as f: - f.write(config_file_content) - se("配置文件写入完成,文件名 TdxTradeServer.ini") - while True: - _dir = click.prompt("请选择程序放置的路径", "C:\\TdxTradeServer") - if os.path.exists(_dir): - click.secho("该目录已存在,请选择一个新的路径") - else: - break - - os.makedirs(_dir) - os.rmdir(_dir) - shutil.copytree(dll_path, _dir) - se("复制完成! 请在路径 {} 下运行 TdxTradeServer.exe 启动服务".format(_dir), fg="green") - - se("客户端您可以使用pytdx的trade模块进行连接,下面是一小段示例代码演示如何初始化对象") - - demo_code = """ -import os -from pytdx.trade import TdxTradeApi -api = TdxTradeApi(endpoint="http://{}:{}/api", enc_key=b"{}", enc_iv=b"{}") -print("---Ping---") -result = api.ping() -print(result) - -print("---登入---") -acc = os.getenv("TDX_ACCOUNT", "") ###### 你的账号 -password = os.getenv("TDX_PASS", "") ###### 你的密码 -result = api.logon("", 7708, - "8.23", 32, - acc, acc, password, "") - -print(result) - -if result["success"]: - client_id = result["data"]["client_id"] - - for i in (0,1,2,3,4,5,6,7,8,12,13,14,15): - print("---查询信息 cate=%d--" % i) - print(api.data_to_df(api.query_data(client_id, i))) - - - print("---查询报价---") - print(api.data_to_df(api.get_quote(client_id, '600315'))) - - print("---登出---") - print(api.logoff(client_id)) - """.format(bind_ip, bind_port, enc_key, enc_iv) - - demo_sample = """ -from pytdx.trade import TdxTradeApi -api = TdxTradeApi(endpoint="http://{}:{}/api", enc_key=b"{}", enc_iv=b"{}") - """.format(bind_ip, bind_port, enc_key, enc_iv) - - print("-"*30) - print(demo_sample) - print("-"*30) - - demo_path = os.path.join(_dir, "demo.py") - with open(demo_path, "w") as f: - f.write(demo_code) - se("pytdx demo 演示代码在 {}".format(demo_path),fg="blue") - se("注意 v1.5版本之后已经支持多账号版本,关于如何配置使用多账号版本,请参考 https://github.com/rainx/TdxTradeServer", fg="red") - se("Happy Trading!", fg="green") - - -def gen_config_file(real_trade_dll_name): - se("开始生成配置文件..") - random_uuid = uuid.uuid1().hex - enc_key = random_uuid[:16] - enc_iv = random_uuid[16:] - se("生成的enc_key = [{}] , enc_iv = [{}]".format(enc_key, enc_iv)) - bind_ip = click.prompt('请输入绑定的ip地址', default="127.0.0.1") - bind_port = click.prompt('请输入绑定的端口号', default="19820") - config_file_content = """bind={} -port={} -trade_dll_path={} -transport_enc_key={} -transport_enc_iv={} -""".format(bind_ip, bind_port, real_trade_dll_name, enc_key, enc_iv) - - return config_file_content, bind_ip, bind_port, enc_key, enc_iv - - - -def yes_to_continue(): - while True: - c = click.prompt('是否继续,继续请输入y, 退出输入n? ', default="y") - if c.lower() == 'n': - click.secho("您选择了退出") - raise SystemExit("need to exit") - elif c.lower() == "y" or c == "": - return - -def make_sig(acc): - - if type(acc) is six.text_type: - acc = acc.encode("utf-8") - - a3 = 0x55e - # 奇数位 - gpdm = acc[::2] - # print("奇数位 :{}".format(gpdm)) - - result = b"" - for c in gpdm: - - if six.PY2: - (c,) = struct.unpack("b", c) - - _next = True - a = c - b = a3 >> 0x8 - c = a ^ b - a3 = (0x207f * (a3 + c) - 0x523d) & 0xffff - j = 64 - while _next: - j += 1 - if j > 90: - break - k = 91 - while _next: - k -= 1 - if k < 65: - break - - temp = 1755 + c - k - if temp % 26 == 0 and temp // 26 == j: - - result += struct.pack("bb", j, k) - _next = False - return result - - -def se(*args, **kwargs): - _args = list(args) - _args[0] = "[ pytdx ] " + _args[0] - click.secho(*_args, **kwargs) - -if __name__ == '__main__': - try: - main() - # gen_config_file() - except SystemExit: - exit() - diff --git a/pytdx/bin/hqbenchmark.py b/pytdx/bin/hqbenchmark.py deleted file mode 100644 index b5767aa..0000000 --- a/pytdx/bin/hqbenchmark.py +++ /dev/null @@ -1,156 +0,0 @@ -#coding: utf-8 -import click - -from concurrent.futures import ThreadPoolExecutor -from pytdx.hq import TdxHq_API -import datetime -import time -from pytdx.util.best_ip import select_best_ip - -GET_QUOTES_PER_GROUPS=80 - -@click.command() -@click.argument("ips", nargs=-1) -def main(ips): - - if len(ips) == 0: - best_ip = select_best_ip() - ips = [best_ip] - print("Using default ip: {}".format(best_ip)) - - def single_client_benchmark(ip): - - def _log(msg): - click.echo("HQ_BENCHMARK: [{:15s}] {} ".format(ip, datetime.datetime.now()) + msg) - - def _grouped_list(stocks): - return [stocks[i:i + GET_QUOTES_PER_GROUPS] for i in range(0, len(stocks), GET_QUOTES_PER_GROUPS)] - - _log("start benchmark") - - total_time = connecting_time = get_security_count_time = get_security_list_time = get_security_quotes_time = num = 0 - - start_time = time.time() - last_time = start_time - - try: - api = TdxHq_API(multithread=True) - - port = 7709 - - if ":" in ip: - ip, port = ip.split(':') - port = int(port) - - with api.connect(ip=ip, port=port): - _log("connected") - cur_time = time.time() - connecting_time = cur_time - last_time - last_time = cur_time - _log("connecting time is {}".format(connecting_time)) - - num = api.get_security_count(0) - _log("all shenzhen market stock count is {}".format(num)) - - cur_time = time.time() - get_security_count_time = cur_time - last_time - last_time = cur_time - _log("get_security_count_time is {}".format(get_security_count_time)) - - all = [] - for i in range((num // 1000) + 1): - offset = i * 1000 - section = api.get_security_list(0, offset) - all = all + section - - cur_time = time.time() - get_security_list_time = cur_time - last_time - last_time = cur_time - - _log("get_security_list_time is {}".format(get_security_list_time)) - - codes = [one['code'] for one in all] - - results = [] - for stocks in _grouped_list(codes): - req_list = [(0, code) for code in stocks] - one_results = api.get_security_quotes(req_list) - results = results + one_results - - cur_time = time.time() - get_security_quotes_time = cur_time - last_time - last_time = cur_time - _log("get_security_quotes_time is {}".format(get_security_quotes_time)) - - total_time = last_time - start_time - - _log("total_time is {}".format(total_time)) - - _log("end benchmark") - except Exception as e: - _log("hit exception " + str(e)) - - return { - "ip": ip, - "total_time": total_time, - "connecting_time": connecting_time, - "get_security_count_time": get_security_count_time, - "get_security_list_time": get_security_list_time, - "get_security_quotes_time": get_security_quotes_time, - "security_count": num - } - - with ThreadPoolExecutor(max_workers=len(ips)) as executor: - results = executor.map(single_client_benchmark, ips) - - - - rows = [] - rows.append(("IP", "Total", "Connecting", "Get Count", "Get List", "Get Quotes")) - for result in results: - rows.append( - [result['ip'], - - "{:0.6f}".format(result['total_time']), - "{:0.6f}".format(result['connecting_time']), - - "{:0.6f} ({})".format(result['get_security_count_time'], result['security_count']), - "{:0.6f}".format(result['get_security_list_time']), - - "{:0.6f}".format(result['get_security_quotes_time'])] - ) - - print("=" * 40) - print_table(rows) - - - -# helper function from http://blog.paphus.com/blog/2012/09/04/simple-ascii-tables-in-python/ -def print_table(lines, separate_head=True): - """Prints a formatted table given a 2 dimensional array""" - #Count the column width - widths = [] - for line in lines: - for i,size in enumerate([len(x) for x in line]): - while i >= len(widths): - widths.append(0) - if size > widths[i]: - widths[i] = size - - #Generate the format string to pad the columns - print_string = "" - for i,width in enumerate(widths): - print_string += "{" + str(i) + ":" + str(width) + "} | " - if (len(print_string) == 0): - return - print_string = print_string[:-3] - - #Print the actual data - for i,line in enumerate(lines): - print(print_string.format(*line)) - if (i == 0 and separate_head): - print("-"*(sum(widths)+3*(len(widths)-1))) - - -if __name__ == '__main__': - main() \ No newline at end of file diff --git a/pytdx/bin/hqget.py b/pytdx/bin/hqget.py deleted file mode 100644 index 80290fb..0000000 --- a/pytdx/bin/hqget.py +++ /dev/null @@ -1,256 +0,0 @@ -# coding=utf-8 -from __future__ import unicode_literals - -import os -import sys -import click - -from collections import OrderedDict -import pprint - -if __name__ == '__main__': - sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))) - -from pytdx.hq import TdxHq_API -from pytdx.params import TDXParams -from pytdx.config.hosts import hq_hosts -import pandas as pd -import pickle -from functools import reduce - - -# 让pandas 显示全部数据 -pd.set_option('display.max_columns', None) -pd.set_option('display.max_rows', None) - -mtstr = os.getenv("TDX_MT", "") -mt = False -if mtstr: - mt = True - -api = TdxHq_API(multithread=mt) - - -def get_security_quotes(params): - market, code = params - stocks = api.get_security_quotes([(int(market), code),]) - return (stocks) - -def get_security_bars(params): - category, market, code, start, count = params - return (api.get_security_bars(int(category), int(market), code, int(start), int(count))) - -def get_security_count(params): - return (api.get_security_count(int(params[0]))) - -def get_security_list(params): - return (api.get_security_list(int(params[0]), int(params[1]))) - -def get_index_bars(params): - category, market, code, start, count = params - return (api.get_index_bars(int(category), int(market), code, int(start), int(count))) - -def get_minute_time_data(params): - return (api.get_minute_time_data(int(params[0]), params[1])) - -def get_history_minute_time_data(params): - return (api.get_history_minute_time_data(int(params[0]), params[1], int(params[2]))) - -def get_transaction_data(params): - return (api.get_transaction_data(int(params[0]), params[1], int(params[2]), int(params[3]))) - -def get_history_transaction_data(params): - return (api.get_history_transaction_data(int(params[0]), params[1], int(params[2]), int(params[3]), int(params[4]))) - -def get_company_info_category(params): - return (api.get_company_info_category(int(params[0]), params[1])) - -def get_company_info_content(params): - return (api.get_company_info_content(int(params[0]), params[1].encode("utf-8"), params[2].encode("utf-8"), int(params[3]), int(params[4]))) - -def get_xdxr_info(params): - return (api.get_xdxr_info(int(params[0]), params[1])) - -def get_finance_info(params): - return (api.get_finance_info(int(params[0]), params[1])) - -FUNCTION_LIST = OrderedDict( - [ - (1, ['获取股票行情', '参数:市场代码, 股票代码, 如: 0,000001 或 1,600300', get_security_quotes, '0,000001']), - (2, ['获取k线', '''category-> K线种类 -0 5分钟K线 1 15分钟K线 2 30分钟K线 3 1小时K线 4 日K线 -5 周K线 -6 月K线 -7 1分钟 -8 1分钟K线 9 日K线 -10 季K线 -11 年K线 -market -> 市场代码 0:深圳,1:上海 -stockcode -> 证券代码; -start -> 指定的范围开始位置; -count -> 用户要请求的 K 线数目,最大值为 800 - -如: 9,0,000001,0,100''', get_security_bars, '9,0,000001,0,100']), - (3, ['获取市场股票数量', '参数:市场代码, 股票代码, 如: 0 或 1', get_security_count, '0']), - (4, ['获取股票列表', '参数:市场代码, 起始位置, 数量 如: 0,0 或 1,100', get_security_list, '0,0']), - (5, ['获取指数k线', """参数: -category-> K线种类 -0 5分钟K线 1 15分钟K线 2 30分钟K线 3 1小时K线 4 日K线 -5 周K线 -6 月K线 -7 1分钟 -8 1分钟K线 9 日K线 -10 季K线 -11 年K线 -market -> 市场代码 0:深圳,1:上海 -stockCode -> 证券代码; -start -> 指定的范围开始位置; count -> 用户要请求的 K 线数目 -如:9,1,000001,0,100""", get_index_bars, '9,1,000001,0,100']), - (6, ['查询分时行情', "参数:市场代码, 股票代码, 如: 0,000001 或 1,600300", get_minute_time_data, '0,000001']), - (7, ['查询历史分时行情', '参数:市场代码, 股票代码,时间 如: 0,000001,20161209 或 1,600300,20161209', get_history_minute_time_data, '0,000001,20161209']), - (8, ['查询分笔成交', '参数:市场代码, 股票代码,起始位置, 数量 如: 0,000001,0,10', get_transaction_data, '0,000001,0,10']), - (9, ['查询历史分笔成交', '参数:市场代码, 股票代码,起始位置,日期 数量 如: 0,000001,0,10,20170209', get_history_transaction_data, '0,000001,0,10,20170209']), - (10, ['查询公司信息目录','参数:市场代码, 股票代码, 如: 0,000001 或 1,600300', get_company_info_category, '0,000001']), - (11, ['读取公司信息详情', '参数:市场代码, 股票代码, 文件名, 起始位置, 数量, 如:0,000001,000001.txt,2054363,9221', get_company_info_content, '0,000001,000001.txt,0,10']), - (12, ['读取除权除息信息', '参数:市场代码, 股票代码, 如: 0,000001 或 1,600300', get_xdxr_info, '0,000001']), - (13, ['读取财务信息', '参数:市场代码, 股票代码, 如: 0,000001 或 1,600300', get_finance_info, '0,000001']), - ] -) - -# 1 : 招商证券深圳行情 119.147.212.81:7709 -# 2 : 华泰证券(南京电信) 221.231.141.60:7709 -# 3 : 华泰证券(上海电信) 101.227.73.20:7709 -# 4 : 华泰证券(上海电信二) 101.227.77.254:7709 -# 5 : zz - -SERVERS = OrderedDict([ -(1, ['招商证券深圳行情', '119.147.212.81:7709']), -(2, ['华泰证券(南京电信)', '221.231.141.60:7709']), -(3, ['华泰证券(上海电信)', '101.227.73.20:7709']), -(4, ['华泰证券(上海电信二)', '101.227.77.254:7709']), -(5, ['华泰证券(深圳电信)', '14.215.128.18:7709']), -(6, ['华泰证券(武汉电信)', '59.173.18.140:7709']), -(7, ['华泰证券(天津联通)', '60.28.23.80:7709']), -(8, ['华泰证券(沈阳联通)', '218.60.29.136:7709']), -(9, ['华泰证券(南京联通)', '122.192.35.44:7709']), -(10, ['华泰证券(南京联通)', '122.192.35.44:7709']), -]) - -def connect(): - while True: - click.secho("请选择服务器") - click.secho("-" * 20) - for k,v in SERVERS.items(): - click.secho("[%d] :%s (%s)" % (k, v[0], v[1])) - click.secho("-" * 20) - num = click.prompt("请输入序号 ", type=int, default=1) - if num not in SERVERS: - click.echo("序号错误") - continue - ip,port = SERVERS[num][1].split(":") - - c = api.connect(ip, int(port)) - if not c: - raise Exception("无法连接") - else: - break - -def connect_to(ipandport): - ip, port = ipandport.split(":") - c = api.connect(ip, int(port)) - if not c: - raise Exception("无法连接") - -def disconnect(): - api.disconnect() - -if sys.version_info[0] == 2: - reload(sys) - sys.setdefaultencoding('utf8') - -FUNCTION_LIST_STR = "0 : 使用交互式接口\n" -for x, y in FUNCTION_LIST.items(): - FUNCTION_LIST_STR = FUNCTION_LIST_STR + str(x) + " : " + y[0] + "\n" - -@click.command() -@click.option('-f', '--function', default=0, type=click.INT, help="选择使用的功能" + "\n" + FUNCTION_LIST_STR) -@click.option('--df/--no-df', default=True, help="是否使用Pandas Dataframe显示") -@click.option('-o', '--output', default="-", help="保存到文件,默认不保存") -@click.option('-s', '--server', default="-", type=click.STRING, help="连接的服务器,设定之后直接连接该服务器,无需选择" ) -@click.option('--all/--no-all', default=False, help="显示全部服务器列表") -def main(function, df, output, server, all): - """ - 股票行情获取程序, 作者RainX - """ - - if all: - global SERVERS - SERVERS = OrderedDict([(idx+1, [host[0], "%s:%s" % (host[1], host[2])]) for idx, host in enumerate(hq_hosts)]) - - click.secho("连接中.... ", fg="green") - if server == '-': - connect() - else: - connect_to(server) - - click.secho("连接成功!", fg="green") - if function == 0: - - while True: - click.secho("-" * 20) - click.secho("功能列表:") - for (k,v) in FUNCTION_LIST.items(): - click.secho(str(k) + " : " + v[0], bold=True) - last = k + 1 - click.secho(str(last) + " : 退出断开连接", bold=True) - click.secho("-" * 20) - value = click.prompt('请输入要使用的功能', type=int) - if value == last: - break - run_function(df, value) - click.secho("-" * 20) - click.echo("按任意键继续") - click.getchar() - elif function in FUNCTION_LIST.keys(): - value = function - result = run_function(df, value) - - if (result is not None) and (output != "-"): - click.secho("写入结果到 " + output) - if isinstance(result, pd.DataFrame): - result.to_csv(output) - else: - with open(output, "wb") as f: - pickle.dump(result, f) - - click.secho("断开连接中.... ", fg="green") - disconnect() - click.secho("断开连接成功!", fg="green") - - -def run_function(df, value): - click.secho("你选择的是功能 " + str(value) + " : " + FUNCTION_LIST[value][0]) - click.secho("-" * 20) - click.secho(FUNCTION_LIST[value][1]) - params_str = click.prompt("请输入参数 ", type=str, default=FUNCTION_LIST[value][3]) - params = [p.strip() for p in params_str.split(",")] - click.secho("-" * 20) - try: - result = FUNCTION_LIST[value][2](params) - if df: - result = api.to_df(result) - click.secho(str(result), bold=True) - return result - else: - pprint.pprint(result) - return result - except Exception as e: - import traceback - print('-' * 60) - traceback.print_exc(file=sys.stdout) - print('-' * 60) - click.secho("发生错误,错误信息为: " + str(e), fg='red') - - -if __name__ == '__main__': - main() \ No newline at end of file diff --git a/pytdx/bin/hqreader.py b/pytdx/bin/hqreader.py deleted file mode 100644 index 8c65930..0000000 --- a/pytdx/bin/hqreader.py +++ /dev/null @@ -1,73 +0,0 @@ -#coding=utf-8 -from __future__ import unicode_literals, division -import click -import sys -import os -if __name__ == '__main__': - sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))) - -from pytdx.reader import TdxDailyBarReader, TdxFileNotFoundException, TdxNotAssignVipdocPathException -from pytdx.reader import TdxMinBarReader -from pytdx.reader import TdxLCMinBarReader -from pytdx.reader import TdxExHqDailyBarReader -from pytdx.reader import GbbqReader -from pytdx.reader import BlockReader -from pytdx.reader import CustomerBlockReader -from pytdx.reader.history_financial_reader import HistoryFinancialReader -import pandas as pd - -# 让pandas 显示全部数据 -pd.set_option('display.max_columns', None) -pd.set_option('display.max_rows', None) - - -Help_Text = ''' -数据文件格式, - - daily 代表日K线 - - ex_daily 代表扩展行情的日线 - - min 代表5分钟或者1分钟线 - - lc 代表lc1, lc5格式的分钟线 - - gbbq 股本变迁文件 - - block 读取板块股票列表文件 - - customblock 读取自定义板块列表 - - history_financial 或者 hf 历史财务信息 如 gpcw20170930.dat 或者 gpcw20170930.zip -''' - -@click.command() -@click.argument("input", type=click.Path(exists=True)) -@click.option("-o", '--output', help="") -@click.option("-d", "--datatype", default="daily", help=Help_Text) -def main(input, output, datatype): - """ - 通达信数据文件读取 - """ - - if datatype == 'daily': - reader = TdxDailyBarReader() - elif datatype == 'ex_daily': - reader = TdxExHqDailyBarReader() - elif datatype == 'lc': - reader = TdxLCMinBarReader() - elif datatype == 'gbbq': - reader = GbbqReader() - elif datatype == 'block': - reader = BlockReader() - elif datatype == 'customblock': - reader = CustomerBlockReader() - elif datatype == 'history_financial' or datatype == 'hf': - reader = HistoryFinancialReader() - else: - reader = TdxMinBarReader() - - try: - df = reader.get_df(input) - if output: - click.echo("写入到文件 : " + output) - df.to_csv(output) - else: - print(df) - except Exception as e: - print(str(e)) - -if __name__ == '__main__': - main() \ No newline at end of file diff --git a/pytdx/config/__init__.py b/pytdx/config/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/pytdx/config/hosts.py b/pytdx/config/hosts.py deleted file mode 100644 index fa50612..0000000 --- a/pytdx/config/hosts.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding=utf-8 - - - -hq_hosts = [ - ("长城国瑞电信1", "218.85.139.19", 7709), - ("长城国瑞电信2", "218.85.139.20", 7709), - ("长城国瑞网通", "58.23.131.163", 7709), - ("上证云成都电信一", "218.6.170.47", 7709), - ("上证云北京联通一", "123.125.108.14", 7709), - ("上海电信主站Z1", "180.153.18.170", 7709), - ("上海电信主站Z2", "180.153.18.171", 7709), - ("上海电信主站Z80", "180.153.18.172", 80), - ("北京联通主站Z1", "202.108.253.130", 7709), - ("北京联通主站Z2", "202.108.253.131", 7709), - ("北京联通主站Z80", "202.108.253.139", 80), - ("杭州电信主站J1", "60.191.117.167", 7709), - ("杭州电信主站J2", "115.238.56.198", 7709), - ("杭州电信主站J3", "218.75.126.9", 7709), - ("杭州电信主站J4", "115.238.90.165", 7709), - ("杭州联通主站J1", "124.160.88.183", 7709), - ("杭州联通主站J2", "60.12.136.250", 7709), - ("杭州华数主站J1", "218.108.98.244", 7709), - ("杭州华数主站J2", "218.108.47.69", 7709), - ("义乌移动主站J1", "223.94.89.115", 7709), - ("青岛联通主站W1", "218.57.11.101", 7709), - ("青岛电信主站W1", "58.58.33.123", 7709), - ("深圳电信主站Z1", "14.17.75.71", 7709), - ("云行情上海电信Z1", "114.80.63.12", 7709), - ("云行情上海电信Z2", "114.80.63.35", 7709), - ("上海电信主站Z3", "180.153.39.51", 7709), - ('招商证券深圳行情', '119.147.212.81', 7709), - ('华泰证券(南京电信)', '221.231.141.60', 7709), - ('华泰证券(上海电信)', '101.227.73.20', 7709), - ('华泰证券(上海电信二)', '101.227.77.254', 7709), - ('华泰证券(深圳电信)', '14.215.128.18', 7709), - ('华泰证券(武汉电信)', '59.173.18.140', 7709), - ('华泰证券(天津联通)', '60.28.23.80', 7709), - ('华泰证券(沈阳联通)', '218.60.29.136', 7709), - ('华泰证券(南京联通)', '122.192.35.44', 7709), - ('华泰证券(南京联通)', '122.192.35.44', 7709), - ('安信', '112.95.140.74', 7709), - ('安信', '112.95.140.92', 7709), - ('安信', '112.95.140.93', 7709), - ('安信', '114.80.149.19', 7709), - ('安信', '114.80.149.21', 7709), - ('安信', '114.80.149.22', 7709), - ('安信', '114.80.149.91', 7709), - ('安信', '114.80.149.92', 7709), - ('安信', '121.14.104.60', 7709), - ('安信', '121.14.104.66', 7709), - ('安信', '123.126.133.13', 7709), - ('安信', '123.126.133.14', 7709), - ('安信', '123.126.133.21', 7709), - ('安信', '211.139.150.61', 7709), - ('安信', '59.36.5.11', 7709), - ('广发', '119.29.19.242', 7709), - ('广发', '123.138.29.107', 7709), - ('广发', '123.138.29.108', 7709), - ('广发', '124.232.142.29', 7709), - ('广发', '183.57.72.11', 7709), - ('广发', '183.57.72.12', 7709), - ('广发', '183.57.72.13', 7709), - ('广发', '183.57.72.15', 7709), - ('广发', '183.57.72.21', 7709), - ('广发', '183.57.72.22', 7709), - ('广发', '183.57.72.23', 7709), - ('广发', '183.57.72.24', 7709), - ('广发', '183.60.224.177', 7709), - ('广发', '183.60.224.178', 7709), - ('国泰君安', '113.105.92.100', 7709), - ('国泰君安', '113.105.92.101', 7709), - ('国泰君安', '113.105.92.102', 7709), - ('国泰君安', '113.105.92.103', 7709), - ('国泰君安', '113.105.92.104', 7709), - ('国泰君安', '113.105.92.99', 7709), - ('国泰君安', '117.34.114.13', 7709), - ('国泰君安', '117.34.114.14', 7709), - ('国泰君安', '117.34.114.15', 7709), - ('国泰君安', '117.34.114.16', 7709), - ('国泰君安', '117.34.114.17', 7709), - ('国泰君安', '117.34.114.18', 7709), - ('国泰君安', '117.34.114.20', 7709), - ('国泰君安', '117.34.114.27', 7709), - ('国泰君安', '117.34.114.30', 7709), - ('国泰君安', '117.34.114.31', 7709), - ('国信', '182.131.3.252', 7709), - ('国信', '183.60.224.11', 7709), - ('国信', '58.210.106.91', 7709), - ('国信', '58.63.254.216', 7709), - ('国信', '58.63.254.219', 7709), - ('国信', '58.63.254.247', 7709), - ('海通', '123.125.108.90', 7709), - ('海通', '175.6.5.153', 7709), - ('海通', '182.118.47.151', 7709), - ('海通', '182.131.3.245', 7709), - ('海通', '202.100.166.27', 7709), - ('海通', '222.161.249.156', 7709), - ('海通', '42.123.69.62', 7709), - ('海通', '58.63.254.191', 7709), - ('海通', '58.63.254.217', 7709), - ('华林', '120.55.172.97', 7709), - ('华林', '139.217.20.27', 7709), - ('华林', '202.100.166.21', 7709), - ('华林', '202.96.138.90', 7709), - ('华林', '218.106.92.182', 7709), - ('华林', '218.106.92.183', 7709), - ('华林', '220.178.55.71', 7709), - ('华林', '220.178.55.86', 7709), - - - -] \ No newline at end of file diff --git a/pytdx/crawler/__init__.py b/pytdx/crawler/__init__.py deleted file mode 100644 index 2ade70f..0000000 --- a/pytdx/crawler/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -#coding: utf-8 - -""" -主要放置一些需要爬取的数据 -""" \ No newline at end of file diff --git a/pytdx/crawler/base_crawler.py b/pytdx/crawler/base_crawler.py deleted file mode 100644 index 705cbac..0000000 --- a/pytdx/crawler/base_crawler.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -import tempfile -import six -import math - -if six.PY2: - from urllib2 import urlopen, Request -else: - from urllib.request import urlopen, Request - - - -def demo_reporthook(downloaded, total_size): - print("Downloaded {}, Total is {}".format(downloaded, total_size)) - -class BaseCralwer: - - def __init__(self, mode="http"): - self.mode = "http" - - def fetch_and_parse(self, reporthook = None, path_to_download=None, proxies=None, chunksize=1024 * 50, *args, **kwargs): - """ - function to get data , - :param reporthook 使用urllib.request 的report_hook 来汇报下载进度 \ - 参考 https://docs.python.org/3/library/urllib.request.html#module-urllib.request - :param path_to_download 数据文件下载的地址,如果没有提供,则下载到临时文件中,并在解析之后删除 - :param proxies urllib格式的代理服务器设置 - :return: 解析之后的数据结果 - """ - if (self.mode == "http"): - download_file = self.fetch_via_http(reporthook=reporthook, path_to_download=path_to_download, proxies=proxies, chunksize=chunksize, *args, **kwargs) - else: - download_file = self.get_content(reporthook=reporthook, path_to_download=path_to_download, chunksize=chunksize, *args, **kwargs); - - result = self.parse(download_file, *args, **kwargs) - try: - download_file.close() - except: - pass - return result - - def fetch_via_http(self, reporthook = None, path_to_download=None, proxies=None, chunksize=1024 * 50, *args, **kwargs): - if path_to_download is None: - download_file = tempfile.NamedTemporaryFile(delete=True) - else: - download_file = open(path_to_download, 'wb') - - url = self.get_url(*args, **kwargs) - - request = Request(url) - request.add_header('Referer', url) - request.add_header('User-Agent', r"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36") - res = urlopen(request) - - if six.PY2: - resinfo = res.info() - else: - resinfo = res - - if resinfo.getheader('Content-Length') is not None: - total_size = int(resinfo.getheader('Content-Length').strip()) - downloaded = 0 - - while True: - chunk = res.read(chunksize) - downloaded += len(chunk) - if reporthook is not None: - reporthook(downloaded,total_size) - if not chunk: - break - download_file.write(chunk) - else: - content = res.read() - download_file.write(content) - - download_file.seek(0) - return download_file - - - def get_url(self, *args, **kwargs): - raise NotImplementedError("will impl in subclass") - - def get_content(self, reporthook = None, path_to_download=None, proxies=None, chunksize=1024 * 50, *args, **kwargs): - raise NotImplementedError("will impl in subclass") - - def parse(self, download_file, *args, **kwargs): - raise NotImplementedError("will impl in subclass") \ No newline at end of file diff --git a/pytdx/crawler/history_financial_crawler.py b/pytdx/crawler/history_financial_crawler.py deleted file mode 100644 index de8c3ee..0000000 --- a/pytdx/crawler/history_financial_crawler.py +++ /dev/null @@ -1,192 +0,0 @@ -# coding: utf-8 - -from struct import calcsize, unpack -from pytdx.crawler.base_crawler import BaseCralwer -import shutil -import tempfile -import random -import os -import six -import pandas as pd - -if six.PY2: - import zipfile - -""" -https://github.com/rainx/pytdx/issues/133 - -获取历史财务数据的接口,参考上面issue里面 @datochan 的方案和代码 - -""" - -class HistoryFinancialListCrawler(BaseCralwer): - - def __init__(self): - self.mode = "content" - - def get_url(self, *args, **kwargs): - return "https://gitee.com/yutiansut/QADATA/raw/master/financial/content.txt" - - def get_content(self, reporthook=None, path_to_download=None, proxies=None, chunksize=1024 * 50, *args, **kwargs): - from pytdx.hq import TdxHq_API - api = TdxHq_API() - api.need_setup = False - # calc.tdx.com.cn, calc2.tdx.com.cn - with api.connect(ip="120.76.152.87"): - content = api.get_report_file_by_size("tdxfin/gpcw.txt") - if path_to_download is None: - download_file = tempfile.NamedTemporaryFile(delete=True) - else: - download_file = open(path_to_download, 'wb') - download_file.write(content) - download_file.seek(0) - return download_file - - def parse(self, download_file, *args, **kwargs): - content = download_file.read() - content = content.decode("utf-8") - - def list_to_dict(l): - return { - 'filename': l[0], - 'hash': l[1], - 'filesize': int(l[2]) - } - result = [list_to_dict(l) for l in [line.strip().split(",") for line in content.strip().split('\n')]] - return result - - -class HistoryFinancialCrawler(BaseCralwer): - - def __init__(self): - self.mode = "content" - - def get_url(self, *args, **kwargs): - if 'filename' in kwargs: - filename = kwargs['filename'] - else: - raise Exception("Param filename is not set") - - return "http://data.yutiansut.com/{}".format(filename) - - - def get_content(self, reporthook=None, path_to_download=None, proxies=None, chunksize=1024 * 50, *args, **kwargs): - if 'filename' in kwargs: - filename = kwargs['filename'] - else: - raise Exception("Param filename is not set") - - if "filesize" in kwargs: - filesize = kwargs["filesize"] - else: - filesize = 0 - - from pytdx.hq import TdxHq_API - api = TdxHq_API() - api.need_setup = False - # calc.tdx.com.cn, calc2.tdx.com.cn - with api.connect(ip="120.76.152.87"): - content = api.get_report_file_by_size("tdxfin/" + filename, filesize=filesize, reporthook=reporthook) - if path_to_download is None: - download_file = tempfile.NamedTemporaryFile(delete=True) - else: - download_file = open(path_to_download, 'wb') - download_file.write(content) - download_file.seek(0) - return download_file - - def parse(self, download_file, *args, **kwargs): - - header_pack_format = '<1hI1H3L' - - if download_file.name.endswith('.zip'): - tmpdir_root = tempfile.gettempdir() - subdir_name = "pytdx_" + str(random.randint(0, 1000000)) - tmpdir = os.path.join(tmpdir_root, subdir_name) - shutil.rmtree(tmpdir, ignore_errors=True) - os.makedirs(tmpdir) - if six.PY2: - with zipfile.ZipFile(download_file.name, 'r') as zf: - zf.extractall(tmpdir) - else: - shutil.unpack_archive(download_file.name, extract_dir=tmpdir) - # only one file endswith .dat should be in zip archives - datfile = None - for _file in os.listdir(tmpdir): - if _file.endswith(".dat"): - datfile = open(os.path.join(tmpdir, _file), "rb") - - if datfile is None: - raise Exception("no dat file found in zip archive") - else: - datfile = download_file - header_size = calcsize(header_pack_format) - stock_item_size = calcsize("<6s1c1L") - data_header = datfile.read(header_size) - stock_header = unpack(header_pack_format, data_header) - max_count = stock_header[2] - report_date = stock_header[1] - report_size = stock_header[4] - report_fields_count = int(report_size / 4) - report_pack_format = '<{}f'.format(report_fields_count) - - results = [] - for stock_idx in range(0, max_count): - datfile.seek(header_size + stock_idx * calcsize("<6s1c1L")) - si = datfile.read(stock_item_size) - stock_item = unpack("<6s1c1L", si) - code = stock_item[0].decode("utf-8") - foa = stock_item[2] - datfile.seek(foa) - - info_data = datfile.read(calcsize(report_pack_format)) - cw_info = unpack(report_pack_format, info_data) - one_record = (code, report_date) + cw_info - results.append(one_record) - - if download_file.name.endswith('.zip'): - datfile.close() - shutil.rmtree(tmpdir, ignore_errors=True) - return results - - def to_df(self, data): - if len(data) == 0: - return None - - total_lengh = len(data[0]) - col = ['code', 'report_date'] - - length = total_lengh - 2 - for i in range(0, length): - col.append("col" + str(i + 1)) - - - df = pd.DataFrame(data=data, columns=col) - df.set_index('code', inplace=True) - return df - - -if __name__ == '__main__': - import pandas as pd - from pytdx.crawler.base_crawler import demo_reporthook - crawler = HistoryFinancialListCrawler() - # - list_data = crawler.fetch_and_parse(reporthook=demo_reporthook) - df = pd.DataFrame(data=list_data) - - print(df["filename"]) - print(df["filename"].str.contains("gpcw20190630.zip").any()) - - # 读取其中一个 - - # filename = list_data[1]['filename'] - # filesize = list_data[1]["filesize"] - - # datacrawler = HistoryFinancialCrawler() - # pd.set_option('display.max_columns', None) - - # result = datacrawler.fetch_and_parse(reporthook=demo_reporthook, filename=filename, filesize=filesize, path_to_download="/tmp/tmpfile.zip") - # print(result) - # with open(r"/tmp/tmpfile.zip", "rb") as fp: - # result = datacrawler.parse(download_file=fp) - # print(datacrawler.to_df(data=result)) diff --git a/pytdx/errors.py b/pytdx/errors.py deleted file mode 100644 index 1e56e35..0000000 --- a/pytdx/errors.py +++ /dev/null @@ -1,20 +0,0 @@ -# coding=utf-8 - - -class TdxConnectionError(Exception): - """ - 当连接服务器出错的时候,会抛出的异常 - """ - pass - -class TdxFunctionCallError(Exception): - """ - 当行数调用出错的时候 - """ - def __init__(self, *args, **kwargs): - super(TdxFunctionCallError, self).__init__(*args, **kwargs) - self.original_exception = None - - - - diff --git a/pytdx/exhq.py b/pytdx/exhq.py deleted file mode 100644 index 0ee1914..0000000 --- a/pytdx/exhq.py +++ /dev/null @@ -1,163 +0,0 @@ -# coding=utf-8 - -# -# Just for practising -# - - -import os -import socket -import sys -import pandas as pd - -if __name__ == '__main__': - sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) - -from pytdx.log import DEBUG, log -from pytdx.parser.ex_setup_commands import ExSetupCmd1 -from pytdx.parser.ex_get_markets import GetMarkets -from pytdx.parser.ex_get_instrument_count import GetInstrumentCount -from pytdx.parser.ex_get_instrument_quote import GetInstrumentQuote -from pytdx.parser.ex_get_minute_time_data import GetMinuteTimeData -from pytdx.parser.ex_get_history_minute_time_data import GetHistoryMinuteTimeData -from pytdx.parser.ex_get_transaction_data import GetTransactionData -from pytdx.parser.ex_get_history_transaction_data import GetHistoryTransactionData -from pytdx.parser.ex_get_instrument_bars import GetInstrumentBars -from pytdx.parser.ex_get_instrument_info import GetInstrumentInfo -from pytdx.parser.ex_get_history_instrument_bars_range import GetHistoryInstrumentBarsRange -from pytdx.parser.ex_get_instrument_quote_list import GetInstrumentQuoteList - - -from pytdx.params import TDXParams - -import threading -import datetime -from pytdx.base_socket_client import BaseSocketClient, update_last_ack_time - - -""" -In [7]: 0x7e -Out[7]: 126 - -In [5]: len(body) -Out[5]: 8066 - -In [6]: len(body)/126 -Out[6]: 64.01587301587301 - -In [7]: len(body)%126 -Out[7]: 2 - -In [8]: (len(body)-2)/126 -Out[8]: 64.0 -""" - - -class TdxExHq_API(BaseSocketClient): - - def setup(self): - ExSetupCmd1(self.client).call_api() - - # API LIST - - @update_last_ack_time - def get_markets(self): - cmd = GetMarkets(self.client) - return cmd.call_api() - - @update_last_ack_time - def get_instrument_count(self): - cmd = GetInstrumentCount(self.client) - return cmd.call_api() - - @update_last_ack_time - def get_instrument_quote(self, market, code): - cmd = GetInstrumentQuote(self.client) - cmd.setParams(market, code) - return cmd.call_api() - - @update_last_ack_time - def get_instrument_bars(self, category, market, code, start=0, count=700): - cmd = GetInstrumentBars(self.client) - cmd.setParams(category, market, code, start=start, count=count) - return cmd.call_api() - - @update_last_ack_time - def get_minute_time_data(self, market, code): - cmd = GetMinuteTimeData(self.client) - cmd.setParams(market, code) - return cmd.call_api() - - @update_last_ack_time - def get_history_minute_time_data(self, market, code, date): - cmd = GetHistoryMinuteTimeData(self.client) - cmd.setParams(market, code, date=date) - return cmd.call_api() - - @update_last_ack_time - def get_transaction_data(self, market, code, start=0, count=1800): - cmd = GetTransactionData(self.client) - cmd.setParams(market, code, start=start, count=count) - return cmd.call_api() - - @update_last_ack_time - def get_history_transaction_data(self, market, code, date, start=0, count=1800): - cmd = GetHistoryTransactionData(self.client) - cmd.setParams(market, code, date, start=start, count=count) - return cmd.call_api() - - @update_last_ack_time - def get_history_instrument_bars_range(self, market, code, start, end): - cmd = GetHistoryInstrumentBarsRange(self.client) - cmd.setParams(market, code, start, end) - return cmd.call_api() - - @update_last_ack_time - def get_instrument_info(self, start, count=100): - cmd = GetInstrumentInfo(self.client) - cmd.setParams(start, count) - return cmd.call_api() - - @update_last_ack_time - def get_instrument_quote_list(self, market, category, start=0, count=80): - cmd = GetInstrumentQuoteList(self.client) - cmd.setParams(market, category, start, count) - return cmd.call_api() - - def do_heartbeat(self): - self.get_instrument_count() - - -if __name__ == '__main__': - import pprint - - api = TdxExHq_API() - with api.connect('121.14.110.210', 7727): - # log.info("获取市场代码") - # pprint.pprint(api.to_df(api.get_markets())) - # log.info("查询市场中商品数量") - # pprint.pprint(api.get_instrument_count()) - # log.info("查询五档行情") - #pprint.pprint(api.to_df(api.get_instrument_quote(47, "IF1709"))) - #pprint.pprint(api.get_instrument_quote(8, "10000889")) - #pprint.pprint(api.get_instrument_quote(31, "00020")) - # log.info("查询分时行情") - #api.get_minute_time_data(47, "IFL0") - #pprint.pprint(api.to_df(api.get_minute_time_data(47, "IFL0"))) - #pprint.pprint(api.to_df(api.get_minute_time_data(8, "10000889")).tail()) - #pprint.pprint(api.get_minute_time_data(31, "00020")) - log.info("查询历史分时行情") - pprint.pprint(api.to_df(api.get_history_minute_time_data(31, "00020", 20170811)).tail()) - log.info("查询分时成交") - pprint.pprint(api.to_df(api.get_transaction_data(31, "00020")).tail()) - - log.info("查询历史分时成交") - pprint.pprint(api.to_df(api.get_history_transaction_data(31, "00020", 20170811)).tail()) - #data = api.get_history_minute_time_data(47, 'IFL0', 20170811) - # pprint.pprint(data) - - # log.info("查询k线") - #pprint.pprint(api.to_df(api.get_instrument_bars(TDXParams.KLINE_TYPE_DAILY, 8, "10000843"))) - #pprint.pprint(api.to_df(api.get_instrument_bars(TDXParams.KLINE_TYPE_DAILY, 31, "00700"))) - # log.info("查询代码列表") - #pprint.pprint(api.to_df(api.get_instrument_info(10000, 98))) diff --git a/pytdx/heartbeat.py b/pytdx/heartbeat.py deleted file mode 100644 index bc0c06a..0000000 --- a/pytdx/heartbeat.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 - -from threading import Thread -import random -from pytdx.log import DEBUG, log -import time - -# 参考 :https://stackoverflow.com/questions/6524459/stopping-a-thread-after-a-certain-amount-of-time - - -DEFAULT_HEARTBEAT_INTERVAL = 10.0 # 10秒一个heartbeat - -class HqHeartBeatThread(Thread): - - def __init__(self, api, stop_event, heartbeat_interval=DEFAULT_HEARTBEAT_INTERVAL): - self.api = api - self.client = api.client - self.stop_event = stop_event - self.heartbeat_interval = heartbeat_interval - super(HqHeartBeatThread, self).__init__() - - def run(self): - while not self.stop_event.is_set(): - self.stop_event.wait(self.heartbeat_interval) - if self.client and (time.time() - self.api.last_ack_time > self.heartbeat_interval): - try: - # 发送一个获取股票数量的包作为心跳包 - self.api.do_heartbeat() - except Exception as e: - log.debug(str(e)) - - diff --git a/pytdx/helper.py b/pytdx/helper.py deleted file mode 100644 index 275c25c..0000000 --- a/pytdx/helper.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding=utf-8 - -import struct -import six - - -#### XXX: 分析了一下,貌似是类似utf-8的编码方式保存有符号数字 -def get_price(data, pos): - pos_byte = 6 - bdata = indexbytes(data, pos) - intdata = bdata & 0x3f - if bdata & 0x40: - sign = True - else: - sign = False - - if bdata & 0x80: - while True: - pos += 1 - bdata = indexbytes(data, pos) - intdata += (bdata & 0x7f) << pos_byte - pos_byte += 7 - - if bdata & 0x80: - pass - else: - break - - pos += 1 - - if sign: - intdata = -intdata - - return intdata, pos - - -def get_volume(ivol): - logpoint = ivol >> (8 * 3) - hheax = ivol >> (8 * 3); # [3] - hleax = (ivol >> (8 * 2)) & 0xff; # [2] - lheax = (ivol >> 8) & 0xff; # [1] - lleax = ivol & 0xff; # [0] - - dbl_1 = 1.0 - dbl_2 = 2.0 - dbl_128 = 128.0 - - dwEcx = logpoint * 2 - 0x7f; - dwEdx = logpoint * 2 - 0x86; - dwEsi = logpoint * 2 - 0x8e; - dwEax = logpoint * 2 - 0x96; - if dwEcx < 0: - tmpEax = - dwEcx - else: - tmpEax = dwEcx - - dbl_xmm6 = 0.0 - dbl_xmm6 = pow(2.0, tmpEax) - if dwEcx < 0: - dbl_xmm6 = 1.0 / dbl_xmm6 - - dbl_xmm4 = 0 - if hleax > 0x80: - tmpdbl_xmm3 = 0.0 - tmpdbl_xmm1 = 0.0 - dwtmpeax = dwEdx + 1 - tmpdbl_xmm3 = pow(2.0, dwtmpeax) - dbl_xmm0 = pow(2.0, dwEdx) * 128.0 - dbl_xmm0 += (hleax & 0x7f) * tmpdbl_xmm3 - dbl_xmm4 = dbl_xmm0 - - else: - dbl_xmm0 = 0.0 - if dwEdx >= 0: - dbl_xmm0 = pow(2.0, dwEdx) * hleax - else: - dbl_xmm0 = (1 / pow(2.0, dwEdx)) * hleax - dbl_xmm4 = dbl_xmm0 - - dbl_xmm3 = pow(2.0, dwEsi) * lheax - dbl_xmm1 = pow(2.0, dwEax) * lleax - if hleax & 0x80: - dbl_xmm3 *= 2.0 - dbl_xmm1 *= 2.0 - - dbl_ret = dbl_xmm6 + dbl_xmm4 + dbl_xmm3 + dbl_xmm1 - return dbl_ret - - -def get_datetime(category, buffer, pos): - year = 0 - month = 0 - day = 0 - hour = 15 - minute = 0 - if category < 4 or category == 7 or category == 8: - (zipday, tminutes) = struct.unpack("> 11) + 2004 - month = int((zipday % 2048) / 100) - day = (zipday % 2048) % 100 - - hour = int(tminutes / 60) - minute = tminutes % 60 - else: - (zipday,) = struct.unpack(" 0: - current_downloaded_size = current_downloaded_size + \ - response["chunksize"] - filecontent.extend(response["chunkdata"]) - if reporthook is not None: - reporthook(current_downloaded_size,filesize) - else: - get_zero_length_package_times = get_zero_length_package_times + 1 - if filesize == 0: - break - elif get_zero_length_package_times > 2: - break - - return filecontent - - def do_heartbeat(self): - self.get_security_count(random.randint(0, 1)) - - def get_k_data(self, code, start_date, end_date): - # 具体详情参见 https://github.com/rainx/pytdx/issues/5 - # 具体详情参见 https://github.com/rainx/pytdx/issues/21 - def __select_market_code(code): - code = str(code) - if code[0] in ['5', '6', '9'] or code[:3] in ["009", "126", "110", "201", "202", "203", "204"]: - return 1 - return 0 - # 新版一劳永逸偷懒写法zzz - market_code = 1 if str(code)[0] == '6' else 0 - # https://github.com/rainx/pytdx/issues/33 - # 0 - 深圳, 1 - 上海 - - data = pd.concat([self.to_df(self.get_security_bars(9, __select_market_code( - code), code, (9 - i) * 800, 800)) for i in range(10)], axis=0) - - data = data.assign(date=data['datetime'].apply(lambda x: str(x)[0:10])).assign(code=str(code))\ - .set_index('date', drop=False, inplace=False)\ - .drop(['year', 'month', 'day', 'hour', 'minute', 'datetime'], axis=1)[start_date:end_date] - return data.assign(date=data['date'].apply(lambda x: str(x)[0:10])) - - -if __name__ == '__main__': - import pprint - - api = TdxHq_API() - if api.connect('101.227.73.20', 7709): - log.info("获取股票行情") - stocks = api.get_security_quotes([(0, "000001"), (1, "600300")]) - pprint.pprint(stocks) - log.info("获取k线") - data = api.get_security_bars(9, 0, '000001', 4, 3) - pprint.pprint(data) - log.info("获取 深市 股票数量") - pprint.pprint(api.get_security_count(0)) - log.info("获取股票列表") - stocks = api.get_security_list(1, 255) - pprint.pprint(stocks) - log.info("获取指数k线") - data = api.get_index_bars(9, 1, '000001', 1, 2) - pprint.pprint(data) - log.info("查询分时行情") - data = api.get_minute_time_data(TDXParams.MARKET_SH, '600300') - pprint.pprint(data) - log.info("查询历史分时行情") - data = api.get_history_minute_time_data( - TDXParams.MARKET_SH, '600300', 20161209) - pprint.pprint(data) - log.info("查询分时成交") - data = api.get_transaction_data(TDXParams.MARKET_SZ, '000001', 0, 30) - pprint.pprint(data) - log.info("查询历史分时成交") - data = api.get_history_transaction_data( - TDXParams.MARKET_SZ, '000001', 0, 10, 20170209) - pprint.pprint(data) - log.info("查询公司信息目录") - data = api.get_company_info_category(TDXParams.MARKET_SZ, '000001') - pprint.pprint(data) - log.info("读取公司信息-最新提示") - data = api.get_company_info_content(0, '000001', '000001.txt', 0, 10) - pprint.pprint(data) - log.info("读取除权除息信息") - data = api.get_xdxr_info(1, '600300') - pprint.pprint(data) - log.info("读取财务信息") - data = api.get_finance_info(0, '000001') - pprint.pprint(data) - log.info("日线级别k线获取函数") - data = api.get_k_data('000001', '2017-07-01', '2017-07-10') - pprint.pprint(data) - - api.disconnect() diff --git a/pytdx/log.py b/pytdx/log.py deleted file mode 100644 index e5dcff4..0000000 --- a/pytdx/log.py +++ /dev/null @@ -1,22 +0,0 @@ -# coding=utf-8 - -import logging -import os - -DEBUG = os.getenv("TDX_DEBUG", "") - -if DEBUG: - LOGLEVEL = logging.DEBUG -else: - LOGLEVEL = logging.INFO - -log = logging.getLogger("PYTDX") - -log.setLevel(LOGLEVEL) -ch = logging.StreamHandler() -ch.setLevel(LOGLEVEL) -# create formatter -formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') -# add formatter to ch -ch.setFormatter(formatter) -log.addHandler(ch) \ No newline at end of file diff --git a/pytdx/params.py b/pytdx/params.py deleted file mode 100644 index f786a4c..0000000 --- a/pytdx/params.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 - - -class TDXParams: - - #市场 - - MARKET_SZ = 0 # 深圳 - MARKET_SH = 1 # 上海 - - #K线种类 - # K 线种类 - # 0 - 5 分钟K 线 - # 1 - 15 分钟K 线 - # 2 - 30 分钟K 线 - # 3 - 1 小时K 线 - # 4 - 日K 线 - # 5 - 周K 线 - # 6 - 月K 线 - # 7 - 1 分钟 - # 8 - 1 分钟K 线 - # 9 - 日K 线 - # 10 - 季K 线 - # 11 - 年K 线 - - KLINE_TYPE_5MIN = 0 - KLINE_TYPE_15MIN = 1 - KLINE_TYPE_30MIN = 2 - KLINE_TYPE_1HOUR = 3 - KLINE_TYPE_DAILY = 4 - KLINE_TYPE_WEEKLY = 5 - KLINE_TYPE_MONTHLY = 6 - KLINE_TYPE_EXHQ_1MIN = 7 - KLINE_TYPE_1MIN = 8 - KLINE_TYPE_RI_K = 9 - KLINE_TYPE_3MONTH = 10 - KLINE_TYPE_YEARLY = 11 - - - # ref : https://github.com/rainx/pytdx/issues/7 - # 分笔行情最多2000条 - MAX_TRANSACTION_COUNT = 2000 - # k先数据最多800条 - MAX_KLINE_COUNT = 800 - - - # 板块相关参数 - BLOCK_SZ = "block_zs.dat" - BLOCK_FG = "block_fg.dat" - BLOCK_GN = "block_gn.dat" - BLOCK_DEFAULT = "block.dat" diff --git a/pytdx/parser/__init__.py b/pytdx/parser/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/pytdx/parser/base.py b/pytdx/parser/base.py deleted file mode 100644 index ba90234..0000000 --- a/pytdx/parser/base.py +++ /dev/null @@ -1,148 +0,0 @@ -# coding=utf-8 - -from pytdx.log import DEBUG, log -import zlib -import struct -import sys -import datetime - -try: - import cython - if cython.compiled: - def buffer(x): - return x -except ImportError: - pass - -class SocketClientNotReady(Exception): - pass - - -class SendPkgNotReady(Exception): - pass - - -class SendRequestPkgFails(Exception): - pass - - -class ResponseHeaderRecvFails(Exception): - pass - - -class ResponseRecvFails(Exception): - pass - -RSP_HEADER_LEN = 0x10 - -class BaseParser(object): - - def __init__(self, client, lock=None): - self.client = client - self.data = None - self.send_pkg = None - - self.rsp_header = None - self.rsp_body = None - self.rsp_header_len = RSP_HEADER_LEN - - if lock: - self.lock = lock - else: - self.lock = None - - def setParams(self, *args, **xargs): - """ - 构建请求 - :return: - """ - pass - - def parseResponse(self, body_buf): - pass - - def setup(self): - pass - - - def call_api(self): - if self.lock: - with self.lock: - log.debug("sending thread lock api call") - result = self._call_api() - else: - result = self._call_api() - return result - - def _call_api(self): - - self.setup() - - if not(self.client): - raise SocketClientNotReady("socket client not ready") - - if not(self.send_pkg): - raise SendPkgNotReady("send pkg not ready") - - nsended = self.client.send(self.send_pkg) - - self.client.send_pkg_num += 1 - self.client.send_pkg_bytes += nsended - self.client.last_api_send_bytes = nsended - - if self.client.first_pkg_send_time is None: - self.client.first_pkg_send_time = datetime.datetime.now() - - if DEBUG: - log.debug("send package:" + str(self.send_pkg)) - if nsended != len(self.send_pkg): - log.debug("send bytes error") - raise SendRequestPkgFails("send fails") - else: - head_buf = self.client.recv(self.rsp_header_len) - if DEBUG: - log.debug("recv head_buf:" + str(head_buf) + " |len is :" + str(len(head_buf))) - if len(head_buf) == self.rsp_header_len: - self.client.recv_pkg_num += 1 - self.client.recv_pkg_bytes += self.rsp_header_len - _, _, _, zipsize, unzipsize = struct.unpack(" 59: - second = 0 - date = datetime.datetime(year, month, day, hour, minute, second) - - if value == 0: - direction = 1 - if zengcang > 0: - if volume > zengcang: - nature_name = "多开" - elif volume == zengcang: - nature_name = "双开" - elif zengcang == 0: - nature_name = "多换" - else: - if volume == -zengcang: - nature_name = "双平" - else: - nature_name = "空平" - elif value == 1: - direction = -1 - if zengcang > 0: - if volume > zengcang: - nature_name = "空开" - elif volume == zengcang: - nature_name = "双开" - elif zengcang == 0: - nature_name = "空换" - else: - if volume == -zengcang: - nature_name = "双平" - else: - nature_name = "多平" - else: - direction = 0 - if zengcang > 0: - if volume > zengcang: - nature_name = "开仓" - elif volume == zengcang: - nature_name = "双开" - elif zengcang < 0: - if volume > -zengcang: - nature_name = "平仓" - elif volume == -zengcang: - nature_name = "双平" - else: - nature_name = "换手" - - if market in [31,48]: - if nature == 0: - direction = 1 - nature_name = 'B' - elif nature == 256: - direction = -1 - nature_name = 'S' - else: #512 - direction = 0 - nature_name = '' - - result.append(OrderedDict([ - ("date", date), - ("hour", hour), - ("minute", minute), - ("price", price), - ("volume", volume), - ("zengcang", zengcang), - ("natrue_name", nature_name), - ("nature_name", nature_name), #修正了nature_name的拼写错误(natrue), 为了保持兼容性,原有的natrue_name还会保留一段时间 - ("direction", direction), - ("nature", nature), - - ])) - - return result - - -if __name__ == '__main__': - - from pytdx.exhq import TdxExHq_API - - api = TdxExHq_API() - with api.connect('121.14.110.210', 7727): - # print(api.to_df(api.get_history_transaction_data(4, 'SR61099D', 20171025))[["date","price","volume",'zengcang','nature','t1','t2']]) - - print(api.to_df(api.get_history_transaction_data(47, 'IFL0', 20170811))) - #print(api.to_df(api.get_history_transaction_data(31, "01918", 20171026))[["date","price","volume",'zengcang','nature']]) - #api.to_df(api.get_history_transaction_data(47, 'IFL0', 20170810)).to_excel('//Users//wy//data//iflo.xlsx') \ No newline at end of file diff --git a/pytdx/parser/ex_get_instrument_bars.py b/pytdx/parser/ex_get_instrument_bars.py deleted file mode 100644 index fd45939..0000000 --- a/pytdx/parser/ex_get_instrument_bars.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding=utf-8 - -from pytdx.parser.base import BaseParser -from pytdx.helper import get_datetime, get_volume, get_price -from collections import OrderedDict -import six -import struct - -class GetInstrumentBars(BaseParser): - - # ff232f49464c30007401a9130400010000000000f000 - """ - - first: - - 0000 01 01 08 6a 01 01 16 00 16 00 ...j...... - - - second: - 0000 ff 23 2f 49 46 4c 30 00 74 01 a9 13 04 00 01 00 .#/IFL0.t....... - 0010 00 00 00 00 f0 00 ...... - - 0000 ff 23 28 42 41 42 41 00 00 00 a9 13 04 00 01 00 .#(BABA......... - 0010 00 00 00 00 f0 00 ...... - - 0000 ff 23 28 42 41 42 41 00 00 00 a9 13 03 00 01 00 .#(BABA......... - 0010 00 00 00 00 f0 00 ...... - - 0000 ff 23 08 31 30 30 30 30 38 34 33 13 04 00 01 00 .#.10000843..... - 0010 00 00 00 00 f0 00 ...... - """ - - def setup(self): - pass - #self.client.send(bytearray.fromhex('01 01 08 6a 01 01 16 00 16 00')) - - def setParams(self, category, market, code, start, count): - if type(code) is six.text_type: - code = code.encode("utf-8") - pkg = bytearray.fromhex('01 01 08 6a 01 01 16 00 16 00') - pkg.extend(bytearray.fromhex("ff 23")) - - self.category = category - - #pkg = bytearray.fromhex("ff 23") - - #count - last_value = 0x00f00000 - pkg.extend(struct.pack(' 59: - second = 0 - - date = datetime.datetime.combine(datetime.date.today(), datetime.time(hour,minute,second)) - - value = direction // 10000 - - if value == 0: - direction = 1 - if zengcang > 0: - if volume > zengcang: - nature_name = "多开" - elif volume == zengcang: - nature_name = "双开" - elif zengcang == 0: - nature_name = "多换" - else: - if volume == -zengcang: - nature_name = "双平" - else: - nature_name = "空平" - elif value == 1: - direction = -1 - if zengcang > 0: - if volume > zengcang: - nature_name = "空开" - elif volume == zengcang: - nature_name = "双开" - elif zengcang == 0: - nature_name = "空换" - else: - if volume == -zengcang: - nature_name = "双平" - else: - nature_name = "多平" - else: - direction = 0 - if zengcang > 0: - if volume > zengcang: - nature_name = "开仓" - elif volume == zengcang: - nature_name = "双开" - elif zengcang < 0: - if volume > -zengcang: - nature_name = "平仓" - elif volume == -zengcang: - nature_name = "双平" - else: - nature_name = "换手" - - if market in [31,48]: - if nature == 0: - direction = 1 - nature_name = 'B' - elif nature == 256: - direction = -1 - nature_name = 'S' - else: #512 - direction = 0 - nature_name = '' - - - result.append(OrderedDict([ - ("date", date), - ("hour", hour), - ("minute", minute), - ("second", second), - ("price", price), - ("volume", volume), - ("zengcang", zengcang), - ("nature", nature), - ("nature_mark", nature // 10000), - ("nature_value", nature % 10000), - ("nature_name", nature_name), - ("direction", direction), - ])) - - return result - - -if __name__ == "__main__": - from pytdx.exhq import TdxExHq_API - - api = TdxExHq_API() - with api.connect('121.14.110.210', 7727): - print(api.to_df(api.get_transaction_data(47, 'IFL9'))) - # print(api.to_df(api.get_transaction_data(31, "00020"))) diff --git a/pytdx/parser/ex_setup_commands.py b/pytdx/parser/ex_setup_commands.py deleted file mode 100644 index b5ec103..0000000 --- a/pytdx/parser/ex_setup_commands.py +++ /dev/null @@ -1,20 +0,0 @@ -# coding=utf-8 - -from pytdx.parser.base import BaseParser -from pytdx.helper import get_datetime, get_volume, get_price -from collections import OrderedDict -import struct - - -class ExSetupCmd1(BaseParser): - - def setup(self): - self.send_pkg = bytearray.fromhex("01 01 48 65 00 01 52 00 52 00 54 24 1f 32 c6 e5" - "d5 3d fb 41 1f 32 c6 e5 d5 3d fb 41 1f 32 c6 e5" - "d5 3d fb 41 1f 32 c6 e5 d5 3d fb 41 1f 32 c6 e5" - "d5 3d fb 41 1f 32 c6 e5 d5 3d fb 41 1f 32 c6 e5" - "d5 3d fb 41 1f 32 c6 e5 d5 3d fb 41 cc e1 6d ff" - "d5 ba 3f b8 cb c5 7a 05 4f 77 48 ea") - - def parseResponse(self, body_buf): - pass \ No newline at end of file diff --git a/pytdx/parser/get_block_info.py b/pytdx/parser/get_block_info.py deleted file mode 100644 index 7f388c5..0000000 --- a/pytdx/parser/get_block_info.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding=utf-8 - -from pytdx.parser.base import BaseParser -from pytdx.reader.block_reader import BlockReader,BlockReader_TYPE_FLAT -from pytdx.helper import get_datetime, get_volume, get_price -from collections import OrderedDict -import struct -import six - - - -class GetBlockInfoMeta(BaseParser): - def setParams(self, block_file): - if type(block_file) is six.text_type: - block_file = block_file.encode("utf-8") - pkg = bytearray.fromhex(u'0C 39 18 69 00 01 2A 00 2A 00 C5 02') - pkg.extend(struct.pack(u"<{}s".format(0x2a - 2), block_file)) - self.send_pkg = pkg - - - def parseResponse(self, body_buf): - (size, _, hash_value, _ ) = struct.unpack(u" 0: - return { - "chunksize": chunksize, - "chunkdata": body_buf[4:] - } - else: - return { - "chunksize": 0 - } - - -if __name__ == "__main__": - from pytdx.hq import TdxHq_API - api = TdxHq_API() - api.need_setup = False - # calc.tdx.com.cn, calc2.tdx.com.cn - with api.connect(ip="120.76.152.87"): - # response = api.get_report_file(r"tdxfin/gpcw19980630.zip", 386003) - content = api.get_report_file_by_size("tdxfin/gpcw.txt") - # content = api.get_report_file_by_size("tdxfin/gpcw19980630.zip", 386073) - print(content) diff --git a/pytdx/parser/get_security_bars.py b/pytdx/parser/get_security_bars.py deleted file mode 100644 index 7fdac78..0000000 --- a/pytdx/parser/get_security_bars.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding=utf-8 - - -from pytdx.parser.base import BaseParser -from pytdx.helper import get_datetime, get_volume, get_price -from collections import OrderedDict -import struct -import six - -""" -Notice:,如果一个股票当天停牌,那天的K线还是能取到,成交量为0 - - -param: category=9, market=0, stockcode=000001, start=0, count=10 -send: 0c01086401011c001c002d0500003030303030310900010000000a0000000000000000000000 -recv: b1cb74000c01086401002d05aa00aa000a006ec73301b28c011e3254a081ad4816d6984d6fc7330154ae0182024ab0a51d4978090c4e70c733015414285e8003bb488b59a64d71c73301140086015ec059274945cb154e74c73301006828724060f648ae0edc4d75c73301000a1e7c40f6da48a37dc24d76c7330100680ad0018052b748ad68a24d77c7330100680072a0f0a448f8b9914d78c733010054285ee0a48b48c294764d7bc733010aa401b8014a001def4874abd44d - -""" - -class GetSecurityBarsCmd(BaseParser): - - def setParams(self, category, market, code, start, count): - if type(code) is six.text_type: - code = code.encode("utf-8") - - self.category = category - - values = ( - 0x10c, - 0x01016408, - 0x1c, - 0x1c, - 0x052d, - market, - code, - category, - 1, - start, - count, - 0, 0, 0 # I + I + H total 10 zero - ) - - pkg = struct.pack(" 3.0 - -2434.0062499046326 ---> 2.6 - -1218.0031249523163 ---> 2.3 - -""" -""" - - 1 除权除息 002175 2008-05-29 - 2 送配股上市 000656 2015-04-29 - 3 非流通股上市 000656 2010-02-10 - 4 未知股本变动 600642 1993-07-19 - 5 股本变化 000656 2017-06-30 - 6 增发新股 600887 2002-08-20 - 7 股份回购 600619 2000-09-08 - 8 增发新股上市 600186 2001-02-14 - 9 转配股上市 600811 2017-07-25 - 10 可转债上市 600418 2006-07-07 - 11 扩缩股 600381 2014-06-27 - 12 非流通股缩股 600339 2006-04-10 - 13 送认购权证 600008 2006-04-19 - 14 送认沽权证 000932 2006-03-01 - -""" - - -XDXR_CATEGORY_MAPPING = { - 1 : "除权除息", - 2 : "送配股上市", - 3 : "非流通股上市", - 4 : "未知股本变动", - 5 : "股本变化", - 6 : "增发新股", - 7 : "股份回购", - 8 : "增发新股上市", - 9 : "转配股上市", - 10 : "可转债上市", - 11 : "扩缩股", - 12 : "非流通股缩股", - 13 : "送认购权证", - 14 : "送认沽权证" -} - - -class GetXdXrInfo(BaseParser): - - def setParams(self, market, code): - if type(code) is six.text_type: - code = code.encode("utf-8") - pkg = bytearray.fromhex(u'0c 1f 18 76 00 01 0b 00 0b 00 0f 00 01 00') - pkg.extend(struct.pack(" 33000.00000 - # b'\x00\xc0\x0fF' => 9200.00000 - # b'\x00@\x83E' => 4200.0000 - - suogu = None - panqianliutong, panhouliutong, qianzongguben, houzongguben = None, None, None, None - songzhuangu, fenhong, peigu, peigujia = None, None, None, None - fenshu, xingquanjia = None, None - if category == 1: - fenhong, peigujia, songzhuangu, peigu = struct.unpack("= self.api_call_max_retry_times: - log.info("(method_name=%s) max retry times(%d) reached" % (method_name, self.api_call_max_retry_times)) - raise TdxHqApiCallMaxRetryTimesReachedException("(method_name=%s) max retry times reached" % method_name) - old_api_ip = self.api.ip - new_api_ip = None - if self.hot_failover_api: - new_api_ip = self.hot_failover_api.ip - log.info("api call from init client (ip=%s) err, perform rotate to (ip =%s)..." %(old_api_ip, new_api_ip)) - self.api.disconnect() - self.api = self.hot_failover_api - log.info("retry times is " + str(self.api_call_max_retry_times)) - # 从池里再次获取备用ip - new_ips = self.ippool.get_ips() - - choise_ip = None - for _test_ip in new_ips: - if _test_ip[0] == old_api_ip or _test_ip[0] == new_api_ip: - continue - choise_ip = _test_ip - break - - if choise_ip: - self.hot_failover_api = self.hq_cls(multithread=True, heartbeat=True) - self.hot_failover_api.connect(*choise_ip) - else: - self.hot_failover_api = None - # 阻塞0.2秒,然后递归调用自己 - time.sleep(self.api_retry_interval) - result = self.do_hq_api_call(method_name, *args, **kwargs) - self.api_call_retry_times += 1 - - else: - self.api_call_retry_times = 0 - - return result - - def connect(self, ipandport, hot_failover_ipandport): - log.debug("setup ip pool") - self.ippool.setup() - log.debug("connecting to primary api") - self.api.connect(*ipandport) - log.debug("connecting to hot backup api") - self.hot_failover_api.connect(*hot_failover_ipandport) - return self - - def disconnect(self): - log.debug("primary api disconnected") - self.api.disconnect() - log.debug("hot backup api disconnected") - self.hot_failover_api.disconnect() - log.debug("ip pool released") - self.ippool.teardown() - - def close(self): - """ - disconnect的别名,为了支持 with closing(obj): 语法 - :return: - """ - self.disconnect() - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_val, exc_tb): - self.close() - - -if __name__ == '__main__': - - from pytdx.hq import TdxHq_API - from pytdx.pool.ippool import AvailableIPPool - from pytdx.config.hosts import hq_hosts - import random - import logging - import pprint - log.setLevel(logging.DEBUG) - ch = logging.StreamHandler() - ch.setLevel(logging.DEBUG) - # create formatter - formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') - # add formatter to ch - ch.setFormatter(formatter) - log.addHandler(ch) - - ips = [(v[1], v[2]) for v in hq_hosts] - - # 获取5个随机ip作为ip池 - random.shuffle(ips) - ips5 = ips[:5] - - ippool = AvailableIPPool(TdxHq_API, ips5) - - primary_ip, hot_backup_ip = ippool.sync_get_top_n(2) - - print("make pool api") - api = TdxHqPool_API(TdxHq_API, ippool) - print("make pool api done") - print("send api call to primary ip %s, %s" % (str(primary_ip), str(hot_backup_ip))) - with api.connect(primary_ip, hot_backup_ip): - ret = api.get_xdxr_info(0, '000001') - print("send api call done") - pprint.pprint(ret) - - - diff --git a/pytdx/pool/ippool.py b/pytdx/pool/ippool.py deleted file mode 100644 index c012674..0000000 --- a/pytdx/pool/ippool.py +++ /dev/null @@ -1,164 +0,0 @@ -#utf-8 - -import random -import threading -from functools import partial -from pytdx.log import DEBUG, log -import time -from collections import OrderedDict - -""" -ips 应该还是一个 (ip ,port) 对的列表,如 - -[ - (ip1, port1), - (ip2, port2), - (ip3, port3), -] - -""" - -class BaseIPPool(object): - - def __init__(self, hq_class): - self.hq_class = hq_class - - def setup(self): - pass - - def teardown(self): - pass - - def sync_get_top_n(self, num): - pass - - def add_to_pool(self, ip): - pass - - -class RandomIPPool(BaseIPPool): - """ - 获取一个随机的优先级列表 - """ - - def __init__(self, hq_class, ips): - """ - :param ips: ip should be a list - """ - super(RandomIPPool, self).__init__(hq_class) - self.ips = ips - - def get_ips(self): - random.shuffle(self.ips) - return self.ips - - def sync_get_top_n(self, num): - ips= self.get_ips() - return ips[:num] - - def add_to_pool(self, ip): - if ip not in self.ips: - self.ips.append(ip) - - -class AvailableIPPool(BaseIPPool): - """ - 测试可连接性,并根据连接速度排序 - 我们启动一个新的线程,周期性的进行更新 - """ - - def __init__(self, hq_class, ips): - super(AvailableIPPool, self).__init__(hq_class) - self.ips = ips - self.sorted_ips = None - self.worker_thread = None - self.sorted_ips_lock = threading.Lock() - self.stop_event = threading.Event() - self.wait_interval = 20 * 60 - - def setup(self): - super(AvailableIPPool, self).setup() - - self.worker_thread = threading.Thread(target=self.run) - self.worker_thread.start() - - def get_ips(self): - if not self.sorted_ips: - return self.ips - else: - return list(self.sorted_ips.values()) - - def teardown(self): - self.stop_event.set() - if self.worker_thread.is_alive(): - self.worker_thread.join() - self.worker_thread = None - - def run(self): - log.debug("pool thread start ") - while not self.stop_event.is_set(): - _available_ips = self.get_all_available_ips() - sorted_keys = sorted(_available_ips) - with self.sorted_ips_lock: - self.sorted_ips = OrderedDict((key, _available_ips[key]) for key in sorted_keys) - self.stop_event.wait(self.wait_interval) - - def get_all_available_ips(self): - """ - 循环测试所有连接的连接速度和有效性 - :return: - """ - _available_ips = OrderedDict() - for ip in self.ips: - ip_addr, port = ip - api = self.hq_class(multithread=False, heartbeat=False) - try: - with api.connect(ip_addr, port): - start_ts = time.time() - api.do_heartbeat() - end_ts = time.time() - diff_ts = end_ts - start_ts - _available_ips[diff_ts] = ip - log.debug("time diff is %f for %s" % (diff_ts, _available_ips)) - except Exception as e: - log.debug("can not use %s:%d the exception is %s" % (ip_addr, port, str(e))) - continue - return _available_ips - - def sync_get_top_n(self, num): - _ips = list(self.get_all_available_ips().values()) - return _ips[:min(len(_ips), num)] - - def add_to_pool(self, ip): - if ip not in self.ips: - self.ips.append(ip) - - -if __name__ == "__main__": - from pytdx.hq import TdxHq_API - from pytdx.config.hosts import hq_hosts - import logging - log.setLevel(logging.DEBUG) - ch = logging.StreamHandler() - ch.setLevel(logging.DEBUG) - # create formatter - formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') - # add formatter to ch - ch.setFormatter(formatter) - log.addHandler(ch) - - ips = [(v[1], v[2]) for v in hq_hosts] - pool = AvailableIPPool(TdxHq_API, ips) - pool.wait_interval = 60 * 5 - pool.setup() - sleep_time = 130 - log.debug("ready to sleep %d" % sleep_time ) - time.sleep(sleep_time) - log.debug("sleep done") - ips = pool.get_ips() - log.debug(str(pool.get_ips())) - log.debug("ready to teardown") - pool.teardown() - - - diff --git a/pytdx/reader/__init__.py b/pytdx/reader/__init__.py deleted file mode 100644 index 17a8746..0000000 --- a/pytdx/reader/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -from pytdx.reader.daily_bar_reader import TdxDailyBarReader, TdxFileNotFoundException, TdxNotAssignVipdocPathException -from pytdx.reader.min_bar_reader import TdxMinBarReader -from pytdx.reader.lc_min_bar_reader import TdxLCMinBarReader -from pytdx.reader.exhq_daily_bar_reader import TdxExHqDailyBarReader -from pytdx.reader.gbbq_reader import GbbqReader -from pytdx.reader.block_reader import BlockReader -from pytdx.reader.block_reader import CustomerBlockReader -from pytdx.reader.history_financial_reader import HistoryFinancialReader - -__all__ = [ - 'TdxDailyBarReader', - 'TdxFileNotFoundException', - 'TdxNotAssignVipdocPathException', - 'TdxMinBarReader', - 'TdxLCMinBarReader', - 'TdxExHqDailyBarReader', - 'GbbqReader', - 'BlockReader', - 'CustomerBlockReader', - 'HistoryFinancialReader' -] \ No newline at end of file diff --git a/pytdx/reader/base_reader.py b/pytdx/reader/base_reader.py deleted file mode 100644 index cb200ec..0000000 --- a/pytdx/reader/base_reader.py +++ /dev/null @@ -1,21 +0,0 @@ -#coding=utf-8 -from __future__ import unicode_literals, division -import struct - - -class TdxFileNotFoundException(Exception): - pass - -class TdxNotAssignVipdocPathException(Exception): - pass - - -class BaseReader(object): - - def unpack_records(self, format, data): - record_struct = struct.Struct(format) - return (record_struct.unpack_from(data, offset) - for offset in range(0, len(data), record_struct.size)) - - def get_df(self, code_or_file, exchange=None): - raise NotImplementedError('not yet') \ No newline at end of file diff --git a/pytdx/reader/block_reader.py b/pytdx/reader/block_reader.py deleted file mode 100644 index 81f14d6..0000000 --- a/pytdx/reader/block_reader.py +++ /dev/null @@ -1,149 +0,0 @@ -#coding: utf-8 -import struct -from pytdx.reader.base_reader import BaseReader -from collections import OrderedDict -import pandas as pd -import os -from io import BytesIO - -""" -参考这个 http://blog.csdn.net/Metal1/article/details/44352639 - -""" - -BlockReader_TYPE_FLAT = 0 -BlockReader_TYPE_GROUP = 1 - -class BlockReader(BaseReader): - - def get_df(self, fname, result_type=BlockReader_TYPE_FLAT): - result = self.get_data(fname, result_type) - return pd.DataFrame(result) - - def get_data(self, fname, result_type=BlockReader_TYPE_FLAT): - - result = [] - - if type(fname) is not bytearray: - with open(fname, "rb") as f: - data = f.read() - else: - data = fname - - pos = 384 - (num, ) = struct.unpack("PyMem_Malloc(1 * filesize) - fread(encrypt_data, 1, filesize, f) - fclose(f) - - pos = 0 - (count, ) = struct.unpack("> 16 - (eax, ) = struct.unpack("> 24 - (eax_add, ) = struct.unpack("> 8 - (eax_xor, ) = struct.unpack("> 16 - (eax, ) = struct.unpack("> 24 - (eax_add, ) = struct.unpack("> 8 - (eax_xor, ) = struct.unpack(" 0: - source = source + b'\x00' * need_to_padding - enc_data = encrypter.update(source) + encrypter.finalize() - b64_enc_data = base64.encodebytes(enc_data) - return urllib.parse.quote(b64_enc_data) - - def decrypt(self, source): - decrypter = self._cipher.decryptor() - source = urllib.parse.unquote(source) - source = base64.decodebytes(source.encode("utf-8")) - data_bytes = decrypter.update(source) + decrypter.finalize() - return data_bytes.rstrip(b"\x00").decode(self._encoding) - - def data_to_df(self, result): - if 'data' in result: - data = result['data'] - return pd.DataFrame(data=data) - - #------ functions - - def ping(self): - - return self.call("ping", {}) - - def logon(self, ip, port, version, yyb_id, account_id, trade_account, jy_passwrod, tx_password): - return self.call("logon",{ - "ip": ip, - "port": port, - "version": version, - "yyb_id": yyb_id, - "account_no": account_id, - "trade_account": trade_account, - "jy_password": jy_passwrod, - "tx_password": tx_password - }) - - def logoff(self, client_id): - return self.call("logoff", { - "client_id": client_id - }) - - def query_data(self, client_id, category): - return self.call("query_data", { - "client_id": client_id, - "category": category - }) - - def send_order(self, client_id, category, price_type, gddm, zqdm, price, quantity): - return self.call("send_order", { - 'client_id': client_id, - 'category': category, - 'price_type': price_type, - 'gddm': gddm, - 'zqdm': zqdm, - 'price': price, - 'quantity': quantity - }) - - def cancel_order(self, client_id, exchange_id, hth): - return self.call("cancel_order", { - 'client_id': client_id, - 'exchange_id': exchange_id, - 'hth': hth - }) - - def get_quote(self, client_id, code): - return self.call("get_quote", { - 'client_id': client_id, - 'code': code, - }) - - def repay(self, client_id, amount): - return self.call("repay", { - 'client_id': client_id, - 'amount': amount - }) - - def query_history_data(self, client_id, category, begin_date, end_date): - return self.call('query_history_data', { - 'client_id': client_id, - 'category': category, - 'begin_date': begin_date, - 'end_date': end_date - }) - - def query_datas(self, client_id, categories): - return self.call('query_datas', { - 'client_id': client_id, - 'categories': categories - }) - - def get_quotes(self, client_id, codes): - return self.call("get_quotes", { - 'client_id': client_id, - 'zqdms': codes - }) - - def send_orders(self, client_id, orders): - """ - 发送订单 - :param client_id: - :param orders: - 格式 - [ - { - "category": xx, - "price_type" :xx, - "price": xx, - "gddm": xx, - "zqdm": xx, - "quantity": xx, - }, - { - .... - }, - { - .... - } - ] - - :return: - """ - return self.call("send_orders", { - 'client_id': client_id, - "orders": orders - }) - - def cancel_orders(self, client_id, orders): - """ - 撤销订单 - :param client_id: - :param orders: - 格式 - [ - { - "exchange_id": xx, - "hth": xx - }, - { - .... - }, - { - .... - } - ] - - :return: - """ - return self.call("cancel_orders", { - 'client_id': client_id, - "orders": orders - }) - - def get_active_clients(self): - return self.call(func="get_active_clients") - -if __name__ == "__main__": - import os - #api = TdxTradeApi(endpoint="http://10.11.5.215:10092/api", enc_key=b"4f1cf3fec4c84c84", enc_iv=b"0c78abc083b011e7") - api = TdxTradeApi(endpoint="http://10.11.5.215:10092/api") - print("---Ping---") - result = api.ping() - print(result) - - print("---登入---") - acc = os.getenv("TDX_ACCOUNT", "") - password = os.getenv("TDX_PASS", "") - result = api.logon("202.108.253.186", 7708, - "8.23", 32, - acc, acc, password, "") - - print(result) - - if result["success"]: - client_id = result["data"]["client_id"] - - for i in (0,1,2,3,4,5,6,7,8,12,13,14,15): - print("---查询信息 cate=%d--" % i) - print(api.data_to_df(api.query_data(client_id, i))) - - - print("---查询报价---") - print(api.data_to_df(api.get_quote(client_id, '600315'))) - - print("---批量查询报价---") - print(api.data_to_df(api.get_quotes(client_id, ['600315', '000001']))) - - print("---批量查询信息") - print(api.data_to_df(api.query_datas(client_id, [0,1,2]))) - - print("---登出---") - print(api.logoff(client_id)) - - - - - diff --git a/pytdx/util/__init__.py b/pytdx/util/__init__.py deleted file mode 100644 index 71e2a48..0000000 --- a/pytdx/util/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -#coding:utf-8 - - -from .trade_date import trade_date_sse -from .date_util import get_real_trade_date -#from pytdx.util.best_ip import select_best_ip, ping -# comment to avoid recycle ref \ No newline at end of file diff --git a/pytdx/util/best_ip.py b/pytdx/util/best_ip.py deleted file mode 100644 index b7be6ef..0000000 --- a/pytdx/util/best_ip.py +++ /dev/null @@ -1,166 +0,0 @@ -#coding: utf-8 -# see https://github.com/rainx/pytdx/issues/38 IP寻优的简单办法 -# by yutianst - -import datetime -from pytdx.hq import TdxHq_API -from pytdx.exhq import TdxExHq_API - -stock_ip = [{'ip': '106.120.74.86', 'port': 7711, 'name': '北京行情主站1'}, - {'ip': '113.105.73.88', 'port': 7709, 'name': '深圳行情主站'}, - {'ip': '113.105.73.88', 'port': 7711, 'name': '深圳行情主站'}, - {'ip': '114.80.80.222', 'port': 7711, 'name': '上海行情主站'}, - {'ip': '117.184.140.156', 'port': 7711, 'name': '移动行情主站'}, - {'ip': '119.147.171.206', 'port': 443, 'name': '广州行情主站'}, - {'ip': '119.147.171.206', 'port': 80, 'name': '广州行情主站'}, - {'ip': '218.108.50.178', 'port': 7711, 'name': '杭州行情主站'}, - {'ip': '221.194.181.176', 'port': 7711, 'name': '北京行情主站2'}, - {'ip': '106.120.74.86', 'port': 7709}, - {'ip': '112.95.140.74', 'port': 7709}, - {'ip': '112.95.140.92', 'port': 7709}, - {'ip': '112.95.140.93', 'port': 7709}, - {'ip': '113.05.73.88', 'port': 7709}, - {'ip': '114.67.61.70', 'port': 7709}, - {'ip': '114.80.149.19', 'port': 7709}, - {'ip': '114.80.149.22', 'port': 7709}, - {'ip': '114.80.149.84', 'port': 7709}, - {'ip': '114.80.80.222', 'port': 7709}, - {'ip': '115.238.56.198', 'port': 7709}, - {'ip': '115.238.90.165', 'port': 7709}, - {'ip': '117.184.140.156', 'port': 7709}, - {'ip': '119.147.164.60', 'port': 7709}, - {'ip': '119.147.171.206', 'port': 7709}, - {'ip': '119.29.51.30', 'port': 7709}, - {'ip': '121.14.104.70', 'port': 7709}, - {'ip': '121.14.104.72', 'port': 7709}, - {'ip': '121.14.110.194', 'port': 7709}, - {'ip': '121.14.2.7', 'port': 7709}, - {'ip': '123.125.108.23', 'port': 7709}, - {'ip': '123.125.108.24', 'port': 7709}, - {'ip': '124.160.88.183', 'port': 7709}, - {'ip': '180.153.18.17', 'port': 7709}, - {'ip': '180.153.18.170', 'port': 7709}, - {'ip': '180.153.18.171', 'port': 7709}, - {'ip': '180.153.39.51', 'port': 7709}, - {'ip': '218.108.47.69', 'port': 7709}, - {'ip': '218.108.50.178', 'port': 7709}, - {'ip': '218.108.98.244', 'port': 7709}, - {'ip': '218.75.126.9', 'port': 7709}, - {'ip': '218.9.148.108', 'port': 7709}, - {'ip': '221.194.181.176', 'port': 7709}, - {'ip': '59.173.18.69', 'port': 7709}, - {'ip': '60.12.136.250', 'port': 7709}, - {'ip': '60.191.117.167', 'port': 7709}, - {'ip': '60.28.29.69', 'port': 7709}, - {'ip': '61.135.142.73', 'port': 7709}, - {'ip': '61.135.142.88', 'port': 7709}, - {'ip': '61.152.107.168', 'port': 7721}, - {'ip': '61.152.249.56', 'port': 7709}, - {'ip': '61.153.144.179', 'port': 7709}, - {'ip': '61.153.209.138', 'port': 7709}, - {'ip': '61.153.209.139', 'port': 7709}, - {'ip': 'hq.cjis.cn', 'port': 7709}, - {'ip': 'hq1.daton.com.cn', 'port': 7709}, - {'ip': 'jstdx.gtjas.com', 'port': 7709}, - {'ip': 'shtdx.gtjas.com', 'port': 7709}, - {'ip': 'sztdx.gtjas.com', 'port': 7709}, - {'ip': '113.105.142.162', 'port': 7721}, - {'ip': '23.129.245.199', 'port': 7721}] - -future_ip = [{'ip': '106.14.95.149', 'port': 7727, 'name': '扩展市场上海双线'}, - {'ip': '112.74.214.43', 'port': 7727, 'name': '扩展市场深圳双线1'}, - {'ip': '119.147.86.171', 'port': 7727, 'name': '扩展市场深圳主站'}, - {'ip': '119.97.185.5', 'port': 7727, 'name': '扩展市场武汉主站1'}, - {'ip': '120.24.0.77', 'port': 7727, 'name': '扩展市场深圳双线2'}, - {'ip': '124.74.236.94', 'port': 7721}, - {'ip': '202.103.36.71', 'port': 443, 'name': '扩展市场武汉主站2'}, - {'ip': '47.92.127.181', 'port': 7727, 'name': '扩展市场北京主站'}, - {'ip': '59.175.238.38', 'port': 7727, 'name': '扩展市场武汉主站3'}, - {'ip': '61.152.107.141', 'port': 7727, 'name': '扩展市场上海主站1'}, - {'ip': '61.152.107.171', 'port': 7727, 'name': '扩展市场上海主站2'}, - {'ip': '119.147.86.171', 'port': 7721, 'name': '扩展市场深圳主站'}, - {'ip': '47.107.75.159', 'port': 7727, 'name': '扩展市场深圳双线3'}] - -def ping(ip, port=7709, type_='stock'): - api = TdxHq_API() - apix = TdxExHq_API() - __time1 = datetime.datetime.now() - try: - if type_ in ['stock']: - with api.connect(ip, port, time_out=0.7): - res = api.get_security_list(0, 1) - #print(len(res)) - if res is not None: - if len(res) > 800: - print('GOOD RESPONSE {}'.format(ip)) - return datetime.datetime.now() - __time1 - else: - print('BAD RESPONSE {}'.format(ip)) - return datetime.timedelta(9, 9, 0) - else: - - print('BAD RESPONSE {}'.format(ip)) - return datetime.timedelta(9, 9, 0) - elif type_ in ['future']: - with apix.connect(ip, port, time_out=0.7): - res = apix.get_instrument_count() - if res is not None: - if res > 20000: - print('GOOD RESPONSE {}'.format(ip)) - return datetime.datetime.now() - __time1 - else: - print('️Bad FUTUREIP REPSONSE {}'.format(ip)) - return datetime.timedelta(9, 9, 0) - else: - print('️Bad FUTUREIP REPSONSE {}'.format(ip)) - return datetime.timedelta(9, 9, 0) - except Exception as e: - if isinstance(e, TypeError): - print(e) - print('Tushare内置的pytdx版本和最新的pytdx 版本不同, 请重新安装pytdx以解决此问题') - print('pip uninstall pytdx') - print('pip install pytdx') - - else: - print('BAD RESPONSE {}'.format(ip)) - return datetime.timedelta(9, 9, 0) - - - -def select_best_ip(_type='stock'): - """目前这里给的是单线程的选优, 如果需要多进程的选优/ 最优ip缓存 可以参考 - https://github.com/QUANTAXIS/QUANTAXIS/blob/master/QUANTAXIS/QAFetch/QATdx.py#L106 - - - Keyword Arguments: - _type {str} -- [description] (default: {'stock'}) - - Returns: - [type] -- [description] - """ - best_ip = { - 'stock': { - 'ip': None, 'port': None - }, - 'future': { - 'ip': None, 'port': None - } - } - ip_list = stock_ip if _type== 'stock' else future_ip - - data = [ping(x['ip'], x['port'], _type) for x in ip_list] - results = [] - for i in range(len(data)): - # 删除ping不通的数据 - if data[i] < datetime.timedelta(0, 9, 0): - results.append((data[i], ip_list[i])) - # 按照ping值从小大大排序 - results = [x[1] for x in sorted(results, key=lambda x: x[0])] - - return results[0] - -if __name__ == '__main__': - ip = select_best_ip('stock') - print(ip) - ip = select_best_ip('future') - print(ip) \ No newline at end of file diff --git a/pytdx/util/date_util.py b/pytdx/util/date_util.py deleted file mode 100644 index c58e498..0000000 --- a/pytdx/util/date_util.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding:utf-8 -from .trade_date import trade_date_sse - -import datetime - - -def get_real_trade_date(date, towards): - """ - 获取真实的交易日期,其中,第三个参数towards是表示向前/向后推 - towards=1 日期向后迭代 - towards=-1 日期向前迭代 - @yutiansut - """ - if towards == 1: - while date not in trade_date_sse: - date = str(datetime.datetime.strptime( - date, '%Y-%m-%d') + datetime.timedelta(days=1))[0:10] - else: - return date - elif towards == -1: - while date not in trade_date_sse: - date = str(datetime.datetime.strptime( - date, '%Y-%m-%d') - datetime.timedelta(days=1))[0:10] - else: - return date diff --git a/pytdx/util/trade_date.py b/pytdx/util/trade_date.py deleted file mode 100644 index 842b841..0000000 --- a/pytdx/util/trade_date.py +++ /dev/null @@ -1,247 +0,0 @@ -#coding:utf-8 -trade_date_sse = ['1990-12-19', '1990-12-20', '1990-12-21', '1990-12-24', '1990-12-25', '1990-12-26', '1990-12-27', '1990-12-28', '1990-12-31', '1991-01-02', '1991-01-03', '1991-01-04', '1991-01-07', '1991-01-08', '1991-01-09', '1991-01-10', '1991-01-11', '1991-01-14', '1991-01-15', '1991-01-16', '1991-01-17', '1991-01-18', '1991-01-21', '1991-01-22', '1991-01-23', '1991-01-24', '1991-01-25', '1991-01-28', '1991-01-29', '1991-01-30', '1991-01-31', '1991-02-01', '1991-02-04', '1991-02-05', '1991-02-06', '1991-02-07', '1991-02-08', '1991-02-11', '1991-02-12', '1991-02-13', '1991-02-14', '1991-02-19', '1991-02-20', '1991-02-21', '1991-02-22', '1991-02-25', '1991-02-26', '1991-02-27', '1991-02-28', '1991-03-01', '1991-03-04', '1991-03-05', '1991-03-06', '1991-03-07', '1991-03-08', '1991-03-11', '1991-03-12', '1991-03-13', '1991-03-14', '1991-03-15', '1991-03-18', '1991-03-19', '1991-03-20', '1991-03-21', '1991-03-22', '1991-03-25', '1991-03-26', '1991-03-27', '1991-03-28', '1991-03-29', '1991-04-01', '1991-04-02', '1991-04-03', '1991-04-04', '1991-04-05', '1991-04-08', '1991-04-09', '1991-04-10', '1991-04-11', '1991-04-12', '1991-04-15', '1991-04-16', '1991-04-17', '1991-04-18', '1991-04-19', '1991-04-22', '1991-04-23', '1991-04-24', '1991-04-25', '1991-04-26', '1991-04-29', '1991-04-30', '1991-05-02', '1991-05-03', '1991-05-06', '1991-05-07', '1991-05-08', '1991-05-09', '1991-05-10', '1991-05-13', '1991-05-14', '1991-05-15', '1991-05-16', '1991-05-17', '1991-05-20', '1991-05-21', '1991-05-22', '1991-05-23', '1991-05-24', '1991-05-27', '1991-05-28', '1991-05-29', '1991-05-30', '1991-05-31', '1991-06-03', '1991-06-04', '1991-06-05', '1991-06-06', '1991-06-07', '1991-06-10', '1991-06-11', '1991-06-12', '1991-06-13', '1991-06-14', '1991-06-17', '1991-06-18', '1991-06-19', '1991-06-20', '1991-06-21', '1991-06-24', '1991-06-25', '1991-06-26', '1991-06-27', '1991-06-28', '1991-07-01', '1991-07-02', '1991-07-03', '1991-07-04', '1991-07-05', '1991-07-08', '1991-07-09', '1991-07-10', '1991-07-11', '1991-07-12', '1991-07-15', '1991-07-16', '1991-07-17', '1991-07-18', '1991-07-19', '1991-07-22', '1991-07-23', '1991-07-24', '1991-07-25', '1991-07-26', '1991-07-29', '1991-07-30', '1991-07-31', '1991-08-01', '1991-08-02', '1991-08-05', '1991-08-06', '1991-08-07', '1991-08-08', '1991-08-09', '1991-08-12', '1991-08-13', '1991-08-14', '1991-08-15', '1991-08-16', '1991-08-19', '1991-08-20', '1991-08-21', '1991-08-22', '1991-08-23', '1991-08-26', '1991-08-27', '1991-08-28', '1991-08-29', '1991-08-30', '1991-09-02', '1991-09-03', '1991-09-04', '1991-09-05', '1991-09-06', '1991-09-09', '1991-09-10', '1991-09-11', '1991-09-12', '1991-09-13', '1991-09-16', '1991-09-17', '1991-09-18', '1991-09-19', '1991-09-20', '1991-09-23', '1991-09-24', '1991-09-25', '1991-09-26', '1991-09-27', '1991-09-30', '1991-10-03', '1991-10-04', '1991-10-07', '1991-10-08', '1991-10-09', '1991-10-10', '1991-10-11', '1991-10-14', '1991-10-15', '1991-10-16', '1991-10-17', '1991-10-18', '1991-10-21', '1991-10-22', '1991-10-23', '1991-10-24', '1991-10-25', '1991-10-28', '1991-10-29', '1991-10-30', '1991-10-31', '1991-11-01', '1991-11-04', '1991-11-05', '1991-11-06', '1991-11-07', '1991-11-08', '1991-11-11', '1991-11-12', '1991-11-13', '1991-11-14', '1991-11-15', '1991-11-18', '1991-11-19', '1991-11-20', '1991-11-21', '1991-11-22', '1991-11-25', '1991-11-26', '1991-11-27', '1991-11-28', '1991-11-29', '1991-12-02', '1991-12-03', '1991-12-04', '1991-12-05', '1991-12-06', '1991-12-09', '1991-12-10', '1991-12-11', '1991-12-12', '1991-12-13', '1991-12-16', '1991-12-17', '1991-12-18', '1991-12-19', '1991-12-20', '1991-12-23', '1991-12-24', '1991-12-25', '1991-12-26', '1991-12-27', '1991-12-30', '1991-12-31', '1992-01-02', '1992-01-03', '1992-01-06', '1992-01-07', '1992-01-08', '1992-01-09', '1992-01-10', '1992-01-13', '1992-01-14', '1992-01-15', '1992-01-16', '1992-01-17', '1992-01-20', '1992-01-21', '1992-01-22', '1992-01-23', '1992-01-24', '1992-01-27', '1992-01-28', '1992-01-29', '1992-01-30', '1992-01-31', '1992-02-03', '1992-02-07', '1992-02-10', '1992-02-11', '1992-02-12', '1992-02-13', '1992-02-14', '1992-02-17', '1992-02-18', '1992-02-19', '1992-02-20', '1992-02-21', '1992-02-24', '1992-02-25', '1992-02-26', '1992-02-27', '1992-02-28', '1992-03-02', '1992-03-03', '1992-03-04', '1992-03-05', '1992-03-06', '1992-03-09', '1992-03-10', '1992-03-11', '1992-03-12', '1992-03-13', '1992-03-16', '1992-03-17', '1992-03-18', '1992-03-19', '1992-03-20', '1992-03-23', '1992-03-24', '1992-03-25', '1992-03-26', '1992-03-27', '1992-03-30', '1992-03-31', '1992-04-01', '1992-04-02', '1992-04-03', '1992-04-06', '1992-04-07', '1992-04-08', '1992-04-09', '1992-04-10', '1992-04-13', '1992-04-14', '1992-04-15', '1992-04-16', '1992-04-17', '1992-04-20', '1992-04-21', '1992-04-22', '1992-04-23', '1992-04-24', '1992-04-27', '1992-04-28', '1992-04-29', '1992-04-30', '1992-05-04', '1992-05-05', '1992-05-06', '1992-05-07', '1992-05-08', '1992-05-11', '1992-05-12', '1992-05-13', '1992-05-14', '1992-05-15', '1992-05-18', '1992-05-19', '1992-05-20', '1992-05-21', '1992-05-22', '1992-05-25', '1992-05-26', '1992-05-27', '1992-05-28', '1992-05-29', '1992-06-01', '1992-06-02', '1992-06-03', '1992-06-04', '1992-06-05', '1992-06-08', '1992-06-09', '1992-06-10', '1992-06-11', '1992-06-12', '1992-06-15', '1992-06-16', '1992-06-17', '1992-06-18', '1992-06-19', '1992-06-22', '1992-06-23', '1992-06-24', '1992-06-25', '1992-06-26', '1992-06-29', '1992-06-30', '1992-07-01', '1992-07-02', '1992-07-03', '1992-07-06', '1992-07-07', '1992-07-08', '1992-07-09', '1992-07-10', '1992-07-13', '1992-07-14', '1992-07-15', '1992-07-16', '1992-07-17', '1992-07-20', '1992-07-21', '1992-07-22', '1992-07-23', '1992-07-24', '1992-07-27', '1992-07-28', '1992-07-29', '1992-07-30', '1992-07-31', '1992-08-03', '1992-08-04', '1992-08-05', '1992-08-06', '1992-08-07', '1992-08-10', '1992-08-11', '1992-08-12', '1992-08-13', '1992-08-14', '1992-08-17', '1992-08-18', '1992-08-19', '1992-08-20', '1992-08-21', '1992-08-24', '1992-08-25', '1992-08-26', '1992-08-27', '1992-08-28', '1992-08-31', '1992-09-01', '1992-09-02', '1992-09-03', '1992-09-04', '1992-09-07', '1992-09-08', '1992-09-09', '1992-09-10', '1992-09-11', '1992-09-14', '1992-09-15', '1992-09-16', '1992-09-17', '1992-09-18', '1992-09-21', '1992-09-22', '1992-09-23', '1992-09-24', '1992-09-25', '1992-09-28', '1992-09-29', '1992-09-30', '1992-10-05', '1992-10-06', '1992-10-07', '1992-10-08', '1992-10-09', '1992-10-12', '1992-10-13', '1992-10-14', '1992-10-15', '1992-10-16', '1992-10-19', '1992-10-20', '1992-10-21', '1992-10-22', '1992-10-23', '1992-10-26', '1992-10-27', '1992-10-28', '1992-10-29', '1992-10-30', '1992-11-02', '1992-11-03', '1992-11-04', '1992-11-05', '1992-11-06', '1992-11-09', '1992-11-10', '1992-11-11', '1992-11-12', '1992-11-13', '1992-11-16', '1992-11-17', '1992-11-18', '1992-11-19', '1992-11-20', '1992-11-23', '1992-11-24', '1992-11-25', '1992-11-26', '1992-11-27', '1992-11-30', '1992-12-01', '1992-12-02', '1992-12-03', '1992-12-04', '1992-12-07', '1992-12-08', '1992-12-09', '1992-12-10', '1992-12-11', '1992-12-14', '1992-12-15', '1992-12-16', '1992-12-17', '1992-12-18', '1992-12-21', '1992-12-22', '1992-12-23', '1992-12-24', '1992-12-25', '1992-12-28', '1992-12-29', '1992-12-30', '1992-12-31', '1993-01-04', '1993-01-05', '1993-01-06', '1993-01-07', '1993-01-08', '1993-01-11', '1993-01-12', '1993-01-13', '1993-01-14', '1993-01-15', '1993-01-18', '1993-01-19', '1993-01-20', '1993-01-21', '1993-01-22', '1993-01-27', '1993-01-28', '1993-01-29', '1993-02-01', '1993-02-02', '1993-02-03', '1993-02-04', '1993-02-05', '1993-02-08', '1993-02-09', '1993-02-10', '1993-02-11', '1993-02-12', '1993-02-15', '1993-02-16', '1993-02-17', '1993-02-18', '1993-02-19', '1993-02-22', '1993-02-23', '1993-02-24', '1993-02-25', '1993-02-26', '1993-03-01', '1993-03-02', '1993-03-03', '1993-03-04', '1993-03-05', '1993-03-08', '1993-03-09', '1993-03-10', '1993-03-11', '1993-03-12', '1993-03-15', '1993-03-16', '1993-03-17', '1993-03-18', '1993-03-19', '1993-03-22', '1993-03-23', '1993-03-24', '1993-03-25', '1993-03-26', '1993-03-29', '1993-03-30', '1993-03-31', '1993-04-01', '1993-04-02', '1993-04-05', '1993-04-06', '1993-04-07', '1993-04-08', '1993-04-09', '1993-04-12', '1993-04-13', '1993-04-14', '1993-04-15', '1993-04-16', '1993-04-19', '1993-04-20', '1993-04-21', '1993-04-22', '1993-04-23', '1993-04-26', '1993-04-27', '1993-04-28', '1993-04-29', '1993-04-30', '1993-05-03', '1993-05-04', '1993-05-05', '1993-05-06', '1993-05-07', '1993-05-10', '1993-05-11', '1993-05-12', '1993-05-13', '1993-05-14', '1993-05-17', '1993-05-18', '1993-05-19', '1993-05-20', '1993-05-21', '1993-05-24', '1993-05-25', '1993-05-26', '1993-05-27', '1993-05-28', '1993-05-31', '1993-06-01', '1993-06-02', '1993-06-03', '1993-06-04', '1993-06-07', '1993-06-08', '1993-06-09', '1993-06-10', '1993-06-11', '1993-06-14', '1993-06-15', '1993-06-16', '1993-06-17', '1993-06-18', '1993-06-21', '1993-06-22', '1993-06-23', '1993-06-24', '1993-06-25', '1993-06-28', '1993-06-29', '1993-06-30', '1993-07-01', '1993-07-02', '1993-07-05', '1993-07-06', '1993-07-07', '1993-07-08', '1993-07-09', '1993-07-12', '1993-07-13', '1993-07-14', '1993-07-15', '1993-07-16', '1993-07-19', '1993-07-20', '1993-07-21', '1993-07-22', '1993-07-23', '1993-07-26', '1993-07-27', '1993-07-28', '1993-07-29', '1993-07-30', '1993-08-02', '1993-08-03', '1993-08-04', '1993-08-05', '1993-08-06', '1993-08-09', '1993-08-10', '1993-08-11', '1993-08-12', '1993-08-13', '1993-08-16', '1993-08-17', '1993-08-18', '1993-08-19', '1993-08-20', '1993-08-23', '1993-08-24', '1993-08-25', '1993-08-26', '1993-08-27', '1993-08-30', '1993-08-31', '1993-09-01', '1993-09-02', '1993-09-03', '1993-09-06', '1993-09-07', '1993-09-08', '1993-09-09', '1993-09-10', '1993-09-13', '1993-09-14', '1993-09-15', '1993-09-16', '1993-09-17', '1993-09-20', '1993-09-21', '1993-09-22', '1993-09-23', '1993-09-24', '1993-09-27', '1993-09-28', '1993-09-29', '1993-09-30', '1993-10-04', '1993-10-05', '1993-10-06', '1993-10-07', '1993-10-08', '1993-10-11', '1993-10-12', '1993-10-13', '1993-10-14', '1993-10-15', '1993-10-18', '1993-10-19', '1993-10-20', '1993-10-21', '1993-10-22', '1993-10-25', '1993-10-26', '1993-10-27', '1993-10-28', '1993-10-29', '1993-11-01', '1993-11-02', '1993-11-03', '1993-11-04', '1993-11-05', '1993-11-08', '1993-11-09', '1993-11-10', '1993-11-11', '1993-11-12', '1993-11-15', '1993-11-16', '1993-11-17', '1993-11-18', '1993-11-19', '1993-11-22', '1993-11-23', '1993-11-24', '1993-11-25', '1993-11-26', '1993-11-29', '1993-11-30', '1993-12-01', '1993-12-02', '1993-12-03', '1993-12-06', '1993-12-07', '1993-12-08', '1993-12-09', '1993-12-10', '1993-12-13', '1993-12-14', '1993-12-15', '1993-12-16', '1993-12-17', '1993-12-20', '1993-12-21', '1993-12-22', '1993-12-23', '1993-12-24', '1993-12-27', '1993-12-28', '1993-12-29', '1993-12-30', '1993-12-31', '1994-01-03', '1994-01-04', '1994-01-05', '1994-01-06', '1994-01-07', '1994-01-10', '1994-01-11', '1994-01-12', '1994-01-13', '1994-01-14', '1994-01-17', '1994-01-18', '1994-01-19', '1994-01-20', '1994-01-21', '1994-01-24', '1994-01-25', '1994-01-26', '1994-01-27', '1994-01-28', '1994-01-31', '1994-02-01', '1994-02-02', '1994-02-03', '1994-02-04', '1994-02-14', '1994-02-15', '1994-02-16', '1994-02-17', '1994-02-18', '1994-02-21', '1994-02-22', '1994-02-23', '1994-02-24', '1994-02-25', '1994-02-28', '1994-03-01', '1994-03-02', '1994-03-03', '1994-03-04', '1994-03-07', '1994-03-08', '1994-03-09', '1994-03-10', '1994-03-11', '1994-03-14', '1994-03-15', '1994-03-16', '1994-03-17', '1994-03-18', '1994-03-21', '1994-03-22', '1994-03-23', '1994-03-24', '1994-03-25', '1994-03-28', '1994-03-29', '1994-03-30', '1994-03-31', '1994-04-01', '1994-04-04', '1994-04-05', '1994-04-06', '1994-04-07', '1994-04-08', '1994-04-11', '1994-04-12', '1994-04-13', '1994-04-14', '1994-04-15', '1994-04-18', '1994-04-19', '1994-04-20', '1994-04-21', '1994-04-22', '1994-04-25', '1994-04-26', '1994-04-27', '1994-04-28', '1994-04-29', '1994-05-03', '1994-05-04', '1994-05-05', '1994-05-06', '1994-05-09', '1994-05-10', '1994-05-11', '1994-05-12', '1994-05-13', '1994-05-16', '1994-05-17', '1994-05-18', '1994-05-19', '1994-05-20', '1994-05-23', '1994-05-24', '1994-05-25', '1994-05-26', '1994-05-27', '1994-05-30', '1994-05-31', '1994-06-01', '1994-06-02', '1994-06-03', '1994-06-06', '1994-06-07', '1994-06-08', '1994-06-09', '1994-06-10', '1994-06-13', '1994-06-14', '1994-06-15', '1994-06-16', '1994-06-17', '1994-06-20', '1994-06-21', '1994-06-22', '1994-06-23', '1994-06-24', '1994-06-27', '1994-06-28', '1994-06-29', '1994-06-30', '1994-07-01', '1994-07-04', '1994-07-05', '1994-07-06', '1994-07-07', '1994-07-08', '1994-07-11', '1994-07-12', '1994-07-13', '1994-07-14', '1994-07-15', '1994-07-18', '1994-07-19', '1994-07-20', '1994-07-21', '1994-07-22', '1994-07-25', '1994-07-26', '1994-07-27', '1994-07-28', '1994-07-29', '1994-08-01', '1994-08-02', '1994-08-03', '1994-08-04', '1994-08-05', '1994-08-08', '1994-08-09', '1994-08-10', '1994-08-11', '1994-08-12', '1994-08-15', '1994-08-16', '1994-08-17', '1994-08-18', '1994-08-19', '1994-08-22', '1994-08-23', '1994-08-24', '1994-08-25', '1994-08-26', '1994-08-29', '1994-08-30', '1994-08-31', '1994-09-01', '1994-09-02', '1994-09-05', '1994-09-06', '1994-09-07', '1994-09-08', '1994-09-09', '1994-09-12', '1994-09-13', '1994-09-14', '1994-09-15', '1994-09-16', '1994-09-19', '1994-09-20', '1994-09-21', '1994-09-22', '1994-09-23', '1994-09-26', '1994-09-27', '1994-09-28', '1994-09-29', '1994-09-30', '1994-10-05', '1994-10-06', '1994-10-07', '1994-10-10', '1994-10-11', '1994-10-12', '1994-10-13', '1994-10-14', '1994-10-17', '1994-10-18', '1994-10-19', '1994-10-20', '1994-10-21', '1994-10-24', '1994-10-25', '1994-10-26', '1994-10-27', '1994-10-28', '1994-10-31', '1994-11-01', '1994-11-02', '1994-11-03', '1994-11-04', '1994-11-07', '1994-11-08', '1994-11-09', '1994-11-10', '1994-11-11', '1994-11-14', '1994-11-15', '1994-11-16', '1994-11-17', '1994-11-18', '1994-11-21', '1994-11-22', '1994-11-23', '1994-11-24', '1994-11-25', '1994-11-28', '1994-11-29', '1994-11-30', '1994-12-01', '1994-12-02', '1994-12-05', '1994-12-06', '1994-12-07', '1994-12-08', '1994-12-09', '1994-12-12', '1994-12-13', '1994-12-14', '1994-12-15', '1994-12-16', '1994-12-19', '1994-12-20', '1994-12-21', '1994-12-22', '1994-12-23', '1994-12-26', '1994-12-27', '1994-12-28', '1994-12-29', '1994-12-30', '1995-01-03', '1995-01-04', '1995-01-05', '1995-01-06', '1995-01-09', '1995-01-10', '1995-01-11', '1995-01-12', '1995-01-13', '1995-01-16', '1995-01-17', '1995-01-18', '1995-01-19', '1995-01-20', '1995-01-23', '1995-01-24', '1995-01-25', '1995-01-26', '1995-01-27', '1995-02-06', '1995-02-07', '1995-02-08', '1995-02-09', '1995-02-10', '1995-02-13', '1995-02-14', '1995-02-15', '1995-02-16', '1995-02-17', '1995-02-20', '1995-02-21', '1995-02-22', '1995-02-23', '1995-02-24', '1995-02-27', '1995-02-28', '1995-03-01', '1995-03-02', '1995-03-03', '1995-03-06', '1995-03-07', '1995-03-08', '1995-03-09', '1995-03-10', '1995-03-13', '1995-03-14', '1995-03-15', '1995-03-16', '1995-03-17', '1995-03-20', '1995-03-21', '1995-03-22', '1995-03-23', '1995-03-24', '1995-03-27', '1995-03-28', '1995-03-29', '1995-03-30', '1995-03-31', '1995-04-03', '1995-04-04', '1995-04-05', '1995-04-06', '1995-04-07', '1995-04-10', '1995-04-11', '1995-04-12', '1995-04-13', '1995-04-14', '1995-04-17', '1995-04-18', '1995-04-19', '1995-04-20', '1995-04-21', '1995-04-24', '1995-04-25', '1995-04-26', '1995-04-27', '1995-04-28', '1995-05-02', '1995-05-03', '1995-05-04', '1995-05-05', '1995-05-08', '1995-05-09', '1995-05-10', '1995-05-11', '1995-05-12', '1995-05-15', '1995-05-16', '1995-05-17', '1995-05-18', '1995-05-19', '1995-05-22', '1995-05-23', '1995-05-24', '1995-05-25', '1995-05-26', '1995-05-29', '1995-05-30', '1995-05-31', '1995-06-01', '1995-06-02', '1995-06-05', '1995-06-06', '1995-06-07', '1995-06-08', '1995-06-09', '1995-06-12', '1995-06-13', '1995-06-14', '1995-06-15', '1995-06-16', '1995-06-19', '1995-06-20', '1995-06-21', '1995-06-22', '1995-06-23', '1995-06-26', '1995-06-27', '1995-06-28', '1995-06-29', '1995-06-30', '1995-07-03', '1995-07-04', '1995-07-05', '1995-07-06', '1995-07-07', '1995-07-10', '1995-07-11', '1995-07-12', '1995-07-13', '1995-07-14', '1995-07-17', '1995-07-18', '1995-07-19', '1995-07-20', '1995-07-21', '1995-07-24', '1995-07-25', '1995-07-26', '1995-07-27', '1995-07-28', '1995-07-31', '1995-08-01', '1995-08-02', '1995-08-03', '1995-08-04', '1995-08-07', '1995-08-08', '1995-08-09', '1995-08-10', '1995-08-11', '1995-08-14', '1995-08-15', '1995-08-16', '1995-08-17', '1995-08-18', '1995-08-21', '1995-08-22', '1995-08-23', '1995-08-24', '1995-08-25', '1995-08-28', '1995-08-29', '1995-08-30', '1995-08-31', '1995-09-01', '1995-09-04', '1995-09-05', '1995-09-06', '1995-09-07', '1995-09-08', '1995-09-11', '1995-09-12', '1995-09-13', '1995-09-14', '1995-09-15', '1995-09-18', '1995-09-19', '1995-09-20', '1995-09-21', '1995-09-22', '1995-09-25', '1995-09-26', '1995-09-27', '1995-09-28', '1995-09-29', '1995-10-04', '1995-10-05', '1995-10-06', '1995-10-09', '1995-10-10', '1995-10-11', '1995-10-12', '1995-10-13', '1995-10-16', '1995-10-17', '1995-10-18', '1995-10-19', '1995-10-20', '1995-10-23', '1995-10-24', '1995-10-25', '1995-10-26', '1995-10-27', '1995-10-30', '1995-10-31', '1995-11-01', '1995-11-02', '1995-11-03', '1995-11-06', '1995-11-07', '1995-11-08', '1995-11-09', '1995-11-10', '1995-11-13', '1995-11-14', '1995-11-15', '1995-11-16', '1995-11-17', '1995-11-20', '1995-11-21', '1995-11-22', '1995-11-23', '1995-11-24', '1995-11-27', '1995-11-28', '1995-11-29', '1995-11-30', '1995-12-01', '1995-12-04', '1995-12-05', '1995-12-06', '1995-12-07', '1995-12-08', '1995-12-11', '1995-12-12', '1995-12-13', '1995-12-14', '1995-12-15', '1995-12-18', '1995-12-19', '1995-12-20', '1995-12-21', '1995-12-22', '1995-12-25', '1995-12-26', '1995-12-27', '1995-12-28', '1995-12-29', '1996-01-02', '1996-01-03', '1996-01-04', '1996-01-05', '1996-01-08', '1996-01-09', '1996-01-10', '1996-01-11', '1996-01-12', '1996-01-15', '1996-01-16', '1996-01-17', '1996-01-18', '1996-01-19', '1996-01-22', '1996-01-23', '1996-01-24', '1996-01-25', '1996-01-26', '1996-01-29', '1996-01-30', '1996-01-31', '1996-02-01', '1996-02-02', '1996-02-05', '1996-02-06', '1996-02-07', '1996-02-08', '1996-02-09', '1996-02-12', '1996-02-13', '1996-02-14', '1996-02-15', '1996-02-16', '1996-03-04', '1996-03-05', '1996-03-06', '1996-03-07', '1996-03-08', '1996-03-11', '1996-03-12', '1996-03-13', '1996-03-14', '1996-03-15', '1996-03-18', '1996-03-19', '1996-03-20', '1996-03-21', '1996-03-22', '1996-03-25', '1996-03-26', '1996-03-27', '1996-03-28', '1996-03-29', '1996-04-01', '1996-04-02', '1996-04-03', '1996-04-04', '1996-04-05', '1996-04-08', '1996-04-09', '1996-04-10', '1996-04-11', '1996-04-12', '1996-04-15', '1996-04-16', '1996-04-17', '1996-04-18', '1996-04-19', '1996-04-22', '1996-04-23', '1996-04-24', '1996-04-25', '1996-04-26', '1996-04-29', '1996-04-30', '1996-05-02', '1996-05-03', '1996-05-06', '1996-05-07', '1996-05-08', '1996-05-09', '1996-05-10', '1996-05-13', '1996-05-14', '1996-05-15', '1996-05-16', '1996-05-17', '1996-05-20', '1996-05-21', '1996-05-22', '1996-05-23', '1996-05-24', '1996-05-27', '1996-05-28', '1996-05-29', '1996-05-30', '1996-05-31', '1996-06-03', '1996-06-04', '1996-06-05', '1996-06-06', '1996-06-07', '1996-06-10', '1996-06-11', '1996-06-12', '1996-06-13', '1996-06-14', '1996-06-17', '1996-06-18', '1996-06-19', '1996-06-20', '1996-06-21', '1996-06-24', '1996-06-25', '1996-06-26', '1996-06-27', '1996-06-28', '1996-07-01', '1996-07-02', '1996-07-03', '1996-07-04', '1996-07-05', '1996-07-08', '1996-07-09', '1996-07-10', '1996-07-11', '1996-07-12', '1996-07-15', '1996-07-16', '1996-07-17', '1996-07-18', '1996-07-19', '1996-07-22', '1996-07-23', '1996-07-24', '1996-07-25', '1996-07-26', '1996-07-29', '1996-07-30', '1996-07-31', '1996-08-01', '1996-08-02', '1996-08-05', '1996-08-06', '1996-08-07', '1996-08-08', '1996-08-09', '1996-08-12', '1996-08-13', '1996-08-14', '1996-08-15', '1996-08-16', '1996-08-19', '1996-08-20', '1996-08-21', '1996-08-22', '1996-08-23', '1996-08-26', '1996-08-27', '1996-08-28', '1996-08-29', '1996-08-30', '1996-09-02', '1996-09-03', '1996-09-04', '1996-09-05', '1996-09-06', '1996-09-09', '1996-09-10', '1996-09-11', '1996-09-12', '1996-09-13', '1996-09-16', '1996-09-17', '1996-09-18', '1996-09-19', '1996-09-20', '1996-09-23', '1996-09-24', '1996-09-25', '1996-09-26', '1996-09-27', '1996-10-03', '1996-10-04', '1996-10-07', '1996-10-08', '1996-10-09', '1996-10-10', '1996-10-11', '1996-10-14', '1996-10-15', '1996-10-16', '1996-10-17', '1996-10-18', '1996-10-21', '1996-10-22', '1996-10-23', '1996-10-24', '1996-10-25', '1996-10-28', '1996-10-29', '1996-10-30', '1996-10-31', '1996-11-01', '1996-11-04', '1996-11-05', '1996-11-06', '1996-11-07', '1996-11-08', '1996-11-11', '1996-11-12', '1996-11-13', '1996-11-14', '1996-11-15', '1996-11-18', '1996-11-19', '1996-11-20', '1996-11-21', '1996-11-22', '1996-11-25', '1996-11-26', '1996-11-27', '1996-11-28', '1996-11-29', '1996-12-02', '1996-12-03', '1996-12-04', '1996-12-05', '1996-12-06', '1996-12-09', '1996-12-10', '1996-12-11', '1996-12-12', '1996-12-13', '1996-12-16', '1996-12-17', '1996-12-18', '1996-12-19', '1996-12-20', '1996-12-23', '1996-12-24', '1996-12-25', '1996-12-26', '1996-12-27', '1996-12-30', '1996-12-31', '1997-01-02', '1997-01-03', '1997-01-06', '1997-01-07', '1997-01-08', '1997-01-09', '1997-01-10', '1997-01-13', '1997-01-14', '1997-01-15', '1997-01-16', '1997-01-17', '1997-01-20', '1997-01-21', '1997-01-22', '1997-01-23', '1997-01-24', '1997-01-27', '1997-01-28', '1997-01-29', '1997-01-30', '1997-01-31', '1997-02-17', '1997-02-18', '1997-02-19', '1997-02-20', '1997-02-21', '1997-02-24', '1997-02-25', '1997-02-26', '1997-02-27', '1997-02-28', '1997-03-03', '1997-03-04', '1997-03-05', '1997-03-06', '1997-03-07', '1997-03-10', '1997-03-11', '1997-03-12', '1997-03-13', '1997-03-14', '1997-03-17', '1997-03-18', '1997-03-19', '1997-03-20', '1997-03-21', '1997-03-24', '1997-03-25', '1997-03-26', '1997-03-27', '1997-03-28', '1997-03-31', '1997-04-01', '1997-04-02', '1997-04-03', '1997-04-04', '1997-04-07', '1997-04-08', '1997-04-09', '1997-04-10', '1997-04-11', '1997-04-14', '1997-04-15', '1997-04-16', '1997-04-17', '1997-04-18', '1997-04-21', '1997-04-22', '1997-04-23', '1997-04-24', '1997-04-25', '1997-04-28', '1997-04-29', '1997-04-30', '1997-05-05', '1997-05-06', '1997-05-07', '1997-05-08', '1997-05-09', '1997-05-12', '1997-05-13', '1997-05-14', '1997-05-15', '1997-05-16', '1997-05-19', '1997-05-20', '1997-05-21', '1997-05-22', '1997-05-23', '1997-05-26', '1997-05-27', '1997-05-28', '1997-05-29', '1997-05-30', '1997-06-02', '1997-06-03', '1997-06-04', '1997-06-05', '1997-06-06', '1997-06-09', '1997-06-10', '1997-06-11', '1997-06-12', '1997-06-13', '1997-06-16', '1997-06-17', '1997-06-18', '1997-06-19', '1997-06-20', '1997-06-23', '1997-06-24', '1997-06-25', '1997-06-26', '1997-06-27', '1997-07-02', '1997-07-03', '1997-07-04', '1997-07-07', '1997-07-08', '1997-07-09', '1997-07-10', '1997-07-11', '1997-07-14', '1997-07-15', '1997-07-16', '1997-07-17', '1997-07-18', '1997-07-21', '1997-07-22', '1997-07-23', '1997-07-24', '1997-07-25', '1997-07-28', '1997-07-29', '1997-07-30', '1997-07-31', '1997-08-01', '1997-08-04', '1997-08-05', '1997-08-06', '1997-08-07', '1997-08-08', '1997-08-11', '1997-08-12', '1997-08-13', '1997-08-14', '1997-08-15', '1997-08-18', '1997-08-19', '1997-08-20', '1997-08-21', '1997-08-22', '1997-08-25', '1997-08-26', '1997-08-27', '1997-08-28', '1997-08-29', '1997-09-01', '1997-09-02', '1997-09-03', '1997-09-04', '1997-09-05', '1997-09-08', '1997-09-09', '1997-09-10', '1997-09-11', '1997-09-12', '1997-09-15', '1997-09-16', '1997-09-17', '1997-09-18', '1997-09-19', '1997-09-22', '1997-09-23', '1997-09-24', '1997-09-25', '1997-09-26', '1997-09-29', '1997-09-30', '1997-10-06', '1997-10-07', '1997-10-08', '1997-10-09', '1997-10-10', '1997-10-13', '1997-10-14', '1997-10-15', '1997-10-16', '1997-10-17', '1997-10-20', '1997-10-21', '1997-10-22', '1997-10-23', '1997-10-24', '1997-10-27', '1997-10-28', '1997-10-29', '1997-10-30', '1997-10-31', '1997-11-03', '1997-11-04', '1997-11-05', '1997-11-06', '1997-11-07', '1997-11-10', '1997-11-11', '1997-11-12', '1997-11-13', '1997-11-14', '1997-11-17', '1997-11-18', '1997-11-19', '1997-11-20', '1997-11-21', '1997-11-24', '1997-11-25', '1997-11-26', '1997-11-27', '1997-11-28', '1997-12-01', '1997-12-02', '1997-12-03', '1997-12-04', '1997-12-05', '1997-12-08', '1997-12-09', '1997-12-10', '1997-12-11', '1997-12-12', '1997-12-15', '1997-12-16', '1997-12-17', '1997-12-18', '1997-12-19', '1997-12-22', '1997-12-23', '1997-12-24', '1997-12-25', '1997-12-26', '1997-12-29', '1997-12-30', '1997-12-31', '1998-01-05', '1998-01-06', '1998-01-07', '1998-01-08', '1998-01-09', '1998-01-12', '1998-01-13', '1998-01-14', '1998-01-15', '1998-01-16', '1998-01-19', '1998-01-20', '1998-01-21', '1998-01-22', '1998-01-23', '1998-02-09', '1998-02-10', '1998-02-11', '1998-02-12', '1998-02-13', '1998-02-16', '1998-02-17', '1998-02-18', '1998-02-19', '1998-02-20', '1998-02-23', '1998-02-24', '1998-02-25', '1998-02-26', '1998-02-27', '1998-03-02', '1998-03-03', '1998-03-04', '1998-03-05', '1998-03-06', '1998-03-09', '1998-03-10', '1998-03-11', '1998-03-12', '1998-03-13', '1998-03-16', '1998-03-17', '1998-03-18', '1998-03-19', '1998-03-20', '1998-03-23', '1998-03-24', '1998-03-25', '1998-03-26', '1998-03-27', '1998-03-30', '1998-03-31', '1998-04-01', '1998-04-02', '1998-04-03', '1998-04-06', '1998-04-07', '1998-04-08', '1998-04-09', '1998-04-10', '1998-04-13', '1998-04-14', '1998-04-15', '1998-04-16', '1998-04-17', '1998-04-20', '1998-04-21', '1998-04-22', '1998-04-23', '1998-04-24', '1998-04-27', '1998-04-28', '1998-04-29', '1998-04-30', '1998-05-04', '1998-05-05', '1998-05-06', '1998-05-07', '1998-05-08', '1998-05-11', '1998-05-12', '1998-05-13', '1998-05-14', '1998-05-15', '1998-05-18', '1998-05-19', '1998-05-20', '1998-05-21', '1998-05-22', '1998-05-25', '1998-05-26', '1998-05-27', '1998-05-28', '1998-05-29', '1998-06-01', '1998-06-02', '1998-06-03', '1998-06-04', '1998-06-05', '1998-06-08', '1998-06-09', '1998-06-10', '1998-06-11', '1998-06-12', '1998-06-15', '1998-06-16', '1998-06-17', '1998-06-18', '1998-06-19', '1998-06-22', '1998-06-23', '1998-06-24', '1998-06-25', '1998-06-26', '1998-06-29', '1998-06-30', '1998-07-01', '1998-07-02', '1998-07-03', '1998-07-06', '1998-07-07', '1998-07-08', '1998-07-09', '1998-07-10', '1998-07-13', '1998-07-14', '1998-07-15', '1998-07-16', '1998-07-17', '1998-07-20', '1998-07-21', '1998-07-22', '1998-07-23', '1998-07-24', '1998-07-27', '1998-07-28', '1998-07-29', '1998-07-30', '1998-07-31', '1998-08-03', '1998-08-04', '1998-08-05', '1998-08-06', '1998-08-07', '1998-08-10', '1998-08-11', '1998-08-12', '1998-08-13', '1998-08-14', '1998-08-17', '1998-08-18', '1998-08-19', '1998-08-20', '1998-08-21', '1998-08-24', '1998-08-25', '1998-08-26', '1998-08-27', '1998-08-28', '1998-08-31', '1998-09-01', '1998-09-02', '1998-09-03', '1998-09-04', '1998-09-07', '1998-09-08', '1998-09-09', '1998-09-10', '1998-09-11', '1998-09-14', '1998-09-15', '1998-09-16', '1998-09-17', '1998-09-18', '1998-09-21', '1998-09-22', '1998-09-23', '1998-09-24', '1998-09-25', '1998-09-28', '1998-09-29', '1998-09-30', '1998-10-05', '1998-10-06', '1998-10-07', '1998-10-08', '1998-10-09', '1998-10-12', '1998-10-13', '1998-10-14', '1998-10-15', '1998-10-16', '1998-10-19', '1998-10-20', '1998-10-21', '1998-10-22', '1998-10-23', '1998-10-26', '1998-10-27', '1998-10-28', '1998-10-29', '1998-10-30', '1998-11-02', '1998-11-03', '1998-11-04', '1998-11-05', '1998-11-06', '1998-11-09', '1998-11-10', '1998-11-11', '1998-11-12', '1998-11-13', '1998-11-16', '1998-11-17', '1998-11-18', '1998-11-19', '1998-11-20', '1998-11-23', '1998-11-24', '1998-11-25', '1998-11-26', '1998-11-27', '1998-11-30', '1998-12-01', '1998-12-02', '1998-12-03', '1998-12-04', '1998-12-07', '1998-12-08', '1998-12-09', '1998-12-10', '1998-12-11', '1998-12-14', '1998-12-15', '1998-12-16', '1998-12-17', '1998-12-18', '1998-12-21', '1998-12-22', '1998-12-23', '1998-12-24', '1998-12-25', '1998-12-28', '1998-12-29', '1998-12-30', '1998-12-31', '1999-01-04', '1999-01-05', '1999-01-06', '1999-01-07', '1999-01-08', '1999-01-11', '1999-01-12', '1999-01-13', '1999-01-14', '1999-01-15', '1999-01-18', '1999-01-19', '1999-01-20', '1999-01-21', '1999-01-22', '1999-01-25', '1999-01-26', '1999-01-27', '1999-01-28', '1999-01-29', '1999-02-01', '1999-02-02', '1999-02-03', '1999-02-04', '1999-02-05', '1999-02-08', '1999-02-09', '1999-03-01', '1999-03-02', '1999-03-03', '1999-03-04', '1999-03-05', '1999-03-08', '1999-03-09', '1999-03-10', '1999-03-11', '1999-03-12', '1999-03-15', '1999-03-16', '1999-03-17', '1999-03-18', '1999-03-19', '1999-03-22', '1999-03-23', '1999-03-24', '1999-03-25', '1999-03-26', '1999-03-29', '1999-03-30', '1999-03-31', '1999-04-01', '1999-04-02', '1999-04-05', '1999-04-06', '1999-04-07', '1999-04-08', '1999-04-09', '1999-04-12', '1999-04-13', '1999-04-14', '1999-04-15', '1999-04-16', '1999-04-19', '1999-04-20', '1999-04-21', '1999-04-22', '1999-04-23', '1999-04-26', '1999-04-27', '1999-04-28', '1999-04-29', '1999-04-30', '1999-05-04', '1999-05-05', '1999-05-06', '1999-05-07', '1999-05-10', '1999-05-11', '1999-05-12', '1999-05-13', '1999-05-14', '1999-05-17', '1999-05-18', '1999-05-19', '1999-05-20', '1999-05-21', '1999-05-24', '1999-05-25', '1999-05-26', '1999-05-27', '1999-05-28', '1999-05-31', '1999-06-01', '1999-06-02', '1999-06-03', '1999-06-04', '1999-06-07', '1999-06-08', '1999-06-09', '1999-06-10', '1999-06-11', '1999-06-14', '1999-06-15', '1999-06-16', '1999-06-17', '1999-06-18', '1999-06-21', '1999-06-22', '1999-06-23', '1999-06-24', '1999-06-25', '1999-06-28', '1999-06-29', '1999-06-30', '1999-07-01', '1999-07-02', '1999-07-05', '1999-07-06', '1999-07-07', '1999-07-08', '1999-07-09', '1999-07-12', '1999-07-13', '1999-07-14', '1999-07-15', '1999-07-16', '1999-07-19', '1999-07-20', '1999-07-21', '1999-07-22', '1999-07-23', '1999-07-26', '1999-07-27', '1999-07-28', '1999-07-29', '1999-07-30', '1999-08-02', '1999-08-03', '1999-08-04', '1999-08-05', '1999-08-06', '1999-08-09', '1999-08-10', '1999-08-11', '1999-08-12', '1999-08-13', '1999-08-16', '1999-08-17', '1999-08-18', '1999-08-19', '1999-08-20', '1999-08-23', '1999-08-24', '1999-08-25', '1999-08-26', '1999-08-27', '1999-08-30', '1999-08-31', '1999-09-01', '1999-09-02', '1999-09-03', '1999-09-06', '1999-09-07', '1999-09-08', '1999-09-09', '1999-09-10', '1999-09-13', '1999-09-14', '1999-09-15', '1999-09-16', '1999-09-17', '1999-09-20', '1999-09-21', '1999-09-22', '1999-09-23', '1999-09-24', '1999-09-27', '1999-09-28', '1999-09-29', '1999-09-30', '1999-10-08', '1999-10-11', '1999-10-12', '1999-10-13', '1999-10-14', '1999-10-15', '1999-10-18', '1999-10-19', '1999-10-20', '1999-10-21', '1999-10-22', '1999-10-25', '1999-10-26', '1999-10-27', '1999-10-28', '1999-10-29', '1999-11-01', '1999-11-02', '1999-11-03', '1999-11-04', '1999-11-05', '1999-11-08', '1999-11-09', '1999-11-10', '1999-11-11', '1999-11-12', '1999-11-15', '1999-11-16', '1999-11-17', '1999-11-18', '1999-11-19', '1999-11-22', '1999-11-23', '1999-11-24', '1999-11-25', '1999-11-26', '1999-11-29', '1999-11-30', '1999-12-01', '1999-12-02', '1999-12-03', '1999-12-06', '1999-12-07', '1999-12-08', '1999-12-09', '1999-12-10', '1999-12-13', '1999-12-14', '1999-12-15', '1999-12-16', '1999-12-17', '1999-12-21', '1999-12-22', '1999-12-23', '1999-12-24', '1999-12-27', '1999-12-28', '1999-12-29', '1999-12-30', '2000-01-04', '2000-01-05', '2000-01-06', '2000-01-07', '2000-01-10', '2000-01-11', '2000-01-12', '2000-01-13', '2000-01-14', '2000-01-17', '2000-01-18', '2000-01-19', '2000-01-20', '2000-01-21', '2000-01-24', '2000-01-25', '2000-01-26', '2000-01-27', '2000-01-28', '2000-02-14', '2000-02-15', '2000-02-16', '2000-02-17', '2000-02-18', '2000-02-21', '2000-02-22', '2000-02-23', '2000-02-24', '2000-02-25', '2000-02-28', '2000-02-29', '2000-03-01', '2000-03-02', '2000-03-03', '2000-03-06', '2000-03-07', '2000-03-08', '2000-03-09', '2000-03-10', '2000-03-13', '2000-03-14', '2000-03-15', '2000-03-16', '2000-03-17', '2000-03-20', '2000-03-21', '2000-03-22', '2000-03-23', '2000-03-24', '2000-03-27', '2000-03-28', '2000-03-29', '2000-03-30', '2000-03-31', '2000-04-03', '2000-04-04', '2000-04-05', '2000-04-06', '2000-04-07', '2000-04-10', '2000-04-11', '2000-04-12', '2000-04-13', '2000-04-14', '2000-04-17', '2000-04-18', '2000-04-19', '2000-04-20', '2000-04-21', '2000-04-24', '2000-04-25', '2000-04-26', '2000-04-27', '2000-04-28', '2000-05-08', '2000-05-09', '2000-05-10', '2000-05-11', '2000-05-12', '2000-05-15', '2000-05-16', '2000-05-17', '2000-05-18', '2000-05-19', '2000-05-22', '2000-05-23', '2000-05-24', '2000-05-25', '2000-05-26', '2000-05-29', '2000-05-30', '2000-05-31', '2000-06-01', '2000-06-02', '2000-06-05', '2000-06-06', '2000-06-07', '2000-06-08', '2000-06-09', '2000-06-12', '2000-06-13', '2000-06-14', '2000-06-15', '2000-06-16', '2000-06-19', '2000-06-20', '2000-06-21', '2000-06-22', '2000-06-23', '2000-06-26', '2000-06-27', '2000-06-28', '2000-06-29', '2000-06-30', '2000-07-03', '2000-07-04', '2000-07-05', '2000-07-06', '2000-07-07', '2000-07-10', '2000-07-11', '2000-07-12', '2000-07-13', '2000-07-14', '2000-07-17', '2000-07-18', '2000-07-19', '2000-07-20', '2000-07-21', '2000-07-24', '2000-07-25', '2000-07-26', '2000-07-27', '2000-07-28', '2000-07-31', '2000-08-01', '2000-08-02', '2000-08-03', '2000-08-04', '2000-08-07', '2000-08-08', '2000-08-09', '2000-08-10', '2000-08-11', '2000-08-14', '2000-08-15', '2000-08-16', '2000-08-17', '2000-08-18', '2000-08-21', '2000-08-22', '2000-08-23', '2000-08-24', '2000-08-25', '2000-08-28', '2000-08-29', '2000-08-30', '2000-08-31', '2000-09-01', '2000-09-04', '2000-09-05', '2000-09-06', '2000-09-07', '2000-09-08', '2000-09-11', '2000-09-12', '2000-09-13', '2000-09-14', '2000-09-15', '2000-09-18', '2000-09-19', '2000-09-20', '2000-09-21', '2000-09-22', '2000-09-25', '2000-09-26', '2000-09-27', '2000-09-28', '2000-09-29', '2000-10-09', '2000-10-10', '2000-10-11', '2000-10-12', '2000-10-13', '2000-10-16', '2000-10-17', '2000-10-18', '2000-10-19', '2000-10-20', '2000-10-23', '2000-10-24', '2000-10-25', '2000-10-26', '2000-10-27', '2000-10-30', '2000-10-31', '2000-11-01', '2000-11-02', '2000-11-03', '2000-11-06', '2000-11-07', '2000-11-08', '2000-11-09', '2000-11-10', '2000-11-13', '2000-11-14', '2000-11-15', '2000-11-16', '2000-11-17', '2000-11-20', '2000-11-21', '2000-11-22', '2000-11-23', '2000-11-24', '2000-11-27', '2000-11-28', '2000-11-29', '2000-11-30', '2000-12-01', '2000-12-04', '2000-12-05', '2000-12-06', '2000-12-07', '2000-12-08', '2000-12-11', '2000-12-12', '2000-12-13', '2000-12-14', '2000-12-15', '2000-12-18', '2000-12-19', '2000-12-20', '2000-12-21', '2000-12-22', '2000-12-25', '2000-12-26', '2000-12-27', '2000-12-28', '2000-12-29', '2001-01-02', '2001-01-03', '2001-01-04', '2001-01-05', '2001-01-08', '2001-01-09', '2001-01-10', '2001-01-11', '2001-01-12', '2001-01-15', '2001-01-16', '2001-01-17', '2001-01-18', '2001-01-19', '2001-02-05', '2001-02-06', '2001-02-07', '2001-02-08', '2001-02-09', '2001-02-12', '2001-02-13', '2001-02-14', '2001-02-15', '2001-02-16', '2001-02-19', '2001-02-20', '2001-02-21', '2001-02-22', '2001-02-23', '2001-02-26', '2001-02-27', '2001-02-28', '2001-03-01', '2001-03-02', '2001-03-05', '2001-03-06', '2001-03-07', '2001-03-08', '2001-03-09', '2001-03-12', '2001-03-13', '2001-03-14', '2001-03-15', '2001-03-16', '2001-03-19', '2001-03-20', '2001-03-21', '2001-03-22', '2001-03-23', '2001-03-26', '2001-03-27', '2001-03-28', '2001-03-29', '2001-03-30', '2001-04-02', '2001-04-03', '2001-04-04', '2001-04-05', '2001-04-06', '2001-04-09', '2001-04-10', '2001-04-11', '2001-04-12', '2001-04-13', '2001-04-16', '2001-04-17', '2001-04-18', '2001-04-19', '2001-04-20', '2001-04-23', '2001-04-24', '2001-04-25', '2001-04-26', '2001-04-27', '2001-04-30', '2001-05-08', '2001-05-09', '2001-05-10', '2001-05-11', '2001-05-14', '2001-05-15', '2001-05-16', '2001-05-17', '2001-05-18', '2001-05-21', '2001-05-22', '2001-05-23', '2001-05-24', '2001-05-25', '2001-05-28', '2001-05-29', '2001-05-30', '2001-05-31', '2001-06-01', '2001-06-04', '2001-06-05', '2001-06-06', '2001-06-07', '2001-06-08', '2001-06-11', '2001-06-12', '2001-06-13', '2001-06-14', '2001-06-15', '2001-06-18', '2001-06-19', '2001-06-20', '2001-06-21', '2001-06-22', '2001-06-25', '2001-06-26', '2001-06-27', '2001-06-28', '2001-06-29', '2001-07-02', '2001-07-03', '2001-07-04', '2001-07-05', '2001-07-06', '2001-07-09', '2001-07-10', '2001-07-11', '2001-07-12', '2001-07-13', '2001-07-16', '2001-07-17', '2001-07-18', '2001-07-19', '2001-07-20', '2001-07-23', '2001-07-24', '2001-07-25', '2001-07-26', '2001-07-27', '2001-07-30', '2001-07-31', '2001-08-01', '2001-08-02', '2001-08-03', '2001-08-06', '2001-08-07', '2001-08-08', '2001-08-09', '2001-08-10', '2001-08-13', '2001-08-14', '2001-08-15', '2001-08-16', '2001-08-17', '2001-08-20', '2001-08-21', '2001-08-22', '2001-08-23', '2001-08-24', '2001-08-27', '2001-08-28', '2001-08-29', '2001-08-30', '2001-08-31', '2001-09-03', '2001-09-04', '2001-09-05', '2001-09-06', '2001-09-07', '2001-09-10', '2001-09-11', '2001-09-12', '2001-09-13', '2001-09-14', '2001-09-17', '2001-09-18', '2001-09-19', '2001-09-20', '2001-09-21', '2001-09-24', '2001-09-25', '2001-09-26', '2001-09-27', '2001-09-28', '2001-10-08', '2001-10-09', '2001-10-10', '2001-10-11', '2001-10-12', '2001-10-15', '2001-10-16', '2001-10-17', '2001-10-18', '2001-10-19', '2001-10-22', '2001-10-23', '2001-10-24', '2001-10-25', '2001-10-26', '2001-10-29', '2001-10-30', '2001-10-31', '2001-11-01', '2001-11-02', '2001-11-05', '2001-11-06', '2001-11-07', '2001-11-08', '2001-11-09', '2001-11-12', '2001-11-13', '2001-11-14', '2001-11-15', '2001-11-16', '2001-11-19', '2001-11-20', '2001-11-21', '2001-11-22', '2001-11-23', '2001-11-26', '2001-11-27', '2001-11-28', '2001-11-29', '2001-11-30', '2001-12-03', '2001-12-04', '2001-12-05', '2001-12-06', '2001-12-07', '2001-12-10', '2001-12-11', '2001-12-12', '2001-12-13', '2001-12-14', '2001-12-17', '2001-12-18', '2001-12-19', '2001-12-20', '2001-12-21', '2001-12-24', '2001-12-25', '2001-12-26', '2001-12-27', '2001-12-28', '2001-12-31', '2002-01-04', '2002-01-07', '2002-01-08', '2002-01-09', '2002-01-10', '2002-01-11', '2002-01-14', '2002-01-15', '2002-01-16', '2002-01-17', '2002-01-18', '2002-01-21', '2002-01-22', '2002-01-23', '2002-01-24', '2002-01-25', '2002-01-28', '2002-01-29', '2002-01-30', '2002-01-31', '2002-02-01', '2002-02-04', '2002-02-05', '2002-02-06', '2002-02-07', '2002-02-08', '2002-02-25', '2002-02-26', '2002-02-27', '2002-02-28', '2002-03-01', '2002-03-04', '2002-03-05', '2002-03-06', '2002-03-07', '2002-03-08', '2002-03-11', '2002-03-12', '2002-03-13', '2002-03-14', '2002-03-15', '2002-03-18', '2002-03-19', '2002-03-20', '2002-03-21', '2002-03-22', '2002-03-25', '2002-03-26', '2002-03-27', '2002-03-28', '2002-03-29', '2002-04-01', '2002-04-02', '2002-04-03', '2002-04-04', '2002-04-05', '2002-04-08', '2002-04-09', '2002-04-10', '2002-04-11', '2002-04-12', '2002-04-15', '2002-04-16', '2002-04-17', '2002-04-18', '2002-04-19', '2002-04-22', '2002-04-23', '2002-04-24', '2002-04-25', '2002-04-26', '2002-04-29', '2002-04-30', '2002-05-08', '2002-05-09', '2002-05-10', '2002-05-13', '2002-05-14', '2002-05-15', '2002-05-16', '2002-05-17', '2002-05-20', '2002-05-21', '2002-05-22', '2002-05-23', '2002-05-24', '2002-05-27', '2002-05-28', '2002-05-29', '2002-05-30', '2002-05-31', '2002-06-03', '2002-06-04', '2002-06-05', '2002-06-06', '2002-06-07', '2002-06-10', '2002-06-11', '2002-06-12', '2002-06-13', '2002-06-14', '2002-06-17', '2002-06-18', '2002-06-19', '2002-06-20', '2002-06-21', '2002-06-24', '2002-06-25', '2002-06-26', '2002-06-27', '2002-06-28', '2002-07-01', '2002-07-02', '2002-07-03', '2002-07-04', '2002-07-05', '2002-07-08', '2002-07-09', '2002-07-10', '2002-07-11', '2002-07-12', '2002-07-15', '2002-07-16', '2002-07-17', '2002-07-18', '2002-07-19', '2002-07-22', '2002-07-23', '2002-07-24', '2002-07-25', '2002-07-26', '2002-07-29', '2002-07-30', '2002-07-31', '2002-08-01', '2002-08-02', '2002-08-05', '2002-08-06', '2002-08-07', '2002-08-08', '2002-08-09', '2002-08-12', '2002-08-13', '2002-08-14', '2002-08-15', '2002-08-16', '2002-08-19', '2002-08-20', '2002-08-21', '2002-08-22', '2002-08-23', '2002-08-26', '2002-08-27', '2002-08-28', '2002-08-29', '2002-08-30', '2002-09-02', '2002-09-03', '2002-09-04', '2002-09-05', '2002-09-06', '2002-09-09', '2002-09-10', '2002-09-11', '2002-09-12', '2002-09-13', '2002-09-16', '2002-09-17', '2002-09-18', '2002-09-19', '2002-09-20', '2002-09-23', '2002-09-24', '2002-09-25', '2002-09-26', '2002-09-27', '2002-10-08', '2002-10-09', '2002-10-10', '2002-10-11', '2002-10-14', '2002-10-15', '2002-10-16', '2002-10-17', '2002-10-18', '2002-10-21', '2002-10-22', '2002-10-23', '2002-10-24', '2002-10-25', '2002-10-28', '2002-10-29', '2002-10-30', '2002-10-31', '2002-11-01', '2002-11-04', '2002-11-05', '2002-11-06', '2002-11-07', '2002-11-08', '2002-11-11', '2002-11-12', '2002-11-13', '2002-11-14', '2002-11-15', '2002-11-18', '2002-11-19', '2002-11-20', '2002-11-21', '2002-11-22', '2002-11-25', '2002-11-26', '2002-11-27', '2002-11-28', '2002-11-29', '2002-12-02', '2002-12-03', '2002-12-04', '2002-12-05', '2002-12-06', '2002-12-09', '2002-12-10', '2002-12-11', '2002-12-12', '2002-12-13', '2002-12-16', '2002-12-17', '2002-12-18', '2002-12-19', '2002-12-20', '2002-12-23', '2002-12-24', '2002-12-25', '2002-12-26', '2002-12-27', '2002-12-30', '2002-12-31', '2003-01-02', '2003-01-03', '2003-01-06', '2003-01-07', '2003-01-08', '2003-01-09', '2003-01-10', '2003-01-13', '2003-01-14', '2003-01-15', '2003-01-16', '2003-01-17', '2003-01-20', '2003-01-21', '2003-01-22', '2003-01-23', '2003-01-24', '2003-01-27', '2003-01-28', '2003-01-29', '2003-02-10', '2003-02-11', '2003-02-12', '2003-02-13', '2003-02-14', '2003-02-17', '2003-02-18', '2003-02-19', '2003-02-20', '2003-02-21', '2003-02-24', '2003-02-25', '2003-02-26', '2003-02-27', '2003-02-28', '2003-03-03', '2003-03-04', '2003-03-05', '2003-03-06', '2003-03-07', '2003-03-10', '2003-03-11', '2003-03-12', '2003-03-13', '2003-03-14', '2003-03-17', '2003-03-18', '2003-03-19', '2003-03-20', '2003-03-21', '2003-03-24', '2003-03-25', '2003-03-26', '2003-03-27', '2003-03-28', '2003-03-31', '2003-04-01', '2003-04-02', '2003-04-03', '2003-04-04', '2003-04-07', '2003-04-08', '2003-04-09', '2003-04-10', '2003-04-11', '2003-04-14', '2003-04-15', '2003-04-16', '2003-04-17', '2003-04-18', '2003-04-21', '2003-04-22', '2003-04-23', '2003-04-24', '2003-04-25', '2003-04-28', '2003-04-29', '2003-04-30', '2003-05-12', '2003-05-13', '2003-05-14', '2003-05-15', '2003-05-16', '2003-05-19', '2003-05-20', '2003-05-21', '2003-05-22', '2003-05-23', '2003-05-26', '2003-05-27', '2003-05-28', '2003-05-29', '2003-05-30', '2003-06-02', '2003-06-03', '2003-06-04', '2003-06-05', '2003-06-06', '2003-06-09', '2003-06-10', '2003-06-11', '2003-06-12', '2003-06-13', '2003-06-16', '2003-06-17', '2003-06-18', '2003-06-19', '2003-06-20', '2003-06-23', '2003-06-24', '2003-06-25', '2003-06-26', '2003-06-27', '2003-06-30', '2003-07-01', '2003-07-02', '2003-07-03', '2003-07-04', '2003-07-07', '2003-07-08', '2003-07-09', '2003-07-10', '2003-07-11', '2003-07-14', '2003-07-15', '2003-07-16', '2003-07-17', '2003-07-18', '2003-07-21', '2003-07-22', '2003-07-23', '2003-07-24', '2003-07-25', '2003-07-28', '2003-07-29', '2003-07-30', '2003-07-31', '2003-08-01', '2003-08-04', '2003-08-05', '2003-08-06', '2003-08-07', '2003-08-08', '2003-08-11', '2003-08-12', '2003-08-13', '2003-08-14', '2003-08-15', '2003-08-18', '2003-08-19', '2003-08-20', '2003-08-21', '2003-08-22', '2003-08-25', '2003-08-26', '2003-08-27', '2003-08-28', '2003-08-29', '2003-09-01', '2003-09-02', '2003-09-03', '2003-09-04', '2003-09-05', '2003-09-08', '2003-09-09', '2003-09-10', '2003-09-11', '2003-09-12', '2003-09-15', '2003-09-16', '2003-09-17', '2003-09-18', '2003-09-19', '2003-09-22', '2003-09-23', '2003-09-24', '2003-09-25', '2003-09-26', '2003-09-29', '2003-09-30', '2003-10-08', '2003-10-09', '2003-10-10', '2003-10-13', '2003-10-14', '2003-10-15', '2003-10-16', '2003-10-17', '2003-10-20', '2003-10-21', '2003-10-22', '2003-10-23', '2003-10-24', '2003-10-27', '2003-10-28', '2003-10-29', '2003-10-30', '2003-10-31', '2003-11-03', '2003-11-04', '2003-11-05', '2003-11-06', '2003-11-07', '2003-11-10', '2003-11-11', '2003-11-12', '2003-11-13', '2003-11-14', '2003-11-17', '2003-11-18', '2003-11-19', '2003-11-20', '2003-11-21', '2003-11-24', '2003-11-25', '2003-11-26', '2003-11-27', '2003-11-28', '2003-12-01', '2003-12-02', '2003-12-03', '2003-12-04', '2003-12-05', '2003-12-08', '2003-12-09', '2003-12-10', '2003-12-11', '2003-12-12', '2003-12-15', '2003-12-16', '2003-12-17', '2003-12-18', '2003-12-19', '2003-12-22', '2003-12-23', '2003-12-24', '2003-12-25', '2003-12-26', '2003-12-29', '2003-12-30', '2003-12-31', '2004-01-02', '2004-01-05', '2004-01-06', '2004-01-07', '2004-01-08', '2004-01-09', '2004-01-12', '2004-01-13', '2004-01-14', '2004-01-15', '2004-01-16', '2004-01-29', '2004-01-30', '2004-02-02', '2004-02-03', '2004-02-04', '2004-02-05', '2004-02-06', '2004-02-09', '2004-02-10', '2004-02-11', '2004-02-12', '2004-02-13', '2004-02-16', '2004-02-17', '2004-02-18', '2004-02-19', '2004-02-20', '2004-02-23', '2004-02-24', '2004-02-25', '2004-02-26', '2004-02-27', '2004-03-01', '2004-03-02', '2004-03-03', '2004-03-04', '2004-03-05', '2004-03-08', '2004-03-09', '2004-03-10', '2004-03-11', '2004-03-12', '2004-03-15', '2004-03-16', '2004-03-17', '2004-03-18', '2004-03-19', '2004-03-22', '2004-03-23', '2004-03-24', '2004-03-25', '2004-03-26', '2004-03-29', '2004-03-30', '2004-03-31', '2004-04-01', '2004-04-02', '2004-04-05', '2004-04-06', '2004-04-07', '2004-04-08', '2004-04-09', '2004-04-12', '2004-04-13', '2004-04-14', '2004-04-15', '2004-04-16', '2004-04-19', '2004-04-20', '2004-04-21', '2004-04-22', '2004-04-23', '2004-04-26', '2004-04-27', '2004-04-28', '2004-04-29', '2004-04-30', '2004-05-10', '2004-05-11', '2004-05-12', '2004-05-13', '2004-05-14', '2004-05-17', '2004-05-18', '2004-05-19', '2004-05-20', '2004-05-21', '2004-05-24', '2004-05-25', '2004-05-26', '2004-05-27', '2004-05-28', '2004-05-31', - '2004-06-01', '2004-06-02', '2004-06-03', '2004-06-04', '2004-06-07', '2004-06-08', '2004-06-09', '2004-06-10', '2004-06-11', '2004-06-14', '2004-06-15', '2004-06-16', '2004-06-17', '2004-06-18', '2004-06-21', '2004-06-22', '2004-06-23', '2004-06-24', '2004-06-25', '2004-06-28', '2004-06-29', '2004-06-30', '2004-07-01', '2004-07-02', '2004-07-05', '2004-07-06', '2004-07-07', '2004-07-08', '2004-07-09', '2004-07-12', '2004-07-13', '2004-07-14', '2004-07-15', '2004-07-16', '2004-07-19', '2004-07-20', '2004-07-21', '2004-07-22', '2004-07-23', '2004-07-26', '2004-07-27', '2004-07-28', '2004-07-29', '2004-07-30', '2004-08-02', '2004-08-03', '2004-08-04', '2004-08-05', '2004-08-06', '2004-08-09', '2004-08-10', '2004-08-11', '2004-08-12', '2004-08-13', '2004-08-16', '2004-08-17', '2004-08-18', '2004-08-19', '2004-08-20', '2004-08-23', '2004-08-24', '2004-08-25', '2004-08-26', '2004-08-27', '2004-08-30', '2004-08-31', '2004-09-01', '2004-09-02', '2004-09-03', '2004-09-06', '2004-09-07', '2004-09-08', '2004-09-09', '2004-09-10', '2004-09-13', '2004-09-14', '2004-09-15', '2004-09-16', '2004-09-17', '2004-09-20', '2004-09-21', '2004-09-22', '2004-09-23', '2004-09-24', '2004-09-27', '2004-09-28', '2004-09-29', '2004-09-30', '2004-10-08', '2004-10-11', '2004-10-12', '2004-10-13', '2004-10-14', '2004-10-15', '2004-10-18', '2004-10-19', '2004-10-20', '2004-10-21', '2004-10-22', '2004-10-25', '2004-10-26', '2004-10-27', '2004-10-28', '2004-10-29', '2004-11-01', '2004-11-02', '2004-11-03', '2004-11-04', '2004-11-05', '2004-11-08', '2004-11-09', '2004-11-10', '2004-11-11', '2004-11-12', '2004-11-15', '2004-11-16', '2004-11-17', '2004-11-18', '2004-11-19', '2004-11-22', '2004-11-23', '2004-11-24', '2004-11-25', '2004-11-26', '2004-11-29', '2004-11-30', '2004-12-01', '2004-12-02', '2004-12-03', '2004-12-06', '2004-12-07', '2004-12-08', '2004-12-09', '2004-12-10', '2004-12-13', '2004-12-14', '2004-12-15', '2004-12-16', '2004-12-17', '2004-12-20', '2004-12-21', '2004-12-22', '2004-12-23', '2004-12-24', '2004-12-27', '2004-12-28', '2004-12-29', '2004-12-30', '2004-12-31', '2005-01-04', '2005-01-05', '2005-01-06', '2005-01-07', '2005-01-10', '2005-01-11', '2005-01-12', '2005-01-13', '2005-01-14', '2005-01-17', '2005-01-18', '2005-01-19', '2005-01-20', '2005-01-21', '2005-01-24', '2005-01-25', '2005-01-26', '2005-01-27', '2005-01-28', '2005-01-31', '2005-02-01', '2005-02-02', '2005-02-03', '2005-02-04', '2005-02-16', '2005-02-17', '2005-02-18', '2005-02-21', '2005-02-22', '2005-02-23', '2005-02-24', '2005-02-25', '2005-02-28', '2005-03-01', '2005-03-02', '2005-03-03', '2005-03-04', '2005-03-07', '2005-03-08', '2005-03-09', '2005-03-10', '2005-03-11', '2005-03-14', '2005-03-15', '2005-03-16', '2005-03-17', '2005-03-18', '2005-03-21', '2005-03-22', '2005-03-23', '2005-03-24', '2005-03-25', '2005-03-28', '2005-03-29', '2005-03-30', '2005-03-31', '2005-04-01', '2005-04-04', '2005-04-05', '2005-04-06', '2005-04-07', '2005-04-08', '2005-04-11', '2005-04-12', '2005-04-13', '2005-04-14', '2005-04-15', '2005-04-18', '2005-04-19', '2005-04-20', '2005-04-21', '2005-04-22', '2005-04-25', '2005-04-26', '2005-04-27', '2005-04-28', '2005-04-29', '2005-05-09', '2005-05-10', '2005-05-11', '2005-05-12', '2005-05-13', '2005-05-16', '2005-05-17', '2005-05-18', '2005-05-19', '2005-05-20', '2005-05-23', '2005-05-24', '2005-05-25', '2005-05-26', '2005-05-27', '2005-05-30', '2005-05-31', '2005-06-01', '2005-06-02', '2005-06-03', '2005-06-06', '2005-06-07', '2005-06-08', '2005-06-09', '2005-06-10', '2005-06-13', '2005-06-14', '2005-06-15', '2005-06-16', '2005-06-17', '2005-06-20', '2005-06-21', '2005-06-22', '2005-06-23', '2005-06-24', '2005-06-27', '2005-06-28', '2005-06-29', '2005-06-30', '2005-07-01', '2005-07-04', '2005-07-05', '2005-07-06', '2005-07-07', '2005-07-08', '2005-07-11', '2005-07-12', '2005-07-13', '2005-07-14', '2005-07-15', '2005-07-18', '2005-07-19', '2005-07-20', '2005-07-21', '2005-07-22', '2005-07-25', '2005-07-26', '2005-07-27', '2005-07-28', '2005-07-29', '2005-08-01', '2005-08-02', '2005-08-03', '2005-08-04', '2005-08-05', '2005-08-08', '2005-08-09', '2005-08-10', '2005-08-11', '2005-08-12', '2005-08-15', '2005-08-16', '2005-08-17', '2005-08-18', '2005-08-19', '2005-08-22', '2005-08-23', '2005-08-24', '2005-08-25', '2005-08-26', '2005-08-29', '2005-08-30', '2005-08-31', '2005-09-01', '2005-09-02', '2005-09-05', '2005-09-06', '2005-09-07', '2005-09-08', '2005-09-09', '2005-09-12', '2005-09-13', '2005-09-14', '2005-09-15', '2005-09-16', '2005-09-19', '2005-09-20', '2005-09-21', '2005-09-22', '2005-09-23', '2005-09-26', '2005-09-27', '2005-09-28', '2005-09-29', '2005-09-30', '2005-10-10', '2005-10-11', '2005-10-12', '2005-10-13', '2005-10-14', '2005-10-17', '2005-10-18', '2005-10-19', '2005-10-20', '2005-10-21', '2005-10-24', '2005-10-25', '2005-10-26', '2005-10-27', '2005-10-28', '2005-10-31', '2005-11-01', '2005-11-02', '2005-11-03', '2005-11-04', '2005-11-07', '2005-11-08', '2005-11-09', '2005-11-10', '2005-11-11', '2005-11-14', '2005-11-15', '2005-11-16', '2005-11-17', '2005-11-18', '2005-11-21', '2005-11-22', '2005-11-23', '2005-11-24', '2005-11-25', '2005-11-28', '2005-11-29', '2005-11-30', '2005-12-01', '2005-12-02', '2005-12-05', '2005-12-06', '2005-12-07', '2005-12-08', '2005-12-09', '2005-12-12', '2005-12-13', '2005-12-14', '2005-12-15', '2005-12-16', '2005-12-19', '2005-12-20', '2005-12-21', '2005-12-22', '2005-12-23', '2005-12-26', '2005-12-27', '2005-12-28', '2005-12-29', '2005-12-30', '2006-01-04', '2006-01-05', '2006-01-06', '2006-01-09', '2006-01-10', '2006-01-11', '2006-01-12', '2006-01-13', '2006-01-16', '2006-01-17', '2006-01-18', '2006-01-19', '2006-01-20', '2006-01-23', '2006-01-24', '2006-01-25', '2006-02-06', '2006-02-07', '2006-02-08', '2006-02-09', '2006-02-10', '2006-02-13', '2006-02-14', '2006-02-15', '2006-02-16', '2006-02-17', '2006-02-20', '2006-02-21', '2006-02-22', '2006-02-23', '2006-02-24', '2006-02-27', '2006-02-28', '2006-03-01', '2006-03-02', '2006-03-03', '2006-03-06', '2006-03-07', '2006-03-08', '2006-03-09', '2006-03-10', '2006-03-13', '2006-03-14', '2006-03-15', '2006-03-16', '2006-03-17', '2006-03-20', '2006-03-21', '2006-03-22', '2006-03-23', '2006-03-24', '2006-03-27', '2006-03-28', '2006-03-29', '2006-03-30', '2006-03-31', '2006-04-03', '2006-04-04', '2006-04-05', '2006-04-06', '2006-04-07', '2006-04-10', '2006-04-11', '2006-04-12', '2006-04-13', '2006-04-14', '2006-04-17', '2006-04-18', '2006-04-19', '2006-04-20', '2006-04-21', '2006-04-24', '2006-04-25', '2006-04-26', '2006-04-27', '2006-04-28', '2006-05-08', '2006-05-09', '2006-05-10', '2006-05-11', '2006-05-12', '2006-05-15', '2006-05-16', '2006-05-17', '2006-05-18', '2006-05-19', '2006-05-22', '2006-05-23', '2006-05-24', '2006-05-25', '2006-05-26', '2006-05-29', '2006-05-30', '2006-05-31', '2006-06-01', '2006-06-02', '2006-06-05', '2006-06-06', '2006-06-07', '2006-06-08', '2006-06-09', '2006-06-12', '2006-06-13', '2006-06-14', '2006-06-15', '2006-06-16', '2006-06-19', '2006-06-20', '2006-06-21', '2006-06-22', '2006-06-23', '2006-06-26', '2006-06-27', '2006-06-28', '2006-06-29', '2006-06-30', '2006-07-03', '2006-07-04', '2006-07-05', '2006-07-06', '2006-07-07', '2006-07-10', '2006-07-11', '2006-07-12', '2006-07-13', '2006-07-14', '2006-07-17', '2006-07-18', '2006-07-19', '2006-07-20', '2006-07-21', '2006-07-24', '2006-07-25', '2006-07-26', '2006-07-27', '2006-07-28', '2006-07-31', '2006-08-01', '2006-08-02', '2006-08-03', '2006-08-04', '2006-08-07', '2006-08-08', '2006-08-09', '2006-08-10', '2006-08-11', '2006-08-14', '2006-08-15', '2006-08-16', '2006-08-17', '2006-08-18', '2006-08-21', '2006-08-22', '2006-08-23', '2006-08-24', '2006-08-25', '2006-08-28', '2006-08-29', '2006-08-30', '2006-08-31', '2006-09-01', '2006-09-04', '2006-09-05', '2006-09-06', '2006-09-07', '2006-09-08', '2006-09-11', '2006-09-12', '2006-09-13', '2006-09-14', '2006-09-15', '2006-09-18', '2006-09-19', '2006-09-20', '2006-09-21', '2006-09-22', '2006-09-25', '2006-09-26', '2006-09-27', '2006-09-28', '2006-09-29', '2006-10-09', '2006-10-10', '2006-10-11', '2006-10-12', '2006-10-13', '2006-10-16', '2006-10-17', '2006-10-18', '2006-10-19', '2006-10-20', '2006-10-23', '2006-10-24', '2006-10-25', '2006-10-26', '2006-10-27', '2006-10-30', '2006-10-31', '2006-11-01', '2006-11-02', '2006-11-03', '2006-11-06', '2006-11-07', '2006-11-08', '2006-11-09', '2006-11-10', '2006-11-13', '2006-11-14', '2006-11-15', '2006-11-16', '2006-11-17', '2006-11-20', '2006-11-21', '2006-11-22', '2006-11-23', '2006-11-24', '2006-11-27', '2006-11-28', '2006-11-29', '2006-11-30', '2006-12-01', '2006-12-04', '2006-12-05', '2006-12-06', '2006-12-07', '2006-12-08', '2006-12-11', '2006-12-12', '2006-12-13', '2006-12-14', '2006-12-15', '2006-12-18', '2006-12-19', '2006-12-20', '2006-12-21', '2006-12-22', '2006-12-25', '2006-12-26', '2006-12-27', '2006-12-28', '2006-12-29', '2007-01-04', '2007-01-05', '2007-01-08', '2007-01-09', '2007-01-10', '2007-01-11', '2007-01-12', '2007-01-15', '2007-01-16', '2007-01-17', '2007-01-18', '2007-01-19', '2007-01-22', '2007-01-23', '2007-01-24', '2007-01-25', '2007-01-26', '2007-01-29', '2007-01-30', '2007-01-31', '2007-02-01', '2007-02-02', '2007-02-05', '2007-02-06', '2007-02-07', '2007-02-08', '2007-02-09', '2007-02-12', '2007-02-13', '2007-02-14', '2007-02-15', '2007-02-16', '2007-02-26', '2007-02-27', '2007-02-28', '2007-03-01', '2007-03-02', '2007-03-05', '2007-03-06', '2007-03-07', '2007-03-08', '2007-03-09', '2007-03-12', '2007-03-13', '2007-03-14', '2007-03-15', '2007-03-16', '2007-03-19', '2007-03-20', '2007-03-21', '2007-03-22', '2007-03-23', '2007-03-26', '2007-03-27', '2007-03-28', '2007-03-29', '2007-03-30', '2007-04-02', '2007-04-03', '2007-04-04', '2007-04-05', '2007-04-06', '2007-04-09', '2007-04-10', '2007-04-11', '2007-04-12', '2007-04-13', '2007-04-16', '2007-04-17', '2007-04-18', '2007-04-19', '2007-04-20', '2007-04-23', '2007-04-24', '2007-04-25', '2007-04-26', '2007-04-27', '2007-04-30', '2007-05-08', '2007-05-09', '2007-05-10', '2007-05-11', '2007-05-14', '2007-05-15', '2007-05-16', '2007-05-17', '2007-05-18', '2007-05-21', '2007-05-22', '2007-05-23', '2007-05-24', '2007-05-25', '2007-05-28', '2007-05-29', '2007-05-30', '2007-05-31', '2007-06-01', '2007-06-04', '2007-06-05', '2007-06-06', '2007-06-07', '2007-06-08', '2007-06-11', '2007-06-12', '2007-06-13', '2007-06-14', '2007-06-15', '2007-06-18', '2007-06-19', '2007-06-20', '2007-06-21', '2007-06-22', '2007-06-25', '2007-06-26', '2007-06-27', '2007-06-28', '2007-06-29', '2007-07-02', '2007-07-03', '2007-07-04', '2007-07-05', '2007-07-06', '2007-07-09', '2007-07-10', '2007-07-11', '2007-07-12', '2007-07-13', '2007-07-16', '2007-07-17', '2007-07-18', '2007-07-19', '2007-07-20', '2007-07-23', '2007-07-24', '2007-07-25', '2007-07-26', '2007-07-27', '2007-07-30', '2007-07-31', '2007-08-01', '2007-08-02', '2007-08-03', '2007-08-06', '2007-08-07', '2007-08-08', '2007-08-09', '2007-08-10', '2007-08-13', '2007-08-14', '2007-08-15', '2007-08-16', '2007-08-17', '2007-08-20', '2007-08-21', '2007-08-22', '2007-08-23', '2007-08-24', '2007-08-27', '2007-08-28', '2007-08-29', '2007-08-30', '2007-08-31', '2007-09-03', '2007-09-04', '2007-09-05', '2007-09-06', '2007-09-07', '2007-09-10', '2007-09-11', '2007-09-12', '2007-09-13', '2007-09-14', '2007-09-17', '2007-09-18', '2007-09-19', '2007-09-20', '2007-09-21', '2007-09-24', '2007-09-25', '2007-09-26', '2007-09-27', '2007-09-28', '2007-10-08', '2007-10-09', '2007-10-10', '2007-10-11', '2007-10-12', '2007-10-15', '2007-10-16', '2007-10-17', '2007-10-18', '2007-10-19', '2007-10-22', '2007-10-23', '2007-10-24', '2007-10-25', '2007-10-26', '2007-10-29', '2007-10-30', '2007-10-31', '2007-11-01', '2007-11-02', '2007-11-05', '2007-11-06', '2007-11-07', '2007-11-08', '2007-11-09', '2007-11-12', '2007-11-13', '2007-11-14', '2007-11-15', '2007-11-16', '2007-11-19', '2007-11-20', '2007-11-21', '2007-11-22', '2007-11-23', '2007-11-26', '2007-11-27', '2007-11-28', '2007-11-29', '2007-11-30', '2007-12-03', '2007-12-04', '2007-12-05', '2007-12-06', '2007-12-07', '2007-12-10', '2007-12-11', '2007-12-12', '2007-12-13', '2007-12-14', '2007-12-17', '2007-12-18', '2007-12-19', '2007-12-20', '2007-12-21', '2007-12-24', '2007-12-25', '2007-12-26', '2007-12-27', '2007-12-28', '2008-01-02', '2008-01-03', '2008-01-04', '2008-01-07', '2008-01-08', '2008-01-09', '2008-01-10', '2008-01-11', '2008-01-14', '2008-01-15', '2008-01-16', '2008-01-17', '2008-01-18', '2008-01-21', '2008-01-22', '2008-01-23', '2008-01-24', '2008-01-25', '2008-01-28', '2008-01-29', '2008-01-30', '2008-01-31', '2008-02-01', '2008-02-04', '2008-02-05', '2008-02-13', '2008-02-14', '2008-02-15', '2008-02-18', '2008-02-19', '2008-02-20', '2008-02-21', '2008-02-22', '2008-02-25', '2008-02-26', '2008-02-27', '2008-02-28', '2008-02-29', '2008-03-03', '2008-03-04', '2008-03-05', '2008-03-06', '2008-03-07', '2008-03-10', '2008-03-11', '2008-03-12', '2008-03-13', '2008-03-14', '2008-03-17', '2008-03-18', '2008-03-19', '2008-03-20', '2008-03-21', '2008-03-24', '2008-03-25', '2008-03-26', '2008-03-27', '2008-03-28', '2008-03-31', '2008-04-01', '2008-04-02', '2008-04-03', '2008-04-07', '2008-04-08', '2008-04-09', '2008-04-10', '2008-04-11', '2008-04-14', '2008-04-15', '2008-04-16', '2008-04-17', '2008-04-18', '2008-04-21', '2008-04-22', '2008-04-23', '2008-04-24', '2008-04-25', '2008-04-28', '2008-04-29', '2008-04-30', '2008-05-05', '2008-05-06', '2008-05-07', '2008-05-08', '2008-05-09', '2008-05-12', '2008-05-13', '2008-05-14', '2008-05-15', '2008-05-16', '2008-05-19', '2008-05-20', '2008-05-21', '2008-05-22', '2008-05-23', '2008-05-26', '2008-05-27', '2008-05-28', '2008-05-29', '2008-05-30', '2008-06-02', '2008-06-03', '2008-06-04', '2008-06-05', '2008-06-06', '2008-06-10', '2008-06-11', '2008-06-12', '2008-06-13', '2008-06-16', '2008-06-17', '2008-06-18', '2008-06-19', '2008-06-20', '2008-06-23', '2008-06-24', '2008-06-25', '2008-06-26', '2008-06-27', '2008-06-30', '2008-07-01', '2008-07-02', '2008-07-03', '2008-07-04', '2008-07-07', '2008-07-08', '2008-07-09', '2008-07-10', '2008-07-11', '2008-07-14', '2008-07-15', '2008-07-16', '2008-07-17', '2008-07-18', '2008-07-21', '2008-07-22', '2008-07-23', '2008-07-24', '2008-07-25', '2008-07-28', '2008-07-29', '2008-07-30', '2008-07-31', '2008-08-01', '2008-08-04', '2008-08-05', '2008-08-06', '2008-08-07', '2008-08-08', '2008-08-11', '2008-08-12', '2008-08-13', '2008-08-14', '2008-08-15', '2008-08-18', '2008-08-19', '2008-08-20', '2008-08-21', '2008-08-22', '2008-08-25', '2008-08-26', '2008-08-27', '2008-08-28', '2008-08-29', '2008-09-01', '2008-09-02', '2008-09-03', '2008-09-04', '2008-09-05', '2008-09-08', '2008-09-09', '2008-09-10', '2008-09-11', '2008-09-12', '2008-09-16', '2008-09-17', '2008-09-18', '2008-09-19', '2008-09-22', '2008-09-23', '2008-09-24', '2008-09-25', '2008-09-26', '2008-10-06', '2008-10-07', '2008-10-08', '2008-10-09', '2008-10-10', '2008-10-13', '2008-10-14', '2008-10-15', '2008-10-16', '2008-10-17', '2008-10-20', '2008-10-21', '2008-10-22', '2008-10-23', '2008-10-24', '2008-10-27', '2008-10-28', '2008-10-29', '2008-10-30', '2008-10-31', '2008-11-03', '2008-11-04', '2008-11-05', '2008-11-06', '2008-11-07', '2008-11-10', '2008-11-11', '2008-11-12', '2008-11-13', '2008-11-14', '2008-11-17', '2008-11-18', '2008-11-19', '2008-11-20', '2008-11-21', '2008-11-24', '2008-11-25', '2008-11-26', '2008-11-27', '2008-11-28', '2008-12-01', '2008-12-02', '2008-12-03', '2008-12-04', '2008-12-05', '2008-12-08', '2008-12-09', '2008-12-10', '2008-12-11', '2008-12-12', '2008-12-15', '2008-12-16', '2008-12-17', '2008-12-18', '2008-12-19', '2008-12-22', '2008-12-23', '2008-12-24', '2008-12-25', '2008-12-26', '2008-12-29', '2008-12-30', '2008-12-31', '2009-01-05', '2009-01-06', '2009-01-07', '2009-01-08', '2009-01-09', '2009-01-12', '2009-01-13', '2009-01-14', '2009-01-15', '2009-01-16', '2009-01-19', '2009-01-20', '2009-01-21', '2009-01-22', '2009-01-23', '2009-02-02', '2009-02-03', '2009-02-04', '2009-02-05', '2009-02-06', '2009-02-09', '2009-02-10', '2009-02-11', '2009-02-12', '2009-02-13', '2009-02-16', '2009-02-17', '2009-02-18', '2009-02-19', '2009-02-20', '2009-02-23', '2009-02-24', '2009-02-25', '2009-02-26', '2009-02-27', '2009-03-02', '2009-03-03', '2009-03-04', '2009-03-05', '2009-03-06', '2009-03-09', '2009-03-10', '2009-03-11', '2009-03-12', '2009-03-13', '2009-03-16', '2009-03-17', '2009-03-18', '2009-03-19', '2009-03-20', '2009-03-23', '2009-03-24', '2009-03-25', '2009-03-26', '2009-03-27', '2009-03-30', '2009-03-31', '2009-04-01', '2009-04-02', '2009-04-03', '2009-04-07', '2009-04-08', '2009-04-09', '2009-04-10', '2009-04-13', '2009-04-14', '2009-04-15', '2009-04-16', '2009-04-17', '2009-04-20', '2009-04-21', '2009-04-22', '2009-04-23', '2009-04-24', '2009-04-27', '2009-04-28', '2009-04-29', '2009-04-30', '2009-05-04', '2009-05-05', '2009-05-06', '2009-05-07', '2009-05-08', '2009-05-11', '2009-05-12', '2009-05-13', '2009-05-14', '2009-05-15', '2009-05-18', '2009-05-19', '2009-05-20', '2009-05-21', '2009-05-22', '2009-05-25', '2009-05-26', '2009-05-27', '2009-06-01', '2009-06-02', '2009-06-03', '2009-06-04', '2009-06-05', '2009-06-08', '2009-06-09', '2009-06-10', '2009-06-11', '2009-06-12', '2009-06-15', '2009-06-16', '2009-06-17', '2009-06-18', '2009-06-19', '2009-06-22', '2009-06-23', '2009-06-24', '2009-06-25', '2009-06-26', '2009-06-29', '2009-06-30', '2009-07-01', '2009-07-02', '2009-07-03', '2009-07-06', '2009-07-07', '2009-07-08', '2009-07-09', '2009-07-10', '2009-07-13', '2009-07-14', '2009-07-15', '2009-07-16', '2009-07-17', '2009-07-20', '2009-07-21', '2009-07-22', '2009-07-23', '2009-07-24', '2009-07-27', '2009-07-28', '2009-07-29', '2009-07-30', '2009-07-31', '2009-08-03', '2009-08-04', '2009-08-05', '2009-08-06', '2009-08-07', '2009-08-10', '2009-08-11', '2009-08-12', '2009-08-13', '2009-08-14', '2009-08-17', '2009-08-18', '2009-08-19', '2009-08-20', '2009-08-21', '2009-08-24', '2009-08-25', '2009-08-26', '2009-08-27', '2009-08-28', '2009-08-31', '2009-09-01', '2009-09-02', '2009-09-03', '2009-09-04', '2009-09-07', '2009-09-08', '2009-09-09', '2009-09-10', '2009-09-11', '2009-09-14', '2009-09-15', '2009-09-16', '2009-09-17', '2009-09-18', '2009-09-21', '2009-09-22', '2009-09-23', '2009-09-24', '2009-09-25', '2009-09-28', '2009-09-29', '2009-09-30', '2009-10-09', '2009-10-12', '2009-10-13', '2009-10-14', '2009-10-15', '2009-10-16', '2009-10-19', '2009-10-20', '2009-10-21', '2009-10-22', '2009-10-23', '2009-10-26', '2009-10-27', '2009-10-28', '2009-10-29', '2009-10-30', '2009-11-02', '2009-11-03', '2009-11-04', '2009-11-05', '2009-11-06', '2009-11-09', '2009-11-10', '2009-11-11', '2009-11-12', '2009-11-13', '2009-11-16', '2009-11-17', '2009-11-18', '2009-11-19', '2009-11-20', '2009-11-23', '2009-11-24', '2009-11-25', '2009-11-26', '2009-11-27', '2009-11-30', '2009-12-01', '2009-12-02', '2009-12-03', '2009-12-04', '2009-12-07', '2009-12-08', '2009-12-09', '2009-12-10', '2009-12-11', '2009-12-14', '2009-12-15', '2009-12-16', '2009-12-17', '2009-12-18', '2009-12-21', '2009-12-22', '2009-12-23', '2009-12-24', '2009-12-25', '2009-12-28', '2009-12-29', '2009-12-30', '2009-12-31', '2010-01-04', '2010-01-05', '2010-01-06', '2010-01-07', '2010-01-08', '2010-01-11', '2010-01-12', '2010-01-13', '2010-01-14', '2010-01-15', '2010-01-18', '2010-01-19', '2010-01-20', '2010-01-21', '2010-01-22', '2010-01-25', '2010-01-26', '2010-01-27', '2010-01-28', '2010-01-29', '2010-02-01', '2010-02-02', '2010-02-03', '2010-02-04', '2010-02-05', '2010-02-08', '2010-02-09', '2010-02-10', '2010-02-11', '2010-02-12', '2010-02-22', '2010-02-23', '2010-02-24', '2010-02-25', '2010-02-26', '2010-03-01', '2010-03-02', '2010-03-03', '2010-03-04', '2010-03-05', '2010-03-08', '2010-03-09', '2010-03-10', '2010-03-11', '2010-03-12', '2010-03-15', '2010-03-16', '2010-03-17', '2010-03-18', '2010-03-19', '2010-03-22', '2010-03-23', '2010-03-24', '2010-03-25', '2010-03-26', '2010-03-29', '2010-03-30', '2010-03-31', '2010-04-01', '2010-04-02', '2010-04-06', '2010-04-07', '2010-04-08', '2010-04-09', '2010-04-12', '2010-04-13', '2010-04-14', '2010-04-15', '2010-04-16', '2010-04-19', '2010-04-20', '2010-04-21', '2010-04-22', '2010-04-23', '2010-04-26', '2010-04-27', '2010-04-28', '2010-04-29', '2010-04-30', '2010-05-04', '2010-05-05', '2010-05-06', '2010-05-07', '2010-05-10', '2010-05-11', '2010-05-12', '2010-05-13', '2010-05-14', '2010-05-17', '2010-05-18', '2010-05-19', '2010-05-20', '2010-05-21', '2010-05-24', '2010-05-25', '2010-05-26', '2010-05-27', '2010-05-28', '2010-05-31', '2010-06-01', '2010-06-02', '2010-06-03', '2010-06-04', '2010-06-07', '2010-06-08', '2010-06-09', '2010-06-10', '2010-06-11', '2010-06-17', '2010-06-18', '2010-06-21', '2010-06-22', '2010-06-23', '2010-06-24', '2010-06-25', '2010-06-28', '2010-06-29', '2010-06-30', '2010-07-01', '2010-07-02', '2010-07-05', '2010-07-06', '2010-07-07', '2010-07-08', '2010-07-09', '2010-07-12', '2010-07-13', '2010-07-14', '2010-07-15', '2010-07-16', '2010-07-19', '2010-07-20', '2010-07-21', '2010-07-22', '2010-07-23', '2010-07-26', '2010-07-27', '2010-07-28', '2010-07-29', '2010-07-30', '2010-08-02', '2010-08-03', '2010-08-04', '2010-08-05', '2010-08-06', '2010-08-09', '2010-08-10', '2010-08-11', '2010-08-12', '2010-08-13', '2010-08-16', '2010-08-17', '2010-08-18', '2010-08-19', '2010-08-20', '2010-08-23', '2010-08-24', '2010-08-25', '2010-08-26', '2010-08-27', '2010-08-30', '2010-08-31', '2010-09-01', '2010-09-02', '2010-09-03', '2010-09-06', '2010-09-07', '2010-09-08', '2010-09-09', '2010-09-10', '2010-09-13', '2010-09-14', '2010-09-15', '2010-09-16', '2010-09-17', '2010-09-20', '2010-09-21', '2010-09-27', '2010-09-28', '2010-09-29', '2010-09-30', '2010-10-08', '2010-10-11', '2010-10-12', '2010-10-13', '2010-10-14', '2010-10-15', '2010-10-18', '2010-10-19', '2010-10-20', '2010-10-21', '2010-10-22', '2010-10-25', '2010-10-26', '2010-10-27', '2010-10-28', '2010-10-29', '2010-11-01', '2010-11-02', '2010-11-03', '2010-11-04', '2010-11-05', '2010-11-08', '2010-11-09', '2010-11-10', '2010-11-11', '2010-11-12', '2010-11-15', '2010-11-16', '2010-11-17', '2010-11-18', '2010-11-19', '2010-11-22', '2010-11-23', '2010-11-24', '2010-11-25', '2010-11-26', '2010-11-29', '2010-11-30', '2010-12-01', '2010-12-02', '2010-12-03', '2010-12-06', '2010-12-07', '2010-12-08', '2010-12-09', '2010-12-10', '2010-12-13', '2010-12-14', '2010-12-15', '2010-12-16', '2010-12-17', '2010-12-20', '2010-12-21', '2010-12-22', '2010-12-23', '2010-12-24', '2010-12-27', '2010-12-28', '2010-12-29', '2010-12-30', '2010-12-31', '2011-01-04', '2011-01-05', '2011-01-06', '2011-01-07', '2011-01-10', '2011-01-11', '2011-01-12', '2011-01-13', '2011-01-14', '2011-01-17', '2011-01-18', '2011-01-19', '2011-01-20', '2011-01-21', '2011-01-24', '2011-01-25', '2011-01-26', '2011-01-27', '2011-01-28', '2011-01-31', '2011-02-01', '2011-02-09', '2011-02-10', '2011-02-11', '2011-02-14', '2011-02-15', '2011-02-16', '2011-02-17', '2011-02-18', '2011-02-21', '2011-02-22', '2011-02-23', '2011-02-24', '2011-02-25', '2011-02-28', '2011-03-01', '2011-03-02', '2011-03-03', '2011-03-04', '2011-03-07', '2011-03-08', '2011-03-09', '2011-03-10', '2011-03-11', '2011-03-14', '2011-03-15', '2011-03-16', '2011-03-17', '2011-03-18', '2011-03-21', '2011-03-22', '2011-03-23', '2011-03-24', '2011-03-25', '2011-03-28', '2011-03-29', '2011-03-30', '2011-03-31', '2011-04-01', '2011-04-06', '2011-04-07', '2011-04-08', '2011-04-11', '2011-04-12', '2011-04-13', '2011-04-14', '2011-04-15', '2011-04-18', '2011-04-19', '2011-04-20', '2011-04-21', '2011-04-22', '2011-04-25', '2011-04-26', '2011-04-27', '2011-04-28', '2011-04-29', '2011-05-03', '2011-05-04', '2011-05-05', '2011-05-06', '2011-05-09', '2011-05-10', '2011-05-11', '2011-05-12', '2011-05-13', '2011-05-16', '2011-05-17', '2011-05-18', '2011-05-19', '2011-05-20', '2011-05-23', '2011-05-24', '2011-05-25', '2011-05-26', '2011-05-27', '2011-05-30', '2011-05-31', '2011-06-01', '2011-06-02', '2011-06-03', '2011-06-07', '2011-06-08', '2011-06-09', '2011-06-10', '2011-06-13', '2011-06-14', '2011-06-15', '2011-06-16', '2011-06-17', '2011-06-20', '2011-06-21', '2011-06-22', '2011-06-23', '2011-06-24', '2011-06-27', '2011-06-28', '2011-06-29', '2011-06-30', '2011-07-01', '2011-07-04', '2011-07-05', '2011-07-06', '2011-07-07', '2011-07-08', '2011-07-11', '2011-07-12', '2011-07-13', '2011-07-14', '2011-07-15', '2011-07-18', '2011-07-19', '2011-07-20', '2011-07-21', '2011-07-22', '2011-07-25', '2011-07-26', '2011-07-27', '2011-07-28', '2011-07-29', '2011-08-01', '2011-08-02', '2011-08-03', '2011-08-04', '2011-08-05', '2011-08-08', '2011-08-09', '2011-08-10', '2011-08-11', '2011-08-12', '2011-08-15', '2011-08-16', '2011-08-17', '2011-08-18', '2011-08-19', '2011-08-22', '2011-08-23', '2011-08-24', '2011-08-25', '2011-08-26', '2011-08-29', '2011-08-30', '2011-08-31', '2011-09-01', '2011-09-02', '2011-09-05', '2011-09-06', '2011-09-07', '2011-09-08', '2011-09-09', '2011-09-13', '2011-09-14', '2011-09-15', '2011-09-16', '2011-09-19', '2011-09-20', '2011-09-21', '2011-09-22', '2011-09-23', '2011-09-26', '2011-09-27', '2011-09-28', '2011-09-29', '2011-09-30', '2011-10-10', '2011-10-11', '2011-10-12', '2011-10-13', '2011-10-14', '2011-10-17', '2011-10-18', '2011-10-19', '2011-10-20', '2011-10-21', '2011-10-24', '2011-10-25', '2011-10-26', '2011-10-27', '2011-10-28', '2011-10-31', '2011-11-01', '2011-11-02', '2011-11-03', '2011-11-04', '2011-11-07', '2011-11-08', '2011-11-09', '2011-11-10', '2011-11-11', '2011-11-14', '2011-11-15', '2011-11-16', '2011-11-17', '2011-11-18', '2011-11-21', '2011-11-22', '2011-11-23', '2011-11-24', '2011-11-25', '2011-11-28', '2011-11-29', '2011-11-30', '2011-12-01', '2011-12-02', '2011-12-05', '2011-12-06', '2011-12-07', '2011-12-08', '2011-12-09', '2011-12-12', '2011-12-13', '2011-12-14', '2011-12-15', '2011-12-16', '2011-12-19', '2011-12-20', '2011-12-21', '2011-12-22', '2011-12-23', '2011-12-26', '2011-12-27', '2011-12-28', '2011-12-29', '2011-12-30', '2012-01-04', '2012-01-05', '2012-01-06', '2012-01-09', '2012-01-10', '2012-01-11', '2012-01-12', '2012-01-13', '2012-01-16', '2012-01-17', '2012-01-18', '2012-01-19', '2012-01-20', '2012-01-30', '2012-01-31', '2012-02-01', '2012-02-02', '2012-02-03', '2012-02-06', '2012-02-07', '2012-02-08', '2012-02-09', '2012-02-10', '2012-02-13', '2012-02-14', '2012-02-15', '2012-02-16', '2012-02-17', '2012-02-20', '2012-02-21', '2012-02-22', '2012-02-23', '2012-02-24', '2012-02-27', '2012-02-28', '2012-02-29', '2012-03-01', '2012-03-02', '2012-03-05', '2012-03-06', '2012-03-07', '2012-03-08', '2012-03-09', '2012-03-12', '2012-03-13', '2012-03-14', '2012-03-15', '2012-03-16', '2012-03-19', '2012-03-20', '2012-03-21', '2012-03-22', '2012-03-23', '2012-03-26', '2012-03-27', '2012-03-28', '2012-03-29', '2012-03-30', '2012-04-05', '2012-04-06', '2012-04-09', '2012-04-10', '2012-04-11', '2012-04-12', '2012-04-13', '2012-04-16', '2012-04-17', '2012-04-18', '2012-04-19', '2012-04-20', '2012-04-23', '2012-04-24', '2012-04-25', '2012-04-26', '2012-04-27', '2012-05-02', '2012-05-03', '2012-05-04', '2012-05-07', '2012-05-08', '2012-05-09', '2012-05-10', '2012-05-11', '2012-05-14', '2012-05-15', '2012-05-16', '2012-05-17', '2012-05-18', '2012-05-21', '2012-05-22', '2012-05-23', '2012-05-24', '2012-05-25', '2012-05-28', '2012-05-29', '2012-05-30', '2012-05-31', '2012-06-01', '2012-06-04', '2012-06-05', '2012-06-06', '2012-06-07', '2012-06-08', '2012-06-11', '2012-06-12', '2012-06-13', '2012-06-14', '2012-06-15', '2012-06-18', '2012-06-19', '2012-06-20', '2012-06-21', '2012-06-25', '2012-06-26', '2012-06-27', '2012-06-28', '2012-06-29', '2012-07-02', '2012-07-03', '2012-07-04', '2012-07-05', '2012-07-06', '2012-07-09', '2012-07-10', '2012-07-11', '2012-07-12', '2012-07-13', '2012-07-16', '2012-07-17', '2012-07-18', '2012-07-19', '2012-07-20', '2012-07-23', '2012-07-24', '2012-07-25', '2012-07-26', '2012-07-27', '2012-07-30', '2012-07-31', '2012-08-01', '2012-08-02', '2012-08-03', '2012-08-06', '2012-08-07', '2012-08-08', '2012-08-09', '2012-08-10', '2012-08-13', '2012-08-14', '2012-08-15', '2012-08-16', '2012-08-17', '2012-08-20', '2012-08-21', '2012-08-22', '2012-08-23', '2012-08-24', '2012-08-27', '2012-08-28', '2012-08-29', '2012-08-30', '2012-08-31', '2012-09-03', '2012-09-04', '2012-09-05', '2012-09-06', '2012-09-07', '2012-09-10', '2012-09-11', '2012-09-12', '2012-09-13', '2012-09-14', '2012-09-17', '2012-09-18', '2012-09-19', '2012-09-20', '2012-09-21', '2012-09-24', '2012-09-25', '2012-09-26', '2012-09-27', '2012-09-28', '2012-10-08', '2012-10-09', '2012-10-10', '2012-10-11', '2012-10-12', '2012-10-15', '2012-10-16', '2012-10-17', '2012-10-18', '2012-10-19', '2012-10-22', '2012-10-23', '2012-10-24', '2012-10-25', '2012-10-26', '2012-10-29', '2012-10-30', '2012-10-31', '2012-11-01', '2012-11-02', '2012-11-05', '2012-11-06', '2012-11-07', '2012-11-08', '2012-11-09', '2012-11-12', '2012-11-13', '2012-11-14', '2012-11-15', '2012-11-16', '2012-11-19', '2012-11-20', '2012-11-21', '2012-11-22', '2012-11-23', '2012-11-26', '2012-11-27', '2012-11-28', '2012-11-29', '2012-11-30', '2012-12-03', '2012-12-04', '2012-12-05', '2012-12-06', '2012-12-07', '2012-12-10', '2012-12-11', '2012-12-12', '2012-12-13', '2012-12-14', '2012-12-17', '2012-12-18', '2012-12-19', '2012-12-20', '2012-12-21', '2012-12-24', '2012-12-25', '2012-12-26', '2012-12-27', '2012-12-28', '2012-12-31', '2013-01-04', '2013-01-07', '2013-01-08', '2013-01-09', '2013-01-10', '2013-01-11', '2013-01-14', '2013-01-15', '2013-01-16', '2013-01-17', '2013-01-18', '2013-01-21', '2013-01-22', '2013-01-23', '2013-01-24', '2013-01-25', '2013-01-28', '2013-01-29', '2013-01-30', '2013-01-31', '2013-02-01', '2013-02-04', '2013-02-05', '2013-02-06', '2013-02-07', '2013-02-08', '2013-02-18', '2013-02-19', '2013-02-20', '2013-02-21', '2013-02-22', '2013-02-25', '2013-02-26', '2013-02-27', '2013-02-28', '2013-03-01', '2013-03-04', '2013-03-05', '2013-03-06', '2013-03-07', '2013-03-08', '2013-03-11', '2013-03-12', '2013-03-13', '2013-03-14', '2013-03-15', '2013-03-18', '2013-03-19', '2013-03-20', '2013-03-21', '2013-03-22', '2013-03-25', '2013-03-26', '2013-03-27', '2013-03-28', '2013-03-29', '2013-04-01', '2013-04-02', '2013-04-03', '2013-04-08', '2013-04-09', '2013-04-10', '2013-04-11', '2013-04-12', '2013-04-15', '2013-04-16', '2013-04-17', '2013-04-18', '2013-04-19', '2013-04-22', '2013-04-23', '2013-04-24', '2013-04-25', '2013-04-26', '2013-05-02', '2013-05-03', '2013-05-06', '2013-05-07', '2013-05-08', '2013-05-09', '2013-05-10', '2013-05-13', '2013-05-14', '2013-05-15', '2013-05-16', '2013-05-17', '2013-05-20', '2013-05-21', '2013-05-22', '2013-05-23', '2013-05-24', '2013-05-27', '2013-05-28', '2013-05-29', '2013-05-30', '2013-05-31', '2013-06-03', '2013-06-04', '2013-06-05', '2013-06-06', '2013-06-07', '2013-06-13', '2013-06-14', '2013-06-17', '2013-06-18', '2013-06-19', '2013-06-20', '2013-06-21', '2013-06-24', '2013-06-25', '2013-06-26', '2013-06-27', '2013-06-28', '2013-07-01', '2013-07-02', '2013-07-03', '2013-07-04', '2013-07-05', '2013-07-08', '2013-07-09', '2013-07-10', '2013-07-11', '2013-07-12', '2013-07-15', '2013-07-16', '2013-07-17', '2013-07-18', '2013-07-19', '2013-07-22', '2013-07-23', '2013-07-24', '2013-07-25', '2013-07-26', '2013-07-29', '2013-07-30', '2013-07-31', '2013-08-01', '2013-08-02', '2013-08-05', '2013-08-06', '2013-08-07', '2013-08-08', '2013-08-09', '2013-08-12', '2013-08-13', '2013-08-14', '2013-08-15', '2013-08-16', '2013-08-19', '2013-08-20', '2013-08-21', '2013-08-22', '2013-08-23', '2013-08-26', '2013-08-27', '2013-08-28', '2013-08-29', '2013-08-30', '2013-09-02', '2013-09-03', '2013-09-04', '2013-09-05', '2013-09-06', '2013-09-09', '2013-09-10', '2013-09-11', '2013-09-12', '2013-09-13', '2013-09-16', '2013-09-17', '2013-09-18', '2013-09-23', '2013-09-24', '2013-09-25', '2013-09-26', '2013-09-27', '2013-09-30', '2013-10-08', '2013-10-09', '2013-10-10', '2013-10-11', '2013-10-14', '2013-10-15', '2013-10-16', '2013-10-17', '2013-10-18', '2013-10-21', '2013-10-22', '2013-10-23', '2013-10-24', '2013-10-25', '2013-10-28', '2013-10-29', '2013-10-30', '2013-10-31', '2013-11-01', '2013-11-04', '2013-11-05', '2013-11-06', '2013-11-07', '2013-11-08', '2013-11-11', '2013-11-12', '2013-11-13', '2013-11-14', '2013-11-15', '2013-11-18', '2013-11-19', '2013-11-20', '2013-11-21', '2013-11-22', '2013-11-25', '2013-11-26', '2013-11-27', '2013-11-28', '2013-11-29', '2013-12-02', '2013-12-03', '2013-12-04', '2013-12-05', '2013-12-06', '2013-12-09', '2013-12-10', '2013-12-11', '2013-12-12', '2013-12-13', '2013-12-16', '2013-12-17', '2013-12-18', '2013-12-19', '2013-12-20', '2013-12-23', '2013-12-24', '2013-12-25', '2013-12-26', '2013-12-27', '2013-12-30', '2013-12-31', '2014-01-02', '2014-01-03', '2014-01-06', '2014-01-07', '2014-01-08', '2014-01-09', '2014-01-10', '2014-01-13', '2014-01-14', '2014-01-15', '2014-01-16', '2014-01-17', '2014-01-20', '2014-01-21', '2014-01-22', '2014-01-23', '2014-01-24', '2014-01-27', '2014-01-28', '2014-01-29', '2014-01-30', '2014-02-07', '2014-02-10', '2014-02-11', '2014-02-12', '2014-02-13', '2014-02-14', '2014-02-17', '2014-02-18', '2014-02-19', '2014-02-20', '2014-02-21', '2014-02-24', '2014-02-25', '2014-02-26', '2014-02-27', '2014-02-28', '2014-03-03', '2014-03-04', '2014-03-05', '2014-03-06', '2014-03-07', '2014-03-10', '2014-03-11', '2014-03-12', '2014-03-13', '2014-03-14', '2014-03-17', '2014-03-18', '2014-03-19', '2014-03-20', '2014-03-21', '2014-03-24', '2014-03-25', '2014-03-26', '2014-03-27', '2014-03-28', '2014-03-31', '2014-04-01', '2014-04-02', '2014-04-03', '2014-04-04', '2014-04-08', '2014-04-09', '2014-04-10', '2014-04-11', '2014-04-14', '2014-04-15', '2014-04-16', '2014-04-17', '2014-04-18', '2014-04-21', '2014-04-22', '2014-04-23', '2014-04-24', '2014-04-25', '2014-04-28', '2014-04-29', '2014-04-30', '2014-05-05', '2014-05-06', '2014-05-07', '2014-05-08', '2014-05-09', '2014-05-12', '2014-05-13', '2014-05-14', '2014-05-15', '2014-05-16', '2014-05-19', '2014-05-20', '2014-05-21', '2014-05-22', '2014-05-23', '2014-05-26', '2014-05-27', '2014-05-28', '2014-05-29', '2014-05-30', '2014-06-03', '2014-06-04', '2014-06-05', '2014-06-06', '2014-06-09', '2014-06-10', '2014-06-11', '2014-06-12', '2014-06-13', '2014-06-16', '2014-06-17', '2014-06-18', '2014-06-19', '2014-06-20', '2014-06-23', '2014-06-24', '2014-06-25', '2014-06-26', '2014-06-27', '2014-06-30', '2014-07-01', '2014-07-02', '2014-07-03', '2014-07-04', '2014-07-07', '2014-07-08', '2014-07-09', '2014-07-10', '2014-07-11', '2014-07-14', '2014-07-15', '2014-07-16', '2014-07-17', '2014-07-18', '2014-07-21', '2014-07-22', '2014-07-23', '2014-07-24', '2014-07-25', '2014-07-28', '2014-07-29', '2014-07-30', '2014-07-31', '2014-08-01', '2014-08-04', '2014-08-05', '2014-08-06', '2014-08-07', '2014-08-08', '2014-08-11', '2014-08-12', '2014-08-13', '2014-08-14', '2014-08-15', '2014-08-18', '2014-08-19', '2014-08-20', '2014-08-21', '2014-08-22', '2014-08-25', '2014-08-26', '2014-08-27', '2014-08-28', '2014-08-29', '2014-09-01', '2014-09-02', '2014-09-03', '2014-09-04', '2014-09-05', '2014-09-09', '2014-09-10', '2014-09-11', '2014-09-12', '2014-09-15', '2014-09-16', '2014-09-17', '2014-09-18', '2014-09-19', '2014-09-22', '2014-09-23', '2014-09-24', '2014-09-25', '2014-09-26', '2014-09-29', '2014-09-30', '2014-10-08', '2014-10-09', '2014-10-10', '2014-10-13', '2014-10-14', '2014-10-15', '2014-10-16', '2014-10-17', '2014-10-20', '2014-10-21', '2014-10-22', '2014-10-23', '2014-10-24', '2014-10-27', '2014-10-28', '2014-10-29', '2014-10-30', '2014-10-31', '2014-11-03', '2014-11-04', '2014-11-05', '2014-11-06', '2014-11-07', '2014-11-10', '2014-11-11', '2014-11-12', '2014-11-13', '2014-11-14', '2014-11-17', '2014-11-18', '2014-11-19', '2014-11-20', '2014-11-21', '2014-11-24', '2014-11-25', '2014-11-26', '2014-11-27', '2014-11-28', '2014-12-01', '2014-12-02', '2014-12-03', '2014-12-04', '2014-12-05', '2014-12-08', '2014-12-09', '2014-12-10', '2014-12-11', '2014-12-12', '2014-12-15', '2014-12-16', '2014-12-17', '2014-12-18', '2014-12-19', '2014-12-22', '2014-12-23', '2014-12-24', '2014-12-25', '2014-12-26', '2014-12-29', '2014-12-30', '2014-12-31', '2015-01-05', '2015-01-06', '2015-01-07', '2015-01-08', '2015-01-09', '2015-01-12', '2015-01-13', '2015-01-14', '2015-01-15', '2015-01-16', '2015-01-19', '2015-01-20', '2015-01-21', '2015-01-22', '2015-01-23', '2015-01-26', '2015-01-27', '2015-01-28', '2015-01-29', '2015-01-30', '2015-02-02', '2015-02-03', '2015-02-04', '2015-02-05', '2015-02-06', '2015-02-09', '2015-02-10', '2015-02-11', '2015-02-12', '2015-02-13', '2015-02-16', '2015-02-17', '2015-02-25', '2015-02-26', '2015-02-27', '2015-03-02', '2015-03-03', '2015-03-04', '2015-03-05', '2015-03-06', '2015-03-09', '2015-03-10', '2015-03-11', '2015-03-12', '2015-03-13', '2015-03-16', '2015-03-17', '2015-03-18', '2015-03-19', '2015-03-20', '2015-03-23', '2015-03-24', '2015-03-25', '2015-03-26', '2015-03-27', '2015-03-30', '2015-03-31', '2015-04-01', '2015-04-02', '2015-04-03', '2015-04-07', '2015-04-08', '2015-04-09', '2015-04-10', '2015-04-13', '2015-04-14', '2015-04-15', '2015-04-16', '2015-04-17', '2015-04-20', '2015-04-21', '2015-04-22', '2015-04-23', '2015-04-24', '2015-04-27', '2015-04-28', '2015-04-29', '2015-04-30', '2015-05-04', '2015-05-05', '2015-05-06', '2015-05-07', '2015-05-08', '2015-05-11', '2015-05-12', '2015-05-13', '2015-05-14', '2015-05-15', '2015-05-18', '2015-05-19', '2015-05-20', '2015-05-21', '2015-05-22', '2015-05-25', '2015-05-26', '2015-05-27', '2015-05-28', '2015-05-29', '2015-06-01', '2015-06-02', '2015-06-03', '2015-06-04', '2015-06-05', '2015-06-08', '2015-06-09', '2015-06-10', '2015-06-11', '2015-06-12', '2015-06-15', '2015-06-16', '2015-06-17', '2015-06-18', '2015-06-19', '2015-06-23', '2015-06-24', '2015-06-25', '2015-06-26', '2015-06-29', '2015-06-30', '2015-07-01', '2015-07-02', '2015-07-03', '2015-07-06', '2015-07-07', '2015-07-08', '2015-07-09', '2015-07-10', '2015-07-13', '2015-07-14', '2015-07-15', '2015-07-16', '2015-07-17', '2015-07-20', '2015-07-21', '2015-07-22', '2015-07-23', '2015-07-24', '2015-07-27', '2015-07-28', '2015-07-29', '2015-07-30', '2015-07-31', '2015-08-03', '2015-08-04', '2015-08-05', '2015-08-06', '2015-08-07', '2015-08-10', '2015-08-11', '2015-08-12', '2015-08-13', '2015-08-14', '2015-08-17', '2015-08-18', '2015-08-19', '2015-08-20', '2015-08-21', '2015-08-24', '2015-08-25', '2015-08-26', '2015-08-27', '2015-08-28', '2015-08-31', '2015-09-01', '2015-09-02', '2015-09-07', '2015-09-08', '2015-09-09', '2015-09-10', '2015-09-11', '2015-09-14', '2015-09-15', '2015-09-16', '2015-09-17', '2015-09-18', '2015-09-21', '2015-09-22', '2015-09-23', '2015-09-24', '2015-09-25', '2015-09-28', '2015-09-29', '2015-09-30', '2015-10-08', '2015-10-09', '2015-10-12', '2015-10-13', '2015-10-14', '2015-10-15', '2015-10-16', '2015-10-19', '2015-10-20', '2015-10-21', '2015-10-22', '2015-10-23', '2015-10-26', '2015-10-27', '2015-10-28', '2015-10-29', '2015-10-30', '2015-11-02', '2015-11-03', '2015-11-04', '2015-11-05', '2015-11-06', '2015-11-09', '2015-11-10', '2015-11-11', '2015-11-12', '2015-11-13', '2015-11-16', '2015-11-17', '2015-11-18', '2015-11-19', '2015-11-20', '2015-11-23', '2015-11-24', '2015-11-25', '2015-11-26', '2015-11-27', '2015-11-30', '2015-12-01', '2015-12-02', '2015-12-03', '2015-12-04', '2015-12-07', '2015-12-08', '2015-12-09', '2015-12-10', '2015-12-11', '2015-12-14', '2015-12-15', '2015-12-16', '2015-12-17', '2015-12-18', '2015-12-21', '2015-12-22', '2015-12-23', '2015-12-24', '2015-12-25', '2015-12-28', '2015-12-29', '2015-12-30', '2015-12-31', '2016-01-04', '2016-01-05', '2016-01-06', '2016-01-07', '2016-01-08', '2016-01-11', '2016-01-12', '2016-01-13', '2016-01-14', '2016-01-15', '2016-01-18', '2016-01-19', '2016-01-20', '2016-01-21', '2016-01-22', '2016-01-25', '2016-01-26', '2016-01-27', '2016-01-28', '2016-01-29', '2016-02-01', '2016-02-02', '2016-02-03', '2016-02-04', '2016-02-05', '2016-02-15', '2016-02-16', '2016-02-17', '2016-02-18', '2016-02-19', '2016-02-22', '2016-02-23', '2016-02-24', '2016-02-25', '2016-02-26', '2016-02-29', '2016-03-01', '2016-03-02', '2016-03-03', '2016-03-04', '2016-03-07', '2016-03-08', '2016-03-09', '2016-03-10', '2016-03-11', '2016-03-14', '2016-03-15', '2016-03-16', '2016-03-17', '2016-03-18', '2016-03-21', '2016-03-22', '2016-03-23', '2016-03-24', '2016-03-25', '2016-03-28', '2016-03-29', '2016-03-30', '2016-03-31', '2016-04-01', '2016-04-05', '2016-04-06', '2016-04-07', '2016-04-08', '2016-04-11', '2016-04-12', '2016-04-13', '2016-04-14', '2016-04-15', '2016-04-18', '2016-04-19', '2016-04-20', '2016-04-21', '2016-04-22', '2016-04-25', '2016-04-26', '2016-04-27', '2016-04-28', '2016-04-29', '2016-05-03', '2016-05-04', '2016-05-05', '2016-05-06', '2016-05-09', '2016-05-10', '2016-05-11', '2016-05-12', '2016-05-13', '2016-05-16', '2016-05-17', '2016-05-18', '2016-05-19', '2016-05-20', '2016-05-23', '2016-05-24', '2016-05-25', '2016-05-26', '2016-05-27', '2016-05-30', '2016-05-31', '2016-06-01', '2016-06-02', '2016-06-03', '2016-06-06', '2016-06-07', '2016-06-08', '2016-06-13', '2016-06-14', '2016-06-15', '2016-06-16', '2016-06-17', '2016-06-20', '2016-06-21', '2016-06-22', '2016-06-23', '2016-06-24', '2016-06-27', '2016-06-28', '2016-06-29', '2016-06-30', '2016-07-01', '2016-07-04', '2016-07-05', '2016-07-06', '2016-07-07', '2016-07-08', '2016-07-11', '2016-07-12', '2016-07-13', '2016-07-14', '2016-07-15', '2016-07-18', '2016-07-19', '2016-07-20', '2016-07-21', '2016-07-22', '2016-07-25', '2016-07-26', '2016-07-27', '2016-07-28', '2016-07-29', '2016-08-01', '2016-08-02', '2016-08-03', '2016-08-04', '2016-08-05', '2016-08-08', '2016-08-09', '2016-08-10', '2016-08-11', '2016-08-12', '2016-08-15', '2016-08-16', '2016-08-17', '2016-08-18', '2016-08-19', '2016-08-22', '2016-08-23', '2016-08-24', '2016-08-25', '2016-08-26', '2016-08-29', '2016-08-30', '2016-08-31', '2016-09-01', '2016-09-02', '2016-09-05', '2016-09-06', '2016-09-07', '2016-09-08', '2016-09-09', '2016-09-12', '2016-09-13', '2016-09-14', '2016-09-19', '2016-09-20', '2016-09-21', '2016-09-22', '2016-09-23', '2016-09-26', '2016-09-27', '2016-09-28', '2016-09-29', '2016-09-30', '2016-10-10', '2016-10-11', '2016-10-12', '2016-10-13', '2016-10-14', '2016-10-17', '2016-10-18', '2016-10-19', '2016-10-20', '2016-10-21', '2016-10-24', '2016-10-25', '2016-10-26', '2016-10-27', '2016-10-28', '2016-10-31', '2016-11-01', '2016-11-02', '2016-11-03', '2016-11-04', '2016-11-07', '2016-11-08', '2016-11-09', '2016-11-10', '2016-11-11', '2016-11-14', '2016-11-15', '2016-11-16', '2016-11-17', '2016-11-18', '2016-11-21', '2016-11-22', '2016-11-23', '2016-11-24', '2016-11-25', '2016-11-28', '2016-11-29', '2016-11-30', '2016-12-01', '2016-12-02', '2016-12-05', '2016-12-06', '2016-12-07', '2016-12-08', '2016-12-09', '2016-12-12', '2016-12-13', '2016-12-14', '2016-12-15', '2016-12-16', '2016-12-19', '2016-12-20', '2016-12-21', '2016-12-22', '2016-12-23', '2016-12-26', '2016-12-27', '2016-12-28', '2016-12-29', '2016-12-30', '2017-01-03', '2017-01-04', '2017-01-05', '2017-01-06', '2017-01-09', '2017-01-10', '2017-01-11', '2017-01-12', '2017-01-13', '2017-01-16', '2017-01-17', '2017-01-18', '2017-01-19', '2017-01-20', '2017-01-23', '2017-01-24', '2017-01-25', '2017-01-26', '2017-02-03', '2017-02-06', '2017-02-07', '2017-02-08', '2017-02-09', '2017-02-10', '2017-02-13', '2017-02-14', '2017-02-15', '2017-02-16', '2017-02-17', '2017-02-20', '2017-02-21', '2017-02-22', '2017-02-23', '2017-02-24', '2017-02-27', '2017-02-28', '2017-03-01', '2017-03-02', '2017-03-03', '2017-03-06', '2017-03-07', '2017-03-08', '2017-03-09', '2017-03-10', '2017-03-13', '2017-03-14', '2017-03-15', '2017-03-16', '2017-03-17', '2017-03-20', '2017-03-21', '2017-03-22', '2017-03-23', '2017-03-24', '2017-03-27', '2017-03-28', '2017-03-29', '2017-03-30', '2017-03-31', '2017-04-05', '2017-04-06', '2017-04-07', '2017-04-10', '2017-04-11', '2017-04-12', '2017-04-13', '2017-04-14', '2017-04-17', '2017-04-18', '2017-04-19', '2017-04-20', '2017-04-21', '2017-04-24', '2017-04-25', '2017-04-26', '2017-04-27', '2017-04-28', '2017-05-02', '2017-05-03', '2017-05-04', '2017-05-05', '2017-05-08', '2017-05-09', '2017-05-10', '2017-05-11', '2017-05-12', '2017-05-15', '2017-05-16', '2017-05-17', '2017-05-18', '2017-05-19', '2017-05-22', '2017-05-23', '2017-05-24', '2017-05-25', '2017-05-26', '2017-05-31', '2017-06-01', '2017-06-02', '2017-06-05', '2017-06-06', '2017-06-07', '2017-06-08', '2017-06-09', '2017-06-12', '2017-06-13', '2017-06-14', '2017-06-15', '2017-06-16', '2017-06-19', '2017-06-20', '2017-06-21', '2017-06-22', '2017-06-23', '2017-06-26', '2017-06-27', '2017-06-28', '2017-06-29', '2017-06-30', '2017-07-03', '2017-07-04', '2017-07-05', '2017-07-06', '2017-07-07', '2017-07-10', '2017-07-11', '2017-07-12', '2017-07-13', '2017-07-14', '2017-07-17', '2017-07-18', '2017-07-19', '2017-07-20', '2017-07-21', '2017-07-24', '2017-07-25', '2017-07-26', '2017-07-27', '2017-07-28', '2017-07-31', '2017-08-01', '2017-08-02', '2017-08-03', '2017-08-04', '2017-08-07', '2017-08-08', '2017-08-09', '2017-08-10', '2017-08-11', '2017-08-14', '2017-08-15', '2017-08-16', '2017-08-17', '2017-08-18', '2017-08-21', '2017-08-22', '2017-08-23', '2017-08-24', '2017-08-25', '2017-08-28', '2017-08-29', '2017-08-30', '2017-08-31', '2017-09-01', '2017-09-04', '2017-09-05', '2017-09-06', '2017-09-07', '2017-09-08', '2017-09-11', '2017-09-12', '2017-09-13', '2017-09-14', '2017-09-15', '2017-09-18', '2017-09-19', '2017-09-20', '2017-09-21', '2017-09-22', '2017-09-25', '2017-09-26', '2017-09-27', '2017-09-28', '2017-09-29', '2017-10-09', '2017-10-10', '2017-10-11', '2017-10-12', '2017-10-13', '2017-10-16', '2017-10-17', '2017-10-18', '2017-10-19', '2017-10-20', '2017-10-23', '2017-10-24', '2017-10-25', '2017-10-26', '2017-10-27', '2017-10-30', '2017-10-31', '2017-11-01', '2017-11-02', '2017-11-03', '2017-11-06', '2017-11-07', '2017-11-08', '2017-11-09', '2017-11-10', '2017-11-13', '2017-11-14', '2017-11-15', '2017-11-16', '2017-11-17', '2017-11-20', '2017-11-21', '2017-11-22', '2017-11-23', '2017-11-24', '2017-11-27', '2017-11-28', '2017-11-29', '2017-11-30', '2017-12-01', '2017-12-04', '2017-12-05', '2017-12-06', '2017-12-07', '2017-12-08', '2017-12-11', '2017-12-12', '2017-12-13', '2017-12-14', '2017-12-15', '2017-12-18', '2017-12-19', '2017-12-20', '2017-12-21', '2017-12-22', '2017-12-25', '2017-12-26', '2017-12-27', '2017-12-28', '2017-12-29', '2018-01-02', '2018-01-03', '2018-01-04', '2018-01-05', '2018-01-08', '2018-01-09', '2018-01-10', '2018-01-11', '2018-01-12', '2018-01-15', '2018-01-16', '2018-01-17', '2018-01-18', '2018-01-19', '2018-01-22', '2018-01-23', '2018-01-24', '2018-01-25', '2018-01-26', '2018-01-29', '2018-01-30', '2018-01-31', '2018-02-01', '2018-02-02', '2018-02-05', '2018-02-06', '2018-02-07', '2018-02-08', '2018-02-09', '2018-02-12', '2018-02-13', '2018-02-14', '2018-02-22', '2018-02-23', '2018-02-26', '2018-02-27', '2018-02-28', '2018-03-01', '2018-03-02', '2018-03-05', '2018-03-06', '2018-03-07', '2018-03-08', '2018-03-09', '2018-03-12', '2018-03-13', '2018-03-14', '2018-03-15', '2018-03-16', '2018-03-19', '2018-03-20', '2018-03-21', '2018-03-22', '2018-03-23', '2018-03-26', '2018-03-27', '2018-03-28', '2018-03-29', '2018-03-30', '2018-04-02', '2018-04-03', '2018-04-04', '2018-04-09', '2018-04-10', '2018-04-11', '2018-04-12', '2018-04-13', '2018-04-16', '2018-04-17', '2018-04-18', '2018-04-19', '2018-04-20', '2018-04-23', '2018-04-24', '2018-04-25', '2018-04-26', '2018-04-27', '2018-05-02', '2018-05-03', '2018-05-04', '2018-05-07', '2018-05-08', '2018-05-09', '2018-05-10', '2018-05-11', '2018-05-14', '2018-05-15', '2018-05-16', '2018-05-17', '2018-05-18', '2018-05-21', '2018-05-22', '2018-05-23', '2018-05-24', '2018-05-25', '2018-05-28', '2018-05-29', '2018-05-30', '2018-05-31', '2018-06-01', '2018-06-04', '2018-06-05', '2018-06-06', '2018-06-07', '2018-06-08', '2018-06-11', '2018-06-12', '2018-06-13', '2018-06-14', '2018-06-15', '2018-06-19', '2018-06-20', '2018-06-21', '2018-06-22', '2018-06-25', '2018-06-26', '2018-06-27', '2018-06-28', '2018-06-29', '2018-07-02', '2018-07-03', '2018-07-04', '2018-07-05', '2018-07-06', '2018-07-09', '2018-07-10', '2018-07-11', '2018-07-12', '2018-07-13', '2018-07-16', '2018-07-17', '2018-07-18', '2018-07-19', '2018-07-20', '2018-07-23', '2018-07-24', '2018-07-25', '2018-07-26', '2018-07-27', '2018-07-30', '2018-07-31', '2018-08-01', '2018-08-02', '2018-08-03', '2018-08-06', '2018-08-07', '2018-08-08', '2018-08-09', '2018-08-10', '2018-08-13', '2018-08-14', '2018-08-15', '2018-08-16', '2018-08-17', '2018-08-20', '2018-08-21', '2018-08-22', '2018-08-23', '2018-08-24', '2018-08-27', '2018-08-28', '2018-08-29', '2018-08-30', '2018-08-31', '2018-09-03', '2018-09-04', '2018-09-05', '2018-09-06', '2018-09-07', '2018-09-10', '2018-09-11', '2018-09-12', '2018-09-13', '2018-09-14', '2018-09-17', '2018-09-18', '2018-09-19', '2018-09-20', '2018-09-21', '2018-09-25', '2018-09-26', '2018-09-27', '2018-09-28', '2018-10-08', '2018-10-09', '2018-10-10', '2018-10-11', '2018-10-12', '2018-10-15', '2018-10-16', '2018-10-17', '2018-10-18', '2018-10-19', '2018-10-22', '2018-10-23', '2018-10-24', '2018-10-25', '2018-10-26', '2018-10-29', '2018-10-30', '2018-10-31', '2018-11-01', '2018-11-02', '2018-11-05', '2018-11-06', '2018-11-07', '2018-11-08', '2018-11-09', '2018-11-12', '2018-11-13', '2018-11-14', '2018-11-15', '2018-11-16', '2018-11-19', '2018-11-20', '2018-11-21', '2018-11-22', '2018-11-23', '2018-11-26', '2018-11-27', '2018-11-28', '2018-11-29', '2018-11-30', '2018-12-03', '2018-12-04', '2018-12-05', '2018-12-06', '2018-12-07', '2018-12-10', '2018-12-11', '2018-12-12', '2018-12-13', '2018-12-14', '2018-12-17', '2018-12-18', '2018-12-19', '2018-12-20', '2018-12-21', '2018-12-24', '2018-12-25', '2018-12-26', '2018-12-27', '2018-12-28', - '2019-01-02', - '2019-01-03', - '2019-01-04', - '2019-01-07', - '2019-01-08', - '2019-01-09', - '2019-01-10', - '2019-01-11', - '2019-01-14', - '2019-01-15', - '2019-01-16', - '2019-01-17', - '2019-01-18', - '2019-01-21', - '2019-01-22', - '2019-01-23', - '2019-01-24', - '2019-01-25', - '2019-01-28', - '2019-01-29', - '2019-01-30', - '2019-01-31', - '2019-02-01', - '2019-02-11', - '2019-02-12', - '2019-02-13', - '2019-02-14', - '2019-02-15', - '2019-02-18', - '2019-02-19', - '2019-02-20', - '2019-02-21', - '2019-02-22', - '2019-02-25', - '2019-02-26', - '2019-02-27', - '2019-02-28', - '2019-03-01', - '2019-03-04', - '2019-03-05', - '2019-03-06', - '2019-03-07', - '2019-03-08', - '2019-03-11', - '2019-03-12', - '2019-03-13', - '2019-03-14', - '2019-03-15', - '2019-03-18', - '2019-03-19', - '2019-03-20', - '2019-03-21', - '2019-03-22', - '2019-03-25', - '2019-03-26', - '2019-03-27', - '2019-03-28', - '2019-03-29', - '2019-04-01', - '2019-04-02', - '2019-04-03', - '2019-04-04', - '2019-04-08', - '2019-04-09', - '2019-04-10', - '2019-04-11', - '2019-04-12', - '2019-04-15', - '2019-04-16', - '2019-04-17', - '2019-04-18', - '2019-04-19', - '2019-04-22', - '2019-04-23', - '2019-04-24', - '2019-04-25', - '2019-04-26', - '2019-04-29', - '2019-04-30', - '2019-05-06', - '2019-05-07', - '2019-05-08', - '2019-05-09', - '2019-05-10', - '2019-05-13', - '2019-05-14', - '2019-05-15', - '2019-05-16', - '2019-05-17', - '2019-05-20', - '2019-05-21', - '2019-05-22', - '2019-05-23', - '2019-05-24', - '2019-05-27', - '2019-05-28', - '2019-05-29', - '2019-05-30', - '2019-05-31', - '2019-06-03', - '2019-06-04', - '2019-06-05', - '2019-06-06', - '2019-06-10', - '2019-06-11', - '2019-06-12', - '2019-06-13', - '2019-06-14', - '2019-06-17', - '2019-06-18', - '2019-06-19', - '2019-06-20', - '2019-06-21', - '2019-06-24', - '2019-06-25', - '2019-06-26', - '2019-06-27', - '2019-06-28', - '2019-07-01', - '2019-07-02', - '2019-07-03', - '2019-07-04', - '2019-07-05', - '2019-07-08', - '2019-07-09', - '2019-07-10', - '2019-07-11', - '2019-07-12', - '2019-07-15', - '2019-07-16', - '2019-07-17', - '2019-07-18', - '2019-07-19', - '2019-07-22', - '2019-07-23', - '2019-07-24', - '2019-07-25', - '2019-07-26', - '2019-07-29', - '2019-07-30', - '2019-07-31', - '2019-08-01', - '2019-08-02', - '2019-08-05', - '2019-08-06', - '2019-08-07', - '2019-08-08', - '2019-08-09', - '2019-08-12', - '2019-08-13', - '2019-08-14', - '2019-08-15', - '2019-08-16', - '2019-08-19', - '2019-08-20', - '2019-08-21', - '2019-08-22', - '2019-08-23', - '2019-08-26', - '2019-08-27', - '2019-08-28', - '2019-08-29', - '2019-08-30', - '2019-09-02', - '2019-09-03', - '2019-09-04', - '2019-09-05', - '2019-09-06', - '2019-09-09', - '2019-09-10', - '2019-09-11', - '2019-09-12', - '2019-09-16', - '2019-09-17', - '2019-09-18', - '2019-09-19', - '2019-09-20', - '2019-09-23', - '2019-09-24', - '2019-09-25', - '2019-09-26', - '2019-09-27', - '2019-09-30', - '2019-10-08', - '2019-10-09', - '2019-10-10', - '2019-10-11', - '2019-10-14', - '2019-10-15', - '2019-10-16', - '2019-10-17', - '2019-10-18', - '2019-10-21', - '2019-10-22', - '2019-10-23', - '2019-10-24', - '2019-10-25', - '2019-10-28', - '2019-10-29', - '2019-10-30', - '2019-10-31', - '2019-11-01', - '2019-11-04', - '2019-11-05', - '2019-11-06', - '2019-11-07', - '2019-11-08', - '2019-11-11', - '2019-11-12', - '2019-11-13', - '2019-11-14', - '2019-11-15', - '2019-11-18', - '2019-11-19', - '2019-11-20', - '2019-11-21', - '2019-11-22', - '2019-11-25', - '2019-11-26', - '2019-11-27', - '2019-11-28', - '2019-11-29', - '2019-12-02', - '2019-12-03', - '2019-12-04', - '2019-12-05', - '2019-12-06', - '2019-12-09', - '2019-12-10', - '2019-12-11', - '2019-12-12', - '2019-12-13', - '2019-12-16', - '2019-12-17', - '2019-12-18', - '2019-12-19', - '2019-12-20', - '2019-12-23', - '2019-12-24', - '2019-12-25', - '2019-12-26', - '2019-12-27', - '2019-12-30', - '2019-12-31'] \ No newline at end of file diff --git a/requirement-dev.txt b/requirement-dev.txt deleted file mode 100644 index 05040f4..0000000 --- a/requirement-dev.txt +++ /dev/null @@ -1,9 +0,0 @@ - -click -pandas -six -cryptography -pylint -pytest -pypandoc -gitpython \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 12669a1..0000000 --- a/setup.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python - -from setuptools import setup, find_packages -import os - -PYTDX_CYTHON = os.getenv("PYTDX_CYTHON", None) - -if PYTDX_CYTHON: - from Cython.Build import cythonize - cythonkw = { - "ext_modules": cythonize( - ["pytdx/reader/c_gbbq_reader.pyx", - 'pytdx/parser/get_security_quotes.py', - 'pytdx/parser/base.py', - 'pytdx/helper.py', - 'pytdx/hq.py', - 'pytdx/base_socket_client.py', - ]) - } -else: - cythonkw = {} -try: - import pypandoc - long_description = pypandoc.convert('README.md', 'rst') -except (IOError, ImportError): - print(30 * "*") - print("Notice, NEED TO INSTALL *pypandoc* TO get full description of package") - print(30 * "*") - long_description = '' - -# try get current branch -cur_branch = 'master' -try: - from git import Repo - cur_path = os.path.abspath(os.path.dirname(__file__)) - repo = Repo(cur_path) - cur_branch = repo.active_branch.name - -except Exception as e: - print(30 * "*") - print("Notice, NEED TO INSTALL *GitPython* TO setup package with branch name") - print(30 * "*") - - -pkg_name = 'pytdx' - -if cur_branch != 'master': - pkg_name = 'pytdx-' + cur_branch - -print(30 * '-') -print("Current Branch is {}, so package name is {}".format(cur_branch, pkg_name)) -print(30 * '-') - -setup( - name=pkg_name, - version='1.72', - description='A Python Interface to TDX protocol', - long_description=long_description, - author=['RainX', 'yutiansut'], - author_email='i@rainx.cc', - url='https://github.com/rainx/pytdx', - packages=find_packages(), - install_requires=[ - 'click', - 'pandas', - 'six', - 'cryptography', - ], - entry_points={ - 'console_scripts': [ - 'hqget=pytdx.bin.hqget:main', - 'hqreader=pytdx.bin.hqreader:main', - 'get_tts=pytdx.bin.get_tdx_trader_server:main', - 'hqbenchmark=pytdx.bin.hqbenchmark:main', - ] - }, - **cythonkw -) diff --git a/tests/test_crawler.py b/tests/test_crawler.py deleted file mode 100644 index e6093ae..0000000 --- a/tests/test_crawler.py +++ /dev/null @@ -1,21 +0,0 @@ -import pytest -import pandas as pd -from pytdx.crawler.base_crawler import demo_reporthook -from pytdx.crawler.history_financial_crawler import HistoryFinancialListCrawler - -def test_crawl_history_financial_list_via_tcp(): - - crawler = HistoryFinancialListCrawler() - - list_data = crawler.fetch_and_parse(reporthook=demo_reporthook) - df = pd.DataFrame(data=list_data) - assert df["filename"].str.contains("gpcw20190630.zip").any() - -def test_crawl_history_financial_list_via_http(): - # via yutianst's http server - crawler = HistoryFinancialListCrawler() - crawler.mode = "http" - - list_data = crawler.fetch_and_parse(reporthook=demo_reporthook) - df = pd.DataFrame(data=list_data) - assert df["filename"].str.contains("gpcw20190630.zip").any() \ No newline at end of file diff --git a/tests/test_exhq.py b/tests/test_exhq.py deleted file mode 100644 index 19c641f..0000000 --- a/tests/test_exhq.py +++ /dev/null @@ -1,112 +0,0 @@ -#coding: utf-8 - -import pytest -from pytdx.errors import TdxFunctionCallError, TdxConnectionError -from collections import OrderedDict -import pandas as pd -import socket -from pytdx.exhq import TdxExHq_API, TDXParams - - -class Log(object): - def info(self, *args): - pass - - -log = Log() - - -test_server_ip = "112.74.214.43" - - -def test_all_functions(): - - symbol_params = [ - [47, "IF1709"], - [8, "10000889"], - [31, "00020"], - [47, "IFL0"], - [31, "00700"] - ] - - api = TdxExHq_API(auto_retry=True) - try: - with api.connect(test_server_ip, 7727, time_out=30): - log.info("获取市场代码") - data = api.get_markets() - assert data is not None - assert type(data) is list - assert len(data) > 0 - - log.info("查询市场中商品数量") - data = api.get_instrument_count() - assert data is not None - assert data > 0 - - log.info("查询五档行情") - for params in symbol_params: - data = api.get_instrument_quote(*params) - - assert data is not None - assert type(data) is list - assert len(data) > 0 - - # log.info("查询分时行情") - for params in symbol_params: - data = api.get_minute_time_data(*params) - assert data is not None - assert type(data) is list - assert len(data) >= 0 - - log.info("查询历史分时行情") - for params in symbol_params: - data = api.get_history_minute_time_data( - params[0], params[1], 20170811) - assert data is not None - assert type(data) is list - assert len(data) >= 0 - - log.info("查询分时成交") - for params in symbol_params: - data = api.get_transaction_data(*params) - assert data is not None - assert type(data) is list - assert len(data) >= 0 - - log.info("查询历史分时成交") - for params in symbol_params: - data = api.get_history_transaction_data( - params[0], params[1], 20170811) - assert data is not None - assert type(data) is list - assert len(data) >= 0 - - log.info("查询k线") - for params in symbol_params: - data = api.get_instrument_bars( - TDXParams.KLINE_TYPE_DAILY, params[0], params[1]) - assert data is not None - assert type(data) is list - assert len(data) >= 0 - - log.info("查询代码列表") - data = api.get_instrument_info(10000, 98) - assert data is not None - assert type(data) is list - assert len(data) > 0 - except socket.timeout as e: - pass - - -def test_get_history_instrument_bars_range(): - log.info("查询代码列表") - api = TdxExHq_API(auto_retry=True) - try: - with api.connect(test_server_ip, 7727): - data = api.get_history_instrument_bars_range( - 74, "BABA", 20170613, 20170620) - assert data is not None - assert type(data) is list - assert len(data) > 0 - except socket.timeout as e: - pass diff --git a/tests/test_hq.py b/tests/test_hq.py deleted file mode 100644 index f7c33d9..0000000 --- a/tests/test_hq.py +++ /dev/null @@ -1,132 +0,0 @@ -#coding: utf-8 - -from collections import OrderedDict - -import pandas as pd -import pytest -from pytdx.errors import TdxConnectionError, TdxFunctionCallError -from pytdx.hq import TdxHq_API, TDXParams -import socket - - -class Log(object): - def info(self, *args): - pass - - -log = Log() - - -# 测试任意组合的选项 -@pytest.mark.parametrize("multithread", [False]) -@pytest.mark.parametrize("heartbeat", [False, True]) -@pytest.mark.parametrize("auto_retry", [False, True]) -@pytest.mark.parametrize("raise_exception", [False]) -def test_all_functions(multithread, heartbeat, auto_retry, raise_exception): - - api = TdxHq_API(multithread=multithread, heartbeat=heartbeat, - auto_retry=auto_retry, raise_exception=raise_exception) - with api.connect(ip="119.147.212.81", time_out=60): - log.info("获取股票行情") - stocks = api.get_security_quotes([(0, "000001"), (1, "600300")]) - assert stocks is not None - assert type(stocks) is list - - # 方法2 - stocks = api.get_security_quotes(0, "000001") - assert stocks is not None - assert type(stocks) is list - - # 方法3 - stocks = api.get_security_quotes((0, "000001")) - assert stocks is not None - assert type(stocks) is list - - log.info("获取k线") - data = api.get_security_bars(9, 0, '000001', 4, 3) - assert data is not None - assert type(data) is list - assert len(data) == 3 - - log.info("获取 深市 股票数量") - assert api.get_security_count(0) > 0 - - log.info("获取股票列表") - stocks = api.get_security_list(1, 0) - assert stocks is not None - assert type(stocks) is list - assert len(stocks) > 0 - - log.info("获取指数k线") - data = api.get_index_bars(9, 1, '000001', 1, 2) - assert data is not None - assert type(data) is list - assert len(data) == 2 - - log.info("查询分时行情") - data = api.get_minute_time_data(TDXParams.MARKET_SH, '600300') - assert data is not None - - log.info("查询历史分时行情") - data = api.get_history_minute_time_data( - TDXParams.MARKET_SH, '600300', 20161209) - assert data is not None - assert type(data) is list - assert len(data) > 0 - - log.info("查询分时成交") - data = api.get_transaction_data(TDXParams.MARKET_SZ, '000001', 0, 30) - assert data is not None - assert type(data) is list - - log.info("查询历史分时成交") - data = api.get_history_transaction_data( - TDXParams.MARKET_SZ, '000001', 0, 10, 20170209) - - assert data is not None - assert type(data) is list - assert len(data) == 10 - - log.info("查询公司信息目录") - data = api.get_company_info_category(TDXParams.MARKET_SZ, '000001') - assert data is not None - assert type(data) is list - assert len(data) > 0 - - start = data[0]['start'] - length = data[0]['length'] - log.info("读取公司信息-最新提示") - data = api.get_company_info_content( - 0, '000001', '000001.txt', start, length) - assert data is not None - assert len(data) > 0 - - log.info("读取除权除息信息") - data = api.get_xdxr_info(1, '600300') - assert data is not None - assert type(data) is list - assert len(data) > 0 - - log.info("读取财务信息") - data = api.get_finance_info(0, '000001') - assert data is not None - assert type(data) is OrderedDict - assert len(data) > 0 - - log.info("日线级别k线获取函数") - data = api.get_k_data('000001', '2017-07-01', '2017-07-10') - assert type(data) is pd.DataFrame - assert len(data) == 6 - - log.info("获取板块信息") - data = api.get_and_parse_block_info(TDXParams.BLOCK_FG) - assert data is not None - assert type(data) is list - assert len(data) > 0 - - -def test_raise_excepiton(): - api = TdxHq_API(raise_exception=True) - with pytest.raises((socket.timeout, TdxConnectionError)): - with api.connect('114.114.114.114'): - pass