hikyuu 2.3.1__py3-none-macosx_11_1_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hikyuu/LICENSE.txt +21 -0
- hikyuu/__init__.py +137 -0
- hikyuu/__init__.pyi +782 -0
- hikyuu/analysis/__init__.py +14 -0
- hikyuu/analysis/__init__.pyi +473 -0
- hikyuu/analysis/analysis.py +151 -0
- hikyuu/analysis/analysis.pyi +503 -0
- hikyuu/config/__init__.py +1 -0
- hikyuu/config/block/__init__.py +0 -0
- hikyuu/config/block/dybk.ini +5357 -0
- hikyuu/config/block/gnbk.ini +50024 -0
- hikyuu/config/block/hybk.ini +5464 -0
- hikyuu/config/block/self.ini +10 -0
- hikyuu/config/block/zsbk.ini +65543 -0
- hikyuu/core.py +27 -0
- hikyuu/core.pyi +468 -0
- hikyuu/cpp/__init__.py +1 -0
- hikyuu/cpp/__init__.pyi +3 -0
- hikyuu/cpp/core310.so +0 -0
- hikyuu/cpp/core311.so +0 -0
- hikyuu/cpp/core312.pyi +12475 -0
- hikyuu/cpp/core312.so +0 -0
- hikyuu/cpp/core313.so +0 -0
- hikyuu/cpp/core39.so +0 -0
- hikyuu/cpp/libcrypto.3.dylib +0 -0
- hikyuu/cpp/libcrypto.dylib +0 -0
- hikyuu/cpp/libhku_hdf5.200.2.0.dylib +0 -0
- hikyuu/cpp/libhku_hdf5.200.dylib +0 -0
- hikyuu/cpp/libhku_hdf5.dylib +0 -0
- hikyuu/cpp/libhku_hdf5_cpp.200.2.0.dylib +0 -0
- hikyuu/cpp/libhku_hdf5_cpp.200.dylib +0 -0
- hikyuu/cpp/libhku_hdf5_cpp.dylib +0 -0
- hikyuu/cpp/libhku_hdf5_hl.200.1.0.dylib +0 -0
- hikyuu/cpp/libhku_hdf5_hl.200.dylib +0 -0
- hikyuu/cpp/libhku_hdf5_hl.dylib +0 -0
- hikyuu/cpp/libhku_hdf5_hl_cpp.200.1.0.dylib +0 -0
- hikyuu/cpp/libhku_hdf5_hl_cpp.200.dylib +0 -0
- hikyuu/cpp/libhku_hdf5_hl_cpp.dylib +0 -0
- hikyuu/cpp/libhku_hdf5_tools.200.1.1.dylib +0 -0
- hikyuu/cpp/libhku_hdf5_tools.200.dylib +0 -0
- hikyuu/cpp/libhku_hdf5_tools.dylib +0 -0
- hikyuu/cpp/libmysqlclient.21.dylib +0 -0
- hikyuu/cpp/libmysqlclient.dylib +0 -0
- hikyuu/cpp/libsqlite3.dylib +0 -0
- hikyuu/cpp/libssl.3.dylib +0 -0
- hikyuu/cpp/libssl.dylib +0 -0
- hikyuu/data/__init__.py +1 -0
- hikyuu/data/common.py +248 -0
- hikyuu/data/common_h5.py +398 -0
- hikyuu/data/common_mysql.py +485 -0
- hikyuu/data/common_pytdx.py +108 -0
- hikyuu/data/common_sqlite3.py +140 -0
- hikyuu/data/em_block_to_mysql.py +120 -0
- hikyuu/data/em_block_to_sqlite.py +117 -0
- hikyuu/data/hku_config_template.py +266 -0
- hikyuu/data/mysql_upgrade/0001.sql +5 -0
- hikyuu/data/mysql_upgrade/0002.sql +3 -0
- hikyuu/data/mysql_upgrade/0003.sql +9 -0
- hikyuu/data/mysql_upgrade/0004.sql +26 -0
- hikyuu/data/mysql_upgrade/0005.sql +3 -0
- hikyuu/data/mysql_upgrade/0006.sql +2 -0
- hikyuu/data/mysql_upgrade/0007.sql +20 -0
- hikyuu/data/mysql_upgrade/0008.sql +6 -0
- hikyuu/data/mysql_upgrade/0009.sql +36 -0
- hikyuu/data/mysql_upgrade/0010.sql +5 -0
- hikyuu/data/mysql_upgrade/0011.sql +5 -0
- hikyuu/data/mysql_upgrade/0012.sql +5 -0
- hikyuu/data/mysql_upgrade/0013.sql +2389 -0
- hikyuu/data/mysql_upgrade/0014.sql +3 -0
- hikyuu/data/mysql_upgrade/0015.sql +4 -0
- hikyuu/data/mysql_upgrade/0016.sql +4 -0
- hikyuu/data/mysql_upgrade/0017.sql +5 -0
- hikyuu/data/mysql_upgrade/0018.sql +2 -0
- hikyuu/data/mysql_upgrade/0019.sql +6 -0
- hikyuu/data/mysql_upgrade/0020.sql +4 -0
- hikyuu/data/mysql_upgrade/0021.sql +4 -0
- hikyuu/data/mysql_upgrade/0022.sql +5 -0
- hikyuu/data/mysql_upgrade/0023.sql +4 -0
- hikyuu/data/mysql_upgrade/0024.sql +2 -0
- hikyuu/data/mysql_upgrade/0025.sql +61 -0
- hikyuu/data/mysql_upgrade/__init__.py +1 -0
- hikyuu/data/mysql_upgrade/createdb.sql +265 -0
- hikyuu/data/pytdx_finance_to_mysql.py +129 -0
- hikyuu/data/pytdx_finance_to_sqlite.py +162 -0
- hikyuu/data/pytdx_to_h5.py +662 -0
- hikyuu/data/pytdx_to_mysql.py +803 -0
- hikyuu/data/pytdx_weight_to_mysql.py +196 -0
- hikyuu/data/pytdx_weight_to_sqlite.py +192 -0
- hikyuu/data/sqlite_mem.py +84 -0
- hikyuu/data/sqlite_mem_sql/__init__.py +1 -0
- hikyuu/data/sqlite_mem_sql/createdb.sql +126 -0
- hikyuu/data/sqlite_upgrade/0001.sql +4 -0
- hikyuu/data/sqlite_upgrade/0002.sql +48 -0
- hikyuu/data/sqlite_upgrade/0003.sql +18 -0
- hikyuu/data/sqlite_upgrade/0004.sql +11 -0
- hikyuu/data/sqlite_upgrade/0005.sql +28 -0
- hikyuu/data/sqlite_upgrade/0006.sql +5 -0
- hikyuu/data/sqlite_upgrade/0007.sql +4 -0
- hikyuu/data/sqlite_upgrade/0008.sql +22 -0
- hikyuu/data/sqlite_upgrade/0009.sql +8 -0
- hikyuu/data/sqlite_upgrade/0010.sql +5 -0
- hikyuu/data/sqlite_upgrade/0011.sql +16 -0
- hikyuu/data/sqlite_upgrade/0012.sql +15 -0
- hikyuu/data/sqlite_upgrade/0013.sql +9 -0
- hikyuu/data/sqlite_upgrade/0014.sql +607 -0
- hikyuu/data/sqlite_upgrade/0015.sql +7 -0
- hikyuu/data/sqlite_upgrade/0016.sql +8 -0
- hikyuu/data/sqlite_upgrade/0017.sql +16 -0
- hikyuu/data/sqlite_upgrade/0018.sql +5 -0
- hikyuu/data/sqlite_upgrade/0019.sql +4 -0
- hikyuu/data/sqlite_upgrade/0020.sql +4 -0
- hikyuu/data/sqlite_upgrade/0021.sql +6 -0
- hikyuu/data/sqlite_upgrade/0022.sql +6 -0
- hikyuu/data/sqlite_upgrade/0023.sql +7 -0
- hikyuu/data/sqlite_upgrade/0024.sql +22 -0
- hikyuu/data/sqlite_upgrade/0025.sql +63 -0
- hikyuu/data/sqlite_upgrade/__init__.py +1 -0
- hikyuu/data/sqlite_upgrade/createdb.sql +61 -0
- hikyuu/data/tdx_to_h5.py +464 -0
- hikyuu/data/tdx_to_mysql.py +464 -0
- hikyuu/data/weight_to_mysql.py +72 -0
- hikyuu/data/weight_to_sqlite.py +70 -0
- hikyuu/data/zh_bond10_to_mysql.py +30 -0
- hikyuu/data/zh_bond10_to_sqlite.py +42 -0
- hikyuu/data_driver/__init__.py +49 -0
- hikyuu/data_driver/jqdata_data_driver.py +277 -0
- hikyuu/data_driver/pytdx_data_driver.py +292 -0
- hikyuu/deprecated.py +651 -0
- hikyuu/draw/__init__.py +65 -0
- hikyuu/draw/drawplot/__init__.py +300 -0
- hikyuu/draw/drawplot/bokeh_draw.py +583 -0
- hikyuu/draw/drawplot/common.py +89 -0
- hikyuu/draw/drawplot/echarts_draw.py +604 -0
- hikyuu/draw/drawplot/icon/1.png +0 -0
- hikyuu/draw/drawplot/icon/10.png +0 -0
- hikyuu/draw/drawplot/icon/11.png +0 -0
- hikyuu/draw/drawplot/icon/12.png +0 -0
- hikyuu/draw/drawplot/icon/13.png +0 -0
- hikyuu/draw/drawplot/icon/14.png +0 -0
- hikyuu/draw/drawplot/icon/15.png +0 -0
- hikyuu/draw/drawplot/icon/16.png +0 -0
- hikyuu/draw/drawplot/icon/17.png +0 -0
- hikyuu/draw/drawplot/icon/18.png +0 -0
- hikyuu/draw/drawplot/icon/19.png +0 -0
- hikyuu/draw/drawplot/icon/2.png +0 -0
- hikyuu/draw/drawplot/icon/20.png +0 -0
- hikyuu/draw/drawplot/icon/21.png +0 -0
- hikyuu/draw/drawplot/icon/22.png +0 -0
- hikyuu/draw/drawplot/icon/23.png +0 -0
- hikyuu/draw/drawplot/icon/24.png +0 -0
- hikyuu/draw/drawplot/icon/25.png +0 -0
- hikyuu/draw/drawplot/icon/26.png +0 -0
- hikyuu/draw/drawplot/icon/27.png +0 -0
- hikyuu/draw/drawplot/icon/28.png +0 -0
- hikyuu/draw/drawplot/icon/29.png +0 -0
- hikyuu/draw/drawplot/icon/3.png +0 -0
- hikyuu/draw/drawplot/icon/30.png +0 -0
- hikyuu/draw/drawplot/icon/31.png +0 -0
- hikyuu/draw/drawplot/icon/32.png +0 -0
- hikyuu/draw/drawplot/icon/33.png +0 -0
- hikyuu/draw/drawplot/icon/34.png +0 -0
- hikyuu/draw/drawplot/icon/35.png +0 -0
- hikyuu/draw/drawplot/icon/36.png +0 -0
- hikyuu/draw/drawplot/icon/37.png +0 -0
- hikyuu/draw/drawplot/icon/38.png +0 -0
- hikyuu/draw/drawplot/icon/39.png +0 -0
- hikyuu/draw/drawplot/icon/4.png +0 -0
- hikyuu/draw/drawplot/icon/40.png +0 -0
- hikyuu/draw/drawplot/icon/41.png +0 -0
- hikyuu/draw/drawplot/icon/42.png +0 -0
- hikyuu/draw/drawplot/icon/43.png +0 -0
- hikyuu/draw/drawplot/icon/44.png +0 -0
- hikyuu/draw/drawplot/icon/45.png +0 -0
- hikyuu/draw/drawplot/icon/46.png +0 -0
- hikyuu/draw/drawplot/icon/47.png +0 -0
- hikyuu/draw/drawplot/icon/48.png +0 -0
- hikyuu/draw/drawplot/icon/49.png +0 -0
- hikyuu/draw/drawplot/icon/5.png +0 -0
- hikyuu/draw/drawplot/icon/6.png +0 -0
- hikyuu/draw/drawplot/icon/7.png +0 -0
- hikyuu/draw/drawplot/icon/8.png +0 -0
- hikyuu/draw/drawplot/icon/9.png +0 -0
- hikyuu/draw/drawplot/icon/__init__.py +0 -0
- hikyuu/draw/drawplot/matplotlib_draw.py +1381 -0
- hikyuu/draw/elder.py +135 -0
- hikyuu/draw/kaufman.py +192 -0
- hikyuu/draw/volume.py +122 -0
- hikyuu/examples/Turtle_SG.py +47 -0
- hikyuu/examples/__init__.py +1 -0
- hikyuu/examples/examples_init.py +33 -0
- hikyuu/examples/notebook/000-Index.ipynb +76 -0
- hikyuu/examples/notebook/001-overview.ipynb +345 -0
- hikyuu/examples/notebook/002-HowToGetStock.ipynb +265 -0
- hikyuu/examples/notebook/003-HowToGetKDataAndDraw.ipynb +375 -0
- hikyuu/examples/notebook/004-IndicatorOverview.ipynb +501 -0
- hikyuu/examples/notebook/005-Drawplot.ipynb +321 -0
- hikyuu/examples/notebook/006-TradeManager.ipynb +381 -0
- hikyuu/examples/notebook/007-SystemDetails.ipynb +380 -0
- hikyuu/examples/notebook/008-Pickle.ipynb +127 -0
- hikyuu/examples/notebook/009-RealData.ipynb +110 -0
- hikyuu/examples/notebook/010-Portfolio.ipynb +333 -0
- hikyuu/examples/notebook/011-PyechartsDrawplot.ipynb +21821 -0
- hikyuu/examples/notebook/Demo/Demo1.ipynb +623 -0
- hikyuu/examples/notebook/Demo/Demo2.ipynb +665 -0
- hikyuu/examples/notebook/Demo/__init__.py +1 -0
- hikyuu/examples/notebook/README.md +1 -0
- hikyuu/examples/notebook/__init__.py +1 -0
- hikyuu/examples/notebook/images/002_01_block_config.png +0 -0
- hikyuu/examples/notebook/images/008_01_tocsv.png +0 -0
- hikyuu/examples/notebook/images/008_02_tocsv_look.png +0 -0
- hikyuu/examples/notebook/images/008_03_pickle.png +0 -0
- hikyuu/examples/notebook/images/__init__.py +1 -0
- hikyuu/examples/quick_crtsg.py +40 -0
- hikyuu/extend.py +387 -0
- hikyuu/extend.pyi +621 -0
- hikyuu/fetcher/__init__.py +8 -0
- hikyuu/fetcher/proxy/__init__.py +12 -0
- hikyuu/fetcher/proxy/proxy.py +39 -0
- hikyuu/fetcher/proxy/zhima.py +63 -0
- hikyuu/fetcher/stock/__init__.py +8 -0
- hikyuu/fetcher/stock/zh_block_em.py +140 -0
- hikyuu/fetcher/stock/zh_stock_a_huatai.py +51 -0
- hikyuu/fetcher/stock/zh_stock_a_pytdx.py +139 -0
- hikyuu/fetcher/stock/zh_stock_a_qmt.py +58 -0
- hikyuu/fetcher/stock/zh_stock_a_sina_qq.py +229 -0
- hikyuu/flat/Spot.py +440 -0
- hikyuu/flat/SpotList.py +74 -0
- hikyuu/flat/__init__.py +4 -0
- hikyuu/gui/HikyuuTDX.py +842 -0
- hikyuu/gui/__init__.py +1 -0
- hikyuu/gui/data/CollectSpotThread.py +43 -0
- hikyuu/gui/data/CollectToMemThread.py +123 -0
- hikyuu/gui/data/CollectToMySQLThread.py +178 -0
- hikyuu/gui/data/EscapetimeThread.py +32 -0
- hikyuu/gui/data/ImportBlockInfoTask.py +55 -0
- hikyuu/gui/data/ImportHistoryFinanceTask.py +141 -0
- hikyuu/gui/data/ImportPytdxTimeToH5Task.py +94 -0
- hikyuu/gui/data/ImportPytdxToH5Task.py +98 -0
- hikyuu/gui/data/ImportPytdxTransToH5Task.py +94 -0
- hikyuu/gui/data/ImportTdxToH5Task.py +111 -0
- hikyuu/gui/data/ImportWeightToSqliteTask.py +114 -0
- hikyuu/gui/data/ImportZhBond10Task.py +48 -0
- hikyuu/gui/data/MainWindow.py +824 -0
- hikyuu/gui/data/SchedImportThread.py +62 -0
- hikyuu/gui/data/UsePytdxImportToH5Thread.py +371 -0
- hikyuu/gui/data/UseTdxImportToH5Thread.py +182 -0
- hikyuu/gui/data/__init__.py +1 -0
- hikyuu/gui/data/tool.py +43 -0
- hikyuu/gui/hikyuu.ico +0 -0
- hikyuu/gui/hikyuu_small.png +0 -0
- hikyuu/gui/importdata.py +166 -0
- hikyuu/gui/spot_server.py +336 -0
- hikyuu/gui/start_huatai_insight.py +510 -0
- hikyuu/gui/start_qmt.py +122 -0
- hikyuu/hub.py +634 -0
- hikyuu/hub.pyi +255 -0
- hikyuu/include/__init__.py +1 -0
- hikyuu/include/hikyuu/Block.h +173 -0
- hikyuu/include/hikyuu/DataType.h +173 -0
- hikyuu/include/hikyuu/GlobalInitializer.h +46 -0
- hikyuu/include/hikyuu/HistoryFinanceInfo.h +35 -0
- hikyuu/include/hikyuu/KData.h +271 -0
- hikyuu/include/hikyuu/KDataImp.h +94 -0
- hikyuu/include/hikyuu/KQuery.h +275 -0
- hikyuu/include/hikyuu/KRecord.h +94 -0
- hikyuu/include/hikyuu/MarketInfo.h +132 -0
- hikyuu/include/hikyuu/Stock.h +351 -0
- hikyuu/include/hikyuu/StockManager.h +371 -0
- hikyuu/include/hikyuu/StockMapIterator.h +72 -0
- hikyuu/include/hikyuu/StockTypeInfo.h +127 -0
- hikyuu/include/hikyuu/StockWeight.h +148 -0
- hikyuu/include/hikyuu/StrategyContext.h +107 -0
- hikyuu/include/hikyuu/TimeLineRecord.h +71 -0
- hikyuu/include/hikyuu/TransRecord.h +79 -0
- hikyuu/include/hikyuu/ZhBond10.h +36 -0
- hikyuu/include/hikyuu/__init__.py +1 -0
- hikyuu/include/hikyuu/analysis/__init__.py +1 -0
- hikyuu/include/hikyuu/analysis/analysis_sys.h +76 -0
- hikyuu/include/hikyuu/analysis/combinate.h +115 -0
- hikyuu/include/hikyuu/config.h +51 -0
- hikyuu/include/hikyuu/data_driver/BaseInfoDriver.h +201 -0
- hikyuu/include/hikyuu/data_driver/BlockInfoDriver.h +108 -0
- hikyuu/include/hikyuu/data_driver/DataDriverFactory.h +58 -0
- hikyuu/include/hikyuu/data_driver/DriverConnectPool.h +146 -0
- hikyuu/include/hikyuu/data_driver/HistoryFinanceReader.h +36 -0
- hikyuu/include/hikyuu/data_driver/KDataDriver.h +194 -0
- hikyuu/include/hikyuu/data_driver/__init__.py +1 -0
- hikyuu/include/hikyuu/data_driver/base_info/__init__.py +1 -0
- hikyuu/include/hikyuu/data_driver/base_info/mysql/MySQLBaseInfoDriver.h +54 -0
- hikyuu/include/hikyuu/data_driver/base_info/mysql/__init__.py +1 -0
- hikyuu/include/hikyuu/data_driver/base_info/sqlite/SQLiteBaseInfoDriver.h +50 -0
- hikyuu/include/hikyuu/data_driver/base_info/sqlite/__init__.py +1 -0
- hikyuu/include/hikyuu/data_driver/base_info/table/HistoryFinanceFieldTable.h +19 -0
- hikyuu/include/hikyuu/data_driver/base_info/table/HistoryFinanceTable.h +23 -0
- hikyuu/include/hikyuu/data_driver/base_info/table/HolidayTable.h +29 -0
- hikyuu/include/hikyuu/data_driver/base_info/table/MarketInfoTable.h +127 -0
- hikyuu/include/hikyuu/data_driver/base_info/table/StockTable.h +64 -0
- hikyuu/include/hikyuu/data_driver/base_info/table/StockTypeInfoTable.h +108 -0
- hikyuu/include/hikyuu/data_driver/base_info/table/StockWeightTable.h +52 -0
- hikyuu/include/hikyuu/data_driver/base_info/table/ZhBond10Table.h +20 -0
- hikyuu/include/hikyuu/data_driver/base_info/table/__init__.py +1 -0
- hikyuu/include/hikyuu/data_driver/block_info/__init__.py +1 -0
- hikyuu/include/hikyuu/data_driver/block_info/mysql/MySQLBlockInfoDriver.h +36 -0
- hikyuu/include/hikyuu/data_driver/block_info/mysql/__init__.py +1 -0
- hikyuu/include/hikyuu/data_driver/block_info/qianlong/QLBlockInfoDriver.h +31 -0
- hikyuu/include/hikyuu/data_driver/block_info/qianlong/__init__.py +1 -0
- hikyuu/include/hikyuu/data_driver/block_info/sqlite/SQLiteBlockInfoDriver.h +36 -0
- hikyuu/include/hikyuu/data_driver/block_info/sqlite/__init__.py +1 -0
- hikyuu/include/hikyuu/data_driver/kdata/DoNothingKDataDriver.h +33 -0
- hikyuu/include/hikyuu/data_driver/kdata/__init__.py +1 -0
- hikyuu/include/hikyuu/data_driver/kdata/cvs/KDataTempCsvDriver.h +106 -0
- hikyuu/include/hikyuu/data_driver/kdata/cvs/__init__.py +1 -0
- hikyuu/include/hikyuu/data_driver/kdata/hdf5/H5KDataDriver.h +89 -0
- hikyuu/include/hikyuu/data_driver/kdata/hdf5/H5Record.h +50 -0
- hikyuu/include/hikyuu/data_driver/kdata/hdf5/__init__.py +1 -0
- hikyuu/include/hikyuu/data_driver/kdata/mysql/KRecordTable.h +124 -0
- hikyuu/include/hikyuu/data_driver/kdata/mysql/MySQLKDataDriver.h +78 -0
- hikyuu/include/hikyuu/data_driver/kdata/mysql/__init__.py +1 -0
- hikyuu/include/hikyuu/data_driver/kdata/sqlite/SQLiteKDataDriver.h +62 -0
- hikyuu/include/hikyuu/data_driver/kdata/sqlite/__init__.py +1 -0
- hikyuu/include/hikyuu/data_driver/kdata/tdx/TdxKDataDriver.h +63 -0
- hikyuu/include/hikyuu/data_driver/kdata/tdx/__init__.py +1 -0
- hikyuu/include/hikyuu/debug.h +32 -0
- hikyuu/include/hikyuu/doc.h +166 -0
- hikyuu/include/hikyuu/global/GlobalSpotAgent.h +33 -0
- hikyuu/include/hikyuu/global/SpotRecord.h +52 -0
- hikyuu/include/hikyuu/global/__init__.py +1 -0
- hikyuu/include/hikyuu/global/agent/SpotAgent.h +143 -0
- hikyuu/include/hikyuu/global/agent/__init__.py +1 -0
- hikyuu/include/hikyuu/global/agent/hikyuu/__init__.py +1 -0
- hikyuu/include/hikyuu/global/agent/hikyuu/flat/__init__.py +1 -0
- hikyuu/include/hikyuu/global/agent/spot_generated.h +527 -0
- hikyuu/include/hikyuu/global/schedule/__init__.py +1 -0
- hikyuu/include/hikyuu/global/schedule/inner_tasks.h +16 -0
- hikyuu/include/hikyuu/global/schedule/scheduler.h +24 -0
- hikyuu/include/hikyuu/global/sysinfo.h +67 -0
- hikyuu/include/hikyuu/hikyuu.h +55 -0
- hikyuu/include/hikyuu/indicator/IndParam.h +39 -0
- hikyuu/include/hikyuu/indicator/Indicator.h +410 -0
- hikyuu/include/hikyuu/indicator/IndicatorImp.h +419 -0
- hikyuu/include/hikyuu/indicator/__init__.py +1 -0
- hikyuu/include/hikyuu/indicator/build_in.h +122 -0
- hikyuu/include/hikyuu/indicator/crt/ABS.h +34 -0
- hikyuu/include/hikyuu/indicator/crt/ACOS.h +36 -0
- hikyuu/include/hikyuu/indicator/crt/AD.h +28 -0
- hikyuu/include/hikyuu/indicator/crt/ADVANCE.h +34 -0
- hikyuu/include/hikyuu/indicator/crt/ALIGN.h +42 -0
- hikyuu/include/hikyuu/indicator/crt/AMA.h +113 -0
- hikyuu/include/hikyuu/indicator/crt/ASIN.h +36 -0
- hikyuu/include/hikyuu/indicator/crt/ATAN.h +36 -0
- hikyuu/include/hikyuu/indicator/crt/ATR.h +44 -0
- hikyuu/include/hikyuu/indicator/crt/AVEDEV.h +45 -0
- hikyuu/include/hikyuu/indicator/crt/BACKSET.h +44 -0
- hikyuu/include/hikyuu/indicator/crt/BARSCOUNT.h +37 -0
- hikyuu/include/hikyuu/indicator/crt/BARSLAST.h +41 -0
- hikyuu/include/hikyuu/indicator/crt/BARSSINCE.h +41 -0
- hikyuu/include/hikyuu/indicator/crt/BETWEEN.h +85 -0
- hikyuu/include/hikyuu/indicator/crt/BLOCKSETNUM.h +23 -0
- hikyuu/include/hikyuu/indicator/crt/CEILING.h +38 -0
- hikyuu/include/hikyuu/indicator/crt/CONTEXT.h +30 -0
- hikyuu/include/hikyuu/indicator/crt/CORR.h +26 -0
- hikyuu/include/hikyuu/indicator/crt/COS.h +36 -0
- hikyuu/include/hikyuu/indicator/crt/COST.h +34 -0
- hikyuu/include/hikyuu/indicator/crt/COUNT.h +54 -0
- hikyuu/include/hikyuu/indicator/crt/CROSS.h +48 -0
- hikyuu/include/hikyuu/indicator/crt/CVAL.h +35 -0
- hikyuu/include/hikyuu/indicator/crt/DECLINE.h +34 -0
- hikyuu/include/hikyuu/indicator/crt/DEVSQ.h +40 -0
- hikyuu/include/hikyuu/indicator/crt/DIFF.h +31 -0
- hikyuu/include/hikyuu/indicator/crt/DMA.h +35 -0
- hikyuu/include/hikyuu/indicator/crt/DOWNNDAY.h +43 -0
- hikyuu/include/hikyuu/indicator/crt/DROPNA.h +31 -0
- hikyuu/include/hikyuu/indicator/crt/EMA.h +44 -0
- hikyuu/include/hikyuu/indicator/crt/EVERY.h +44 -0
- hikyuu/include/hikyuu/indicator/crt/EXIST.h +44 -0
- hikyuu/include/hikyuu/indicator/crt/EXP.h +34 -0
- hikyuu/include/hikyuu/indicator/crt/FILTER.h +44 -0
- hikyuu/include/hikyuu/indicator/crt/FINANCE.h +20 -0
- hikyuu/include/hikyuu/indicator/crt/FLOOR.h +38 -0
- hikyuu/include/hikyuu/indicator/crt/HHV.h +44 -0
- hikyuu/include/hikyuu/indicator/crt/HHVBARS.h +44 -0
- hikyuu/include/hikyuu/indicator/crt/HSL.h +39 -0
- hikyuu/include/hikyuu/indicator/crt/IC.h +41 -0
- hikyuu/include/hikyuu/indicator/crt/ICIR.h +51 -0
- hikyuu/include/hikyuu/indicator/crt/INDEX.h +48 -0
- hikyuu/include/hikyuu/indicator/crt/INSUM.h +36 -0
- hikyuu/include/hikyuu/indicator/crt/INTPART.h +38 -0
- hikyuu/include/hikyuu/indicator/crt/IR.h +44 -0
- hikyuu/include/hikyuu/indicator/crt/ISINF.h +28 -0
- hikyuu/include/hikyuu/indicator/crt/ISINFA.h +28 -0
- hikyuu/include/hikyuu/indicator/crt/ISLASTBAR.h +30 -0
- hikyuu/include/hikyuu/indicator/crt/ISNA.h +29 -0
- hikyuu/include/hikyuu/indicator/crt/KDATA.h +72 -0
- hikyuu/include/hikyuu/indicator/crt/LAST.h +100 -0
- hikyuu/include/hikyuu/indicator/crt/LIUTONGPAN.h +23 -0
- hikyuu/include/hikyuu/indicator/crt/LLV.h +46 -0
- hikyuu/include/hikyuu/indicator/crt/LLVBARS.h +44 -0
- hikyuu/include/hikyuu/indicator/crt/LN.h +36 -0
- hikyuu/include/hikyuu/indicator/crt/LOG.h +35 -0
- hikyuu/include/hikyuu/indicator/crt/LONGCROSS.h +68 -0
- hikyuu/include/hikyuu/indicator/crt/MA.h +44 -0
- hikyuu/include/hikyuu/indicator/crt/MACD.h +62 -0
- hikyuu/include/hikyuu/indicator/crt/MAX.h +45 -0
- hikyuu/include/hikyuu/indicator/crt/MDD.h +29 -0
- hikyuu/include/hikyuu/indicator/crt/MIN.h +45 -0
- hikyuu/include/hikyuu/indicator/crt/MOD.h +49 -0
- hikyuu/include/hikyuu/indicator/crt/MRR.h +29 -0
- hikyuu/include/hikyuu/indicator/crt/NDAY.h +43 -0
- hikyuu/include/hikyuu/indicator/crt/NOT.h +35 -0
- hikyuu/include/hikyuu/indicator/crt/POS.h +21 -0
- hikyuu/include/hikyuu/indicator/crt/POW.h +48 -0
- hikyuu/include/hikyuu/indicator/crt/PRICELIST.h +59 -0
- hikyuu/include/hikyuu/indicator/crt/RECOVER.h +45 -0
- hikyuu/include/hikyuu/indicator/crt/REF.h +48 -0
- hikyuu/include/hikyuu/indicator/crt/REPLACE.h +29 -0
- hikyuu/include/hikyuu/indicator/crt/RESULT.h +20 -0
- hikyuu/include/hikyuu/indicator/crt/REVERSE.h +36 -0
- hikyuu/include/hikyuu/indicator/crt/ROC.h +39 -0
- hikyuu/include/hikyuu/indicator/crt/ROCP.h +39 -0
- hikyuu/include/hikyuu/indicator/crt/ROCR.h +39 -0
- hikyuu/include/hikyuu/indicator/crt/ROCR100.h +39 -0
- hikyuu/include/hikyuu/indicator/crt/ROUND.h +36 -0
- hikyuu/include/hikyuu/indicator/crt/ROUNDDOWN.h +36 -0
- hikyuu/include/hikyuu/indicator/crt/ROUNDUP.h +36 -0
- hikyuu/include/hikyuu/indicator/crt/RSI.h +43 -0
- hikyuu/include/hikyuu/indicator/crt/SAFTYLOSS.h +79 -0
- hikyuu/include/hikyuu/indicator/crt/SGN.h +34 -0
- hikyuu/include/hikyuu/indicator/crt/SIN.h +36 -0
- hikyuu/include/hikyuu/indicator/crt/SLICE.h +44 -0
- hikyuu/include/hikyuu/indicator/crt/SLOPE.h +44 -0
- hikyuu/include/hikyuu/indicator/crt/SMA.h +72 -0
- hikyuu/include/hikyuu/indicator/crt/SPEARMAN.h +24 -0
- hikyuu/include/hikyuu/indicator/crt/SQRT.h +41 -0
- hikyuu/include/hikyuu/indicator/crt/STDEV.h +44 -0
- hikyuu/include/hikyuu/indicator/crt/STDP.h +38 -0
- hikyuu/include/hikyuu/indicator/crt/SUM.h +44 -0
- hikyuu/include/hikyuu/indicator/crt/SUMBARS.h +44 -0
- hikyuu/include/hikyuu/indicator/crt/TAN.h +36 -0
- hikyuu/include/hikyuu/indicator/crt/TIME.h +69 -0
- hikyuu/include/hikyuu/indicator/crt/TIMELINE.h +23 -0
- hikyuu/include/hikyuu/indicator/crt/TIMELINEVOL.h +21 -0
- hikyuu/include/hikyuu/indicator/crt/TURNOVER.h +21 -0
- hikyuu/include/hikyuu/indicator/crt/UPNDAY.h +43 -0
- hikyuu/include/hikyuu/indicator/crt/VAR.h +40 -0
- hikyuu/include/hikyuu/indicator/crt/VARP.h +40 -0
- hikyuu/include/hikyuu/indicator/crt/VIGOR.h +34 -0
- hikyuu/include/hikyuu/indicator/crt/WMA.h +46 -0
- hikyuu/include/hikyuu/indicator/crt/ZHBOND10.h +27 -0
- hikyuu/include/hikyuu/indicator/crt/ZONGGUBEN.h +17 -0
- hikyuu/include/hikyuu/indicator/crt/ZSCORE.h +30 -0
- hikyuu/include/hikyuu/indicator/crt/__init__.py +1 -0
- hikyuu/include/hikyuu/indicator/imp/IAbs.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/IAcos.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/IAd.h +30 -0
- hikyuu/include/hikyuu/indicator/imp/IAdvance.h +29 -0
- hikyuu/include/hikyuu/indicator/imp/IAlign.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/IAma.h +38 -0
- hikyuu/include/hikyuu/indicator/imp/IAsin.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/IAtan.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/IAtr.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/IBackset.h +33 -0
- hikyuu/include/hikyuu/indicator/imp/IBarsCount.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/IBarsLast.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/IBarsSince.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/IBlockSetNum.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/ICeil.h +31 -0
- hikyuu/include/hikyuu/indicator/imp/IContext.h +44 -0
- hikyuu/include/hikyuu/indicator/imp/ICorr.h +41 -0
- hikyuu/include/hikyuu/indicator/imp/ICos.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/ICount.h +32 -0
- hikyuu/include/hikyuu/indicator/imp/ICval.h +29 -0
- hikyuu/include/hikyuu/indicator/imp/IDecline.h +29 -0
- hikyuu/include/hikyuu/indicator/imp/IDevsq.h +29 -0
- hikyuu/include/hikyuu/indicator/imp/IDiff.h +29 -0
- hikyuu/include/hikyuu/indicator/imp/IDma.h +47 -0
- hikyuu/include/hikyuu/indicator/imp/IDropna.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/IEma.h +29 -0
- hikyuu/include/hikyuu/indicator/imp/IEvery.h +32 -0
- hikyuu/include/hikyuu/indicator/imp/IExist.h +32 -0
- hikyuu/include/hikyuu/indicator/imp/IExp.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/IFilter.h +34 -0
- hikyuu/include/hikyuu/indicator/imp/IFinance.h +25 -0
- hikyuu/include/hikyuu/indicator/imp/IFloor.h +31 -0
- hikyuu/include/hikyuu/indicator/imp/IHhvbars.h +29 -0
- hikyuu/include/hikyuu/indicator/imp/IHighLine.h +34 -0
- hikyuu/include/hikyuu/indicator/imp/IIc.h +45 -0
- hikyuu/include/hikyuu/indicator/imp/IInSum.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/IIntpart.h +31 -0
- hikyuu/include/hikyuu/indicator/imp/IIsInf.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/IIsInfa.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/IIsLastBar.h +27 -0
- hikyuu/include/hikyuu/indicator/imp/IIsNa.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/IKData.h +29 -0
- hikyuu/include/hikyuu/indicator/imp/ILiuTongPan.h +29 -0
- hikyuu/include/hikyuu/indicator/imp/ILn.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/ILog.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/ILowLine.h +30 -0
- hikyuu/include/hikyuu/indicator/imp/ILowLineBars.h +29 -0
- hikyuu/include/hikyuu/indicator/imp/IMa.h +27 -0
- hikyuu/include/hikyuu/indicator/imp/IMacd.h +41 -0
- hikyuu/include/hikyuu/indicator/imp/IMdd.h +23 -0
- hikyuu/include/hikyuu/indicator/imp/IMrr.h +23 -0
- hikyuu/include/hikyuu/indicator/imp/INot.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/IPow.h +32 -0
- hikyuu/include/hikyuu/indicator/imp/IPriceList.h +29 -0
- hikyuu/include/hikyuu/indicator/imp/IRecover.h +29 -0
- hikyuu/include/hikyuu/indicator/imp/IRef.h +34 -0
- hikyuu/include/hikyuu/indicator/imp/IReplace.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/IResult.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/IReverse.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/IRoc.h +29 -0
- hikyuu/include/hikyuu/indicator/imp/IRocp.h +29 -0
- hikyuu/include/hikyuu/indicator/imp/IRocr.h +29 -0
- hikyuu/include/hikyuu/indicator/imp/IRocr100.h +29 -0
- hikyuu/include/hikyuu/indicator/imp/IRound.h +32 -0
- hikyuu/include/hikyuu/indicator/imp/IRoundDown.h +32 -0
- hikyuu/include/hikyuu/indicator/imp/IRoundUp.h +32 -0
- hikyuu/include/hikyuu/indicator/imp/ISaftyLoss.h +44 -0
- hikyuu/include/hikyuu/indicator/imp/ISign.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/ISin.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/ISlice.h +25 -0
- hikyuu/include/hikyuu/indicator/imp/ISlope.h +25 -0
- hikyuu/include/hikyuu/indicator/imp/ISma.h +34 -0
- hikyuu/include/hikyuu/indicator/imp/ISpearman.h +41 -0
- hikyuu/include/hikyuu/indicator/imp/ISqrt.h +31 -0
- hikyuu/include/hikyuu/indicator/imp/IStdev.h +31 -0
- hikyuu/include/hikyuu/indicator/imp/IStdp.h +33 -0
- hikyuu/include/hikyuu/indicator/imp/ISum.h +27 -0
- hikyuu/include/hikyuu/indicator/imp/ISumBars.h +30 -0
- hikyuu/include/hikyuu/indicator/imp/ITan.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/ITime.h +33 -0
- hikyuu/include/hikyuu/indicator/imp/ITimeLine.h +32 -0
- hikyuu/include/hikyuu/indicator/imp/IVar.h +32 -0
- hikyuu/include/hikyuu/indicator/imp/IVarp.h +32 -0
- hikyuu/include/hikyuu/indicator/imp/IVigor.h +35 -0
- hikyuu/include/hikyuu/indicator/imp/IWma.h +30 -0
- hikyuu/include/hikyuu/indicator/imp/IZScore.h +25 -0
- hikyuu/include/hikyuu/indicator/imp/IZhBond10.h +30 -0
- hikyuu/include/hikyuu/indicator/imp/IZongGuBen.h +25 -0
- hikyuu/include/hikyuu/indicator/imp/__init__.py +1 -0
- hikyuu/include/hikyuu/indicator_talib/__init__.py +1 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaAdosc.h +26 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaApo.h +24 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaBbands.h +24 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaMa.h +24 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaMacd.h +24 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaMacdext.h +24 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaMama.h +24 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaMavp.h +41 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaPpo.h +24 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaSar.h +26 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaSarext.h +31 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaStddev.h +24 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaStoch.h +27 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaStochf.h +26 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaStochrsi.h +24 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaT3.h +24 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaUltosc.h +26 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaVar.h +24 -0
- hikyuu/include/hikyuu/indicator_talib/imp/__init__.py +1 -0
- hikyuu/include/hikyuu/indicator_talib/imp/ta_defines.h +288 -0
- hikyuu/include/hikyuu/indicator_talib/imp/ta_imp.h +1374 -0
- hikyuu/include/hikyuu/indicator_talib/ta_crt.h +322 -0
- hikyuu/include/hikyuu/python/__init__.py +1 -0
- hikyuu/include/hikyuu/python/pickle_support.h +90 -0
- hikyuu/include/hikyuu/python/pybind_utils.h +103 -0
- hikyuu/include/hikyuu/serialization/Block_serialization.h +55 -0
- hikyuu/include/hikyuu/serialization/Datetime_serialization.h +40 -0
- hikyuu/include/hikyuu/serialization/KData_serialization.h +45 -0
- hikyuu/include/hikyuu/serialization/KQuery_serialization.h +79 -0
- hikyuu/include/hikyuu/serialization/KRecord_serialization.h +50 -0
- hikyuu/include/hikyuu/serialization/MarketInfo_serialization.h +68 -0
- hikyuu/include/hikyuu/serialization/PriceList_serialization.h +66 -0
- hikyuu/include/hikyuu/serialization/StockTypeInfo_serialization.h +62 -0
- hikyuu/include/hikyuu/serialization/StockWeight_serialization.h +65 -0
- hikyuu/include/hikyuu/serialization/Stock_serialization.h +47 -0
- hikyuu/include/hikyuu/serialization/TimeDelta_serialization.h +44 -0
- hikyuu/include/hikyuu/serialization/TimeLineRecord_serialization.h +42 -0
- hikyuu/include/hikyuu/serialization/TransRecord_serialization.h +44 -0
- hikyuu/include/hikyuu/serialization/__init__.py +1 -0
- hikyuu/include/hikyuu/serialization/all.h +26 -0
- hikyuu/include/hikyuu/strategy/BrokerTradeManager.h +433 -0
- hikyuu/include/hikyuu/strategy/RunPortfolioInStrategy.h +37 -0
- hikyuu/include/hikyuu/strategy/RunSystemInStrategy.h +38 -0
- hikyuu/include/hikyuu/strategy/Strategy.h +191 -0
- hikyuu/include/hikyuu/strategy/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_manage/BorrowRecord.h +91 -0
- hikyuu/include/hikyuu/trade_manage/CostRecord.h +67 -0
- hikyuu/include/hikyuu/trade_manage/FundsRecord.h +110 -0
- hikyuu/include/hikyuu/trade_manage/LoanRecord.h +64 -0
- hikyuu/include/hikyuu/trade_manage/OrderBrokerBase.h +207 -0
- hikyuu/include/hikyuu/trade_manage/Performance.h +80 -0
- hikyuu/include/hikyuu/trade_manage/PositionRecord.h +108 -0
- hikyuu/include/hikyuu/trade_manage/TradeCostBase.h +174 -0
- hikyuu/include/hikyuu/trade_manage/TradeManager.h +487 -0
- hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +778 -0
- hikyuu/include/hikyuu/trade_manage/TradeRecord.h +151 -0
- hikyuu/include/hikyuu/trade_manage/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_manage/build_in.h +19 -0
- hikyuu/include/hikyuu/trade_manage/crt/TC_FixedA.h +45 -0
- hikyuu/include/hikyuu/trade_manage/crt/TC_FixedA2015.h +43 -0
- hikyuu/include/hikyuu/trade_manage/crt/TC_FixedA2017.h +44 -0
- hikyuu/include/hikyuu/trade_manage/crt/TC_TestStub.h +21 -0
- hikyuu/include/hikyuu/trade_manage/crt/TC_Zero.h +25 -0
- hikyuu/include/hikyuu/trade_manage/crt/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_manage/crt/crtTM.h +33 -0
- hikyuu/include/hikyuu/trade_manage/imp/FixedA2015TradeCost.h +53 -0
- hikyuu/include/hikyuu/trade_manage/imp/FixedA2017TradeCost.h +56 -0
- hikyuu/include/hikyuu/trade_manage/imp/FixedATradeCost.h +88 -0
- hikyuu/include/hikyuu/trade_manage/imp/TradeCostStub.h +48 -0
- hikyuu/include/hikyuu/trade_manage/imp/ZeroTradeCost.h +50 -0
- hikyuu/include/hikyuu/trade_manage/imp/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/all.h +24 -0
- hikyuu/include/hikyuu/trade_sys/allocatefunds/AllocateFundsBase.h +229 -0
- hikyuu/include/hikyuu/trade_sys/allocatefunds/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/allocatefunds/build_in.h +16 -0
- hikyuu/include/hikyuu/trade_sys/allocatefunds/crt/AF_EqualWeight.h +25 -0
- hikyuu/include/hikyuu/trade_sys/allocatefunds/crt/AF_FixedWeight.h +26 -0
- hikyuu/include/hikyuu/trade_sys/allocatefunds/crt/AF_MultiFactor.h +21 -0
- hikyuu/include/hikyuu/trade_sys/allocatefunds/crt/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/allocatefunds/imp/EqualWeightAllocateFunds.h +27 -0
- hikyuu/include/hikyuu/trade_sys/allocatefunds/imp/FixedWeightAllocateFunds.h +28 -0
- hikyuu/include/hikyuu/trade_sys/allocatefunds/imp/MultiFactorAllocaterFunds.h +23 -0
- hikyuu/include/hikyuu/trade_sys/allocatefunds/imp/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/condition/ConditionBase.h +241 -0
- hikyuu/include/hikyuu/trade_sys/condition/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/condition/build_in.h +17 -0
- hikyuu/include/hikyuu/trade_sys/condition/crt/CN_Bool.h +22 -0
- hikyuu/include/hikyuu/trade_sys/condition/crt/CN_Logic.h +35 -0
- hikyuu/include/hikyuu/trade_sys/condition/crt/CN_Manual.h +20 -0
- hikyuu/include/hikyuu/trade_sys/condition/crt/CN_OPLine.h +26 -0
- hikyuu/include/hikyuu/trade_sys/condition/crt/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/condition/imp/BoolCondition.h +40 -0
- hikyuu/include/hikyuu/trade_sys/condition/imp/ManualCondition.h +23 -0
- hikyuu/include/hikyuu/trade_sys/condition/imp/OPLineCondition.h +44 -0
- hikyuu/include/hikyuu/trade_sys/condition/imp/SubCondition.h +42 -0
- hikyuu/include/hikyuu/trade_sys/condition/imp/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/condition/imp/logic/AddCondition.h +42 -0
- hikyuu/include/hikyuu/trade_sys/condition/imp/logic/AndCondition.h +42 -0
- hikyuu/include/hikyuu/trade_sys/condition/imp/logic/DivCondition.h +42 -0
- hikyuu/include/hikyuu/trade_sys/condition/imp/logic/MultiCondition.h +42 -0
- hikyuu/include/hikyuu/trade_sys/condition/imp/logic/OrCondition.h +42 -0
- hikyuu/include/hikyuu/trade_sys/condition/imp/logic/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/environment/EnvironmentBase.h +178 -0
- hikyuu/include/hikyuu/trade_sys/environment/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/environment/build_in.h +16 -0
- hikyuu/include/hikyuu/trade_sys/environment/crt/EV_Bool.h +23 -0
- hikyuu/include/hikyuu/trade_sys/environment/crt/EV_Manual.h +20 -0
- hikyuu/include/hikyuu/trade_sys/environment/crt/EV_TwoLine.h +28 -0
- hikyuu/include/hikyuu/trade_sys/environment/crt/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/environment/imp/BoolEnvironment.h +41 -0
- hikyuu/include/hikyuu/trade_sys/environment/imp/ManualEnvironment.h +23 -0
- hikyuu/include/hikyuu/trade_sys/environment/imp/TwoLineEnvironment.h +47 -0
- hikyuu/include/hikyuu/trade_sys/environment/imp/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/MoneyManagerBase.h +230 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/build_in.h +20 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedCapital.h +20 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedCount.h +28 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedPercent.h +27 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedRisk.h +20 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedUnits.h +20 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_Nothing.h +24 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_WilliamsFixedRisk.h +20 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/imp/FixedCapitalMoneyManager.h +28 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/imp/FixedCountMoneyManager.h +38 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/imp/FixedPercentMoneyManager.h +34 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/imp/FixedRiskMoneyManager.h +28 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/imp/FixedUnitsMoneyManager.h +28 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/imp/NotMoneyManager.h +30 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/imp/WilliamsFixedRiskMoneyManager.h +28 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/imp/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/MultiFactorBase.h +275 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/ScoreRecord.h +51 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/build_in.h +13 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_EqualWeight.h +29 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_ICIRWeight.h +30 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_ICWeight.h +30 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_Weight.h +30 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/crt/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/imp/EqualWeightMultiFactor.h +25 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/imp/ICIRMultiFactor.h +27 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/imp/ICMultiFactor.h +27 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/imp/WeightMultiFactor.h +41 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/imp/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +256 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/build_in.h +14 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/crt/PF_Simple.h +23 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/crt/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/imp/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/profitgoal/ProfitGoalBase.h +189 -0
- hikyuu/include/hikyuu/trade_sys/profitgoal/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/profitgoal/build_in.h +16 -0
- hikyuu/include/hikyuu/trade_sys/profitgoal/crt/PG_FixedHoldDays.h +26 -0
- hikyuu/include/hikyuu/trade_sys/profitgoal/crt/PG_FixedPercent.h +25 -0
- hikyuu/include/hikyuu/trade_sys/profitgoal/crt/PG_NoGoal.h +24 -0
- hikyuu/include/hikyuu/trade_sys/profitgoal/crt/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/profitgoal/imp/FixedHoldDays.h +29 -0
- hikyuu/include/hikyuu/trade_sys/profitgoal/imp/FixedPercentProfitGoal.h +28 -0
- hikyuu/include/hikyuu/trade_sys/profitgoal/imp/NoGoalProfitGoal.h +27 -0
- hikyuu/include/hikyuu/trade_sys/profitgoal/imp/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/selector/SelectorBase.h +245 -0
- hikyuu/include/hikyuu/trade_sys/selector/SystemWeight.h +70 -0
- hikyuu/include/hikyuu/trade_sys/selector/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/selector/build_in.h +18 -0
- hikyuu/include/hikyuu/trade_sys/selector/crt/SE_Fixed.h +38 -0
- hikyuu/include/hikyuu/trade_sys/selector/crt/SE_Logic.h +43 -0
- hikyuu/include/hikyuu/trade_sys/selector/crt/SE_MultiFactor.h +40 -0
- hikyuu/include/hikyuu/trade_sys/selector/crt/SE_Optimal.h +26 -0
- hikyuu/include/hikyuu/trade_sys/selector/crt/SE_Signal.h +30 -0
- hikyuu/include/hikyuu/trade_sys/selector/crt/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/FixedSelector.h +28 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector.h +52 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/SignalSelector.h +30 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorAddSelector.h +19 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorAddValueSelector.h +19 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorDivSelector.h +19 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorDivValueSelector.h +19 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorInvertDivValueSelector.h +19 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorInvertSubValueSelector.h +19 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorMulSelector.h +19 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorMulValueSelector.h +19 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorSelector.h +108 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorSubSelector.h +19 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorSubValueSelector.h +19 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorValueSelector.h +94 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/MaxFundsOptimalSelector.h +27 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/OptimalSelectorBase.h +86 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/PerformanceOptimalSelector.h +42 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/signal/SignalBase.h +249 -0
- hikyuu/include/hikyuu/trade_sys/signal/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/signal/build_in.h +22 -0
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_AllwaysBuy.h +20 -0
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_Band.h +37 -0
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_Bool.h +28 -0
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_Cross.h +28 -0
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_CrossGold.h +29 -0
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_Cycle.h +20 -0
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_Flex.h +29 -0
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_Manual.h +20 -0
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_Single.h +56 -0
- hikyuu/include/hikyuu/trade_sys/signal/crt/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/AllwaysBuySignal.h +25 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/BandSignal.h +46 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/BandSignal2.h +47 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/BoolSignal.h +46 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/CrossGoldSignal.h +46 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/CrossSignal.h +46 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/CycleSignal.h +25 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/ManualSignal.h +23 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/SingleSignal.h +45 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/SingleSignal2.h +45 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/slippage/SlippageBase.h +170 -0
- hikyuu/include/hikyuu/trade_sys/slippage/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/slippage/build_in.h +15 -0
- hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_FixedPercent.h +26 -0
- hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_FixedValue.h +26 -0
- hikyuu/include/hikyuu/trade_sys/slippage/crt/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/slippage/imp/FixedPercentSlippage.h +28 -0
- hikyuu/include/hikyuu/trade_sys/slippage/imp/FixedValueSlippage.h +28 -0
- hikyuu/include/hikyuu/trade_sys/slippage/imp/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/stoploss/StoplossBase.h +199 -0
- hikyuu/include/hikyuu/trade_sys/stoploss/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/stoploss/build_in.h +16 -0
- hikyuu/include/hikyuu/trade_sys/stoploss/crt/ST_FixedPercent.h +25 -0
- hikyuu/include/hikyuu/trade_sys/stoploss/crt/ST_Indicator.h +21 -0
- hikyuu/include/hikyuu/trade_sys/stoploss/crt/ST_Saftyloss.h +37 -0
- hikyuu/include/hikyuu/trade_sys/stoploss/crt/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/stoploss/imp/FixedPercentStoploss.h +30 -0
- hikyuu/include/hikyuu/trade_sys/stoploss/imp/IndicatorStoploss.h +50 -0
- hikyuu/include/hikyuu/trade_sys/stoploss/imp/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/system/System.h +639 -0
- hikyuu/include/hikyuu/trade_sys/system/SystemPart.h +54 -0
- hikyuu/include/hikyuu/trade_sys/system/TradeRequest.h +94 -0
- hikyuu/include/hikyuu/trade_sys/system/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/system/build_in.h +15 -0
- hikyuu/include/hikyuu/trade_sys/system/crt/SYS_Simple.h +50 -0
- hikyuu/include/hikyuu/trade_sys/system/crt/SYS_WalkForward.h +21 -0
- hikyuu/include/hikyuu/trade_sys/system/crt/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/system/imp/DelegateSystem.h +51 -0
- hikyuu/include/hikyuu/trade_sys/system/imp/WalkForwardSystem.h +70 -0
- hikyuu/include/hikyuu/trade_sys/system/imp/WalkForwardTradeManager.h +465 -0
- hikyuu/include/hikyuu/trade_sys/system/imp/__init__.py +1 -0
- hikyuu/include/hikyuu/utilities/ConnectPool.h +163 -0
- hikyuu/include/hikyuu/utilities/FilterNode.h +267 -0
- hikyuu/include/hikyuu/utilities/LRUCache11.h +230 -0
- hikyuu/include/hikyuu/utilities/Log.h +411 -0
- hikyuu/include/hikyuu/utilities/Null.h +176 -0
- hikyuu/include/hikyuu/utilities/Parameter.h +511 -0
- hikyuu/include/hikyuu/utilities/ResourcePool.h +636 -0
- hikyuu/include/hikyuu/utilities/SpendTimer.h +305 -0
- hikyuu/include/hikyuu/utilities/TimerManager.h +552 -0
- hikyuu/include/hikyuu/utilities/__init__.py +1 -0
- hikyuu/include/hikyuu/utilities/any_to_string.h +142 -0
- hikyuu/include/hikyuu/utilities/arithmetic.h +401 -0
- hikyuu/include/hikyuu/utilities/base64.h +52 -0
- hikyuu/include/hikyuu/utilities/config.h +41 -0
- hikyuu/include/hikyuu/utilities/cppdef.h +25 -0
- hikyuu/include/hikyuu/utilities/datetime/Datetime.h +438 -0
- hikyuu/include/hikyuu/utilities/datetime/TimeDelta.h +343 -0
- hikyuu/include/hikyuu/utilities/datetime/__init__.py +1 -0
- hikyuu/include/hikyuu/utilities/db_connect/AutoTransAction.h +124 -0
- hikyuu/include/hikyuu/utilities/db_connect/DBCondition.h +248 -0
- hikyuu/include/hikyuu/utilities/db_connect/DBConnect.h +30 -0
- hikyuu/include/hikyuu/utilities/db_connect/DBConnectBase.h +658 -0
- hikyuu/include/hikyuu/utilities/db_connect/DBUpgrade.h +28 -0
- hikyuu/include/hikyuu/utilities/db_connect/SQLException.h +62 -0
- hikyuu/include/hikyuu/utilities/db_connect/SQLResultSet.h +248 -0
- hikyuu/include/hikyuu/utilities/db_connect/SQLStatementBase.h +305 -0
- hikyuu/include/hikyuu/utilities/db_connect/TableMacro.h +2579 -0
- hikyuu/include/hikyuu/utilities/db_connect/__init__.py +1 -0
- hikyuu/include/hikyuu/utilities/db_connect/mysql/MySQLConnect.h +56 -0
- hikyuu/include/hikyuu/utilities/db_connect/mysql/MySQLStatement.h +88 -0
- hikyuu/include/hikyuu/utilities/db_connect/mysql/__init__.py +1 -0
- hikyuu/include/hikyuu/utilities/db_connect/sqlite/SQLiteConnect.h +89 -0
- hikyuu/include/hikyuu/utilities/db_connect/sqlite/SQLiteStatement.h +71 -0
- hikyuu/include/hikyuu/utilities/db_connect/sqlite/SQLiteUtil.h +80 -0
- hikyuu/include/hikyuu/utilities/db_connect/sqlite/__init__.py +1 -0
- hikyuu/include/hikyuu/utilities/exception.h +52 -0
- hikyuu/include/hikyuu/utilities/http_client/HttpClient.h +229 -0
- hikyuu/include/hikyuu/utilities/http_client/__init__.py +1 -0
- hikyuu/include/hikyuu/utilities/http_client/nng_wrap.h +517 -0
- hikyuu/include/hikyuu/utilities/http_client/url.h +25 -0
- hikyuu/include/hikyuu/utilities/ini_parser/IniParser.h +104 -0
- hikyuu/include/hikyuu/utilities/ini_parser/__init__.py +1 -0
- hikyuu/include/hikyuu/utilities/md5.h +41 -0
- hikyuu/include/hikyuu/utilities/mo/__init__.py +1 -0
- hikyuu/include/hikyuu/utilities/mo/mo.h +48 -0
- hikyuu/include/hikyuu/utilities/mo/moFileReader.h +836 -0
- hikyuu/include/hikyuu/utilities/node/NodeClient.h +175 -0
- hikyuu/include/hikyuu/utilities/node/NodeError.h +66 -0
- hikyuu/include/hikyuu/utilities/node/NodeMessage.h +80 -0
- hikyuu/include/hikyuu/utilities/node/NodeServer.h +246 -0
- hikyuu/include/hikyuu/utilities/node/__init__.py +1 -0
- hikyuu/include/hikyuu/utilities/os.h +102 -0
- hikyuu/include/hikyuu/utilities/osdef.h +159 -0
- hikyuu/include/hikyuu/utilities/runtimeinfo.h +35 -0
- hikyuu/include/hikyuu/utilities/snowflake.h +110 -0
- hikyuu/include/hikyuu/utilities/string_view.h +70 -0
- hikyuu/include/hikyuu/utilities/thread/FuncWrapper.h +85 -0
- hikyuu/include/hikyuu/utilities/thread/InterruptFlag.h +30 -0
- hikyuu/include/hikyuu/utilities/thread/MQStealQueue.h +112 -0
- hikyuu/include/hikyuu/utilities/thread/MQStealThreadPool.h +315 -0
- hikyuu/include/hikyuu/utilities/thread/MQThreadPool.h +275 -0
- hikyuu/include/hikyuu/utilities/thread/StealThreadPool.h +309 -0
- hikyuu/include/hikyuu/utilities/thread/ThreadPool.h +231 -0
- hikyuu/include/hikyuu/utilities/thread/ThreadSafeQueue.h +101 -0
- hikyuu/include/hikyuu/utilities/thread/WorkStealQueue.h +105 -0
- hikyuu/include/hikyuu/utilities/thread/__init__.py +1 -0
- hikyuu/include/hikyuu/utilities/thread/algorithm.h +110 -0
- hikyuu/include/hikyuu/utilities/thread/thread.h +10 -0
- hikyuu/include/hikyuu/version.h +24 -0
- hikyuu/indicator/__init__.py +29 -0
- hikyuu/indicator/indicator.py +157 -0
- hikyuu/indicator/pyind.py +47 -0
- hikyuu/indicator/talib_wrap.py +1273 -0
- hikyuu/interactive.py +385 -0
- hikyuu/setup.py +104 -0
- hikyuu/shell/__init__.py +0 -0
- hikyuu/shell/cmdserver.py +126 -0
- hikyuu/shell/hkucmd.py +110 -0
- hikyuu/shell/hkushell.py +20 -0
- hikyuu/strategy/__init__.py +2 -0
- hikyuu/strategy/strategy_demo1.py +54 -0
- hikyuu/strategy/strategy_demo2.py +47 -0
- hikyuu/strategy/strategy_demo3.py +24 -0
- hikyuu/test/AllocateFunds.py +25 -0
- hikyuu/test/Condition.py +95 -0
- hikyuu/test/Datetime.py +61 -0
- hikyuu/test/Environment.py +88 -0
- hikyuu/test/Indicator.py +233 -0
- hikyuu/test/KData.py +64 -0
- hikyuu/test/MarketInfo.py +26 -0
- hikyuu/test/MoneyManager.py +88 -0
- hikyuu/test/Parameter.py +62 -0
- hikyuu/test/ProfitGoal.py +83 -0
- hikyuu/test/Signal.py +160 -0
- hikyuu/test/Slippage.py +88 -0
- hikyuu/test/Stock.py +127 -0
- hikyuu/test/StockTypeInfo.py +47 -0
- hikyuu/test/Stoploss.py +86 -0
- hikyuu/test/TradeCost.py +71 -0
- hikyuu/test/__init__.py +0 -0
- hikyuu/test/test.py +63 -0
- hikyuu/test/test_init.py +36 -0
- hikyuu/tools/__init__.py +1 -0
- hikyuu/tools/copy_file.py +16 -0
- hikyuu/tools/delete_index.py +50 -0
- hikyuu/tools/fenge.py +139 -0
- hikyuu/tools/h5_data_clear.py +163 -0
- hikyuu/tools/mysql_clear_last_day_data.py +61 -0
- hikyuu/tools/update_block_info.py +168 -0
- hikyuu/trade_manage/__init__.py +30 -0
- hikyuu/trade_manage/__init__.pyi +713 -0
- hikyuu/trade_manage/broker.py +95 -0
- hikyuu/trade_manage/broker.pyi +54 -0
- hikyuu/trade_manage/broker_easytrader.py +63 -0
- hikyuu/trade_manage/broker_easytrader.pyi +21 -0
- hikyuu/trade_manage/broker_mail.py +101 -0
- hikyuu/trade_manage/broker_mail.pyi +55 -0
- hikyuu/trade_manage/trade.py +111 -0
- hikyuu/trade_manage/trade.pyi +719 -0
- hikyuu/trade_sys/__init__.py +27 -0
- hikyuu/trade_sys/trade_sys.py +251 -0
- hikyuu/util/__init__.py +49 -0
- hikyuu/util/__init__.pyi +55 -0
- hikyuu/util/check.py +153 -0
- hikyuu/util/check.pyi +59 -0
- hikyuu/util/mylog.py +264 -0
- hikyuu/util/mylog.pyi +70 -0
- hikyuu/util/notebook.py +47 -0
- hikyuu/util/notebook.pyi +23 -0
- hikyuu/util/singleton.py +29 -0
- hikyuu/util/singleton.pyi +18 -0
- hikyuu/util/slice.py +43 -0
- hikyuu/util/slice.pyi +8 -0
- hikyuu/util/timeout.py +83 -0
- hikyuu-2.3.1.dist-info/LICENSE +201 -0
- hikyuu-2.3.1.dist-info/METADATA +151 -0
- hikyuu-2.3.1.dist-info/RECORD +931 -0
- hikyuu-2.3.1.dist-info/WHEEL +5 -0
- hikyuu-2.3.1.dist-info/entry_points.txt +3 -0
- hikyuu-2.3.1.dist-info/top_level.txt +115 -0
hikyuu/gui/importdata.py
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
#!/usr/bin/python
|
|
2
|
+
# -*- coding: utf8 -*-
|
|
3
|
+
# cp936
|
|
4
|
+
|
|
5
|
+
import os.path
|
|
6
|
+
import sys
|
|
7
|
+
from configparser import ConfigParser
|
|
8
|
+
|
|
9
|
+
from PyQt5.Qt import QCoreApplication
|
|
10
|
+
|
|
11
|
+
from hikyuu.data.weight_to_sqlite import qianlong_import_weight
|
|
12
|
+
from hikyuu.data.common_pytdx import search_best_tdx
|
|
13
|
+
|
|
14
|
+
from hikyuu.gui.data.EscapetimeThread import EscapetimeThread
|
|
15
|
+
from hikyuu.gui.data.UseTdxImportToH5Thread import UseTdxImportToH5Thread
|
|
16
|
+
from hikyuu.gui.data.UsePytdxImportToH5Thread import UsePytdxImportToH5Thread
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class HKUImportDataCMD:
|
|
20
|
+
def __init__(self):
|
|
21
|
+
self.initThreads()
|
|
22
|
+
|
|
23
|
+
def getUserConfigDir(self):
|
|
24
|
+
return os.path.expanduser('~') + '/.hikyuu'
|
|
25
|
+
|
|
26
|
+
def getCurrentConfig(self):
|
|
27
|
+
# 读取保存的配置文件信息,如果不存在,则使用默认配置
|
|
28
|
+
this_dir = self.getUserConfigDir()
|
|
29
|
+
import_config = ConfigParser()
|
|
30
|
+
import_config.read(this_dir + '/importdata-gui.ini', encoding='utf-8')
|
|
31
|
+
return import_config
|
|
32
|
+
|
|
33
|
+
def initThreads(self):
|
|
34
|
+
self.escape_time_thread = None
|
|
35
|
+
self.hdf5_import_thread = None
|
|
36
|
+
self.mysql_import_thread = None
|
|
37
|
+
self.import_running = False
|
|
38
|
+
self.progress = {'DAY': 0, '1MIN': 0, '5MIN': 0, 'TRANS': 0, 'TIME': 0}
|
|
39
|
+
self.info_type = {'DAY': '日线数据', '1MIN': '一分钟线', '5MIN': '五分钟线', 'TRANS': '历史分笔', 'TIME': '分时数据'}
|
|
40
|
+
self.escape_time = 0.0
|
|
41
|
+
self.details = []
|
|
42
|
+
|
|
43
|
+
def print_progress(self, ktype, progress):
|
|
44
|
+
if progress != self.progress[ktype]:
|
|
45
|
+
print(
|
|
46
|
+
'import progress: {}% - {} - 已耗时 {:>.2f} 分钟'.format(progress, self.info_type[ktype], self.escape_time)
|
|
47
|
+
)
|
|
48
|
+
self.progress[ktype] = progress
|
|
49
|
+
|
|
50
|
+
def on_message_from_thread(self, msg):
|
|
51
|
+
if not msg or len(msg) < 2:
|
|
52
|
+
print("msg is empty!")
|
|
53
|
+
return
|
|
54
|
+
|
|
55
|
+
msg_name, msg_task_name = msg[:2]
|
|
56
|
+
if msg_name == 'ESCAPE_TIME':
|
|
57
|
+
self.escape_time = msg_task_name / 60
|
|
58
|
+
|
|
59
|
+
elif msg_name == 'HDF5_IMPORT':
|
|
60
|
+
if msg_task_name == 'INFO':
|
|
61
|
+
print(msg[2])
|
|
62
|
+
|
|
63
|
+
elif msg_task_name == 'THREAD':
|
|
64
|
+
status = msg[2]
|
|
65
|
+
if status == 'FAILURE':
|
|
66
|
+
self.details.append(msg[3])
|
|
67
|
+
self.hdf5_import_thread.terminate()
|
|
68
|
+
self.hdf5_import_thread = None
|
|
69
|
+
self.escape_time_thread.stop()
|
|
70
|
+
self.escape_time_thread = None
|
|
71
|
+
print("\n导入完毕, 共耗时 {:>.2f} 分钟".format(self.escape_time))
|
|
72
|
+
print('\n=========================================================')
|
|
73
|
+
print("导入详情:")
|
|
74
|
+
for info in self.details:
|
|
75
|
+
print(info)
|
|
76
|
+
print('=========================================================')
|
|
77
|
+
self.import_running = False
|
|
78
|
+
QCoreApplication.quit()
|
|
79
|
+
|
|
80
|
+
elif msg_task_name == 'IMPORT_KDATA':
|
|
81
|
+
ktype, progress = msg[2:4]
|
|
82
|
+
if ktype != 'FINISHED':
|
|
83
|
+
self.print_progress(ktype, progress)
|
|
84
|
+
else:
|
|
85
|
+
self.details.append('导入 {} {} 记录数:{}'.format(msg[3], msg[4], msg[5]))
|
|
86
|
+
|
|
87
|
+
elif msg_task_name == 'IMPORT_TRANS':
|
|
88
|
+
ktype, progress = msg[2:4]
|
|
89
|
+
if ktype != 'FINISHED':
|
|
90
|
+
self.print_progress('TRANS', progress)
|
|
91
|
+
else:
|
|
92
|
+
self.details.append('导入 {} 分笔记录数:{}'.format(msg[3], msg[5]))
|
|
93
|
+
|
|
94
|
+
elif msg_task_name == 'IMPORT_TIME':
|
|
95
|
+
ktype, progress = msg[2:4]
|
|
96
|
+
if ktype != 'FINISHED':
|
|
97
|
+
self.print_progress('TIME', progress)
|
|
98
|
+
else:
|
|
99
|
+
self.details.append('导入 {} 分时记录数:{}'.format(msg[3], msg[5]))
|
|
100
|
+
|
|
101
|
+
elif msg_task_name == 'IMPORT_WEIGHT':
|
|
102
|
+
if msg[2] == 'INFO':
|
|
103
|
+
pass
|
|
104
|
+
elif msg[2] == 'FINISHED':
|
|
105
|
+
print('导入权息数据完毕!')
|
|
106
|
+
elif msg[2] == '导入完成!':
|
|
107
|
+
self.details.append('导入权息记录数:{}'.format(msg[3]))
|
|
108
|
+
elif msg[2] == '权息数据无变化':
|
|
109
|
+
self.details.append(msg[3])
|
|
110
|
+
else:
|
|
111
|
+
print('权息{}'.format(msg[2]))
|
|
112
|
+
|
|
113
|
+
elif msg_task_name == 'IMPORT_FINANCE':
|
|
114
|
+
print("财务数据下载: {}%".format(msg[2]))
|
|
115
|
+
|
|
116
|
+
def start_import_data(self):
|
|
117
|
+
config = self.getCurrentConfig()
|
|
118
|
+
if config.getboolean('hdf5', 'enable'):
|
|
119
|
+
if not os.path.lexists(config['hdf5']['dir']):
|
|
120
|
+
os.makedirs(f"{config['hdf5']['dir']}/tmp")
|
|
121
|
+
elif not os.path.isdir(config['hdf5']['dir']):
|
|
122
|
+
print("错误", '指定的目标数据存放目录不存在!')
|
|
123
|
+
sys.exit(-1)
|
|
124
|
+
|
|
125
|
+
if config.getboolean('tdx', 'enable'):
|
|
126
|
+
if not os.path.lexists(config['tdx']['dir']):
|
|
127
|
+
os.makedirs(f"{config['tdx']['dir']}/tmp")
|
|
128
|
+
elif not os.path.isdir(config['tdx']['dir']):
|
|
129
|
+
print("错误", "请确认通达信安装目录是否正确!")
|
|
130
|
+
sys.exit(-1)
|
|
131
|
+
|
|
132
|
+
if config.getboolean('mysql', 'enable'):
|
|
133
|
+
if not os.path.lexists(config['mysql']['tmpdir']):
|
|
134
|
+
os.makedirs(config['mysql']['tmpdir'])
|
|
135
|
+
elif not os.path.isdir(config['mysql']['tmpdir']):
|
|
136
|
+
print("错误", "请确认临时目录是否正确!")
|
|
137
|
+
sys.exit(-1)
|
|
138
|
+
|
|
139
|
+
self.import_running = True
|
|
140
|
+
|
|
141
|
+
print("正在启动任务....")
|
|
142
|
+
QCoreApplication.processEvents()
|
|
143
|
+
|
|
144
|
+
if config.getboolean('tdx', 'enable'):
|
|
145
|
+
self.hdf5_import_thread = UseTdxImportToH5Thread(None, config)
|
|
146
|
+
else:
|
|
147
|
+
self.hdf5_import_thread = UsePytdxImportToH5Thread(None, config)
|
|
148
|
+
|
|
149
|
+
self.hdf5_import_thread.message.connect(self.on_message_from_thread)
|
|
150
|
+
self.hdf5_import_thread.start()
|
|
151
|
+
|
|
152
|
+
self.escape_time = 0.0
|
|
153
|
+
self.escape_time_thread = EscapetimeThread()
|
|
154
|
+
self.escape_time_thread.message.connect(self.on_message_from_thread)
|
|
155
|
+
self.escape_time_thread.start()
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
def main():
|
|
159
|
+
app = QCoreApplication(sys.argv)
|
|
160
|
+
x = HKUImportDataCMD()
|
|
161
|
+
x.start_import_data()
|
|
162
|
+
sys.exit(app.exec())
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
if __name__ == '__main__':
|
|
166
|
+
main()
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
# -*- coding: utf8 -*-
|
|
2
|
+
# cp936
|
|
3
|
+
#
|
|
4
|
+
# The MIT License (MIT)
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2020 hikyuu.org
|
|
7
|
+
#
|
|
8
|
+
# Create on: 2020-12-13
|
|
9
|
+
# Author: fasiondog
|
|
10
|
+
|
|
11
|
+
import os
|
|
12
|
+
import time
|
|
13
|
+
import flatbuffers
|
|
14
|
+
import pynng
|
|
15
|
+
import click
|
|
16
|
+
import threading
|
|
17
|
+
|
|
18
|
+
import hikyuu.flat as fb
|
|
19
|
+
|
|
20
|
+
from hikyuu.util import *
|
|
21
|
+
from hikyuu.fetcher.stock.zh_stock_a_sina_qq import get_spot as qq_get_spot
|
|
22
|
+
from hikyuu.fetcher.stock.zh_stock_a_qmt import get_spot as qmt_get_spot
|
|
23
|
+
from hikyuu import hikyuu_init, StockManager, constant, Datetime, TimeDelta
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def create_fb_spot_record(builder, record):
|
|
27
|
+
market = builder.CreateString(record['market'])
|
|
28
|
+
code = builder.CreateString(record['code'])
|
|
29
|
+
name = builder.CreateString(record['name'])
|
|
30
|
+
datetime = builder.CreateString(str(record['datetime']))
|
|
31
|
+
|
|
32
|
+
fb.SpotStart(builder)
|
|
33
|
+
fb.SpotAddMarket(builder, market)
|
|
34
|
+
fb.SpotAddCode(builder, code)
|
|
35
|
+
fb.SpotAddName(builder, name)
|
|
36
|
+
fb.SpotAddDatetime(builder, datetime)
|
|
37
|
+
fb.SpotAddYesterdayClose(builder, record['yesterday_close'])
|
|
38
|
+
fb.SpotAddOpen(builder, record['open'])
|
|
39
|
+
fb.SpotAddHigh(builder, record['high'])
|
|
40
|
+
fb.SpotAddLow(builder, record['low'])
|
|
41
|
+
fb.SpotAddClose(builder, record['close'])
|
|
42
|
+
fb.SpotAddAmount(builder, record['amount'])
|
|
43
|
+
fb.SpotAddVolume(builder, record['volume'])
|
|
44
|
+
fb.SpotAddBid1(builder, record['bid1'])
|
|
45
|
+
fb.SpotAddBid1Amount(builder, record['bid1_amount'])
|
|
46
|
+
fb.SpotAddBid2(builder, record['bid2'])
|
|
47
|
+
fb.SpotAddBid2Amount(builder, record['bid2_amount'])
|
|
48
|
+
fb.SpotAddBid3(builder, record['bid3'])
|
|
49
|
+
fb.SpotAddBid3Amount(builder, record['bid3_amount'])
|
|
50
|
+
fb.SpotAddBid4(builder, record['bid4'])
|
|
51
|
+
fb.SpotAddBid4Amount(builder, record['bid4_amount'])
|
|
52
|
+
fb.SpotAddBid5(builder, record['bid5'])
|
|
53
|
+
fb.SpotAddBid5Amount(builder, record['bid5_amount'])
|
|
54
|
+
fb.SpotAddAsk1(builder, record['ask1'])
|
|
55
|
+
fb.SpotAddAsk1Amount(builder, record['ask1_amount'])
|
|
56
|
+
fb.SpotAddAsk2(builder, record['ask2'])
|
|
57
|
+
fb.SpotAddAsk2Amount(builder, record['ask2_amount'])
|
|
58
|
+
fb.SpotAddAsk3(builder, record['ask3'])
|
|
59
|
+
fb.SpotAddAsk3Amount(builder, record['ask3_amount'])
|
|
60
|
+
fb.SpotAddAsk4(builder, record['ask4'])
|
|
61
|
+
fb.SpotAddAsk4Amount(builder, record['ask4_amount'])
|
|
62
|
+
fb.SpotAddAsk5(builder, record['ask5'])
|
|
63
|
+
fb.SpotAddAsk5Amount(builder, record['ask5_amount'])
|
|
64
|
+
return fb.SpotEnd(builder)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def create_fb_spot(records):
|
|
68
|
+
builder = flatbuffers.Builder(0)
|
|
69
|
+
end = None
|
|
70
|
+
spot_list = []
|
|
71
|
+
for record in records:
|
|
72
|
+
spot_list.append(create_fb_spot_record(builder, record))
|
|
73
|
+
total = len(spot_list)
|
|
74
|
+
fb.SpotListStartSpotVector(builder, total)
|
|
75
|
+
for spot in spot_list:
|
|
76
|
+
builder.PrependUOffsetTRelative(spot)
|
|
77
|
+
|
|
78
|
+
if flatbuffers.__version__ >= '2.0':
|
|
79
|
+
inv = builder.EndVector()
|
|
80
|
+
else:
|
|
81
|
+
inv = builder.EndVector(total)
|
|
82
|
+
|
|
83
|
+
fb.SpotListStart(builder)
|
|
84
|
+
fb.SpotListAddSpot(builder, inv)
|
|
85
|
+
end = fb.SpotListEnd(builder)
|
|
86
|
+
|
|
87
|
+
builder.Finish(end)
|
|
88
|
+
return builder.Output()
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def print_spot(spot):
|
|
92
|
+
print(spot.Market().decode())
|
|
93
|
+
print(spot.Code().decode())
|
|
94
|
+
print(spot.Name().decode())
|
|
95
|
+
print(spot.Datetime().decode())
|
|
96
|
+
print(spot.YesterdayClose())
|
|
97
|
+
print(spot.Open())
|
|
98
|
+
print(spot.High())
|
|
99
|
+
print(spot.Low())
|
|
100
|
+
print(spot.Close())
|
|
101
|
+
print(spot.Amount())
|
|
102
|
+
print(spot.volume())
|
|
103
|
+
print(spot.Bid1())
|
|
104
|
+
print(spot.Bid1Amount())
|
|
105
|
+
print(spot.Bid2())
|
|
106
|
+
print(spot.Bid2Amount())
|
|
107
|
+
print(spot.Bid3())
|
|
108
|
+
print(spot.Bid3Amount())
|
|
109
|
+
print(spot.Bid4())
|
|
110
|
+
print(spot.Bid4Amount())
|
|
111
|
+
print(spot.Bid5())
|
|
112
|
+
print(spot.Bid5Amount())
|
|
113
|
+
print(spot.Ask1())
|
|
114
|
+
print(spot.Ask1Amount())
|
|
115
|
+
print(spot.Ask2())
|
|
116
|
+
print(spot.Ask2Amount())
|
|
117
|
+
print(spot.Ask3())
|
|
118
|
+
print(spot.Ask3Amount())
|
|
119
|
+
print(spot.Ask4())
|
|
120
|
+
print(spot.Ask4Amount())
|
|
121
|
+
print(spot.Ask5())
|
|
122
|
+
print(spot.Ask5Amount())
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def print_spot_list(buf):
|
|
126
|
+
spot_list = fb.SpotList.GetRootAsSpotList(buf, 0)
|
|
127
|
+
print(spot_list.SpotLength())
|
|
128
|
+
for i in range(spot_list.SpotLength()):
|
|
129
|
+
print_spot(spot_list.Spot(i))
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
@hku_catch()
|
|
133
|
+
def parse_phase(phase):
|
|
134
|
+
return [TimeDelta(hours=int(a[0]), minutes=int(a[1])) for a in [x.split(':') for x in phase.split('-')]]
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def next_delta(start_time, interval, phase1_delta, phase2_delta, ignore_weekend):
|
|
138
|
+
interval_delta = TimeDelta(seconds=interval)
|
|
139
|
+
phase1_start_delta, phase1_end_delta = phase1_delta
|
|
140
|
+
phase2_start_delta, phase2_end_delta = phase2_delta
|
|
141
|
+
today = Datetime.today()
|
|
142
|
+
phase1_start, phase1_end = today + phase1_start_delta, today + phase1_end_delta
|
|
143
|
+
phase2_start, phase2_end = today + phase2_start_delta, today + phase2_end_delta
|
|
144
|
+
|
|
145
|
+
current_time = Datetime.now()
|
|
146
|
+
maybe_time = current_time + interval_delta
|
|
147
|
+
if phase1_start_delta == phase1_end_delta and phase2_start_delta == phase2_end_delta:
|
|
148
|
+
# 两个时间周期各自的起止时间相等,则认为未做限制
|
|
149
|
+
delta = interval_delta - (current_time - start_time)
|
|
150
|
+
elif maybe_time > phase2_end:
|
|
151
|
+
# 如果预计的下一次时间大于周期2的结束日期, 则取下一日的周期1起始时间计算
|
|
152
|
+
next_time = today + TimeDelta(1) + phase1_start_delta
|
|
153
|
+
if ignore_weekend and next_time.day_of_week() in (0, 6):
|
|
154
|
+
next_time = today.next_week() + phase1_start_delta
|
|
155
|
+
delta = next_time - start_time
|
|
156
|
+
elif maybe_time in (phase1_start, phase1_end, phase2_start, phase2_end):
|
|
157
|
+
# 如果下一次时间刚好等于时间周期的起止点,则直接返回预计的时间间隔
|
|
158
|
+
delta = interval_delta
|
|
159
|
+
elif start_time < phase1_start:
|
|
160
|
+
# 如果本次的时间小于周期1的起始时间,则取phase1起始时间计算
|
|
161
|
+
delta = phase1_start - start_time
|
|
162
|
+
elif phase1_end < maybe_time < phase2_start:
|
|
163
|
+
delta = phase2_start - start_time
|
|
164
|
+
else:
|
|
165
|
+
delta = interval_delta - (current_time - start_time)
|
|
166
|
+
return delta
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
# 多线程时锁住申请
|
|
170
|
+
g_nng_sender_lock = threading.Lock()
|
|
171
|
+
g_nng_ipc_sender = None
|
|
172
|
+
g_nng_tcp_sender = None
|
|
173
|
+
g_spot_topic = ':spot:'
|
|
174
|
+
g_ipc_addr = 'ipc:///tmp/hikyuu_real.ipc'
|
|
175
|
+
g_tcp_addr = 'tcp://*:9200'
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
@hku_catch(trace=True)
|
|
179
|
+
def get_nng_ipc_sender():
|
|
180
|
+
global g_nng_ipc_sender
|
|
181
|
+
if g_nng_ipc_sender is None:
|
|
182
|
+
g_nng_ipc_sender = pynng.Pub0()
|
|
183
|
+
g_nng_ipc_sender.listen(g_ipc_addr)
|
|
184
|
+
return g_nng_ipc_sender
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
@hku_catch(trace=True)
|
|
188
|
+
def get_nng_tcp_sender():
|
|
189
|
+
global g_nng_tcp_sender
|
|
190
|
+
if g_nng_tcp_sender is None:
|
|
191
|
+
g_nng_tcp_sender = pynng.Pub0()
|
|
192
|
+
g_nng_tcp_sender.listen(g_tcp_addr)
|
|
193
|
+
return g_nng_tcp_sender
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
def get_nng_senders():
|
|
197
|
+
g_nng_sender_lock.acquire()
|
|
198
|
+
ipc_sender = get_nng_ipc_sender()
|
|
199
|
+
tcp_sender = get_nng_tcp_sender()
|
|
200
|
+
g_nng_sender_lock.release()
|
|
201
|
+
return ipc_sender, tcp_sender
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def release_nng_senders():
|
|
205
|
+
global g_nng_ipc_sender, g_nng_tcp_sender
|
|
206
|
+
g_nng_sender_lock.acquire()
|
|
207
|
+
if g_nng_ipc_sender is not None:
|
|
208
|
+
g_nng_ipc_sender.close()
|
|
209
|
+
g_nng_ipc_sender = None
|
|
210
|
+
if g_nng_tcp_sender is not None:
|
|
211
|
+
g_nng_tcp_sender.close()
|
|
212
|
+
g_nng_tcp_sender = None
|
|
213
|
+
g_nng_sender_lock.release()
|
|
214
|
+
hku_info("release pynng socket")
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
def start_send_spot():
|
|
218
|
+
senders = get_nng_senders()
|
|
219
|
+
for sender in senders:
|
|
220
|
+
sender.send("{}{}".format(g_spot_topic, '[start spot]').encode('utf-8'))
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def end_send_spot():
|
|
224
|
+
senders = get_nng_senders()
|
|
225
|
+
for sender in senders:
|
|
226
|
+
sender.send('{}{}'.format(g_spot_topic, '[end spot]').encode('utf-8'))
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
def send_spot(records):
|
|
230
|
+
spot = bytearray(g_spot_topic.encode('utf-8'))
|
|
231
|
+
buf = create_fb_spot(records)
|
|
232
|
+
spot.extend(buf)
|
|
233
|
+
senders = get_nng_senders()
|
|
234
|
+
for sender in senders:
|
|
235
|
+
sender.send(bytes(spot))
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
def collect(server, use_proxy, source, seconds, phase1, phase2, ignore_weekend):
|
|
239
|
+
global g_tcp_addr
|
|
240
|
+
if len(server) >= 3 and server[:3] == 'tcp':
|
|
241
|
+
g_tcp_addr = server
|
|
242
|
+
|
|
243
|
+
phase1_delta = parse_phase(phase1)
|
|
244
|
+
if phase1_delta is None or len(phase1_delta) != 2:
|
|
245
|
+
hku_error("无效参数 phase1: {}".format(phase1))
|
|
246
|
+
exit(1)
|
|
247
|
+
if phase1_delta[0] > phase1_delta[1]:
|
|
248
|
+
hku_error("无效参数 phase1: {}, 结束时间应大于等于起始时间".format(phase1))
|
|
249
|
+
exit(1)
|
|
250
|
+
|
|
251
|
+
phase2_delta = parse_phase(phase2)
|
|
252
|
+
if phase2_delta is None or len(phase2_delta) != 2:
|
|
253
|
+
hku_error("无效参数 phase2: {}".format(phase2))
|
|
254
|
+
exit(1)
|
|
255
|
+
if phase2_delta[0] > phase2_delta[1]:
|
|
256
|
+
hku_error("无效参数 phase2: {}, 结束时间应大于等于起始时间".format(phase2))
|
|
257
|
+
exit(1)
|
|
258
|
+
if phase1_delta[1] > phase2_delta[0]:
|
|
259
|
+
hku_error("无效参数 phase1: {}, phase2: {}, phase2 起始时间应大于等于 phase1 结束时间".format(phase1, phase2))
|
|
260
|
+
exit(1)
|
|
261
|
+
|
|
262
|
+
hku_logger.info("采集时间段1:{}".format(phase1))
|
|
263
|
+
hku_logger.info("采集时间段2:{}".format(phase2))
|
|
264
|
+
|
|
265
|
+
config_file = os.path.expanduser('~') + '/.hikyuu/hikyuu.ini'
|
|
266
|
+
if not os.path.exists(config_file):
|
|
267
|
+
print("未找到配置文件,请先运行 HikyuuTDX 进行配置与数据导入")
|
|
268
|
+
exit(1)
|
|
269
|
+
|
|
270
|
+
hikyuu_init(config_file, ignore_preload=True)
|
|
271
|
+
|
|
272
|
+
sm = StockManager.instance()
|
|
273
|
+
if source == 'qmt':
|
|
274
|
+
stk_list = [s for s in sm if s.valid and s.type in (
|
|
275
|
+
constant.STOCKTYPE_A, constant.STOCKTYPE_INDEX, constant.STOCKTYPE_ETF,
|
|
276
|
+
constant.STOCKTYPE_GEM, constant.STOCKTYPE_START, constant.STOCKTYPE_A_BJ)]
|
|
277
|
+
else:
|
|
278
|
+
stk_list = [
|
|
279
|
+
stk.market_code.lower() for stk in sm if stk.valid and stk.type in
|
|
280
|
+
(constant.STOCKTYPE_A, constant.STOCKTYPE_INDEX, constant.STOCKTYPE_GEM,
|
|
281
|
+
constant.STOCKTYPE_START, constant.STOCKTYPE_A_BJ)
|
|
282
|
+
]
|
|
283
|
+
|
|
284
|
+
_ = get_nng_senders()
|
|
285
|
+
|
|
286
|
+
if source == 'qmt':
|
|
287
|
+
get_spot = qmt_get_spot
|
|
288
|
+
elif source == 'qq':
|
|
289
|
+
get_spot = qq_get_spot
|
|
290
|
+
|
|
291
|
+
start_time = Datetime.now()
|
|
292
|
+
delta = next_delta(start_time, seconds, phase1_delta, phase2_delta, ignore_weekend)
|
|
293
|
+
next_time = start_time + delta
|
|
294
|
+
hku_info("启动采集时间:{}".format(next_time))
|
|
295
|
+
time.sleep(delta.total_seconds())
|
|
296
|
+
while True:
|
|
297
|
+
try:
|
|
298
|
+
start_time = Datetime.now()
|
|
299
|
+
start_send_spot()
|
|
300
|
+
records = get_spot(stk_list, source, use_proxy, send_spot)
|
|
301
|
+
hku_info("{}:{}:{} 采集数量: {}".format(start_time.hour, start_time.minute, start_time.second, len(records)))
|
|
302
|
+
# pub_sock.send('{}{}'.format(spot_topic, '[end spot]').encode('utf-8'))
|
|
303
|
+
end_send_spot()
|
|
304
|
+
delta = next_delta(start_time, seconds, phase1_delta, phase2_delta, ignore_weekend)
|
|
305
|
+
hku_info("sleep {}'s".format(delta.total_seconds()))
|
|
306
|
+
if delta.total_seconds() > 0:
|
|
307
|
+
time.sleep(delta.total_seconds())
|
|
308
|
+
else:
|
|
309
|
+
pass
|
|
310
|
+
except KeyboardInterrupt:
|
|
311
|
+
print("Ctrl-C 终止")
|
|
312
|
+
break
|
|
313
|
+
except Exception as e:
|
|
314
|
+
hku_error(str(e))
|
|
315
|
+
time.sleep(10)
|
|
316
|
+
release_nng_senders()
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
@click.command()
|
|
320
|
+
@click.option('-server', '--server', default='tcp://*:9200')
|
|
321
|
+
@click.option('-use_proxy', '--use_proxy', is_flag=True, help='是否使用代理,须自行申请芝麻http代理并加入ip白名单')
|
|
322
|
+
@click.option('-source', '--source', default='qq', type=click.Choice(['qmt', 'qq']), help='数据来源')
|
|
323
|
+
@click.option('-seconds', '--seconds', default=10)
|
|
324
|
+
@click.option('-phase1', '--phase1', default='9:00-12:00')
|
|
325
|
+
@click.option('-phase2', '--phase2', default='13:00-15:00')
|
|
326
|
+
@click.option('-ignore_weekend', '--ignore_weekend', is_flag=True)
|
|
327
|
+
def run(server, use_proxy, source, seconds, phase1, phase2, ignore_weekend):
|
|
328
|
+
collect(server, use_proxy, source, seconds, phase1, phase2, ignore_weekend)
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
if __name__ == '__main__':
|
|
332
|
+
try:
|
|
333
|
+
print("采集程序运行中,可使用 Ctrl-C 终止!")
|
|
334
|
+
run()
|
|
335
|
+
except KeyboardInterrupt:
|
|
336
|
+
exit(1)
|