hikyuu 2.6.8.3__py3-none-manylinux2014_aarch64.whl → 2.7.3__py3-none-manylinux2014_aarch64.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.
Files changed (280) hide show
  1. hikyuu/__init__.py +55 -23
  2. hikyuu/__init__.pyi +626 -595
  3. hikyuu/analysis/__init__.pyi +589 -563
  4. hikyuu/analysis/analysis.pyi +590 -564
  5. hikyuu/core.py +2 -0
  6. hikyuu/core.pyi +591 -565
  7. hikyuu/cpp/__init__.pyi +2 -2
  8. hikyuu/cpp/core310.pyi +587 -130
  9. hikyuu/cpp/core310.so +0 -0
  10. hikyuu/cpp/core311.pyi +587 -130
  11. hikyuu/cpp/core311.so +0 -0
  12. hikyuu/cpp/core312.pyi +587 -130
  13. hikyuu/cpp/core312.so +0 -0
  14. hikyuu/cpp/core313.pyi +587 -130
  15. hikyuu/cpp/core313.so +0 -0
  16. hikyuu/cpp/i18n/zh_CN/hikyuu.mo +0 -0
  17. hikyuu/cpp/i18n/zh_CN/hikyuu_plugin.mo +0 -0
  18. hikyuu/cpp/libboost_atomic.so +0 -0
  19. hikyuu/cpp/libboost_atomic.so.1.90.0 +0 -0
  20. hikyuu/cpp/libboost_charconv.so +0 -0
  21. hikyuu/cpp/libboost_charconv.so.1.90.0 +0 -0
  22. hikyuu/cpp/libboost_chrono.so +0 -0
  23. hikyuu/cpp/libboost_chrono.so.1.90.0 +0 -0
  24. hikyuu/cpp/libboost_container.so +0 -0
  25. hikyuu/cpp/libboost_container.so.1.90.0 +0 -0
  26. hikyuu/cpp/libboost_date_time.so +0 -0
  27. hikyuu/cpp/libboost_date_time.so.1.90.0 +0 -0
  28. hikyuu/cpp/libboost_locale.so +0 -0
  29. hikyuu/cpp/libboost_locale.so.1.90.0 +0 -0
  30. hikyuu/cpp/libboost_random.so +0 -0
  31. hikyuu/cpp/libboost_random.so.1.90.0 +0 -0
  32. hikyuu/cpp/libboost_serialization.so +0 -0
  33. hikyuu/cpp/libboost_serialization.so.1.90.0 +0 -0
  34. hikyuu/cpp/libboost_thread.so +0 -0
  35. hikyuu/cpp/libboost_thread.so.1.90.0 +0 -0
  36. hikyuu/cpp/libboost_wserialization.so +0 -0
  37. hikyuu/cpp/libboost_wserialization.so.1.90.0 +0 -0
  38. hikyuu/cpp/libhikyuu.so +0 -0
  39. hikyuu/cpp/libhku_hdf5.so +0 -0
  40. hikyuu/cpp/libhku_hdf5.so.200 +0 -0
  41. hikyuu/cpp/libhku_hdf5.so.200.2.0 +0 -0
  42. hikyuu/cpp/libhku_hdf5_cpp.so +0 -0
  43. hikyuu/cpp/libhku_hdf5_cpp.so.200 +0 -0
  44. hikyuu/cpp/libhku_hdf5_cpp.so.200.2.0 +0 -0
  45. hikyuu/cpp/libhku_hdf5_hl.so +0 -0
  46. hikyuu/cpp/libhku_hdf5_hl.so.200 +0 -0
  47. hikyuu/cpp/libhku_hdf5_hl.so.200.1.0 +0 -0
  48. hikyuu/cpp/libhku_hdf5_hl_cpp.so +0 -0
  49. hikyuu/cpp/libhku_hdf5_hl_cpp.so.200 +0 -0
  50. hikyuu/cpp/libhku_hdf5_hl_cpp.so.200.1.0 +0 -0
  51. hikyuu/cpp/libhku_hdf5_tools.so +0 -0
  52. hikyuu/cpp/libhku_hdf5_tools.so.200 +0 -0
  53. hikyuu/cpp/libhku_hdf5_tools.so.200.1.1 +0 -0
  54. hikyuu/cpp/libsqlite3.so +0 -0
  55. hikyuu/data/clickhouse_upgrade/0001.sql +2 -0
  56. hikyuu/data/clickhouse_upgrade/createdb.sql +105 -105
  57. hikyuu/data/common.py +3 -3
  58. hikyuu/data/common_clickhouse.py +1 -3
  59. hikyuu/data/download_block.py +351 -0
  60. hikyuu/data/em_block_to_clickhouse.py +26 -74
  61. hikyuu/data/em_block_to_mysql.py +25 -75
  62. hikyuu/data/em_block_to_sqlite.py +26 -78
  63. hikyuu/data/hku_config_template.py +33 -6
  64. hikyuu/data/mysql_upgrade/0029.sql +2 -0
  65. hikyuu/data/pytdx_to_clickhouse.py +96 -38
  66. hikyuu/data/pytdx_to_h5.py +78 -29
  67. hikyuu/data/pytdx_to_mysql.py +69 -21
  68. hikyuu/data/pytdx_weight_to_clickhouse.py +3 -1
  69. hikyuu/data/pytdx_weight_to_mysql.py +3 -1
  70. hikyuu/data/pytdx_weight_to_sqlite.py +3 -1
  71. hikyuu/data/sqlite_upgrade/0029.sql +4 -0
  72. hikyuu/data/tdx_to_clickhouse.py +2 -2
  73. hikyuu/data/tdx_to_h5.py +11 -11
  74. hikyuu/data/tdx_to_mysql.py +2 -2
  75. hikyuu/data/zh_bond10_to_clickhouse.py +1 -1
  76. hikyuu/draw/__init__.pyi +1 -1
  77. hikyuu/draw/drawplot/__init__.pyi +8 -8
  78. hikyuu/draw/drawplot/bokeh_draw.pyi +610 -583
  79. hikyuu/draw/drawplot/common.pyi +1 -1
  80. hikyuu/draw/drawplot/echarts_draw.pyi +612 -585
  81. hikyuu/draw/drawplot/matplotlib_draw.py +12 -76
  82. hikyuu/draw/drawplot/matplotlib_draw.pyi +623 -596
  83. hikyuu/draw/elder.pyi +11 -11
  84. hikyuu/draw/kaufman.pyi +18 -18
  85. hikyuu/draw/volume.pyi +10 -10
  86. hikyuu/examples/notebook/Demo/Demo1.ipynb +48 -33
  87. hikyuu/extend.py +0 -7
  88. hikyuu/extend.pyi +599 -573
  89. hikyuu/fetcher/stock/zh_block_em.py +12 -40
  90. hikyuu/gui/HikyuuTDX.py +140 -33
  91. hikyuu/gui/data/CollectSpotThread.py +1 -1
  92. hikyuu/gui/data/EscapetimeThread.py +8 -14
  93. hikyuu/gui/data/ImportBlockInfoTask.py +3 -10
  94. hikyuu/gui/data/MainWindow.py +1300 -761
  95. hikyuu/gui/data/SchedImportThread.py +2 -2
  96. hikyuu/gui/data/UsePytdxImportToH5Thread.py +3 -3
  97. hikyuu/gui/data/UseQmtImportToH5Thread.py +2 -2
  98. hikyuu/gui/data/UseTdxImportToH5Thread.py +3 -3
  99. hikyuu/gui/data/tool.py +32 -25
  100. hikyuu/gui/dataserver.py +5 -3
  101. hikyuu/gui/images/liandongxiaopu.png +0 -0
  102. hikyuu/gui/importdata.py +4 -0
  103. hikyuu/hub.pyi +6 -6
  104. hikyuu/include/hikyuu/DataType.h +4 -16
  105. hikyuu/include/hikyuu/KData.h +6 -3
  106. hikyuu/include/hikyuu/KDataPrivatedBufferImp.h +1 -1
  107. hikyuu/include/hikyuu/KDataSharedBufferImp.h +1 -1
  108. hikyuu/include/hikyuu/KQuery.h +2 -2
  109. hikyuu/include/hikyuu/Stock.h +4 -1
  110. hikyuu/include/hikyuu/StockManager.h +29 -4
  111. hikyuu/include/hikyuu/StrategyContext.h +4 -4
  112. hikyuu/include/hikyuu/data_driver/BaseInfoDriver.h +9 -0
  113. hikyuu/include/hikyuu/data_driver/BlockInfoDriver.h +6 -0
  114. hikyuu/include/hikyuu/data_driver/KDataDriver.h +24 -1
  115. hikyuu/include/hikyuu/data_driver/base_info/mysql/MySQLBaseInfoDriver.h +1 -1
  116. hikyuu/include/hikyuu/data_driver/base_info/sqlite/SQLiteBaseInfoDriver.h +1 -1
  117. hikyuu/include/hikyuu/data_driver/block_info/mysql/MySQLBlockInfoDriver.h +2 -1
  118. hikyuu/include/hikyuu/data_driver/block_info/qianlong/QLBlockInfoDriver.h +2 -1
  119. hikyuu/include/hikyuu/data_driver/block_info/sqlite/SQLiteBlockInfoDriver.h +2 -1
  120. hikyuu/include/hikyuu/data_driver/kdata/DoNothingKDataDriver.h +1 -1
  121. hikyuu/include/hikyuu/data_driver/kdata/cvs/KDataTempCsvDriver.h +1 -1
  122. hikyuu/include/hikyuu/data_driver/kdata/hdf5/H5KDataDriver.h +1 -1
  123. hikyuu/include/hikyuu/data_driver/kdata/mysql/MySQLKDataDriver.h +6 -2
  124. hikyuu/include/hikyuu/data_driver/kdata/sqlite/SQLiteKDataDriver.h +2 -2
  125. hikyuu/include/hikyuu/data_driver/kdata/tdx/TdxKDataDriver.h +1 -1
  126. hikyuu/include/hikyuu/global/sysinfo.h +24 -5
  127. hikyuu/include/hikyuu/hikyuu.h +1 -1
  128. hikyuu/include/hikyuu/indicator/IndicatorImp.h +1 -1
  129. hikyuu/include/hikyuu/indicator/build_in.h +1 -0
  130. hikyuu/include/hikyuu/indicator/crt/CYCLE.h +4 -4
  131. hikyuu/include/hikyuu/indicator/crt/HSL.h +2 -2
  132. hikyuu/include/hikyuu/indicator/crt/QUANTILE_TRUNC.h +30 -0
  133. hikyuu/include/hikyuu/indicator/crt/TURNOVER.h +1 -0
  134. hikyuu/include/hikyuu/indicator/crt/ZSCORE.h +2 -2
  135. hikyuu/include/hikyuu/indicator/imp/IQuantileTrunc.h +25 -0
  136. hikyuu/include/hikyuu/lang.h +15 -2
  137. hikyuu/include/hikyuu/misc.h +38 -0
  138. hikyuu/include/hikyuu/plugin/KDataToClickHouseImporter.h +40 -0
  139. hikyuu/include/hikyuu/plugin/KDataToMySQLImporter.h +40 -0
  140. hikyuu/include/hikyuu/plugin/checkdata.h +20 -0
  141. hikyuu/include/hikyuu/plugin/dataserver.h +2 -1
  142. hikyuu/include/hikyuu/plugin/device.h +10 -0
  143. hikyuu/include/hikyuu/plugin/extind.h +40 -0
  144. hikyuu/include/hikyuu/plugin/hkuextra.h +1 -17
  145. hikyuu/include/hikyuu/plugin/interface/CheckDataPluginInterface.h +25 -0
  146. hikyuu/include/hikyuu/plugin/interface/DataServerPluginInterface.h +2 -2
  147. hikyuu/include/hikyuu/plugin/interface/DevicePluginInterface.h +2 -0
  148. hikyuu/include/hikyuu/plugin/interface/ExtendIndicatorsPluginInterface.h +12 -0
  149. hikyuu/include/hikyuu/plugin/interface/HkuExtraPluginInterface.h +1 -13
  150. hikyuu/include/hikyuu/plugin/interface/ImportKDataToClickHousePluginInterface.h +44 -0
  151. hikyuu/include/hikyuu/plugin/interface/ImportKDataToMySQLPluginInterface.h +42 -0
  152. hikyuu/include/hikyuu/plugin/interface/plugins.h +9 -1
  153. hikyuu/include/hikyuu/python/convert_any.h +9 -6
  154. hikyuu/include/hikyuu/python/pybind_utils.h +4 -11
  155. hikyuu/include/hikyuu/strategy/RunSystemInStrategy.h +3 -0
  156. hikyuu/include/hikyuu/strategy/Strategy.h +1 -1
  157. hikyuu/include/hikyuu/trade_manage/Performance.h +4 -4
  158. hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +10 -2
  159. hikyuu/include/hikyuu/trade_manage/TradeRecord.h +2 -1
  160. hikyuu/include/hikyuu/trade_sys/allocatefunds/AllocateFundsBase.h +0 -1
  161. hikyuu/include/hikyuu/trade_sys/allocatefunds/build_in.h +1 -0
  162. hikyuu/include/hikyuu/trade_sys/allocatefunds/crt/AF_FixedAmount.h +26 -0
  163. hikyuu/include/hikyuu/trade_sys/allocatefunds/imp/FixAmountFunds.h +18 -0
  164. hikyuu/include/hikyuu/trade_sys/condition/ConditionBase.h +0 -1
  165. hikyuu/include/hikyuu/trade_sys/environment/EnvironmentBase.h +0 -1
  166. hikyuu/include/hikyuu/trade_sys/moneymanager/MoneyManagerBase.h +0 -1
  167. hikyuu/include/hikyuu/trade_sys/moneymanager/imp/FixedCapitalFundsMM.h +0 -4
  168. hikyuu/include/hikyuu/trade_sys/multifactor/MultiFactorBase.h +36 -4
  169. hikyuu/include/hikyuu/trade_sys/multifactor/NormalizeBase.h +124 -0
  170. hikyuu/include/hikyuu/trade_sys/multifactor/ScoresFilterBase.h +124 -0
  171. hikyuu/include/hikyuu/trade_sys/multifactor/build_in.h +3 -0
  172. hikyuu/include/hikyuu/trade_sys/multifactor/buildin_norm.h +36 -0
  173. hikyuu/include/hikyuu/trade_sys/multifactor/buildin_scfilter.h +51 -0
  174. hikyuu/include/hikyuu/trade_sys/multifactor/filter/GroupSCFilter.h +24 -0
  175. hikyuu/include/hikyuu/trade_sys/multifactor/filter/IgnoreLessOrEqualValueSCFilter.h +24 -0
  176. hikyuu/include/hikyuu/trade_sys/multifactor/filter/IgnoreNanSCFilter.h +24 -0
  177. hikyuu/include/hikyuu/trade_sys/multifactor/filter/MinAmountPercentSCFilter.h +25 -0
  178. hikyuu/include/hikyuu/trade_sys/multifactor/filter/PriceSCFilter.h +24 -0
  179. hikyuu/include/hikyuu/trade_sys/multifactor/filter/TopNSCFilter.h +24 -0
  180. hikyuu/include/hikyuu/trade_sys/multifactor/imp/EqualWeightMultiFactor.h +1 -1
  181. hikyuu/include/hikyuu/trade_sys/multifactor/imp/ICIRMultiFactor.h +1 -1
  182. hikyuu/include/hikyuu/trade_sys/multifactor/imp/ICMultiFactor.h +1 -1
  183. hikyuu/include/hikyuu/trade_sys/multifactor/imp/WeightMultiFactor.h +1 -1
  184. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormMinMax.h +23 -0
  185. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormQuantile.h +28 -0
  186. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormQuantileUniform.h +28 -0
  187. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormZScore.h +25 -0
  188. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/__init__.py +1 -0
  189. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/quantile_trunc.h +16 -0
  190. hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +20 -13
  191. hikyuu/include/hikyuu/trade_sys/portfolio/imp/SimplePortfolio.h +7 -0
  192. hikyuu/include/hikyuu/trade_sys/portfolio/imp/WithoutAFPortfolio.h +7 -0
  193. hikyuu/include/hikyuu/trade_sys/profitgoal/ProfitGoalBase.h +9 -11
  194. hikyuu/include/hikyuu/trade_sys/selector/SelectorBase.h +49 -1
  195. hikyuu/include/hikyuu/trade_sys/selector/build_in.h +1 -0
  196. hikyuu/include/hikyuu/trade_sys/selector/crt/SE_MultiFactor2.h +40 -0
  197. hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector.h +0 -3
  198. hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector2.h +49 -0
  199. hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorSelector.h +1 -1
  200. hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorValueSelector.h +1 -1
  201. hikyuu/include/hikyuu/trade_sys/signal/SignalBase.h +0 -1
  202. hikyuu/include/hikyuu/trade_sys/signal/imp/BandSignal2.h +0 -4
  203. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/AddValueSignal.h +2 -2
  204. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/DivValueSignal.h +2 -2
  205. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/MulValueSignal.h +2 -2
  206. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorSignal.h +1 -1
  207. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorValueSignal.h +4 -4
  208. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/SubValueSignal.h +2 -2
  209. hikyuu/include/hikyuu/trade_sys/slippage/SlippageBase.h +0 -1
  210. hikyuu/include/hikyuu/trade_sys/slippage/build_in.h +5 -1
  211. hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_LogNormal.h +22 -0
  212. hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_Normal.h +22 -0
  213. hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_TruncNormal.h +25 -0
  214. hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_Uniform.h +23 -0
  215. hikyuu/include/hikyuu/trade_sys/slippage/imp/LogNormalSlippage.h +28 -0
  216. hikyuu/include/hikyuu/trade_sys/slippage/imp/NormalSlippage.h +28 -0
  217. hikyuu/include/hikyuu/trade_sys/slippage/imp/TruncNormalSlippage.h +28 -0
  218. hikyuu/include/hikyuu/trade_sys/slippage/imp/UniformSlippage.h +24 -0
  219. hikyuu/include/hikyuu/trade_sys/stoploss/StoplossBase.h +0 -1
  220. hikyuu/include/hikyuu/trade_sys/system/System.h +15 -3
  221. hikyuu/include/hikyuu/utilities/Log.h +6 -7
  222. hikyuu/include/hikyuu/utilities/Parameter.h +17 -0
  223. hikyuu/include/hikyuu/utilities/SpendTimer.h +17 -7
  224. hikyuu/include/hikyuu/utilities/arithmetic.h +55 -0
  225. hikyuu/include/hikyuu/utilities/config.h +28 -0
  226. hikyuu/include/hikyuu/utilities/db_connect/mysql/MySQLConnect.h +1 -1
  227. hikyuu/include/hikyuu/utilities/db_connect/mysql/MySQLStatement.h +1 -1
  228. hikyuu/include/hikyuu/utilities/db_connect/sqlite/SQLiteConnect.h +1 -1
  229. hikyuu/include/hikyuu/utilities/db_connect/sqlite/SQLiteStatement.h +1 -1
  230. hikyuu/include/hikyuu/utilities/plugin/PluginBase.h +17 -2
  231. hikyuu/include/hikyuu/utilities/plugin/PluginLoader.h +4 -1
  232. hikyuu/include/hikyuu/utilities/plugin/PluginManager.h +41 -22
  233. hikyuu/include/hikyuu/utilities/thread/GlobalStealThreadPool.h +1 -2
  234. hikyuu/include/hikyuu/utilities/thread/GlobalThreadPool.h +1 -1
  235. hikyuu/include/hikyuu/utilities/thread/MQStealThreadPool.h +286 -0
  236. hikyuu/include/hikyuu/utilities/thread/MQThreadPool.h +1 -0
  237. hikyuu/include/hikyuu/utilities/thread/StealThreadPool.h +297 -0
  238. hikyuu/include/hikyuu/utilities/thread/ThreadPool.h +1 -0
  239. hikyuu/include/hikyuu/utilities/thread/WorkStealQueue.h +9 -8
  240. hikyuu/include/hikyuu/utilities/thread/algorithm.h +64 -14
  241. hikyuu/include/hikyuu/version.h +5 -5
  242. hikyuu/plugin/libbacktest.so +0 -0
  243. hikyuu/plugin/libcheckdata.so +0 -0
  244. hikyuu/plugin/libclickhousedriver.so +0 -0
  245. hikyuu/plugin/libdataserver.so +0 -0
  246. hikyuu/{cpp/core39.so → plugin/libdataserver_parquet.so} +0 -0
  247. hikyuu/plugin/libdevice.so +0 -0
  248. hikyuu/plugin/libextind.so +0 -0
  249. hikyuu/plugin/libhkuextra.so +0 -0
  250. hikyuu/plugin/libimport2ch.so +0 -0
  251. hikyuu/plugin/libimport2hdf5.so +0 -0
  252. hikyuu/plugin/libimport2mysql.so +0 -0
  253. hikyuu/plugin/libtmreport.so +0 -0
  254. hikyuu/trade_manage/__init__.pyi +607 -582
  255. hikyuu/trade_manage/broker.pyi +3 -3
  256. hikyuu/trade_manage/broker_easytrader.pyi +1 -1
  257. hikyuu/trade_manage/trade.py +0 -2
  258. hikyuu/trade_manage/trade.pyi +607 -582
  259. hikyuu/trade_sys/trade_sys.py +54 -5
  260. hikyuu/util/__init__.pyi +2 -2
  261. hikyuu/util/singleton.pyi +1 -1
  262. {hikyuu-2.6.8.3.dist-info → hikyuu-2.7.3.dist-info}/METADATA +42 -32
  263. {hikyuu-2.6.8.3.dist-info → hikyuu-2.7.3.dist-info}/RECORD +267 -212
  264. {hikyuu-2.6.8.3.dist-info → hikyuu-2.7.3.dist-info}/top_level.txt +2 -2
  265. hikyuu/cpp/core39.pyi +0 -14190
  266. hikyuu/data/pytdx_to_taos.py +0 -736
  267. hikyuu/data_driver/__init__.py +0 -49
  268. hikyuu/data_driver/jqdata_data_driver.py +0 -277
  269. hikyuu/data_driver/pytdx_data_driver.py +0 -292
  270. hikyuu/fetcher/stock/zh_stock_a_huatai.py +0 -51
  271. hikyuu/fetcher/stock/zh_stock_a_pytdx.py +0 -129
  272. hikyuu/gui/data/CollectToMemThread.py +0 -123
  273. hikyuu/gui/data/CollectToMySQLThread.py +0 -178
  274. hikyuu/gui/start_huatai_insight.py +0 -510
  275. hikyuu/include/hikyuu/views/arrow_common.h +0 -38
  276. hikyuu/include/hikyuu/views/arrow_views.h +0 -117
  277. hikyuu/tools/update_block_info.py +0 -168
  278. /hikyuu/include/hikyuu/{views → trade_sys/multifactor/filter}/__init__.py +0 -0
  279. {hikyuu-2.6.8.3.dist-info → hikyuu-2.7.3.dist-info}/WHEEL +0 -0
  280. {hikyuu-2.6.8.3.dist-info → hikyuu-2.7.3.dist-info}/entry_points.txt +0 -0
