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
hikyuu/cpp/core313.pyi CHANGED
@@ -3,7 +3,7 @@ import collections.abc
3
3
  import numpy
4
4
  import numpy.typing
5
5
  import typing
6
- __all__: list[str] = ['ABS', 'ACOS', 'AD', 'ADVANCE', 'AF_EqualWeight', 'AF_FixedWeight', 'AF_FixedWeightList', 'AF_MultiFactor', 'AGG_COUNT', 'AGG_MAD', 'AGG_MAX', 'AGG_MEAN', 'AGG_MEDIAN', 'AGG_MIN', 'AGG_PROD', 'AGG_QUANTILE', 'AGG_STD', 'AGG_SUM', 'AGG_VAR', 'ALIGN', 'AMA', 'ASIN', 'ATAN', 'ATR', 'AVEDEV', 'AllocateFundsBase', 'BACKSET', 'BARSCOUNT', 'BARSLAST', 'BARSLASTCOUNT', 'BARSSINCE', 'BARSSINCEN', 'BETWEEN', 'BLOCKSETNUM', 'BUSINESS', 'Block', 'BlockInfoDriver', 'BorrowRecord', 'BrokerPositionRecord', 'CEILING', 'CN_Bool', 'CN_OPLine', 'CONTEXT', 'CONTEXT_K', 'CORR', 'COS', 'COST', 'COUNT', 'CROSS', 'CVAL', 'CYCLE', 'C_AMO', 'C_CLOSE', 'C_HIGH', 'C_KDATA', 'C_LOW', 'C_OPEN', 'C_VOL', 'ConditionBase', 'Constant', 'CostRecord', 'DATE', 'DAY', 'DEBUG', 'DECLINE', 'DEVSQ', 'DIFF', 'DISCARD', 'DMA', 'DOWNNDAY', 'DROPNA', 'DataDriverFactory', 'Datetime', 'DatetimeList', 'Days', 'EMA', 'ERROR', 'EVERY', 'EV_Bool', 'EV_TwoLine', 'EXIST', 'EXP', 'EnvironmentBase', 'FATAL', 'FILTER', 'FINANCE', 'FLOOR', 'FundsRecord', 'HHV', 'HHVBARS', 'HKUException', 'HOUR', 'HSL', 'Hours', 'IC', 'ICIR', 'IF', 'INBLOCK', 'INDEXA', 'INDEXADV', 'INDEXC', 'INDEXDEC', 'INDEXH', 'INDEXL', 'INDEXO', 'INDEXV', 'INFO', 'INSUM', 'INTPART', 'IR', 'ISINF', 'ISINFA', 'ISLASTBAR', 'ISNA', 'IndParam', 'Indicator', 'IndicatorImp', 'JUMPDOWN', 'JUMPUP', 'KALMAN', 'KDATA_PART', 'KData', 'KDataDriver', 'KDataToHdf5Importer', 'KRecord', 'KRecordList', 'LAST', 'LASTVALUE', 'LIUTONGPAN', 'LLV', 'LLVBARS', 'LN', 'LOG', 'LOG_LEVEL', 'LONGCROSS', 'LoanRecord', 'MA', 'MACD', 'MAX', 'MDD', 'MF_EqualWeight', 'MF_ICIRWeight', 'MF_ICWeight', 'MF_Weight', 'MIN', 'MINUTE', 'MM_FixedCapital', 'MM_FixedCapitalFunds', 'MM_FixedCount', 'MM_FixedCountTps', 'MM_FixedPercent', 'MM_FixedRisk', 'MM_FixedUnits', 'MM_Nothing', 'MM_WilliamsFixedRisk', 'MOD', 'MONTH', 'MRR', 'MarketInfo', 'Microseconds', 'Milliseconds', 'Minutes', 'MoneyManagerBase', 'MultiFactorBase', 'NDAY', 'NOT', 'OFF', 'OrderBrokerBase', 'PF_Simple', 'PF_WithoutAF', 'PG_FixedHoldDays', 'PG_FixedPercent', 'PG_NoGoal', 'POS', 'POW', 'PRICELIST', 'Parameter', 'Performance', 'Portfolio', 'PositionRecord', 'PositionRecordList', 'ProfitGoalBase', 'Query', 'RANK', 'RECOVER_BACKWARD', 'RECOVER_EQUAL_BACKWARD', 'RECOVER_EQUAL_FORWARD', 'RECOVER_FORWARD', 'REF', 'REFX', 'REPLACE', 'RESULT', 'REVERSE', 'ROC', 'ROCP', 'ROCR', 'ROCR100', 'ROUND', 'ROUNDDOWN', 'ROUNDUP', 'RSI', 'SAFTYLOSS', 'SE_EvaluateOptimal', 'SE_Fixed', 'SE_MaxFundsOptimal', 'SE_MultiFactor', 'SE_PerformanceOptimal', 'SE_Signal', 'SGN', 'SG_Add', 'SG_AllwaysBuy', 'SG_And', 'SG_Band', 'SG_Bool', 'SG_Buy', 'SG_Cross', 'SG_CrossGold', 'SG_Cycle', 'SG_Div', 'SG_Flex', 'SG_Mul', 'SG_OneSide', 'SG_Or', 'SG_Sell', 'SG_Single', 'SG_Single2', 'SG_Sub', 'SIN', 'SLICE', 'SLOPE', 'SMA', 'SPEARMAN', 'SP_FixedPercent', 'SP_FixedValue', 'SQRT', 'STDEV', 'STDP', 'ST_FixedPercent', 'ST_Indicator', 'ST_Saftyloss', 'SUM', 'SUMBARS', 'SYS_Simple', 'SYS_WalkForward', 'ScoreRecord', 'ScoreRecordList', 'Seconds', 'SelectorBase', 'SignalBase', 'SlippageBase', 'SpotRecord', 'Stock', 'StockManager', 'StockTypeInfo', 'StockWeight', 'StockWeightList', 'StoplossBase', 'Strategy', 'StrategyContext', 'System', 'SystemPart', 'SystemWeight', 'SystemWeightList', 'TAN', 'TA_ACCBANDS', 'TA_ACOS', 'TA_AD', 'TA_ADD', 'TA_ADOSC', 'TA_ADX', 'TA_ADXR', 'TA_APO', 'TA_AROON', 'TA_AROONOSC', 'TA_ASIN', 'TA_ATAN', 'TA_ATR', 'TA_AVGDEV', 'TA_AVGPRICE', 'TA_BBANDS', 'TA_BETA', 'TA_BOP', 'TA_CCI', 'TA_CDL2CROWS', 'TA_CDL3BLACKCROWS', 'TA_CDL3INSIDE', 'TA_CDL3LINESTRIKE', 'TA_CDL3OUTSIDE', 'TA_CDL3STARSINSOUTH', 'TA_CDL3WHITESOLDIERS', 'TA_CDLABANDONEDBABY', 'TA_CDLADVANCEBLOCK', 'TA_CDLBELTHOLD', 'TA_CDLBREAKAWAY', 'TA_CDLCLOSINGMARUBOZU', 'TA_CDLCONCEALBABYSWALL', 'TA_CDLCOUNTERATTACK', 'TA_CDLDARKCLOUDCOVER', 'TA_CDLDOJI', 'TA_CDLDOJISTAR', 'TA_CDLDRAGONFLYDOJI', 'TA_CDLENGULFING', 'TA_CDLEVENINGDOJISTAR', 'TA_CDLEVENINGSTAR', 'TA_CDLGAPSIDESIDEWHITE', 'TA_CDLGRAVESTONEDOJI', 'TA_CDLHAMMER', 'TA_CDLHANGINGMAN', 'TA_CDLHARAMI', 'TA_CDLHARAMICROSS', 'TA_CDLHIGHWAVE', 'TA_CDLHIKKAKE', 'TA_CDLHIKKAKEMOD', 'TA_CDLHOMINGPIGEON', 'TA_CDLIDENTICAL3CROWS', 'TA_CDLINNECK', 'TA_CDLINVERTEDHAMMER', 'TA_CDLKICKING', 'TA_CDLKICKINGBYLENGTH', 'TA_CDLLADDERBOTTOM', 'TA_CDLLONGLEGGEDDOJI', 'TA_CDLLONGLINE', 'TA_CDLMARUBOZU', 'TA_CDLMATCHINGLOW', 'TA_CDLMATHOLD', 'TA_CDLMORNINGDOJISTAR', 'TA_CDLMORNINGSTAR', 'TA_CDLONNECK', 'TA_CDLPIERCING', 'TA_CDLRICKSHAWMAN', 'TA_CDLRISEFALL3METHODS', 'TA_CDLSEPARATINGLINES', 'TA_CDLSHOOTINGSTAR', 'TA_CDLSHORTLINE', 'TA_CDLSPINNINGTOP', 'TA_CDLSTALLEDPATTERN', 'TA_CDLSTICKSANDWICH', 'TA_CDLTAKURI', 'TA_CDLTASUKIGAP', 'TA_CDLTHRUSTING', 'TA_CDLTRISTAR', 'TA_CDLUNIQUE3RIVER', 'TA_CDLUPSIDEGAP2CROWS', 'TA_CDLXSIDEGAP3METHODS', 'TA_CEIL', 'TA_CMO', 'TA_CORREL', 'TA_COS', 'TA_COSH', 'TA_DEMA', 'TA_DIV', 'TA_DX', 'TA_EMA', 'TA_EXP', 'TA_FLOOR', 'TA_HT_DCPERIOD', 'TA_HT_DCPHASE', 'TA_HT_PHASOR', 'TA_HT_SINE', 'TA_HT_TRENDLINE', 'TA_HT_TRENDMODE', 'TA_IMI', 'TA_KAMA', 'TA_LINEARREG', 'TA_LINEARREG_ANGLE', 'TA_LINEARREG_INTERCEPT', 'TA_LINEARREG_SLOPE', 'TA_LN', 'TA_LOG10', 'TA_MA', 'TA_MACD', 'TA_MACDEXT', 'TA_MACDFIX', 'TA_MAMA', 'TA_MAVP', 'TA_MAX', 'TA_MAXINDEX', 'TA_MEDPRICE', 'TA_MFI', 'TA_MIDPOINT', 'TA_MIDPRICE', 'TA_MIN', 'TA_MININDEX', 'TA_MINMAX', 'TA_MINMAXINDEX', 'TA_MINUS_DI', 'TA_MINUS_DM', 'TA_MOM', 'TA_MULT', 'TA_NATR', 'TA_OBV', 'TA_PLUS_DI', 'TA_PLUS_DM', 'TA_PPO', 'TA_ROC', 'TA_ROCP', 'TA_ROCR', 'TA_ROCR100', 'TA_RSI', 'TA_SAR', 'TA_SAREXT', 'TA_SIN', 'TA_SINH', 'TA_SMA', 'TA_SQRT', 'TA_STDDEV', 'TA_STOCH', 'TA_STOCHF', 'TA_STOCHRSI', 'TA_SUB', 'TA_SUM', 'TA_T3', 'TA_TAN', 'TA_TANH', 'TA_TEMA', 'TA_TRANGE', 'TA_TRIMA', 'TA_TRIX', 'TA_TSF', 'TA_TYPPRICE', 'TA_ULTOSC', 'TA_VAR', 'TA_WCLPRICE', 'TA_WILLR', 'TA_WMA', 'TC_FixedA', 'TC_FixedA2015', 'TC_FixedA2017', 'TC_TestStub', 'TC_Zero', 'TIME', 'TIMELINE', 'TIMELINEVOL', 'TR', 'TRACE', 'TURNOVER', 'TimeDelta', 'TimeLineList', 'TimeLineRecord', 'TradeCostBase', 'TradeManager', 'TradeRecord', 'TradeRecordList', 'TradeRequest', 'TransList', 'TransRecord', 'UPNDAY', 'UTCOffset', 'VAR', 'VARP', 'VIGOR', 'WARN', 'WEAVE', 'WEEK', 'WINNER', 'WITHDAY', 'WITHHALFYEAR', 'WITHHOUR', 'WITHHOUR2', 'WITHHOUR4', 'WITHKTYPE', 'WITHMIN', 'WITHMIN15', 'WITHMIN30', 'WITHMIN5', 'WITHMIN60', 'WITHMONTH', 'WITHQUARTER', 'WITHWEEK', 'WITHYEAR', 'WMA', 'YEAR', 'ZHBOND10', 'ZONGGUBEN', 'ZSCORE', 'active_device', 'backtest', 'batch_calculate_inds', 'can_upgrade', 'close_ostream_to_python', 'close_spend_time', 'combinate_ind', 'combinate_index', 'constant', 'crtBrokerTM', 'crtSEOptimal', 'crtTM', 'crt_pf_strategy', 'crt_sys_strategy', 'dates_to_np', 'dates_to_pa', 'df_to_krecords', 'fetch_trial_license', 'find_optimal_system', 'find_optimal_system_multi', 'get_block', 'get_business_name', 'get_data_from_buffer_server', 'get_date_range', 'get_inds_view', 'get_inds_view_pyarrow', 'get_kdata', 'get_last_version', 'get_log_level', 'get_market_view', 'get_market_view_pyarrow', 'get_spot_from_buffer_server', 'get_stock', 'get_system_part_enum', 'get_system_part_name', 'get_version', 'get_version_git', 'get_version_with_build', 'hikyuu_init', 'inner_analysis_sys_list', 'inner_combinate_ind_analysis', 'inner_combinate_ind_analysis_with_block', 'is_valid_license', 'isinf', 'isnan', 'krecords_to_df', 'krecords_to_np', 'krecords_to_pa', 'open_ostream_to_python', 'open_spend_time', 'positions_to_df', 'positions_to_np', 'positions_to_pa', 'register_extra_ktype', 'release_extra_ktype', 'remove_license', 'roundDown', 'roundEx', 'roundUp', 'run_in_strategy', 'scorerecords_to_df', 'scorerecords_to_np', 'set_log_level', 'set_python_in_interactive', 'set_python_in_jupyter', 'spot_agent_is_connected', 'spot_agent_is_running', 'start_data_server', 'start_spot_agent', 'stop_data_server', 'stop_spot_agent', 'systemweights_to_df', 'systemweights_to_np', 'timeline_to_df', 'timeline_to_np', 'timeline_to_pa', 'toPriceList', 'trades_to_df', 'trades_to_np', 'trades_to_pa', 'translist_to_df', 'translist_to_np', 'translist_to_pa', 'view_license', 'weights_to_df', 'weights_to_np', 'weights_to_pa']
6
+ __all__: list[str] = ['ABS', 'ACOS', 'AD', 'ADVANCE', 'AF_EqualWeight', 'AF_FixedAmount', 'AF_FixedWeight', 'AF_FixedWeightList', 'AF_MultiFactor', 'AGG_COUNT', 'AGG_FUNC', 'AGG_MAD', 'AGG_MAX', 'AGG_MEAN', 'AGG_MEDIAN', 'AGG_MIN', 'AGG_PROD', 'AGG_QUANTILE', 'AGG_STD', 'AGG_SUM', 'AGG_VAR', 'AGG_VWAP', 'ALIGN', 'AMA', 'ASIN', 'ATAN', 'ATR', 'AVEDEV', 'AllocateFundsBase', 'BACKSET', 'BARSCOUNT', 'BARSLAST', 'BARSLASTCOUNT', 'BARSSINCE', 'BARSSINCEN', 'BETWEEN', 'BLOCKSETNUM', 'BUSINESS', 'Block', 'BlockInfoDriver', 'BorrowRecord', 'BrokerPositionRecord', 'CEILING', 'CN_Bool', 'CN_OPLine', 'CONTEXT', 'CONTEXT_K', 'CORR', 'COS', 'COST', 'COUNT', 'CROSS', 'CVAL', 'CYCLE', 'C_AMO', 'C_CLOSE', 'C_HIGH', 'C_KDATA', 'C_LOW', 'C_OPEN', 'C_VOL', 'ConditionBase', 'Constant', 'CostRecord', 'DATE', 'DAY', 'DEBUG', 'DECLINE', 'DEVSQ', 'DIFF', 'DISCARD', 'DMA', 'DOWNNDAY', 'DROPNA', 'DataDriverFactory', 'Datetime', 'DatetimeList', 'Days', 'EMA', 'ERROR', 'EVERY', 'EV_Bool', 'EV_TwoLine', 'EXIST', 'EXP', 'EnvironmentBase', 'FATAL', 'FILTER', 'FINANCE', 'FLOOR', 'FundsRecord', 'GROUP_COUNT', 'GROUP_FUNC', 'GROUP_MAX', 'GROUP_MEAN', 'GROUP_MIN', 'GROUP_PROD', 'GROUP_SUM', 'HHV', 'HHVBARS', 'HKUException', 'HOUR', 'HSL', 'Hours', 'IC', 'ICIR', 'IF', 'INBLOCK', 'INDEXA', 'INDEXADV', 'INDEXC', 'INDEXDEC', 'INDEXH', 'INDEXL', 'INDEXO', 'INDEXV', 'INFO', 'INSUM', 'INTPART', 'IR', 'ISINF', 'ISINFA', 'ISLASTBAR', 'ISNA', 'IndParam', 'Indicator', 'IndicatorImp', 'JUMPDOWN', 'JUMPUP', 'KALMAN', 'KDATA_PART', 'KData', 'KDataDriver', 'KDataToClickHouseImporter', 'KDataToHdf5Importer', 'KDataToMySQLImporter', 'KRecord', 'KRecordList', 'LAST', 'LASTVALUE', 'LIUTONGPAN', 'LLV', 'LLVBARS', 'LN', 'LOG', 'LOG_LEVEL', 'LONGCROSS', 'LoanRecord', 'MA', 'MACD', 'MAX', 'MDD', 'MF_EqualWeight', 'MF_ICIRWeight', 'MF_ICWeight', 'MF_Weight', 'MIN', 'MINUTE', 'MM_FixedCapital', 'MM_FixedCapitalFunds', 'MM_FixedCount', 'MM_FixedCountTps', 'MM_FixedPercent', 'MM_FixedRisk', 'MM_FixedUnits', 'MM_Nothing', 'MM_WilliamsFixedRisk', 'MOD', 'MONTH', 'MRR', 'MarketInfo', 'Microseconds', 'Milliseconds', 'Minutes', 'MoneyManagerBase', 'MultiFactorBase', 'NDAY', 'NORM_MinMax', 'NORM_NOTHING', 'NORM_Quantile', 'NORM_Quantile_Uniform', 'NORM_Zscore', 'NOT', 'NormalizeBase', 'OFF', 'OrderBrokerBase', 'PF_Simple', 'PF_WithoutAF', 'PG_FixedHoldDays', 'PG_FixedPercent', 'PG_NoGoal', 'POS', 'POW', 'PRICELIST', 'Parameter', 'Performance', 'Portfolio', 'PositionRecord', 'PositionRecordList', 'ProfitGoalBase', 'QUANTILE_TRUNC', 'Query', 'RANK', 'RECOVER_BACKWARD', 'RECOVER_EQUAL_BACKWARD', 'RECOVER_EQUAL_FORWARD', 'RECOVER_FORWARD', 'REF', 'REFX', 'REPLACE', 'RESULT', 'REVERSE', 'ROC', 'ROCP', 'ROCR', 'ROCR100', 'ROUND', 'ROUNDDOWN', 'ROUNDUP', 'RSI', 'SAFTYLOSS', 'SCFilter_AmountLimit', 'SCFilter_Group', 'SCFilter_IgnoreNan', 'SCFilter_LessOrEqualValue', 'SCFilter_Price', 'SCFilter_TopN', 'SE_EvaluateOptimal', 'SE_Fixed', 'SE_MaxFundsOptimal', 'SE_MultiFactor', 'SE_MultiFactor2', 'SE_PerformanceOptimal', 'SE_Signal', 'SGN', 'SG_Add', 'SG_AllwaysBuy', 'SG_And', 'SG_Band', 'SG_Bool', 'SG_Buy', 'SG_Cross', 'SG_CrossGold', 'SG_Cycle', 'SG_Div', 'SG_Flex', 'SG_Mul', 'SG_OneSide', 'SG_Or', 'SG_Sell', 'SG_Single', 'SG_Single2', 'SG_Sub', 'SIN', 'SLICE', 'SLOPE', 'SMA', 'SPEARMAN', 'SP_FixedPercent', 'SP_FixedValue', 'SP_LogNormal', 'SP_Normal', 'SP_TruncNormal', 'SP_Uniform', 'SQRT', 'STDEV', 'STDP', 'ST_FixedPercent', 'ST_Indicator', 'ST_Saftyloss', 'SUM', 'SUMBARS', 'SYS_Simple', 'SYS_WalkForward', 'ScoreRecord', 'ScoreRecordList', 'ScoresFilterBase', 'Seconds', 'SelectorBase', 'SignalBase', 'SlippageBase', 'SpotRecord', 'Stock', 'StockManager', 'StockTypeInfo', 'StockWeight', 'StockWeightList', 'StoplossBase', 'Strategy', 'StrategyContext', 'System', 'SystemPart', 'SystemWeight', 'SystemWeightList', 'TAN', 'TA_ACCBANDS', 'TA_ACOS', 'TA_AD', 'TA_ADD', 'TA_ADOSC', 'TA_ADX', 'TA_ADXR', 'TA_APO', 'TA_AROON', 'TA_AROONOSC', 'TA_ASIN', 'TA_ATAN', 'TA_ATR', 'TA_AVGDEV', 'TA_AVGPRICE', 'TA_BBANDS', 'TA_BETA', 'TA_BOP', 'TA_CCI', 'TA_CDL2CROWS', 'TA_CDL3BLACKCROWS', 'TA_CDL3INSIDE', 'TA_CDL3LINESTRIKE', 'TA_CDL3OUTSIDE', 'TA_CDL3STARSINSOUTH', 'TA_CDL3WHITESOLDIERS', 'TA_CDLABANDONEDBABY', 'TA_CDLADVANCEBLOCK', 'TA_CDLBELTHOLD', 'TA_CDLBREAKAWAY', 'TA_CDLCLOSINGMARUBOZU', 'TA_CDLCONCEALBABYSWALL', 'TA_CDLCOUNTERATTACK', 'TA_CDLDARKCLOUDCOVER', 'TA_CDLDOJI', 'TA_CDLDOJISTAR', 'TA_CDLDRAGONFLYDOJI', 'TA_CDLENGULFING', 'TA_CDLEVENINGDOJISTAR', 'TA_CDLEVENINGSTAR', 'TA_CDLGAPSIDESIDEWHITE', 'TA_CDLGRAVESTONEDOJI', 'TA_CDLHAMMER', 'TA_CDLHANGINGMAN', 'TA_CDLHARAMI', 'TA_CDLHARAMICROSS', 'TA_CDLHIGHWAVE', 'TA_CDLHIKKAKE', 'TA_CDLHIKKAKEMOD', 'TA_CDLHOMINGPIGEON', 'TA_CDLIDENTICAL3CROWS', 'TA_CDLINNECK', 'TA_CDLINVERTEDHAMMER', 'TA_CDLKICKING', 'TA_CDLKICKINGBYLENGTH', 'TA_CDLLADDERBOTTOM', 'TA_CDLLONGLEGGEDDOJI', 'TA_CDLLONGLINE', 'TA_CDLMARUBOZU', 'TA_CDLMATCHINGLOW', 'TA_CDLMATHOLD', 'TA_CDLMORNINGDOJISTAR', 'TA_CDLMORNINGSTAR', 'TA_CDLONNECK', 'TA_CDLPIERCING', 'TA_CDLRICKSHAWMAN', 'TA_CDLRISEFALL3METHODS', 'TA_CDLSEPARATINGLINES', 'TA_CDLSHOOTINGSTAR', 'TA_CDLSHORTLINE', 'TA_CDLSPINNINGTOP', 'TA_CDLSTALLEDPATTERN', 'TA_CDLSTICKSANDWICH', 'TA_CDLTAKURI', 'TA_CDLTASUKIGAP', 'TA_CDLTHRUSTING', 'TA_CDLTRISTAR', 'TA_CDLUNIQUE3RIVER', 'TA_CDLUPSIDEGAP2CROWS', 'TA_CDLXSIDEGAP3METHODS', 'TA_CEIL', 'TA_CMO', 'TA_CORREL', 'TA_COS', 'TA_COSH', 'TA_DEMA', 'TA_DIV', 'TA_DX', 'TA_EMA', 'TA_EXP', 'TA_FLOOR', 'TA_HT_DCPERIOD', 'TA_HT_DCPHASE', 'TA_HT_PHASOR', 'TA_HT_SINE', 'TA_HT_TRENDLINE', 'TA_HT_TRENDMODE', 'TA_IMI', 'TA_KAMA', 'TA_LINEARREG', 'TA_LINEARREG_ANGLE', 'TA_LINEARREG_INTERCEPT', 'TA_LINEARREG_SLOPE', 'TA_LN', 'TA_LOG10', 'TA_MA', 'TA_MACD', 'TA_MACDEXT', 'TA_MACDFIX', 'TA_MAMA', 'TA_MAVP', 'TA_MAX', 'TA_MAXINDEX', 'TA_MEDPRICE', 'TA_MFI', 'TA_MIDPOINT', 'TA_MIDPRICE', 'TA_MIN', 'TA_MININDEX', 'TA_MINMAX', 'TA_MINMAXINDEX', 'TA_MINUS_DI', 'TA_MINUS_DM', 'TA_MOM', 'TA_MULT', 'TA_NATR', 'TA_OBV', 'TA_PLUS_DI', 'TA_PLUS_DM', 'TA_PPO', 'TA_ROC', 'TA_ROCP', 'TA_ROCR', 'TA_ROCR100', 'TA_RSI', 'TA_SAR', 'TA_SAREXT', 'TA_SIN', 'TA_SINH', 'TA_SMA', 'TA_SQRT', 'TA_STDDEV', 'TA_STOCH', 'TA_STOCHF', 'TA_STOCHRSI', 'TA_SUB', 'TA_SUM', 'TA_T3', 'TA_TAN', 'TA_TANH', 'TA_TEMA', 'TA_TRANGE', 'TA_TRIMA', 'TA_TRIX', 'TA_TSF', 'TA_TYPPRICE', 'TA_ULTOSC', 'TA_VAR', 'TA_WCLPRICE', 'TA_WILLR', 'TA_WMA', 'TC_FixedA', 'TC_FixedA2015', 'TC_FixedA2017', 'TC_TestStub', 'TC_Zero', 'TIME', 'TIMELINE', 'TIMELINEVOL', 'TR', 'TRACE', 'TURNOVER', 'TimeDelta', 'TimeLineList', 'TimeLineRecord', 'TradeCostBase', 'TradeManager', 'TradeRecord', 'TradeRecordList', 'TradeRequest', 'TransList', 'TransRecord', 'UPNDAY', 'UTCOffset', 'VAR', 'VARP', 'VIGOR', 'WARN', 'WEAVE', 'WEEK', 'WINNER', 'WITHDAY', 'WITHHALFYEAR', 'WITHHOUR', 'WITHHOUR2', 'WITHHOUR4', 'WITHKTYPE', 'WITHMIN', 'WITHMIN15', 'WITHMIN30', 'WITHMIN5', 'WITHMIN60', 'WITHMONTH', 'WITHQUARTER', 'WITHWEEK', 'WITHYEAR', 'WMA', 'YEAR', 'ZHBOND10', 'ZONGGUBEN', 'ZSCORE', 'active_device', 'backtest', 'batch_calculate_inds', 'bind_email', 'can_upgrade', 'check_data', 'close_ostream_to_python', 'close_spend_time', 'combinate_ind', 'combinate_index', 'constant', 'crtBrokerTM', 'crtSEOptimal', 'crtTM', 'crt_pf_strategy', 'crt_sys_strategy', 'dates_to_np', 'df_to_krecords', 'fetch_trial_license', 'find_optimal_system', 'find_optimal_system_multi', 'get_block', 'get_business_name', 'get_data_from_buffer_server', 'get_date_range', 'get_expire_date', 'get_funds_list', 'get_kdata', 'get_latest_version_info', 'get_log_level', 'get_spot_from_buffer_server', 'get_stock', 'get_system_part_enum', 'get_system_part_name', 'get_version', 'get_version_git', 'get_version_with_build', 'hikyuu_init', 'inner_analysis_sys_list', 'inner_combinate_ind_analysis', 'inner_combinate_ind_analysis_with_block', 'is_valid_license', 'isinf', 'isnan', 'krecords_to_df', 'krecords_to_np', 'open_ostream_to_python', 'open_spend_time', 'parallel_run_pf', 'parallel_run_sys', 'positions_to_df', 'positions_to_np', 'register_extra_ktype', 'release_extra_ktype', 'remove_license', 'roundDown', 'roundEx', 'roundUp', 'run_in_strategy', 'scorerecords_to_df', 'scorerecords_to_np', 'set_log_level', 'set_python_in_interactive', 'set_python_in_jupyter', 'spot_agent_is_connected', 'spot_agent_is_running', 'start_data_server', 'start_spot_agent', 'stop_data_server', 'stop_spot_agent', 'systemweights_to_df', 'systemweights_to_np', 'timeline_to_df', 'timeline_to_np', 'toPriceList', 'trades_to_df', 'trades_to_np', 'translist_to_df', 'translist_to_np', 'view_license', 'weights_to_df', 'weights_to_np']
7
7
  class AllocateFundsBase:
8
8
  """
9
9
  资产分配算法基类, 子类接口:
@@ -154,6 +154,8 @@ class BUSINESS:
154
154
 
155
155
  RETURN_STOCK
156
156
 
157
+ SUOGU
158
+
157
159
  INVALID
158
160
  """
159
161
  BONUS: typing.ClassVar[BUSINESS] # value = <BUSINESS.BONUS: 4>
@@ -167,12 +169,13 @@ class BUSINESS:
167
169
  CHECKOUT_STOCK: typing.ClassVar[BUSINESS] # value = <BUSINESS.CHECKOUT_STOCK: 8>
168
170
  GIFT: typing.ClassVar[BUSINESS] # value = <BUSINESS.GIFT: 3>
169
171
  INIT: typing.ClassVar[BUSINESS] # value = <BUSINESS.INIT: 0>
170
- INVALID: typing.ClassVar[BUSINESS] # value = <BUSINESS.INVALID: 15>
172
+ INVALID: typing.ClassVar[BUSINESS] # value = <BUSINESS.INVALID: 16>
171
173
  RETURN_CASH: typing.ClassVar[BUSINESS] # value = <BUSINESS.RETURN_CASH: 10>
172
174
  RETURN_STOCK: typing.ClassVar[BUSINESS] # value = <BUSINESS.RETURN_STOCK: 12>
