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
@@ -377,8 +377,14 @@ def iplot(
377
377
  if not label:
378
378
  label = "%s %.2f" % (indicator.long_name, indicator[-1])
379
379
 
380
- py_indicatr = [None if x == constant.null_price else x for x in indicator]
381
- axes.plot(py_indicatr, linestyle=linestyle, label=label, *args, **kwargs)
380
+ #解决缺值时无法绘图的问题 by stone 20251217
381
+ #py_indicatr = [None if x == constant.null_price else x for x in indicator]
382
+ #axes.plot(py_indicatr, linestyle=linestyle, label=label, *args, **kwargs)
383
+
384
+ py_indicatr = np.array([None if x == constant.null_price else x for x in indicator])
385
+ py_x = np.arange(len(py_indicatr))
386
+ imask = np.isfinite(py_indicatr)
387
+ axes.plot(py_x[imask], py_indicatr[imask], linestyle=linestyle, label=label, *args, **kwargs)
382
388
 
383
389
  if legend_on:
384
390
  leg = axes.legend(loc='upper left')
@@ -866,7 +872,6 @@ def tm_performance(tm: TradeManager, query: Query, ref_stk: Stock = None):
866
872
  funds = VALUE(funds)
867
873
  funds_return = [f.total_assets / f.total_base if f.total_base != 0.0 else constant.null_price for f in funds_list]
868
874
  funds_return = VALUE(funds_return, align_dates=ref_dates)
869
- funds_return.name = "系统累积收益率"
870
875
  ref_return = ALIGN(ROCR(ref_k.close, 0), ref_dates)
871
876
  ref_return.name = f"{ref_stk.name}({ref_stk.market_code})"
872
877
 
@@ -897,8 +902,8 @@ def tm_performance(tm: TradeManager, query: Query, ref_stk: Stock = None):
897
902
  ax1 = fg.add_subplot(gs[:4, :3])
898
903
  ax2 = fg.add_subplot(gs[:, 3:])
899
904
  ax3 = fg.add_subplot(gs[4:, :3])
900
- ref_return.plot(axes=ax1, legend_on=True)
901
- funds_return.plot(axes=ax1, legend_on=True)
905
+ ref_return.plot(axes=ax1, legend_on=True, label=f'{ref_stk.name}({ref_stk.market_code}) 收益曲线')
906
+ funds_return.plot(axes=ax1, legend_on=True, label=f'{tm.name} 累积收益率 {funds_return[-1]*100.:<.2f}%')
902
907
  ax1.set_title(f"账户({tm.name}) 累积收益率")
903
908
  label = t1 + '\n\n' + t2 + '\n\n' + t3
904
909
  ax2.text(0,
@@ -923,6 +928,7 @@ def tm_performance(tm: TradeManager, query: Query, ref_stk: Stock = None):
923
928
  ax3.xaxis.set_visible(False)
924
929
  ax3.yaxis.set_visible(False)
925
930
  ax3.set_frame_on(False)
931
+ return ax1 # 返回主图axis
926
932
 
927
933
 
928
934
  def sys_performance(sys, ref_stk=None):
@@ -937,77 +943,7 @@ def sys_performance(sys, ref_stk=None):
937
943
  ref_stk = get_stock('sh000300')
938
944
 
939
945
  query = sys.query
940
- sh000001_k = get_kdata('sh000001', query)
941
- ref_dates = sh000001_k.get_datetime_list()
942
-
943
- ref_k = ref_stk.get_kdata(query)
944
-
945
- funds_list = sys.tm.get_funds_list(ref_dates)
946
- funds = [f.total_assets for f in funds_list]
947
- funds = VALUE(funds)
948
- funds_return = [f.total_assets / f.total_base if f.total_base != 0.0 else constant.null_price for f in funds_list]
949
- funds_return = VALUE(funds_return, align_dates=ref_dates)
950
- funds_return.name = "系统累积收益率"
951
- ref_return = ALIGN(ROCR(ref_k.close, 0), ref_dates)
952
- ref_return.name = f"{ref_stk.name}({ref_stk.market_code})"
953
-
954
- per = sys.tm.get_performance(sh000001_k[-1].datetime)
955
- text = per.report()
956
-
957
- # 计算最大回撤
958
- max_pullback = min(MDD(funds))
959
-
960
- # 计算 sharp
961
- bond = ZHBOND10(ref_dates)
962
- sigma = STDEV(ROCP(funds), len(ref_dates))
963
- sigma = 15.874507866387544 * sigma[-1] # 15.874 = sqrt(252)
964
- sharp = (per['帐户平均年收益率%'] - bond[-1]) * 0.01 / sigma if sigma != 0.0 else 0.0
965
-
966
- invest_total = per['累计投入本金'] + per['累计投入资产']
967
- cur_fund = per['当前总资产']
968
- t1 = '投入总资产: {:<.2f} 当前总资产: {:<.2f} 当前盈利: {:<.2f}'.format(
969
- invest_total, cur_fund, cur_fund - invest_total)
970
- t2 = '当前策略收益: {:<.2f}% 年化收益率: {:<.2f}% 最大回撤: {:<.2f}%'.format(
971
- funds_return[-1]*100 - 100, per["帐户平均年收益率%"], max_pullback)
972
- t3 = '系统胜率: {:<.2f}% 盈/亏比: 1 : {:<.2f} 夏普比率: {:<.2f}'.format(
973
- per['赢利交易比例%'], per['净赢利/亏损比例'], sharp)
974
-
975
- import matplotlib.pyplot as plt
976
- fg = plt.figure(figsize=(15, 10))
977
- gs = fg.add_gridspec(5, 4)
978
- ax1 = fg.add_subplot(gs[:4, :3])
979
- ax2 = fg.add_subplot(gs[:, 3:])
980
- ax3 = fg.add_subplot(gs[4:, :3])
981
- ref_return.plot(axes=ax1, legend_on=True)
982
- funds_return.plot(axes=ax1, legend_on=True)
983
- if isinstance(sys, System):
984
- stk = sys.get_stock()
985
- ax1.set_title(f"{sys.name} {stk.name}({stk.market_code}) 累积收益率")
986
- else:
987
- ax1.set_title(f"{sys.name} 累积收益率")
988
- label = t1 + '\n\n' + t2 + '\n\n' + t3
989
- ax2.text(0,
990
- 1,
991
- text,
992
- horizontalalignment='left',
993
- verticalalignment='top',
994
- transform=ax2.transAxes,
995
- # color='r'
996
- )
997
- ax3.text(0.02,
998
- 0.9,
999
- label,
1000
- horizontalalignment='left',
1001
- verticalalignment='top',
1002
- transform=ax3.transAxes,
1003
- # color='r'
1004
- )
1005
- ax2.xaxis.set_visible(False)
1006
- ax2.yaxis.set_visible(False)
1007
- ax2.set_frame_on(False)
1008
- ax3.xaxis.set_visible(False)
1009
- ax3.yaxis.set_visible(False)
1010
- ax3.set_frame_on(False)
946
+ return tm_performance(sys.tm, query, ref_stk)
1011
947
 
1012
948
 
1013
949
  def tm_heatmap(tm, start_date, end_date=None, axes=None):