@@ -1,168 +0,0 @@
1
- #!/usr/bin/python
2
- # -*- coding: utf8 -*-
3
- #
4
- # Create on: 2023-12-18
5
- # Author: fasiondog
6
-
7
- import requests
8
- import akshare as ak
9
- from hikyuu.interactive import *
10
-
11
-
12
- def get_code_market_dict():
13
- ret = {}
14
- for s in sm:
15
- if s.type in (constant.STOCKTYPE_A, constant.STOCKTYPE_A_BJ, constant.STOCKTYPE_B, constant.STOCKTYPE_GEM, constant.STOCKTYPE_START):
16
- ret[s.code] = "0" if s.market == 'SH' else "1"
17
- return ret
18
-
19
-
20
- def get_all_hybk_info():
21
- code_market = get_code_market_dict()
22
- blk_names = ak.stock_board_industry_name_em()['板块名称']
23
- ret = {}
24
- for blk_name in blk_names:
25
- print(blk_name)
26
- ret[blk_name] = []
27
- stk_codes = ak.stock_board_industry_cons_em(blk_name)
28
- stk_codes = stk_codes['代码'].to_list()
29
- for stk_code in stk_codes:
30
- try:
31
- ret[blk_name].append(f"{code_market[stk_code]},{stk_code}")
32
- except:
33
- print(stk_code)
34
- return ret
35
-
36
-
37
- def get_all_gnbk_info():
38
- code_market = get_code_market_dict()
39
- blk_names = ak.stock_board_concept_name_em()['板块名称']
40
- ret = {}
41
- for blk_name in blk_names:
42
- print(blk_name)
43
- ret[blk_name] = []
44
- stk_codes = ak.stock_board_concept_cons_em(blk_name)
45
- stk_codes = stk_codes['代码'].to_list()
46
- for stk_code in stk_codes:
47
- try:
48
- ret[blk_name].append(f"{code_market[stk_code]},{stk_code}")
49
- except:
50
- print(stk_code)
51
- return ret
52
-
53
-
54
- def get_all_dybk_info():
55
- url = "http://13.push2.eastmoney.com/api/qt/clist/get"
56
- params = {
57
- "pn": "1",
58
- "pz": "50000",
59
- "po": "1",
60
- "np": "1",
61
- "ut": "bd1d9ddb04089700cf9c27f6f7426281",
62
- "fltt": "2",
63
- "invt": "2",
64
- "fid": "f3",
65
- "fs": "m:90+t:1+f:!50",
66
- "fields": "f12,f14",
67
- # "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,f22,f11,f62,f128,"
68
- # "f136,f115,f152",
69
- "_": "1623833739532",
70
- }
71
- r = requests.get(url, params=params)
72
- data_json = r.json()
73
- data_json = data_json["data"]["diff"]
74
-
75
- params = {
76
- "pn": "1",
77
- "pz": "2000",
78
- "po": "1",
79
- "np": "1",
80
- "ut": "bd1d9ddb04089700cf9c27f6f7426281",
81
- "fltt": "2",
82
- "invt": "2",
83
- "fid": "f3",
84
- # "fs": f"b:{stock_board_code} f:!50",
85
- "fields": "f12",
86
- "_": "1626081702127",
87
- }
88
-
89
- ret = {}
90
- code_market = get_code_market_dict()
91
- for v in data_json:
92
- # print(v)
93
- blk_code = v["f12"]
94
- blk_name = v["f14"]
95
- print(blk_name)
96
- ret[blk_name] = []
97
- params["fs"] = f"b:{blk_code} f:!50"
98
- r = requests.get(url, params=params)
99
- stk_json = r.json()
100
- stk_json = stk_json["data"]["diff"]
101
-
102
- for item in stk_json:
103
- stk_code = item["f12"]
104
- try:
105
- ret[blk_name].append(f"{code_market[stk_code]},{stk_code}")
106
- except:
107
- print(stk_code)
108
- return ret
109
-
110
-
111
- def get_all_zsbk_info():
112
- code_market = get_code_market_dict()
113
- blk_info = ak.index_stock_info()
114
- blk_codes = blk_info["index_code"]
115
- blk_names = blk_info["display_name"]
116
- ret = {}
117
- total = len(blk_codes)
118
- # for blk_name in blk_names:
119
- for i in range(total):
120
- blk_name = blk_names[i]
121
- blk_code = blk_codes[i]
122
- print(i, blk_name)
123
- # 沪深指数有重复,避免深指覆盖
124
- if blk_name in ret:
125
- continue
126
- try:
127
- ret[blk_name] = []
128
- stk_codes = ak.index_stock_cons_csindex(symbol=blk_code)
129
- stk_codes = stk_codes['成分券代码'].to_list()
130
- for stk_code in stk_codes:
131
- try:
132
- ret[blk_name].append(f"{code_market[stk_code]},{stk_code}")
133
- except:
134
- print(stk_code)
135
- except KeyboardInterrupt:
136
- exit(-1)
137
- except:
138
- print("Failed!", blk_code, blk_name)
139
- return ret
140
-
141
-
142
- def write_blk_file(blk_info, filename):
143
- with open(filename, 'w', encoding='utf-8') as f:
144
- for k in blk_info:
145
- print(k)
146
- if blk_info[k]:
147
- f.write(f"[{k}]\n")
148
- for code in blk_info[k]:
149
- f.write(f'{code}\n')
150
-
151
-
152
- if __name__ == "__main__":
153
- # # 更新行业板块
154
- # x = get_all_hybk_info()
155
- # write_blk_file(x, 'hikyuu/config/block/hybk.ini')
156
-
157
- # # 更新概念板块
158
- # x = get_all_gnbk_info()
159
- # write_blk_file(x, 'hikyuu/config/block/gnbk.ini')
160
-
161
- # # 更新地域板块
162
- # x = get_all_dybk_info()
163
- # write_blk_file(x, 'hikyuu/config/block/dybk.ini')
164
-
165
- # 更新指数成分
166
- x = get_all_zsbk_info()
167
- write_blk_file(x, 'hikyuu/config/block/zsbk.ini')
168
- # print(x)