173
175
  SELL: typing.ClassVar[BUSINESS] # value = <BUSINESS.SELL: 2>
174
176
  SELL_SHORT: typing.ClassVar[BUSINESS] # value = <BUSINESS.SELL_SHORT: 13>
175
- __members__: typing.ClassVar[dict[str, BUSINESS]] # value = {'INIT': <BUSINESS.INIT: 0>, 'BUY': <BUSINESS.BUY: 1>, 'SELL': <BUSINESS.SELL: 2>, 'BUY_SHORT': <BUSINESS.BUY_SHORT: 14>, 'SELL_SHORT': <BUSINESS.SELL_SHORT: 13>, 'GIFT': <BUSINESS.GIFT: 3>, 'BONUS': <BUSINESS.BONUS: 4>, 'CHECKIN': <BUSINESS.CHECKIN: 5>, 'CHECKOUT': <BUSINESS.CHECKOUT: 6>, 'CHECKIN_STOCK': <BUSINESS.CHECKIN_STOCK: 7>, 'CHECKOUT_STOCK': <BUSINESS.CHECKOUT_STOCK: 8>, 'BORROW_CASH': <BUSINESS.BORROW_CASH: 9>, 'RETURN_CASH': <BUSINESS.RETURN_CASH: 10>, 'BORROW_STOCK': <BUSINESS.BORROW_STOCK: 11>, 'RETURN_STOCK': <BUSINESS.RETURN_STOCK: 12>, 'INVALID': <BUSINESS.INVALID: 15>}
177
+ SUOGU: typing.ClassVar[BUSINESS] # value = <BUSINESS.SUOGU: 15>
178
+ __members__: typing.ClassVar[dict[str, BUSINESS]] # value = {'INIT': <BUSINESS.INIT: 0>, 'BUY': <BUSINESS.BUY: 1>, 'SELL': <BUSINESS.SELL: 2>, 'BUY_SHORT': <BUSINESS.BUY_SHORT: 14>, 'SELL_SHORT': <BUSINESS.SELL_SHORT: 13>, 'GIFT': <BUSINESS.GIFT: 3>, 'BONUS': <BUSINESS.BONUS: 4>, 'CHECKIN': <BUSINESS.CHECKIN: 5>, 'CHECKOUT': <BUSINESS.CHECKOUT: 6>, 'CHECKIN_STOCK': <BUSINESS.CHECKIN_STOCK: 7>, 'CHECKOUT_STOCK': <BUSINESS.CHECKOUT_STOCK: 8>, 'BORROW_CASH': <BUSINESS.BORROW_CASH: 9>, 'RETURN_CASH': <BUSINESS.RETURN_CASH: 10>, 'BORROW_STOCK': <BUSINESS.BORROW_STOCK: 11>, 'RETURN_STOCK': <BUSINESS.RETURN_STOCK: 12>, 'SUOGU': <BUSINESS.SUOGU: 15>, 'INVALID': <BUSINESS.INVALID: 16>}
176
179
  def __eq__(self, other: typing.Any) -> bool:
177
180
  ...
178
181
  def __getstate__(self) -> int:
@@ -220,7 +223,10 @@ class Block:
220
223
  def __init__(self) -> None:
221
224
  ...
222
225
  @typing.overload
223
- def __init__(self, arg0: str, arg1: str) -> None:
226
+ def __init__(self, category: str, name: str) -> None:
227
+ ...
228
+ @typing.overload
229
+ def __init__(self, category: str, name: str, index_code: str) -> None:
224
230
  ...
225
231
  @typing.overload
226
232
  def __init__(self, arg0: Block) -> None:
@@ -1171,9 +1177,6 @@ class DatetimeList:
1171
1177
  @staticmethod
1172
1178
  def to_pandas(data: DatetimeList):
1173
1179
  ...
1174
- @staticmethod
1175
- def to_pyarrow(data):
1176
- ...
1177
1180
  def __bool__(self) -> bool:
1178
1181
  """
1179
1182
  Check whether the list is nonempty
@@ -1961,8 +1964,6 @@ class Indicator:
1961
1964
  """
1962
1965
  转化为np.array, 如果为时间序列, 则包含 datetime 日期列
1963
1966
  """
1964
- def to_pyarrow(self) -> typing.Any:
1965
- ...
1966
1967
  def value_to_df(self) -> typing.Any:
1967
1968
  """
1968
1969
  转换为 DataFrame, 仅包含值
@@ -1971,8 +1972,6 @@ class Indicator:
1971
1972
  """
1972
1973
  仅转化值为np.array, 不包含日期列
1973
1974
  """
1974
- def value_to_pyarrow(self) -> typing.Any:
1975
- ...
1976
1975
  @property
1977
1976
  def discard(self) -> int:
1978
1977
  """
@@ -2282,8 +2281,6 @@ class KData:
2282
2281
  """
2283
2282
  将 KData 转换为 NumPy 数组
2284
2283
  """
2285
- def to_pyarrow(self) -> typing.Any:
2286
- ...
2287
2284
  def tocsv(self, arg0: str) -> None:
2288
2285
  """
2289
2286
  tocsv(self, filename)
@@ -2397,6 +2394,20 @@ class KDataDriver:
2397
2394
  """
2398
2395
  驱动名称
2399
2396
  """
2397
+ class KDataToClickHouseImporter:
2398
+ """
2399
+ K线数据导入器
2400
+ """
2401
+ def __init__(self) -> None:
2402
+ ...
2403
+ def remove(self, arg0: str, arg1: str, arg2: str, arg3: Datetime) -> None:
2404
+ """
2405
+ 删除指定时间及其之后的K线数据
2406
+ """
2407
+ def set_config(self, host: str, port: typing.SupportsInt = 9000, usr: str = 'default', pwd: str = '') -> bool:
2408
+ """
2409
+ 设置数据保存路径和数据源列表
2410
+ """
2400
2411
  class KDataToHdf5Importer:
2401
2412
  """
2402
2413
  K线数据导入器
@@ -2431,6 +2442,20 @@ class KDataToHdf5Importer:
2431
2442
  """
2432
2443
  更新索引
2433
2444
  """
2445
+ class KDataToMySQLImporter:
2446
+ """
2447
+ K线数据导入器
2448
+ """
2449
+ def __init__(self) -> None:
2450
+ ...
2451
+ def remove(self, arg0: str, arg1: str, arg2: str, arg3: Datetime) -> None:
2452
+ """
2453
+ 删除指定时间及其之后的K线数据
2454
+ """
2455
+ def set_config(self, host: str, port: typing.SupportsInt = 9000, usr: str = 'default', pwd: str = '') -> bool:
2456
+ """
2457
+ 设置数据保存路径和数据源列表
2458
+ """
2434
2459
  class KRecord:
2435
2460
  """
2436
2461
  K线记录,组成K线数据,属性可读写
@@ -2531,9 +2556,6 @@ class KRecordList:
2531
2556
  @staticmethod
2532
2557
  def to_pandas(data):
2533
2558
  ...
2534
- @staticmethod
2535
- def to_pyarrow(data):
2536
- ...
2537
2559
  def __bool__(self) -> bool:
2538
2560
  """
2539
2561
  Check whether the list is nonempty
@@ -2993,6 +3015,17 @@ class MultiFactorBase:
2993
3015
  ...
2994
3016
  def __str__(self) -> str:
2995
3017
  ...
3018
+ def add_special_normalize(self, name: str, norm: NormalizeBase = None, category: str = '', style_inds: collections.abc.Sequence[Indicator] = []) -> None:
3019
+ """
3020
+ add_special_normalize(self, name[, norm=None, category="", style_inds=[]])
3021
+
3022
+ 对指定名称的指标应用特定的标准化/归一化、行业中性化、风格因子中性化操作。标准化操作、行业中性化、风格因子中性化彼此无关,可同时指定也可分开指定。
3023
+
3024
+ :param str name: 特殊归一化方法名称
3025
+ :param Normalize norm: 特殊归一化方法
3026
+ :param str category: 行业中性化时,指定板块类别
3027
+ :param list[Indicator] style_inds: 用于中性化的风格指标列表
3028
+ """
2996
3029
  def clone(self) -> MultiFactorBase:
2997
3030
  """
2998
3031
  克隆操作
@@ -3014,7 +3047,14 @@ class MultiFactorBase:
3014
3047
  :return: ScoreRecordList
3015
3048
  """
3016
3049
  def get_all_src_factors(self) -> list[list[Indicator]]:
3017
- ...
3050
+ """
3051
+ get_all_src_factors(self)
3052
+
3053
+ 获取所有原始因子列表(如果指定了标准化、行业中性化, 返回为已处理的因子列表)
3054
+
3055
+ :rtype: list
3056
+ :return: list IndicatorList stks x inds
3057
+ """
3018
3058
  def get_datetime_list(self) -> DatetimeList:
3019
3059
  """
3020
3060
  获取参考日期列表(由参考证券通过查询条件获得)
@@ -3090,6 +3130,14 @@ class MultiFactorBase:
3090
3130
  """
3091
3131
  是否存在指定参数
3092
3132
  """
3133
+ def set_normalize(self, norm: typing.Any) -> None:
3134
+ """
3135
+ set_normalize(self, norm)
3136
+
3137
+ 设置标准化或归一化方法(影响全部因子)
3138
+
3139
+ :param NormalizeBase norm: 标准化或归一化方法实例
3140
+ """
3093
3141
  def set_param(self, arg0: str, arg1: any) -> None:
3094
3142
  """
3095
3143
  set_param(self, name, value)
@@ -3140,6 +3188,71 @@ class MultiFactorBase:
3140
3188
  @query.setter
3141
3189
  def query(self, arg1: Query) -> None:
3142
3190
  ...
3191
+ class NormalizeBase:
3192
+ """
3193
+ 用于 MF 的截面标准化操作
3194
+ """
3195
+ def __getstate__(self) -> tuple:
3196
+ ...
3197
+ @typing.overload
3198
+ def __init__(self) -> None:
3199
+ ...
3200
+ @typing.overload
3201
+ def __init__(self, arg0: NormalizeBase) -> None:
3202
+ ...
3203
+ @typing.overload
3204
+ def __init__(self, arg0: str) -> None:
3205
+ """
3206
+ 初始化构造函数
3207
+
3208
+ :param str name: 名称
3209
+ """
3210
+ def __repr__(self) -> str:
3211
+ ...
3212
+ def __setstate__(self, arg0: tuple) -> None:
3213
+ ...
3214
+ def __str__(self) -> str:
3215
+ ...
3216
+ def clone(self) -> NormalizeBase:
3217
+ """
3218
+ 克隆操作
3219
+ """
3220
+ def get_param(self, arg0: str) -> any:
3221
+ """
3222
+ get_param(self, name)
3223
+
3224
+ 获取指定的参数
3225
+
3226
+ :param str name: 参数名称
3227
+ :return: 参数值
3228
+ :raises out_of_range: 无此参数
3229
+ """
3230
+ def have_param(self, arg0: str) -> bool:
3231
+ """
3232
+ 是否存在指定参数
3233
+ """
3234
+ def normalize(self, arg0: collections.abc.Sequence[typing.SupportsFloat]) -> list[float]:
3235
+ """
3236
+ 【重载接口】子类计算接口
3237
+ """
3238
+ def set_param(self, arg0: str, arg1: any) -> None:
3239
+ """
3240
+ set_param(self, name, value)
3241
+
3242
+ 设置参数
3243
+
3244
+ :param str name: 参数名称
3245
+ :param value: 参数值
3246
+ :raises logic_error: Unsupported type! 不支持的参数类型
3247
+ """
3248
+ @property
3249
+ def name(self) -> str:
3250
+ """
3251
+ 名称
3252
+ """
3253
+ @name.setter
3254
+ def name(self, arg1: str) -> None:
3255
+ ...
3143
3256
  class OrderBrokerBase:
3144
3257
  """
3145
3258
  订单代理包装基类,用户可以参考自定义自己的订单代理,加入额外的处理
@@ -3401,6 +3514,10 @@ class Portfolio:
3401
3514
  """
3402
3515
  是否存在指定参数
3403
3516
  """
3517
+ def last_suggestion(self) -> typing.Any:
3518
+ """
3519
+ 回测完成后,返回最后一天交易记录,以及需要延迟的买入和卖出延迟请求
3520
+ """
3404
3521
  def reset(self) -> None:
3405
3522
  """
3406
3523
  复位操作
@@ -3431,7 +3548,7 @@ class Portfolio:
3431
3548
  设置或获取资产分配算法
3432
3549
  """
3433
3550
  @af.setter
3434
- def af(self, arg1: AllocateFundsBase) -> None:
3551
+ def af(self, arg1: typing.Any) -> None:
3435
3552
  ...
3436
3553
  @property
3437
3554
  def name(self) -> str:
@@ -3460,7 +3577,7 @@ class Portfolio:
3460
3577
  设置或获取交易对象选择算法
3461
3578
  """
3462
3579
  @se.setter
3463
- def se(self, arg1: SelectorBase) -> None:
3580
+ def se(self, arg1: typing.Any) -> None:
3464
3581
  ...
3465
3582
  @property
3466
3583
  def tm(self) -> TradeManager:
@@ -3468,7 +3585,7 @@ class Portfolio:
3468
3585
  设置或获取交易管理对象
3469
3586
  """
3470
3587
  @tm.setter
3471
- def tm(self, arg1: TradeManager) -> None:
3588
+ def tm(self, arg1: typing.Any) -> None:
3472
3589
  ...
3473
3590
  class PositionRecord:
3474
3591
  """
@@ -3691,8 +3808,6 @@ class PositionRecordList:
3691
3808
  ...
3692
3809
  def to_pandas(self):
3693
3810
  ...
3694
- def to_pyarrow(self):
3695
- ...
3696
3811
  class ProfitGoalBase:
3697
3812
  """
3698
3813
  盈利目标策略基类
@@ -3753,8 +3868,8 @@ class ProfitGoalBase:
3753
3868
 
3754
3869
  【重载接口】获取盈利目标价格,返回constant.null_price时,表示未限定目标;返回0意味着需要卖出
3755
3870
 
3756
- :param Datetime datetime: 买入时间
3757
- :param float price: 买入价格
3871
+ :param Datetime datetime: 当前时间
3872
+ :param float price: 当前价格
3758
3873
  :return: 目标价格
3759
3874
  :rtype: float
3760
3875
  """
@@ -4153,6 +4268,84 @@ class ScoreRecordList:
4153
4268
  ...
4154
4269
  def to_pandas(self):
4155
4270
  ...
4271
+ class ScoresFilterBase:
4272
+ """
4273
+ 用于 MF 的截面标准化操作
4274
+ """
4275
+ def __getstate__(self) -> tuple:
4276
+ ...
4277
+ @typing.overload
4278
+ def __init__(self) -> None:
4279
+ ...
4280
+ @typing.overload
4281
+ def __init__(self, arg0: ScoresFilterBase) -> None:
4282
+ ...
4283
+ @typing.overload
4284
+ def __init__(self, arg0: str) -> None:
4285
+ """
4286
+ 初始化构造函数
4287
+
4288
+ :param str name: 名称
4289
+ """
4290
+ def __or__(self, arg0: ScoresFilterBase) -> ScoresFilterBase:
4291
+ ...
4292
+ def __repr__(self) -> str:
4293
+ ...
4294
+ def __setstate__(self, arg0: tuple) -> None:
4295
+ ...
4296
+ def __str__(self) -> str:
4297
+ ...
4298
+ def _filter(self, arg0: ScoreRecordList, arg1: Datetime, arg2: Query) -> ScoreRecordList:
4299
+ """
4300
+ 【重载接口】子类计算接口
4301
+ """
4302
+ def clone(self) -> ScoresFilterBase:
4303
+ """
4304
+ 克隆操作
4305
+ """
4306
+ def filter(self, arg0: ScoreRecordList, arg1: Datetime, arg2: Query) -> ScoreRecordList:
4307
+ """
4308
+ filter(self, scores, date, query)
4309
+
4310
+ 截面过滤
4311
+ :param list scores: 截面数据
4312
+ :param Datetime date: 截面日期
4313
+ :param KQuery query: 查询参数
4314
+ :return: 截面数据
4315
+ :rtype: ScoreRecordList
4316
+ """
4317
+ def get_param(self, arg0: str) -> any:
4318
+ """
4319
+ get_param(self, name)
4320
+
4321
+ 获取指定的参数
4322
+
4323
+ :param str name: 参数名称
4324
+ :return: 参数值
4325
+ :raises out_of_range: 无此参数
4326
+ """
4327
+ def have_param(self, arg0: str) -> bool:
4328
+ """
4329
+ 是否存在指定参数
4330
+ """
4331
+ def set_param(self, arg0: str, arg1: any) -> None:
4332
+ """
4333
+ set_param(self, name, value)
4334
+
4335
+ 设置参数
4336
+
4337
+ :param str name: 参数名称
4338
+ :param value: 参数值
4339
+ :raises logic_error: Unsupported type! 不支持的参数类型
4340
+ """
4341
+ @property
4342
+ def name(self) -> str:
4343
+ """
4344
+ 名称
4345
+ """
4346
+ @name.setter
4347
+ def name(self, arg1: str) -> None:
4348
+ ...
4156
4349
  class SelectorBase:
4157
4350
  """
4158
4351
  选择器策略基类,实现标的、系统策略的评估和选取算法,自定义选择器策略子类接口:
@@ -4227,6 +4420,14 @@ class SelectorBase:
4227
4420
  """
4228
4421
  子类复位操作实现
4229
4422
  """
4423
+ def add_scores_filter(self, arg0: ScoresFilterBase) -> None:
4424
+ """
4425
+ add_scores_filter(self, filter)
4426
+
4427
+ 在已有过滤基础上新增过滤, 仅适用于 SE_MultiFactor
4428
+
4429
+ :param ScoresFilter filter: 新的过滤器
4430
+ """
4230
4431
  def add_stock(self, stock: Stock, sys: ...) -> None:
4231
4432
  """
4232
4433
  add_stock(self, stock, sys)
@@ -4309,6 +4510,19 @@ class SelectorBase:
4309
4510
  :param value: 参数值
4310
4511
  :raises logic_error: Unsupported type! 不支持的参数类型
4311
4512
  """
4513
+ def set_scores_filter(self, arg0: ScoresFilterBase) -> None:
4514
+ """
4515
+ set_scores_filter(self, filter)
4516
+
4517
+ 设置 ScoresFilter, 将替换现有的过滤器. 仅适用于 SE_MultiFactor
4518
+
4519
+ :param ScoresFilter filter: ScoresFilter
4520
+ """
4521
+ @property
4522
+ def mf(self) -> ...:
4523
+ """
4524
+ 获取关联的 MF
4525
+ """
4312
4526
  @property
4313
4527
  def name(self) -> str:
4314
4528
  """
@@ -4327,6 +4541,11 @@ class SelectorBase:
4327
4541
  """
4328
4542
  由 PF 运行时设定的实际运行系统列表
4329
4543
  """
4544
+ @property
4545
+ def scfilter(self) -> ScoresFilterBase:
4546
+ """
4547
+ 获取 ScoresFilter
4548
+ """
4330
4549
  class SignalBase:
4331
4550
  """
4332
4551
  信号指示器基类
@@ -4928,7 +5147,7 @@ class Stock:
4928
5147
 
4929
5148
  :param Query.KType ktype: K线类型
4930
5149
  """
4931
- def set_kdata_from_df(self, df: typing.Any, cols: collections.abc.Sequence[str], ktype: str = 'DAY') -> None:
5150
+ def set_kdata_from_df(self, df: typing.Any, cols: collections.abc.Sequence[str] = ['datetime', 'open', 'high', 'low', 'close', 'amount', 'volume'], ktype: str = 'DAY') -> None:
4932
5151
  """
4933
5152
  set_kdata_from_df(self, df, cols, [ktype=Query.DAY])
4934
5153
 
@@ -5122,6 +5341,10 @@ class StockManager:
5122
5341
  :return: 加入的Stock
5123
5342
  :rtype: Stock
5124
5343
  """
5344
+ def cancel_load(self) -> None:
5345
+ """
5346
+ 取消所有数据加载
5347
+ """
5125
5348
  def datadir(self) -> str:
5126
5349
  """
5127
5350
  datadir(self) -> str
@@ -5157,10 +5380,29 @@ class StockManager:
5157
5380
  :return: 板块列表
5158
5381
  :rtype: BlockList
5159
5382
  """
5383
+ def get_block_list_by_index_stock(self, index_stk: ...) -> list[...]:
5384
+ """
5385
+ get_block_list_by_index_stock(self, index_stk)
5386
+
5387
+ 获取指定指数的板块列表
5388
+
5389
+ :param Stock index_stk: 指数
5390
+ :return: 板块列表
5391
+ :rtype: BlockList
5392
+ """
5160
5393
  def get_block_parameter(self) -> ...:
5161
5394
  """
5162
5395
  获取当前板块信息驱动参数
5163
5396
  """
5397
+ def get_category_list(self) -> list[str]:
5398
+ """
5399
+ get_category_list(self)
5400
+
5401
+ 获取所有板块分类
5402
+
5403
+ :return: 所有板块分类
5404
+ :rtype: StringList
5405
+ """
5164
5406
  def get_context(self) -> StrategyContext:
5165
5407
  """
5166
5408
  获取当前上下文
@@ -5509,9 +5751,6 @@ class StockWeightList:
5509
5751
  @staticmethod
5510
5752
  def to_pandas(data):
5511
5753
  ...
5512
- @staticmethod
5513
- def to_pyarrow(data):
5514
- ...
5515
5754
  def __bool__(self) -> bool:
5516
5755
  """
5517
5756
  Check whether the list is nonempty
@@ -6093,6 +6332,10 @@ class System:
6093
6332
  """
6094
6333
  是否存在指定参数
6095
6334
  """
6335
+ def last_suggestion(self) -> typing.Any:
6336
+ """
6337
+ 回测完成后,返回最后一天交易记录,以及需要延迟的买入和卖出延迟请求
6338
+ """
6096
6339
  def ready(self) -> None:
6097
6340
  ...
6098
6341
  def reset(self) -> None:
@@ -6139,7 +6382,7 @@ class System:
6139
6382
  系统有效条件
6140
6383
  """
6141
6384
  @cn.setter
6142
- def cn(self, arg1: ConditionBase) -> None:
6385
+ def cn(self, arg1: typing.Any) -> None:
6143
6386
  ...
6144
6387
  @property
6145
6388
  def ev(self) -> EnvironmentBase:
@@ -6147,7 +6390,7 @@ class System:
6147
6390
  市场环境判断策略
6148
6391
  """
6149
6392
  @ev.setter
6150
- def ev(self, arg1: EnvironmentBase) -> None:
6393
+ def ev(self, arg1: typing.Any) -> None:
6151
6394
  ...
6152
6395
  @property
6153
6396
  def mm(self) -> MoneyManagerBase:
@@ -6155,7 +6398,7 @@ class System:
6155
6398
  资金管理策略
6156
6399
  """
6157
6400
  @mm.setter
6158
- def mm(self, arg1: MoneyManagerBase) -> None:
6401
+ def mm(self, arg1: typing.Any) -> None:
6159
6402
  ...
6160
6403
  @property
6161
6404
  def name(self) -> str:
@@ -6171,7 +6414,7 @@ class System:
6171
6414
  盈利目标策略
6172
6415
  """
6173
6416
  @pg.setter
6174
- def pg(self, arg1: ProfitGoalBase) -> None:
6417
+ def pg(self, arg1: typing.Any) -> None:
6175
6418
  ...
6176
6419
  @property
6177
6420
  def query(self) -> Query:
@@ -6184,7 +6427,7 @@ class System:
6184
6427
  信号指示器
6185
6428
  """
6186
6429
  @sg.setter
6187
- def sg(self, arg1: SignalBase) -> None:
6430
+ def sg(self, arg1: typing.Any) -> None:
6188
6431
  ...
6189
6432
  @property
6190
6433
  def sp(self) -> SlippageBase:
@@ -6192,7 +6435,7 @@ class System:
6192
6435
  移滑价差算法
6193
6436
  """
6194
6437
  @sp.setter
6195
- def sp(self, arg1: SlippageBase) -> None:
6438
+ def sp(self, arg1: typing.Any) -> None:
6196
6439
  ...
6197
6440
  @property
6198
6441
  def st(self) -> StoplossBase:
@@ -6200,7 +6443,7 @@ class System:
6200
6443
  止损策略
6201
6444
  """
6202
6445
  @st.setter
6203
- def st(self, arg1: StoplossBase) -> None:
6446
+ def st(self, arg1: typing.Any) -> None:
6204
6447
  ...
6205
6448
  @property
6206
6449
  def tm(self) -> TradeManager:
@@ -6208,7 +6451,7 @@ class System:
6208
6451
  关联的交易管理实例
6209
6452
  """
6210
6453
  @tm.setter
6211
- def tm(self, arg1: TradeManager) -> None:
6454
+ def tm(self, arg1: typing.Any) -> None:
6212
6455
  ...
6213
6456
  @property
6214
6457
  def to(self) -> KData:
@@ -6224,7 +6467,7 @@ class System:
6224
6467
  止盈策略
6225
6468
  """
6226
6469
  @tp.setter
6227
- def tp(self, arg1: StoplossBase) -> None:
6470
+ def tp(self, arg1: typing.Any) -> None:
6228
6471
  ...
6229
6472
  class SystemPart:
6230
6473
  """
@@ -6692,9 +6935,6 @@ class TimeLineList:
6692
6935
  @staticmethod
6693
6936
  def to_pandas(data):
6694
6937
  ...
6695
- @staticmethod
6696
- def to_pyarrow(data):
6697
- ...
6698
6938
  def __bool__(self) -> bool:
6699
6939
  """
6700
6940
  Check whether the list is nonempty
@@ -7640,8 +7880,6 @@ class TradeRecordList:
7640
7880
  ...
7641
7881
  def to_pandas(self):
7642
7882
  ...
7643
- def to_pyarrow(self):
7644
- ...
7645
7883
  class TradeRequest:
7646
7884
  """
7647
7885
  交易请求记录。系统内部在实现延迟操作时登记的交易请求信息。暴露该结构的主要目的是用于
@@ -7722,9 +7960,6 @@ class TransList:
7722
7960
  @staticmethod
7723
7961
  def to_pandas(data):
7724
7962
  ...
7725
- @staticmethod
7726
- def to_pyarrow(data):
7727
- ...
7728
7963
  def __bool__(self) -> bool:
7729
7964
  """
7730
7965
  Check whether the list is nonempty
@@ -7936,6 +8171,14 @@ def AF_EqualWeight() -> AllocateFundsBase:
7936
8171
 
7937
8172
  等权重资产分配,对选中的资产进行等比例分配
7938
8173
  """
8174
+ def AF_FixedAmount(amount: typing.SupportsFloat = 20000.0) -> AllocateFundsBase:
8175
+ """
8176
+ AF_FixedAmount(amount)
8177
+
8178
+ 等金额资产分配,对选中的资产进行等金额分配
8179
+
8180
+ :param float amount: 交易最大金额
8181
+ """
7939
8182
  def AF_FixedWeight(weight: typing.SupportsFloat = 0.1) -> AllocateFundsBase:
7940
8183
  """
7941
8184
  AF_FixedWeight(weight)
@@ -7962,6 +8205,26 @@ def AGG_COUNT(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit:
7962
8205
  """
7963
8206
  聚合函数: 非空值计数, 可参考 AGG_STD 帮助
7964
8207
  """
8208
+ def AGG_FUNC(ind: Indicator, agg_func: typing.Any, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
8209
+ """
8210
+ AGG_FUNC(ind, agg_func[, ktype=Query.MIN, fill_null=False, unit=1]
8211
+
8212
+ 使用自定函数聚合其他K线周期的指标。虽然支持python自定义函数, 但python函数需要GIL, 速度会慢。建议最好直接使用 C++ 自定义聚合函数。
8213
+
8214
+ 示例, 计算日线时聚合分钟线收盘价的和:
8215
+
8216
+ >>> kdata = get_kdata('sh600000', Query(Datetime(20250101), ktype=Query.DAY))
8217
+ >>> ind = AGG_FUNC(CLOSE(), lambda ds, x: np.sum(x))
8218
+ >>> ind(k)
8219
+
8220
+ :param Indicator ind: 待计算指标
8221
+ :param callable agg_func: 自定义聚合函数,输入参数为 arg1: datetime list, arg2: numpy array, 返回针对list的聚合结果, 注意是单个值
8222
+ :param KQuery.KType ktype: 聚合的K线周期
8223
+ :param bool fill_null: 是否填充缺失值
8224
+ :param int unit: 聚合周期单位 (上下文K线分组单位, 使用日线计算分钟线聚合时, unit=2代表聚合2天的分钟线)
8225
+ :return: 聚合结果
8226
+ :rtype: Indicator
8227
+ """
7965
8228
  def AGG_MAD(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
7966
8229
  """
7967
8230
  聚合函数: 平均绝对偏差, 可参考 AGG_STD 帮助
@@ -8040,6 +8303,19 @@ def AGG_VAR(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: t
8040
8303
  :return: 指标数据
8041
8304
  :rtype: Indicator
8042
8305
  """
8306
+ def AGG_VWAP(ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
8307
+ """
8308
+ AGG_VWAP([ktype=Query.MIN, fill_null=False, unit=1])
8309
+
8310
+ 聚合其他K线成交量加权平均价格(Volume Weighted Average Price)
8311
+ VWAP 是成交量加权的平均价格,计算方式是将每一分钟(或单位时间)的成交量乘以该分钟的成交价格,然后对所有乘积求和,最后除以总成交量。
8312
+
8313
+ :param KQuery.KType ktype: 聚合的K线周期
8314
+ :param bool fill_null: 是否填充缺失值
8315
+ :param int unit: 聚合周期单位 (上下文K线分组单位, 使用日线计算分钟线聚合时, unit=2代表聚合2天的分钟线)
8316
+ :return: 指标数据
8317
+ :rtype: Indicator
8318
+ """
8043
8319
  @typing.overload
8044
8320
  def ALIGN(ref: DatetimeList, fill_null: bool = True) -> Indicator:
8045
8321
  ...
@@ -8937,6 +9213,48 @@ def FLOOR(arg0: typing.SupportsFloat) -> Indicator:
8937
9213
  :param data: 输入数据
8938
9214
  :rtype: Indicator
8939
9215
  """
9216
+ def GROUP_COUNT(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
9217
+ """
9218
+ 分组累积计数
9219
+ """
9220
+ def GROUP_FUNC(ind: Indicator, group_func: typing.Any, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
9221
+ """
9222
+ GROUP_FUNC(ind, group_func[, ktype=Query.DAY, unit=1])
9223
+
9224
+ 自定义分组累积计算指标。虽然支持python自定义函数, 但python函数需要GIL, 速度较慢。建议最好直接使用 C++ 自定义分组累积函数。
9225
+
9226
+ 示例, 计算日线时聚合分钟线收盘价的和:
9227
+
9228
+ >>> kdata = get_kdata('sh600000', Query(Datetime(20250101), ktype=Query.DAY))
9229
+ >>> ind = GROUP_FUNC(CLOSE(), lambda dates, data: data/2.0)
9230
+ >>> ind(k)
9231
+
9232
+ :param Indicator ind: 待计算指标
9233
+ :param callable group_func: 自定义分组累积函数,输入参数为 arg1: datetime list, arg2: numpy array, 返回和输入等长的累积计算结果, 类型同样须为 np.array
9234
+ :param KQuery.KType ktype: 分组的K线周期
9235
+ :param int unit: 分组周期单位 (分组的K线周期单位, 使用日线计算分钟线, unit=2代表按2天累积计算的分钟线)
9236
+ :rtype: Indicator
9237
+ """
9238
+ def GROUP_MAX(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
9239
+ """
9240
+ 分组累积最大值
9241
+ """
9242
+ def GROUP_MEAN(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
9243
+ """
9244
+ 分组累积平均
9245
+ """
9246
+ def GROUP_MIN(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
9247
+ """
9248
+ 分组累积最小值
9249
+ """
9250
+ def GROUP_PROD(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
9251
+ """
9252
+ 分组累积乘积
9253
+ """
9254
+ def GROUP_SUM(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
9255
+ """
9256
+ 分组累积和
9257
+ """
8940
9258
  @typing.overload
8941
9259
  def HHV(n: typing.SupportsInt = 20) -> Indicator:
8942
9260
  ...
@@ -9691,13 +10009,13 @@ def MF_Weight() -> MultiFactorBase:
9691
10009
  @typing.overload
9692
10010
  def MF_Weight(inds: collections.abc.Sequence, stks: collections.abc.Sequence, weights: collections.abc.Sequence, query: Query, ref_stk: typing.Any = None, ic_n: typing.SupportsInt = 5, spearman: bool = True, mode: typing.SupportsInt = 0, save_all_factors: bool = False) -> MultiFactorBase:
9693
10011
  """
9694
- MF_EqualWeight(inds, stks, query, ref_stk[, ic_n=5])
10012
+ MF_Weight(inds, stks, weights, query, ref_stk[, ic_n=5, spearman=True, mode=0, save_all_factors=False])
9695
10013
 
9696
10014
  按指定权重合成因子 = ind1 * weight1 + ind2 * weight2 + ... + indn * weightn
9697
10015
 
9698
10016
  :param sequense(Indicator) inds: 原始因子列表
9699
- :param sequense(float) weights: 权重列表(需和 inds 等长)
9700
10017
  :param sequense(stock) stks: 计算证券列表
10018
+ :param sequense(float) weights: 权重列表(需和 inds 等长)
9701
10019
  :param Query query: 日期范围
9702
10020
  :param Stock ref_stk: 参考证券 (未指定时,默认为 sh000300 沪深300)
9703
10021
  :param int ic_n: 默认 IC 对应的 N 日收益率
@@ -9908,6 +10226,36 @@ def NDAY(x: Indicator, y: Indicator, n: IndParam) -> Indicator:
9908
10226
  :param int|Indicator|IndParam n: 时间窗口
9909
10227
  :rtype: Indicator
9910
10228
  """
10229
+ def NORM_MinMax() -> NormalizeBase:
10230
+ """
10231
+ 最小-最大标准化操作
10232
+ """
10233
+ def NORM_NOTHING() -> NormalizeBase:
10234
+ """
10235
+ 无截面标准化操作
10236
+ """
10237
+ def NORM_Quantile(quantile_min: typing.SupportsFloat = 0.01, quantile_max: typing.SupportsFloat = 0.99) -> NormalizeBase:
10238
+ """
10239
+ 分位数截面标准化操作
10240
+
10241
+ :param quantile_min: 最小分位数
10242
+ :param quantile_max: 最大分位数
10243
+ """
10244
+ def NORM_Quantile_Uniform(quantile_min: typing.SupportsFloat = 0.01, quantile_max: typing.SupportsFloat = 0.99) -> NormalizeBase:
10245
+ """
10246
+ 分位数截面均匀分布标准化操作
10247
+
10248
+ :param quantile_min: 最小分位数
10249
+ :param quantile_max: 最大分位数
10250
+ """
10251
+ def NORM_Zscore(out_extreme: bool = False, nsigma: typing.SupportsFloat = 3.0, recursive: bool = False) -> NormalizeBase:
10252
+ """
10253
+ Z-score 标准化操作
10254
+
10255
+ :param out_extreme: 是否剔除异常值
10256
+ :param nsigma: 异常值判断倍数±3.0
10257
+ :param recursive: 是否递归处理异常值
10258
+ """
9911
10259
  @typing.overload
9912
10260
  def NOT() -> Indicator:
9913
10261
  ...
@@ -9921,7 +10269,7 @@ def NOT(arg0: Indicator) -> Indicator:
9921
10269
  :param Indicator data: 输入数据
9922
10270
  :rtype: Indicator
9923
10271
  """
9924
- def PF_Simple(tm: TradeManager = None, se: SelectorBase = ..., af: AllocateFundsBase = ..., adjust_cycle: typing.SupportsInt = 1, adjust_mode: str = 'query', delay_to_trading_day: bool = True) -> Portfolio:
10272
+ def PF_Simple(tm: typing.Any = None, se: typing.Any = ..., af: typing.Any = ..., adjust_cycle: typing.SupportsInt = 1, adjust_mode: str = 'query', delay_to_trading_day: bool = True) -> Portfolio:
9925
10273
  """
9926
10274
  PF_Simple([tm, se, af, adjust_cycle=1, adjust_mode="query", delay_to_trading_day=True])
9927
10275
 
@@ -9944,7 +10292,7 @@ def PF_Simple(tm: TradeManager = None, se: SelectorBase = ..., af: AllocateFunds
9944
10292
  :param str adjust_mode: 调仓模式
9945
10293
  :param bool delay_to_trading_day: 如果当日不是交易日将会被顺延至当前周期内的第一个交易日
9946
10294
  """
9947
- def PF_WithoutAF(tm: TradeManager = None, se: SelectorBase = ..., adjust_cycle: typing.SupportsInt = 1, adjust_mode: str = 'query', delay_to_trading_day: bool = True, trade_on_close: bool = True, sys_use_self_tm: bool = False, sell_at_not_selected: bool = False) -> Portfolio:
10295
+ def PF_WithoutAF(tm: typing.Any = None, se: typing.Any = ..., adjust_cycle: typing.SupportsInt = 1, adjust_mode: str = 'query', delay_to_trading_day: bool = True, trade_on_close: bool = True, sys_use_self_tm: bool = False, sell_at_not_selected: bool = False) -> Portfolio:
9948
10296
  """
9949
10297
  PF_WithoutAF([tm, se, adjust_cycle=1, adjust_mode="query", delay_to_trading_day=True, trade_on_close=True, sys_use_self_tm=False,sell_at_not_selected=False])
9950
10298
 
@@ -10046,6 +10394,22 @@ def PRICELIST(data: typing.Any = None, discard: typing.SupportsInt = 0, align_da
10046
10394
  :rtype: Indicator
10047
10395
  """
10048
10396
  @typing.overload
10397
+ def QUANTILE_TRUNC(n: typing.SupportsInt = 60, quantial_min: typing.SupportsFloat = 0.01, quantial_max: typing.SupportsFloat = 0.99) -> Indicator:
10398
+ ...
10399
+ @typing.overload
10400
+ def QUANTILE_TRUNC(data: Indicator, n: typing.SupportsInt = 60, quantial_min: typing.SupportsFloat = 0.01, quantial_max: typing.SupportsFloat = 0.99) -> Indicator:
10401
+ """
10402
+ QUANTILE_TRUNC(data[, n=60, quantial_min=0.01, quantial_max=0.99])
10403
+
10404
+ 对数据进行分位数截断处理。非窗口滚动。
10405
+
10406
+ :param Indicator data: 待剔除异常值数据
10407
+ :param int n: 时间窗口
10408
+ :param float quantial_min: 剔除极值时使用的百分位数下限,默认 0.01
10409
+ :param float quantial_max: 剔除极值时使用的百分位数上限,默认 0.99
10410
+ :rtype: Indicator
10411
+ """
10412
+ @typing.overload
10049
10413
  def RANK(stks: collections.abc.Sequence, mode: typing.SupportsInt = 0, fill_null: bool = True, market: str = 'SH') -> Indicator:
10050
10414
  ...
10051
10415
  @typing.overload
@@ -10403,6 +10767,59 @@ def SAFTYLOSS(data: Indicator, n1: Indicator, n2: Indicator, p: Indicator) -> In
10403
10767
  :param float|Indicator|IndParam p: 噪音系数
10404
10768
  :rtype: Indicator
10405
10769
  """
10770
+ def SCFilter_AmountLimit(min_amount_percent_limit: typing.SupportsFloat = 0.1) -> ScoresFilterBase:
10771
+ """
10772
+ SCFilter_AmountLimit([min_amount_percent_limit: float = 0.1])
10773
+
10774
+ 过滤掉成交金额在评分列表末尾百分比范围内的截面
10775
+
10776
+ 注意:和传入的截面评分列表顺序相关,如果是降序,过滤的是成交金额较小的系统评分记录;反之,则是金额较大的系统评分记录
10777
+
10778
+ :param double min_amount_percent_limit: 最小金额百分比限制
10779
+ :return: 截面过滤器
10780
+ :rtype: ScoresFilterPtr
10781
+ """
10782
+ def SCFilter_Group(group: typing.SupportsInt = 10, group_index: typing.SupportsInt = 0) -> ScoresFilterBase:
10783
+ """
10784
+ SCFilter_Group([group: int=10, group_index: int=0])
10785
+
10786
+ 按截面进行分组过滤
10787
+ :param int group: 分组数量
10788
+ :param int group_index: 分组索引
10789
+ :return: 截面过滤器
10790
+ :rtype: ScoresFilterPtr
10791
+ """
10792
+ def SCFilter_IgnoreNan() -> ScoresFilterBase:
10793
+ """
10794
+ SCFilter_IgnoreNan() -> ScoresFilterPtr
10795
+
10796
+ 忽略截面中的NAN值
10797
+ """
10798
+ def SCFilter_LessOrEqualValue(value: typing.SupportsFloat = 0.0) -> ScoresFilterBase:
10799
+ """
10800
+ SCFilter_LessOrEqualValue([value = 0.0])
10801
+
10802
+ 过滤掉评分小于等于指定值的截面
10803
+ """
10804
+ def SCFilter_Price(min_price: typing.SupportsFloat = 10.0, max_price: typing.SupportsFloat = 100000.0) -> ScoresFilterBase:
10805
+ """
10806
+ SCFilter_Price([min_price = 10., max_price = 100000.])
10807
+
10808
+ 仅保留价格在 [min_price, max_price] 之间的标的
10809
+
10810
+ 注意:和传入的截面评分列表顺序相关,如果是降序,过滤的是价格较小的系统评分记录;反之,则是价格较大的系统评分记录
10811
+
10812
+ :param double min_price: 最小价格限制
10813
+ :param double max_price: 最大价格限制
10814
+ """
10815
+ def SCFilter_TopN(topn: typing.SupportsInt = 10) -> ScoresFilterBase:
10816
+ """
10817
+ SCFilter_TopN([topn: int=10])
10818
+
10819
+ 获取评分列表中的前 topn 个
10820
+
10821
+ :param int topn: 前 topn 个
10822
+ """
10406
10823
  def SE_EvaluateOptimal(arg0: typing.Any) -> SelectorBase:
10407
10824
  """
10408
10825
  SE_EvaluateOptimal(evalulate_func)
@@ -10453,6 +10870,27 @@ def SE_MultiFactor(inds: collections.abc.Sequence, topn: typing.SupportsInt = 10
10453
10870
  :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
10454
10871
  :param str mode: "MF_ICIRWeight" | "MF_ICWeight" | "MF_EqualWeight" 因子合成算法名称
10455
10872
  """
10873
+ @typing.overload
10874
+ def SE_MultiFactor2(mf: ..., filter: ScoresFilterBase = ...) -> SelectorBase:
10875
+ ...
10876
+ @typing.overload
10877
+ def SE_MultiFactor2(inds: collections.abc.Sequence, ic_n: typing.SupportsInt = 5, ic_rolling_n: typing.SupportsInt = 120, ref_stk: typing.Any = None, spearman: bool = True, mode: str = 'MF_ICIRWeight', filter: ScoresFilterBase = ...) -> SelectorBase:
10878
+ """
10879
+ SE_MultiFactor2([inds, ic_n, ic_rolling_n, ref_stk, spearman, mode, filter])
10880
+
10881
+ 创建基于多因子评分的选择器,两种创建方式
10882
+
10883
+ - 直接指定 MF:
10884
+ :param MultiFactorBase mf: 直接指定的多因子合成算法
10885
+
10886
+ - 参数直接创建:
10887
+ :param sequense(Indicator) inds: 原始因子列表
10888
+ :param int ic_n: 默认 IC 对应的 N 日收益率
10889
+ :param int ic_rolling_n: IC 滚动周期
10890
+ :param Stock ref_stk: 参考证券 (未指定时,默认为 sh000300 沪深300)
10891
+ :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
10892
+ :param str mode: "MF_ICIRWeight" | "MF_ICWeight" | "MF_EqualWeight" 因子合成算法名称
10893
+ """
10456
10894
  def SE_PerformanceOptimal(key: str = '帐户平均年收益率%', mode: typing.SupportsInt = 0) -> SelectorBase:
10457
10895
  """
10458
10896
  SE_PerformanceOptimal(key="帐户平均年收益率%", mode=0)
@@ -10863,6 +11301,48 @@ def SP_FixedValue(value: typing.SupportsFloat = 0.01) -> SlippageBase:
10863
11301
  :param float p: 偏移价格
10864
11302
  :return: 移滑价差算法实例
10865
11303
  """
11304
+ def SP_LogNormal(mean: typing.SupportsFloat = 0.0, stddev: typing.SupportsFloat = 0.05) -> SlippageBase:
11305
+ """
11306
+ SP_LogNormal([mean=0.0, stddev=0.05])
11307
+
11308
+ 对数正态分布随机价格移滑价差算法, 买入和卖出操作是价格在对数正态分布[mean, stddev]范围内的随机偏移
11309
+
11310
+ :param float mean: 对数正态分布的均值
11311
+ :param float stddev: 对数正态分布的标准差
11312
+ :return: 移滑价差算法实例
11313
+ """
11314
+ def SP_Normal(mean: typing.SupportsFloat = 0.0, stddev: typing.SupportsFloat = 0.05) -> SlippageBase:
11315
+ """
11316
+ SP_Normal([mean=0.0, stddev=0.05])
11317
+
11318
+ 正态分布随机价格移滑价差算法, 买入和卖出操作是价格在正态分布[mean, stddev]范围内的随机偏移
11319
+
11320
+ :param float mean: 正态分布的均值
11321
+ :param float stddev: 正态分布的标准差
11322
+ :return: 移滑价差算法实例
11323
+ """
11324
+ def SP_TruncNormal(mean: typing.SupportsFloat = 0.0, stddev: typing.SupportsFloat = 0.05, min_value: typing.SupportsFloat = -0.11, max_value: typing.SupportsFloat = 0.1) -> SlippageBase:
11325
+ """
11326
+ SP_TruncNormal([mean=0.0, stddev=0.05, min_value=-0.1, max_value=0.1])
11327
+
11328
+ 截断正态分布随机价格移滑价差算法, 买入和卖出操作是价格在截断正态分布[mean, stddev, min_value, max_value]范围内的随机偏移
11329
+
11330
+ :param float mean: 截断正态分布的均值
11331
+ :param float stddev: 截断正态分布的标准差
11332
+ :param float min_value: 最小截断值
11333
+ :param float max_value: 最大截断值
11334
+ :return: 移滑价差算法实例
11335
+ """
11336
+ def SP_Uniform(min_value: typing.SupportsFloat = -0.05, max_value: typing.SupportsFloat = 0.05) -> SlippageBase:
11337
+ """
11338
+ SP_Uniform([min_value=-0.05, max_value=0.05])
11339
+
11340
+ 均匀分布随机价格移滑价差算法, 买入和卖出操作是价格在[min_value, max_value]范围内的均匀分布随机偏移
11341
+
11342
+ :param float min_value: 最小偏移价格
11343
+ :param float max_value: 最大偏移价格
11344
+ :return: 移滑价差算法实例
11345
+ """
10866
11346
  @typing.overload
10867
11347
  def SQRT() -> Indicator:
10868
11348
  ...
@@ -13552,7 +14032,7 @@ def ZSCORE(data: Indicator, out_extreme: bool = False, nsigma: typing.SupportsFl
13552
14032
  """
13553
14033
  ZSCORE(data[, out_extreme, nsigma, recursive])
13554
14034
 
13555
- 对数据进行标准化(归一),可选进行极值排除
14035
+ 对数据进行标准化(归一),可选进行极值处理
13556
14036
 
13557
14037
  注:非窗口滚动,如需窗口滚动的标准化,直接 (x - MA(x, n)) / STDEV(x, n) 即可。
13558
14038
 
@@ -13606,8 +14086,21 @@ def batch_calculate_inds(arg0: collections.abc.Sequence, arg1: KData) -> list:
13606
14086
  :return: 指标计算结果列表
13607
14087
  :rtype: list
13608
14088
  """
14089
+ def bind_email(arg0: str, arg1: str) -> None:
14090
+ """
14091
+ bind_email(email: str, code: str)
14092
+
14093
+ 绑定邮箱和授权码
14094
+
14095
+ :param str email: 邮箱地址
14096
+ :param str code: 授权码
14097
+ """
13609
14098
  def can_upgrade() -> bool:
13610
14099
  ...
14100
+ def check_data(stock_list: collections.abc.Sequence, start_date: Datetime, end_date: Datetime, ktype: str) -> tuple:
14101
+ """
14102
+ 检查数据
14103
+ """
13611
14104
  def close_ostream_to_python() -> None:
13612
14105
  ...
13613
14106
  def close_spend_time() -> None:
@@ -13666,10 +14159,6 @@ def dates_to_np(arg0: DatetimeList) -> numpy.ndarray:
13666
14159
  """
13667
14160
  将 DatetimeList 转换为 NumPy 元组
13668
14161
  """
13669
- def dates_to_pa(arg0: DatetimeList) -> typing.Any:
13670
- """
13671
- 将日期列表转换为 pyarrow.Table 对象
13672
- """
13673
14162
  def df_to_krecords(df: typing.Any, columns: collections.abc.Sequence[str] = ['datetime', 'open', 'high', 'low', 'close', 'amount', 'volume']) -> KRecordList:
13674
14163
  """
13675
14164
  df_to_krecords(df: pd.DataFrame[, columns: dict]) -> KRecordList
@@ -13683,7 +14172,7 @@ def df_to_krecords(df: typing.Any, columns: collections.abc.Sequence[str] = ['da
13683
14172
  def fetch_trial_license(arg0: str) -> str:
13684
14173
  """
13685
14174
  fetch_trial_license(email: str)
13686
-
14175
+
13687
14176
  获取试用授权码
13688
14177
 
13689
14178
  :param str email: 邮箱地址
@@ -13731,38 +14220,23 @@ def get_date_range(start: Datetime, end: Datetime) -> DatetimeList:
13731
14220
  :param Datetime end: 结束日期
13732
14221
  :rtype: DatetimeList
13733
14222
  """
13734
- @typing.overload
13735
- def get_inds_view(stks: collections.abc.Sequence, inds: collections.abc.Sequence[Indicator], query: Query, market: str = 'SH') -> typing.Any:
13736
- ...
13737
- @typing.overload
13738
- def get_inds_view(stks: collections.abc.Sequence, inds: collections.abc.Sequence[Indicator], date: Datetime, cal_len: typing.SupportsInt = 100, ktype: str = 'DAY', market: str = 'SH') -> typing.Any:
14223
+ def get_expire_date() -> Datetime:
14224
+ """
14225
+ get_expire_date() -> Datetime
14226
+
14227
+ 查看授权到期时间
13739
14228
  """
13740
- get_inds_view(stks, inds, date[, cal_len=100, ktype=Query.DAY, market='SH']) -> pandas.DataFrame)
14229
+ def get_funds_list(arg0: collections.abc.Sequence[TradeManager], arg1: DatetimeList) -> list[list[FundsRecord]]:
14230
+ """
14231
+ get_funds_list(tm_list: list, ref_dates: DatetimeList) -> list[Funds])
13741
14232
 
13742
- 方式1: 获取指定日期的各证券的各指标结果
13743
-
13744
- :param stks: 证券列表
13745
- :param list[Indicator] inds: 指标列表
13746
- :param Datetime date: 指定日期
13747
- :param int cal_len: 计算需要的数据长度
13748
- :param str ktype: k线类型
13749
- :param str market: 指定行情市场(用于日期对齐)
13750
-
13751
- 方式2: 获取按指定Query查询计算的各证券的各指标结果, 结果中将包含指定 Query 包含的所有指定市场交易日日期
13752
- get_inds_view(stks, inds, query, market='SH'])
14233
+ 一次性从多个账户中获取多个指定时刻的账户资金信息
13753
14234
 
13754
- :param stks: 指定证券列表
13755
- :param list[Indicator] inds: 指定指标列表
13756
- :param Query query: 查询条件
13757
- :param str market: 指定行情市场(用于日期对齐)
14235
+ :param list tm_list: 账户列表
14236
+ :param DatetimeList ref_dates: 获取时刻列表
14237
+ :return: 账户资金列表
13758
14238
  """
13759
14239
  @typing.overload
13760
- def get_inds_view_pyarrow(stks: collections.abc.Sequence, inds: collections.abc.Sequence[Indicator], query: Query, market: str = 'SH') -> typing.Any:
13761
- ...
13762
- @typing.overload
13763
- def get_inds_view_pyarrow(stks: collections.abc.Sequence, inds: collections.abc.Sequence[Indicator], date: Datetime, cal_len: typing.SupportsInt = 100, ktype: str = 'DAY', market: str = 'SH') -> typing.Any:
13764
- ...
13765
- @typing.overload
13766
14240
  def get_kdata(arg0: str, arg1: Query) -> KData:
13767
14241
  ...
13768
14242
  @typing.overload
@@ -13787,29 +14261,12 @@ def get_kdata(market_code: str, start: Datetime = ..., end: Datetime = ..., ktyp
13787
14261
  :param Query.KType ktype: K 线类型, 'DAY'|'WEEK'|'MONTH'|'QUARTER'|'HALFYEAR'|'YEAR'|'MIN'|'MIN5'|'MIN15'|'MIN30'|'MIN60'
13788
14262
  :param Query.RecoverType recover_type: 复权类型
13789
14263
  """
13790
- def get_last_version() -> str:
14264
+ def get_latest_version_info() -> dict:
13791
14265
  ...
13792
14266
  def get_log_level() -> LOG_LEVEL:
13793
14267
  """
13794
14268
  获取当前日志级别
13795
14269
  """
13796
- def get_market_view(stks: collections.abc.Sequence, date: Datetime = ..., market: str = 'SH') -> typing.Any:
13797
- """
13798
- get_market_view(stks[, date=Datetime(), market='SH']) -> pandas.DataFrame
13799
-
13800
- 获取指定股票集合在指定交易日的行情数据,不包含当日停牌无数据的股票。如未指定日期,则返回最后交易日行情数据,
13801
- 如同时接收了行情数据,则为实时行情。
13802
-
13803
- 注: 此函数依赖于日线数据
13804
-
13805
- :param list[Stock] stks: 股票列表
13806
- :param Datetime date: 获取指定日期的行情数据
13807
- :param str market: 市场代码
13808
- :return: 指定股票列表最后行情数据
13809
- :rtype: pandas.DataFrame
13810
- """
13811
- def get_market_view_pyarrow(stks: collections.abc.Sequence, date: Datetime = ..., market: str = 'SH') -> typing.Any:
13812
- ...
13813
14270
  def get_spot_from_buffer_server(arg0: str, arg1: str, arg2: str, arg3: Datetime) -> list[SpotRecord]:
13814
14271
  """
13815
14272
  get_spot_from_buffer_server(addr: str, market: str, code: str, datetime: str)
@@ -13896,16 +14353,33 @@ def krecords_to_df(arg0: KRecordList) -> typing.Any:
13896
14353
  ...
13897
14354
  def krecords_to_np(arg0: KRecordList) -> numpy.ndarray:
13898
14355
  ...
13899
- def krecords_to_pa(arg0: KRecordList) -> typing.Any:
13900
- """
13901
- 将KRecordList转换为parraw.Table
13902
- """
13903
14356
  def open_ostream_to_python() -> None:
13904
14357
  ...
13905
14358
  def open_spend_time() -> None:
13906
14359
  """
13907
14360
  全局开启 c++ 部分耗时打印
13908
14361
  """
14362
+ def parallel_run_pf(pf_list: collections.abc.Sequence[...], query: Query, force: bool = False) -> list[list[...]]:
14363
+ """
14364
+ parallel_run_pf(pf_list, query[, force=False])
14365
+
14366
+ 并行执行多个投资组合策略, 并返回 list FundsList, 各账户对应资产(按query时间段)
14367
+
14368
+ :param list pf_list: 投资组合列表
14369
+ :param Query query: 查询条件
14370
+ :param bool force: 强制重新计算
14371
+ """
14372
+ def parallel_run_sys(sys_list: collections.abc.Sequence[...], query: Query, reset: bool = False, reset_all: bool = False) -> list[list[...]]:
14373
+ """
14374
+ parallel_run_sys(sys_list, query[, reset=False, reset_all=False])
14375
+
14376
+ 并行运行多个系系统, 并返回 list FundsList, 各账户对应资产(按query时间段)
14377
+
14378
+ :param sys_list: 系统列表
14379
+ :param query: 查询条件
14380
+ :param bool reset: 执行前是否依据系统部件共享属性复位
14381
+ :param bool reset_all: 强制复位所有部件
14382
+ """
13909
14383
  def positions_to_df(arg0: PositionRecordList) -> typing.Any:
13910
14384
  """
13911
14385
  positions_to_df(positions)
@@ -13924,10 +14398,6 @@ def positions_to_np(arg0: PositionRecordList) -> numpy.ndarray:
13924
14398
 
13925
14399
  注意: 其中的当前市值、利润、盈亏等计算值均以日线计算, 如使用日线一下级别回测时, 对未清仓的持仓记录需要自行重新计算!
13926
14400
  """
13927
- def positions_to_pa(arg0: PositionRecordList) -> typing.Any:
13928
- """
13929
- 将交易记录列表转换为 pyarrow.Table 对象
13930
- """
13931
14401
  @typing.overload
13932
14402
  def register_extra_ktype(ktype: str, basetype: str, minutes: typing.SupportsInt, get_phase_end: collections.abc.Callable[[Datetime], Datetime]) -> None:
13933
14403
  ...
@@ -13971,7 +14441,7 @@ def release_extra_ktype() -> None:
13971
14441
  def remove_license() -> None:
13972
14442
  """
13973
14443
  remove_license()
13974
-
14444
+
13975
14445
  移除当前授权
13976
14446
  """
13977
14447
  @typing.overload
@@ -14065,16 +14535,19 @@ def spot_agent_is_running() -> bool:
14065
14535
  """
14066
14536
  判断行情数据接收代理是否在运行
14067
14537
  """
14068
- def start_data_server(addr: str = 'tcp://0.0.0.0:9201', work_num: typing.SupportsInt = 2, save_tick: bool = False, buf_tick: bool = False) -> None:
14538
+ def start_data_server(addr: str = 'tcp://0.0.0.0:9201', work_num: typing.SupportsInt = 3, save_tick: bool = False, buf_tick: bool = False, parquet_path: str = '') -> None:
14069
14539
  """
14070
- start_data_server(addr: str[, work_num: int=2])
14540
+ start_data_server(addr: str[, work_num: int=3, save_tick: bool=False, buf_tick: bool=False, parquet_path: str=''])
14071
14541
 
14072
- 启动数据缓存服务
14073
-
14542
+ 启动数据缓存服务。其中save_tick 参数和 parquet_path 有关联:
14543
+ - 如果 save_tick=True, parquet_path 不为空时, 使用 parquet_path 保存数据;
14544
+ - 如果 save_tick=True, parquet_path 为空时, 则使用 clickhouse K线存储引擎保存数据(需配置使用 clickhouse K线存储引擎)
14545
+
14074
14546
  :param str addr: 服务器地址
14075
14547
  :param int work_num: 工作线程数
14076
- :param bool save_tick: 是否保存tick数据至数据库(仅支持使用 clickhouse K线存储引擎)
14548
+ :param bool save_tick: 是否保存tick数据至数据库(如果 parquet_path 不为空时, 使用 parquet 文件进行保存;否则,需使用 clickhouse K线存储引擎)
14077
14549
  :param bool buf_tick: 是否缓存tick数据
14550
+ :param str parquet_path: 保存tick数据至parquet文件路径, 仅在 save_tick=True 时有效
14078
14551
  :return: None
14079
14552
  """
14080
14553
  def start_spot_agent(print: bool = False, worker_num: typing.SupportsInt = 1, addr: str = '') -> None:
@@ -14109,10 +14582,6 @@ def timeline_to_np(arg0: TimeLineList) -> numpy.ndarray:
14109
14582
  """
14110
14583
  将分时线记录转换为NumPy元组
14111
14584
  """
14112
- def timeline_to_pa(arg0: TimeLineList) -> typing.Any:
14113
- """
14114
- 将分时线记录转换为 pyarrow.Table 对象
14115
- """
14116
14585
  def toPriceList(arg0: collections.abc.Sequence) -> list[float]:
14117
14586
  """
14118
14587
  将 python list/tuple/np.arry 对象转化为 PriceList 对象
@@ -14129,10 +14598,6 @@ def trades_to_df(arg0: TradeRecordList) -> typing.Any:
14129
14598
  """
14130
14599
  def trades_to_np(arg0: TradeRecordList) -> numpy.ndarray:
14131
14600
  ...
14132
- def trades_to_pa(arg0: TradeRecordList) -> typing.Any:
14133
- """
14134
- 将交易记录列表转换为 pyarrow.Table 对象
14135
- """
14136
14601
  def translist_to_df(arg0: TransList) -> typing.Any:
14137
14602
  """
14138
14603
  将分笔记录转换为 DataFrame
@@ -14141,10 +14606,6 @@ def translist_to_np(arg0: TransList) -> numpy.ndarray:
14141
14606
  """
14142
14607
  将分笔记录转换为NumPy元组
14143
14608
  """
14144
- def translist_to_pa(arg0: TransList) -> typing.Any:
14145
- """
14146
- 将分笔记录转换为 pyarrow.Table 对象
14147
- """
14148
14609
  def view_license() -> str:
14149
14610
  """
14150
14611
  view_license()
@@ -14155,10 +14616,6 @@ def weights_to_df(arg0: StockWeightList) -> typing.Any:
14155
14616
  ...
14156
14617
  def weights_to_np(arg0: StockWeightList) -> numpy.ndarray:
14157
14618
  ...
14158
- def weights_to_pa(arg0: StockWeightList) -> typing.Any:
14159
- """
14160
- 将权息记录列表转换为 pyarrow.Table 对象
14161
- """
14162
14619
  DEBUG: LOG_LEVEL # value = <LOG_LEVEL.DEBUG: 1>
14163
14620
  ERROR: LOG_LEVEL # value = <LOG_LEVEL.ERROR: 4>
14164
14621
  FATAL: LOG_LEVEL # value = <LOG_LEVEL.FATAL: 5>