hikyuu 2.7.0__py3-none-manylinux2014_aarch64.whl → 2.7.5__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 (295) hide show
  1. hikyuu/__init__.py +28 -8
  2. hikyuu/__init__.pyi +26 -14
  3. hikyuu/analysis/__init__.pyi +7 -1
  4. hikyuu/analysis/analysis.pyi +8 -2
  5. hikyuu/core.pyi +9 -3
  6. hikyuu/cpp/core310.pyi +172 -68
  7. hikyuu/cpp/core310.so +0 -0
  8. hikyuu/cpp/core311.pyi +172 -68
  9. hikyuu/cpp/core311.so +0 -0
  10. hikyuu/cpp/core312.pyi +172 -68
  11. hikyuu/cpp/core312.so +0 -0
  12. hikyuu/cpp/core313.pyi +172 -68
  13. hikyuu/cpp/core313.so +0 -0
  14. hikyuu/cpp/i18n/zh_CN/hikyuu.mo +0 -0
  15. hikyuu/cpp/i18n/zh_CN/hikyuu_plugin.mo +0 -0
  16. hikyuu/cpp/libboost_atomic.so +0 -0
  17. hikyuu/cpp/libboost_atomic.so.1.90.0 +0 -0
  18. hikyuu/cpp/{libboost_charconv-mt.so → libboost_charconv.so} +0 -0
  19. hikyuu/cpp/{libboost_charconv-mt.so.1.88.0 → libboost_charconv.so.1.90.0} +0 -0
  20. hikyuu/cpp/libboost_chrono.so +0 -0
  21. hikyuu/cpp/libboost_chrono.so.1.90.0 +0 -0
  22. hikyuu/cpp/libboost_container.so +0 -0
  23. hikyuu/cpp/libboost_container.so.1.90.0 +0 -0
  24. hikyuu/cpp/libboost_date_time.so +0 -0
  25. hikyuu/cpp/libboost_date_time.so.1.90.0 +0 -0
  26. hikyuu/cpp/libboost_locale.so +0 -0
  27. hikyuu/cpp/libboost_locale.so.1.90.0 +0 -0
  28. hikyuu/cpp/libboost_random.so +0 -0
  29. hikyuu/cpp/libboost_random.so.1.90.0 +0 -0
  30. hikyuu/cpp/libboost_serialization.so +0 -0
  31. hikyuu/cpp/libboost_serialization.so.1.90.0 +0 -0
  32. hikyuu/cpp/libboost_thread.so +0 -0
  33. hikyuu/cpp/libboost_thread.so.1.90.0 +0 -0
  34. hikyuu/cpp/libboost_wserialization.so +0 -0
  35. hikyuu/cpp/libboost_wserialization.so.1.90.0 +0 -0
  36. hikyuu/cpp/libhikyuu.so +0 -0
  37. hikyuu/cpp/libmimalloc.so +0 -0
  38. hikyuu/cpp/libmimalloc.so.3 +0 -0
  39. hikyuu/cpp/libmimalloc.so.3.1 +0 -0
  40. hikyuu/cpp/libsqlite3.so +0 -0
  41. hikyuu/data/clickhouse_upgrade/0001.sql +2 -0
  42. hikyuu/data/clickhouse_upgrade/0002.sql +9 -0
  43. hikyuu/data/common_clickhouse.py +1 -3
  44. hikyuu/data/common_mysql.py +1 -1
  45. hikyuu/data/download_block.py +1 -1
  46. hikyuu/data/em_block_to_mysql.py +16 -4
  47. hikyuu/data/em_block_to_sqlite.py +16 -4
  48. hikyuu/data/hku_config_template.py +31 -4
  49. hikyuu/data/mysql_upgrade/0029.sql +2 -0
  50. hikyuu/data/mysql_upgrade/0030.sql +3 -0
  51. hikyuu/data/pytdx_to_clickhouse.py +86 -32
  52. hikyuu/data/pytdx_to_h5.py +73 -28
  53. hikyuu/data/pytdx_to_mysql.py +65 -21
  54. hikyuu/data/pytdx_weight_to_clickhouse.py +2 -0
  55. hikyuu/data/pytdx_weight_to_mysql.py +2 -0
  56. hikyuu/data/pytdx_weight_to_sqlite.py +2 -0
  57. hikyuu/data/sqlite_upgrade/0029.sql +4 -0
  58. hikyuu/data/sqlite_upgrade/0030.sql +5 -0
  59. hikyuu/data/tdx_to_clickhouse.py +2 -2
  60. hikyuu/data/tdx_to_h5.py +11 -11
  61. hikyuu/data/tdx_to_mysql.py +2 -2
  62. hikyuu/draw/__init__.pyi +1 -1
  63. hikyuu/draw/drawplot/__init__.pyi +1 -1
  64. hikyuu/draw/drawplot/bokeh_draw.pyi +17 -9
  65. hikyuu/draw/drawplot/echarts_draw.pyi +17 -9
  66. hikyuu/draw/drawplot/matplotlib_draw.py +23 -9
  67. hikyuu/draw/drawplot/matplotlib_draw.pyi +17 -9
  68. hikyuu/examples/notebook/001-overview.ipynb +112 -78
  69. hikyuu/examples/notebook/004-IndicatorOverview.ipynb +52 -65
  70. hikyuu/examples/notebook/006-TradeManager.ipynb +402 -291
  71. hikyuu/examples/notebook/008-Pickle.ipynb +25 -17
  72. hikyuu/examples/notebook/009-RealData.ipynb +36 -38
  73. hikyuu/examples/notebook/Demo/Demo2.ipynb +146 -116
  74. hikyuu/extend.pyi +10 -4
  75. hikyuu/gui/HikyuuTDX.py +42 -3
  76. hikyuu/gui/data/MainWindow.py +189 -129
  77. hikyuu/gui/data/UseTdxImportToH5Thread.py +4 -2
  78. hikyuu/gui/start_qmt.py +1 -1
  79. hikyuu/hub.pyi +6 -6
  80. hikyuu/include/hikyuu/Block.h +9 -9
  81. hikyuu/include/hikyuu/HistoryFinanceInfo.h +3 -3
  82. hikyuu/include/hikyuu/KData.h +51 -28
  83. hikyuu/include/hikyuu/KDataImp.h +12 -7
  84. hikyuu/include/hikyuu/KDataPrivatedBufferImp.h +13 -7
  85. hikyuu/include/hikyuu/KDataSharedBufferImp.h +8 -6
  86. hikyuu/include/hikyuu/KQuery.h +11 -11
  87. hikyuu/include/hikyuu/KRecord.h +1 -1
  88. hikyuu/include/hikyuu/MarketInfo.h +10 -10
  89. hikyuu/include/hikyuu/Stock.h +30 -30
  90. hikyuu/include/hikyuu/StockManager.h +28 -12
  91. hikyuu/include/hikyuu/StockTypeInfo.h +9 -9
  92. hikyuu/include/hikyuu/StockWeight.h +9 -9
  93. hikyuu/include/hikyuu/StrategyContext.h +4 -4
  94. hikyuu/include/hikyuu/TimeLineRecord.h +1 -1
  95. hikyuu/include/hikyuu/TransRecord.h +1 -1
  96. hikyuu/include/hikyuu/data_driver/BaseInfoDriver.h +2 -1
  97. hikyuu/include/hikyuu/data_driver/BlockInfoDriver.h +6 -0
  98. hikyuu/include/hikyuu/data_driver/KDataDriver.h +6 -7
  99. hikyuu/include/hikyuu/data_driver/kdata/mysql/MySQLKDataDriver.h +5 -1
  100. hikyuu/include/hikyuu/data_driver/kdata/sqlite/SQLiteKDataDriver.h +1 -1
  101. hikyuu/include/hikyuu/global/sysinfo.h +24 -5
  102. hikyuu/include/hikyuu/indicator/IndParam.h +1 -1
  103. hikyuu/include/hikyuu/indicator/Indicator.h +56 -27
  104. hikyuu/include/hikyuu/indicator/Indicator2InImp.h +0 -4
  105. hikyuu/include/hikyuu/indicator/IndicatorImp.h +147 -74
  106. hikyuu/include/hikyuu/indicator/crt/CONTEXT.h +11 -1
  107. hikyuu/include/hikyuu/indicator/crt/IC.h +19 -14
  108. hikyuu/include/hikyuu/indicator/crt/ICIR.h +4 -7
  109. hikyuu/include/hikyuu/indicator/imp/IAbs.h +1 -0
  110. hikyuu/include/hikyuu/indicator/imp/IAcos.h +1 -0
  111. hikyuu/include/hikyuu/indicator/imp/IAd.h +0 -2
  112. hikyuu/include/hikyuu/indicator/imp/IAdvance.h +3 -0
  113. hikyuu/include/hikyuu/indicator/imp/IAma.h +3 -0
  114. hikyuu/include/hikyuu/indicator/imp/IAsin.h +1 -0
  115. hikyuu/include/hikyuu/indicator/imp/IAtan.h +1 -0
  116. hikyuu/include/hikyuu/indicator/imp/IAtr.h +2 -3
  117. hikyuu/include/hikyuu/indicator/imp/IBackset.h +2 -4
  118. hikyuu/include/hikyuu/indicator/imp/IBlockSetNum.h +3 -0
  119. hikyuu/include/hikyuu/indicator/imp/ICeil.h +1 -0
  120. hikyuu/include/hikyuu/indicator/imp/IContext.h +0 -3
  121. hikyuu/include/hikyuu/indicator/imp/ICorr.h +3 -0
  122. hikyuu/include/hikyuu/indicator/imp/ICos.h +1 -0
  123. hikyuu/include/hikyuu/indicator/imp/ICost.h +0 -2
  124. hikyuu/include/hikyuu/indicator/imp/ICount.h +2 -1
  125. hikyuu/include/hikyuu/indicator/imp/ICval.h +1 -4
  126. hikyuu/include/hikyuu/indicator/imp/ICycle.h +0 -2
  127. hikyuu/include/hikyuu/indicator/imp/IDecline.h +3 -0
  128. hikyuu/include/hikyuu/indicator/imp/IDevsq.h +4 -1
  129. hikyuu/include/hikyuu/indicator/imp/IDiff.h +1 -0
  130. hikyuu/include/hikyuu/indicator/imp/IDma.h +2 -0
  131. hikyuu/include/hikyuu/indicator/imp/IDropna.h +0 -4
  132. hikyuu/include/hikyuu/indicator/imp/IEma.h +3 -1
  133. hikyuu/include/hikyuu/indicator/imp/IEvery.h +5 -1
  134. hikyuu/include/hikyuu/indicator/imp/IExist.h +5 -1
  135. hikyuu/include/hikyuu/indicator/imp/IExp.h +1 -0
  136. hikyuu/include/hikyuu/indicator/imp/IFilter.h +4 -5
  137. hikyuu/include/hikyuu/indicator/imp/IFinance.h +1 -2
  138. hikyuu/include/hikyuu/indicator/imp/IFloor.h +1 -0
  139. hikyuu/include/hikyuu/indicator/imp/IHhvbars.h +5 -1
  140. hikyuu/include/hikyuu/indicator/imp/IHighLine.h +5 -1
  141. hikyuu/include/hikyuu/indicator/imp/IHsl.h +0 -2
  142. hikyuu/include/hikyuu/indicator/imp/IIc.h +3 -6
  143. hikyuu/include/hikyuu/indicator/imp/IInBlock.h +1 -2
  144. hikyuu/include/hikyuu/indicator/imp/IIntpart.h +1 -0
  145. hikyuu/include/hikyuu/indicator/imp/IIsInf.h +1 -0
  146. hikyuu/include/hikyuu/indicator/imp/IIsInfa.h +1 -0
  147. hikyuu/include/hikyuu/indicator/imp/IIsLastBar.h +0 -1
  148. hikyuu/include/hikyuu/indicator/imp/IIsNa.h +1 -0
  149. hikyuu/include/hikyuu/indicator/imp/IJumpDown.h +1 -0
  150. hikyuu/include/hikyuu/indicator/imp/IJumpUp.h +1 -0
  151. hikyuu/include/hikyuu/indicator/imp/IKData.h +1 -2
  152. hikyuu/include/hikyuu/indicator/imp/ILiuTongPan.h +0 -2
  153. hikyuu/include/hikyuu/indicator/imp/ILn.h +1 -0
  154. hikyuu/include/hikyuu/indicator/imp/ILog.h +1 -0
  155. hikyuu/include/hikyuu/indicator/imp/ILowLine.h +5 -1
  156. hikyuu/include/hikyuu/indicator/imp/ILowLineBars.h +5 -1
  157. hikyuu/include/hikyuu/indicator/imp/IMa.h +6 -1
  158. hikyuu/include/hikyuu/indicator/imp/IMacd.h +2 -0
  159. hikyuu/include/hikyuu/indicator/imp/INot.h +1 -0
  160. hikyuu/include/hikyuu/indicator/imp/IPow.h +3 -1
  161. hikyuu/include/hikyuu/indicator/imp/IQuantileTrunc.h +1 -0
  162. hikyuu/include/hikyuu/indicator/imp/IRecover.h +3 -0
  163. hikyuu/include/hikyuu/indicator/imp/IRef.h +3 -1
  164. hikyuu/include/hikyuu/indicator/imp/IResult.h +1 -0
  165. hikyuu/include/hikyuu/indicator/imp/IReverse.h +1 -0
  166. hikyuu/include/hikyuu/indicator/imp/IRoc.h +6 -1
  167. hikyuu/include/hikyuu/indicator/imp/IRocp.h +5 -1
  168. hikyuu/include/hikyuu/indicator/imp/IRocr.h +5 -1
  169. hikyuu/include/hikyuu/indicator/imp/IRocr100.h +5 -1
  170. hikyuu/include/hikyuu/indicator/imp/IRound.h +1 -0
  171. hikyuu/include/hikyuu/indicator/imp/IRoundDown.h +1 -0
  172. hikyuu/include/hikyuu/indicator/imp/IRoundUp.h +1 -0
  173. hikyuu/include/hikyuu/indicator/imp/ISaftyLoss.h +1 -0
  174. hikyuu/include/hikyuu/indicator/imp/ISign.h +1 -0
  175. hikyuu/include/hikyuu/indicator/imp/ISin.h +1 -0
  176. hikyuu/include/hikyuu/indicator/imp/ISlope.h +5 -1
  177. hikyuu/include/hikyuu/indicator/imp/ISma.h +2 -0
  178. hikyuu/include/hikyuu/indicator/imp/ISpearman.h +3 -0
  179. hikyuu/include/hikyuu/indicator/imp/ISqrt.h +1 -0
  180. hikyuu/include/hikyuu/indicator/imp/IStdev.h +5 -1
  181. hikyuu/include/hikyuu/indicator/imp/IStdp.h +5 -1
  182. hikyuu/include/hikyuu/indicator/imp/ISum.h +6 -1
  183. hikyuu/include/hikyuu/indicator/imp/ITan.h +1 -0
  184. hikyuu/include/hikyuu/indicator/imp/ITime.h +1 -2
  185. hikyuu/include/hikyuu/indicator/imp/ITimeLine.h +0 -2
  186. hikyuu/include/hikyuu/indicator/imp/ITr.h +1 -2
  187. hikyuu/include/hikyuu/indicator/imp/IVar.h +5 -1
  188. hikyuu/include/hikyuu/indicator/imp/IVarp.h +5 -1
  189. hikyuu/include/hikyuu/indicator/imp/IVigor.h +0 -2
  190. hikyuu/include/hikyuu/indicator/imp/IWma.h +5 -1
  191. hikyuu/include/hikyuu/indicator/imp/IZongGuBen.h +1 -2
  192. hikyuu/include/hikyuu/indicator_talib/imp/TaAdosc.h +0 -2
  193. hikyuu/include/hikyuu/indicator_talib/imp/TaSar.h +0 -2
  194. hikyuu/include/hikyuu/indicator_talib/imp/TaSarext.h +0 -4
  195. hikyuu/include/hikyuu/indicator_talib/imp/TaStoch.h +0 -3
  196. hikyuu/include/hikyuu/indicator_talib/imp/TaStochf.h +0 -2
  197. hikyuu/include/hikyuu/indicator_talib/imp/TaUltosc.h +0 -2
  198. hikyuu/include/hikyuu/indicator_talib/imp/ta_defines.h +2 -4
  199. hikyuu/include/hikyuu/indicator_talib/imp/ta_imp.h +70 -90
  200. hikyuu/include/hikyuu/plugin/KDataToClickHouseImporter.h +40 -0
  201. hikyuu/include/hikyuu/plugin/KDataToMySQLImporter.h +40 -0
  202. hikyuu/include/hikyuu/plugin/checkdata.h +20 -0
  203. hikyuu/include/hikyuu/plugin/extind.h +3 -0
  204. hikyuu/include/hikyuu/plugin/hkuextra.h +4 -0
  205. hikyuu/include/hikyuu/plugin/interface/CheckDataPluginInterface.h +25 -0
  206. hikyuu/include/hikyuu/plugin/interface/HkuExtraPluginInterface.h +4 -0
  207. hikyuu/include/hikyuu/plugin/interface/ImportKDataToClickHousePluginInterface.h +44 -0
  208. hikyuu/include/hikyuu/plugin/interface/ImportKDataToMySQLPluginInterface.h +42 -0
  209. hikyuu/include/hikyuu/plugin/interface/plugins.h +6 -0
  210. hikyuu/include/hikyuu/python/convert_any.h +9 -6
  211. hikyuu/include/hikyuu/python/pybind_utils.h +22 -5
  212. hikyuu/include/hikyuu/strategy/Strategy.h +1 -1
  213. hikyuu/include/hikyuu/trade_manage/TradeCostBase.h +5 -3
  214. hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +9 -3
  215. hikyuu/include/hikyuu/trade_manage/TradeRecord.h +2 -1
  216. hikyuu/include/hikyuu/trade_sys/allocatefunds/AllocateFundsBase.h +8 -4
  217. hikyuu/include/hikyuu/trade_sys/allocatefunds/build_in.h +1 -0
  218. hikyuu/include/hikyuu/trade_sys/allocatefunds/crt/AF_FixedAmount.h +26 -0
  219. hikyuu/include/hikyuu/trade_sys/allocatefunds/imp/FixAmountFunds.h +18 -0
  220. hikyuu/include/hikyuu/trade_sys/condition/ConditionBase.h +5 -3
  221. hikyuu/include/hikyuu/trade_sys/environment/EnvironmentBase.h +6 -3
  222. hikyuu/include/hikyuu/trade_sys/moneymanager/MoneyManagerBase.h +5 -3
  223. hikyuu/include/hikyuu/trade_sys/multifactor/MultiFactorBase.h +23 -20
  224. hikyuu/include/hikyuu/trade_sys/multifactor/NormalizeBase.h +6 -4
  225. hikyuu/include/hikyuu/trade_sys/multifactor/ScoresFilterBase.h +5 -3
  226. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_EqualWeight.h +3 -3
  227. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_ICIRWeight.h +4 -4
  228. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_ICWeight.h +4 -4
  229. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_Weight.h +4 -4
  230. hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +16 -13
  231. hikyuu/include/hikyuu/trade_sys/profitgoal/ProfitGoalBase.h +13 -13
  232. hikyuu/include/hikyuu/trade_sys/selector/SelectorBase.h +12 -3
  233. hikyuu/include/hikyuu/trade_sys/selector/crt/SE_MultiFactor.h +1 -1
  234. hikyuu/include/hikyuu/trade_sys/selector/crt/SE_MultiFactor2.h +1 -1
  235. hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector.h +1 -0
  236. hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector2.h +1 -0
  237. hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/OptimalSelectorBase.h +0 -2
  238. hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/PerformanceOptimalSelector.h +0 -4
  239. hikyuu/include/hikyuu/trade_sys/signal/SignalBase.h +5 -3
  240. hikyuu/include/hikyuu/trade_sys/slippage/SlippageBase.h +5 -3
  241. hikyuu/include/hikyuu/trade_sys/stoploss/StoplossBase.h +5 -3
  242. hikyuu/include/hikyuu/trade_sys/system/System.h +6 -4
  243. hikyuu/include/hikyuu/utilities/Log.h +6 -7
  244. hikyuu/include/hikyuu/utilities/LruCache.h +299 -0
  245. hikyuu/include/hikyuu/utilities/Parameter.h +17 -0
  246. hikyuu/include/hikyuu/utilities/arithmetic.h +2 -2
  247. hikyuu/include/hikyuu/utilities/config.h +28 -0
  248. hikyuu/include/hikyuu/utilities/omp_macro.h +25 -0
  249. hikyuu/include/hikyuu/utilities/plugin/PluginBase.h +17 -2
  250. hikyuu/include/hikyuu/utilities/plugin/PluginManager.h +46 -22
  251. hikyuu/include/hikyuu/utilities/thread/GlobalStealThreadPool.h +71 -19
  252. hikyuu/include/hikyuu/utilities/thread/GlobalThreadPool.h +1 -5
  253. hikyuu/include/hikyuu/utilities/thread/MQStealThreadPool.h +286 -0
  254. hikyuu/include/hikyuu/utilities/thread/MQThreadPool.h +1 -0
  255. hikyuu/include/hikyuu/utilities/thread/StealThreadPool.h +297 -0
  256. hikyuu/include/hikyuu/utilities/thread/ThreadPool.h +1 -4
  257. hikyuu/include/hikyuu/utilities/thread/WorkStealQueue.h +9 -8
  258. hikyuu/include/hikyuu/utilities/thread/algorithm.h +350 -14
  259. hikyuu/include/hikyuu/version.h +4 -4
  260. hikyuu/plugin/libbacktest.so +0 -0
  261. hikyuu/plugin/libcheckdata.so +0 -0
  262. hikyuu/plugin/libclickhousedriver.so +0 -0
  263. hikyuu/plugin/libdataserver.so +0 -0
  264. hikyuu/plugin/libdataserver_parquet.so +0 -0
  265. hikyuu/plugin/libdevice.so +0 -0
  266. hikyuu/plugin/libextind.so +0 -0
  267. hikyuu/plugin/libhkuextra.so +0 -0
  268. hikyuu/plugin/libimport2ch.so +0 -0
  269. hikyuu/plugin/libimport2hdf5.so +0 -0
  270. hikyuu/plugin/libimport2mysql.so +0 -0
  271. hikyuu/plugin/libtmreport.so +0 -0
  272. hikyuu/test/Indicator.py +1 -2
  273. hikyuu/trade_manage/__init__.pyi +14 -8
  274. hikyuu/trade_manage/trade.pyi +14 -8
  275. hikyuu/trade_sys/trade_sys.py +54 -5
  276. hikyuu/util/__init__.pyi +2 -2
  277. hikyuu/util/singleton.pyi +1 -1
  278. {hikyuu-2.7.0.dist-info → hikyuu-2.7.5.dist-info}/METADATA +10 -4
  279. {hikyuu-2.7.0.dist-info → hikyuu-2.7.5.dist-info}/RECORD +282 -252
  280. hikyuu/cpp/libboost_chrono-mt.so +0 -0
  281. hikyuu/cpp/libboost_chrono-mt.so.1.88.0 +0 -0
  282. hikyuu/cpp/libboost_date_time-mt.so +0 -0
  283. hikyuu/cpp/libboost_date_time-mt.so.1.88.0 +0 -0
  284. hikyuu/cpp/libboost_serialization-mt.so +0 -0
  285. hikyuu/cpp/libboost_serialization-mt.so.1.88.0 +0 -0
  286. hikyuu/cpp/libboost_system-mt.so +0 -0
  287. hikyuu/cpp/libboost_system-mt.so.1.88.0 +0 -0
  288. hikyuu/cpp/libboost_thread-mt.so +0 -0
  289. hikyuu/cpp/libboost_thread-mt.so.1.88.0 +0 -0
  290. hikyuu/cpp/libboost_wserialization-mt.so +0 -0
  291. hikyuu/cpp/libboost_wserialization-mt.so.1.88.0 +0 -0
  292. hikyuu/data/pytdx_to_taos.py +0 -736
  293. {hikyuu-2.7.0.dist-info → hikyuu-2.7.5.dist-info}/WHEEL +0 -0
  294. {hikyuu-2.7.0.dist-info → hikyuu-2.7.5.dist-info}/entry_points.txt +0 -0
  295. {hikyuu-2.7.0.dist-info → hikyuu-2.7.5.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,299 @@
1
+ /*
2
+ * Copyright (c) 2026 hikyuu.org
3
+ *
4
+ * Created on: 2026-01-18
5
+ * Author: fasiondog
6
+ */
7
+
8
+ #pragma once
9
+ #include <unordered_map>
10
+ #include <list>
11
+ #include <mutex>
12
+ #include <shared_mutex>
13
+ #include <atomic>
14
+ #include <optional>
15
+
16
+ namespace hku {
17
+
18
+ class NullLock {
19
+ public:
20
+ void lock() noexcept {}
21
+ void unlock() noexcept {}
22
+ bool try_lock() noexcept {
23
+ return true;
24
+ }
25
+ void lock_shared() noexcept {}
26
+ void unlock_shared() noexcept {}
27
+ bool try_lock_shared() noexcept {
28
+ return true;
29
+ }
30
+ };
31
+
32
+ /**
33
+ * @brief LRU (Least Recently Used)
34
+ * 缓存实现(非严格意义LRU以便提升并发读取性能)
35
+ * @tparam KeyType 键的类型,必须支持哈希和相等比较
36
+ * @tparam ValueType 值的类型,必须支持拷贝和移动操作
37
+ */
38
+ template <typename KeyType, typename ValueType, class Lock = NullLock>
39
+ class LruCache final {
40
+ public:
41
+ using key_type = KeyType;
42
+ using value_type = ValueType;
43
+ using size_type = size_t;
44
+ typedef Lock lock_type;
45
+ using UniqueGuard = std::unique_lock<lock_type>;
46
+ using SharedGuard = std::shared_lock<lock_type>;
47
+
48
+ // 存储结构:值 + 原子脏标记(标记是否被get访问过,需要更新LRU顺序)
49
+ using CacheValue = std::pair<value_type, std::atomic<bool>>;
50
+ using LruList = std::list<key_type>;
51
+ using CacheMap =
52
+ std::unordered_map<key_type, std::pair<typename LruList::iterator, CacheValue>>;
53
+
54
+ /**
55
+ * @brief 构造函数
56
+ * @param capacity 缓存容量,默认为64,0表示无限制容量
57
+ * @param overflow 溢出容量,默认为8,允许缓存临时超出设定容量
58
+ * 仅当缓存大小 >= 容量+溢出容量时才触发淘汰机制
59
+ */
60
+ explicit LruCache(size_type capacity = 64, size_type overflow = 8)
61
+ : m_capacity(capacity), m_overflow(overflow) {}
62
+
63
+ ~LruCache() {
64
+ UniqueGuard lock(m_mutex);
65
+ m_cache.clear();
66
+ m_lru_list.clear();
67
+ }
68
+
69
+ /**
70
+ * @brief 插入键值对
71
+ * @param key 键
72
+ * @param value 值
73
+ */
74
+ void insert(const key_type& key, const value_type& value) {
75
+ UniqueGuard lock(m_mutex);
76
+ _batch_update_dirty_nodes();
77
+ auto it = m_cache.find(key);
78
+ if (it != m_cache.end()) {
79
+ it->second.second.first = value;
80
+ it->second.second.second.store(false, std::memory_order_relaxed);
81
+ m_lru_list.splice(m_lru_list.begin(), m_lru_list, it->second.first);
82
+ } else {
83
+ m_lru_list.emplace_front(key);
84
+ m_cache.emplace(key, std::make_pair(m_lru_list.begin(),
85
+ std::make_pair(value, false) // 初始脏标记为false
86
+ ));
87
+ _prune_if_needed();
88
+ }
89
+ }
90
+
91
+ /**
92
+ * @brief 插入键值对(移动版本)
93
+ * @param key 键
94
+ * @param value 值(右值引用)
95
+ */
96
+ void insert(const key_type& key, value_type&& value) {
97
+ UniqueGuard lock(m_mutex);
98
+ _batch_update_dirty_nodes();
99
+ auto it = m_cache.find(key);
100
+ if (it != m_cache.end()) {
101
+ it->second.second.first = std::move(value);
102
+ it->second.second.second.store(false, std::memory_order_relaxed);
103
+ m_lru_list.splice(m_lru_list.begin(), m_lru_list, it->second.first);
104
+ } else {
105
+ m_lru_list.emplace_front(key);
106
+ m_cache.emplace(
107
+ key, std::make_pair(m_lru_list.begin(), std::make_pair(std::move(value), false)));
108
+ _prune_if_needed();
109
+ }
110
+ }
111
+
112
+ /**
113
+ * @brief 获取键对应的值
114
+ * @param key 键
115
+ * @return 存在则返回值,否则返回ValueType的默认构造值
116
+ */
117
+ value_type get(const key_type& key) {
118
+ SharedGuard lock(m_mutex);
119
+ auto it = m_cache.find(key);
120
+ if (it != m_cache.end()) {
121
+ it->second.second.second.store(true, std::memory_order_relaxed);
122
+ return it->second.second.first;
123
+ }
124
+ return value_type{};
125
+ }
126
+
127
+ /**
128
+ * @brief 尝试获取键对应的值
129
+ * @param key 键
130
+ * @param value 用于接收值的引用参数
131
+ * @return 如果键存在返回true,否则返回false
132
+ */
133
+ bool tryGet(const key_type& key, value_type& value) {
134
+ SharedGuard lock(m_mutex);
135
+ auto it = m_cache.find(key);
136
+ if (it != m_cache.end()) {
137
+ it->second.second.second.store(true, std::memory_order_relaxed);
138
+ value = it->second.second.first;
139
+ return true;
140
+ }
141
+ return false;
142
+ }
143
+
144
+ /**
145
+ * @brief 检查是否包含指定键
146
+ * @param key 键
147
+ * @return 存在返回true,否则返回false
148
+ */
149
+ bool contains(const key_type& key) {
150
+ SharedGuard lock(m_mutex);
151
+ return m_cache.find(key) != m_cache.end();
152
+ }
153
+
154
+ /**
155
+ * @brief 删除指定键
156
+ * @param key 要删除的键
157
+ * @return 成功删除返回true,不存在返回false
158
+ */
159
+ bool remove(const key_type& key) {
160
+ UniqueGuard lock(m_mutex);
161
+ auto it = m_cache.find(key);
162
+ if (it != m_cache.end()) {
163
+ m_lru_list.erase(it->second.first);
164
+ m_cache.erase(it);
165
+ return true;
166
+ }
167
+ return false;
168
+ }
169
+
170
+ /**
171
+ * @brief 清空缓存
172
+ */
173
+ void clear() {
174
+ UniqueGuard lock(m_mutex);
175
+ m_cache.clear();
176
+ m_lru_list.clear();
177
+ }
178
+
179
+ /**
180
+ * @brief 获取缓存当前大小
181
+ * @return 当前缓存元素数量
182
+ */
183
+ size_type size() const {
184
+ SharedGuard lock(m_mutex);
185
+ return m_cache.size();
186
+ }
187
+
188
+ /**
189
+ * @brief 检查缓存是否为空
190
+ * @return 空返回true,否则返回false
191
+ */
192
+ bool empty() const {
193
+ SharedGuard lock(m_mutex);
194
+ return m_cache.empty();
195
+ }
196
+
197
+ /**
198
+ * @brief 获取缓存容量
199
+ * @return 缓存容量
200
+ */
201
+ size_type capacity() const {
202
+ SharedGuard lock(m_mutex);
203
+ return m_capacity;
204
+ }
205
+
206
+ /**
207
+ * @brief 获取缓存溢出容量
208
+ * @return 缓存溢出容量
209
+ */
210
+ size_type overflow() const {
211
+ SharedGuard lock(m_mutex);
212
+ return m_overflow;
213
+ }
214
+
215
+ /**
216
+ * @brief 设置缓存容量
217
+ * @param capacity 新的容量,0表示不限制容量
218
+ */
219
+ void resize(size_type capacity) {
220
+ UniqueGuard lock(m_mutex);
221
+ m_capacity = capacity;
222
+ _prune_if_needed();
223
+ }
224
+
225
+ /**
226
+ * @brief 设置缓存溢出容量
227
+ * @param overflow 新的溢出容量
228
+ */
229
+ void setOverflow(size_type overflow) {
230
+ UniqueGuard lock(m_mutex);
231
+ m_overflow = overflow;
232
+ _prune_if_needed();
233
+ }
234
+
235
+ private:
236
+ // 如果缓存已满,移除最久未使用的项
237
+ size_t _prune_if_needed() {
238
+ size_t maxAllowed = m_capacity + m_overflow;
239
+ if (m_capacity == 0 || m_cache.size() <= maxAllowed) {
240
+ return 0;
241
+ }
242
+ size_t count = 0;
243
+ while (m_cache.size() > m_capacity) {
244
+ m_cache.erase(m_lru_list.back());
245
+ m_lru_list.pop_back();
246
+ ++count;
247
+ }
248
+ return count;
249
+ }
250
+
251
+ // 批量更新所有脏节点:移到链表头部,清除脏标记
252
+ void _batch_update_dirty_nodes() {
253
+ // 修复点1:避免默认构造,改用指针/引用追踪最新脏节点
254
+ typename LruList::reverse_iterator latest_dirty_it;
255
+ bool has_dirty = false;
256
+
257
+ // 反向遍历链表:从尾部→头部,找第一个脏节点(最新访问的节点)
258
+ for (auto it = m_lru_list.rbegin(); it != m_lru_list.rend(); ++it) {
259
+ const key_type& key = *it;
260
+ auto cache_it = m_cache.find(key);
261
+ if (cache_it == m_cache.end()) {
262
+ continue;
263
+ }
264
+
265
+ auto& dirty_flag = cache_it->second.second.second;
266
+ // 修复点2:原子加载判断,避免未初始化访问
267
+ if (dirty_flag.load(std::memory_order_relaxed)) {
268
+ latest_dirty_it = it;
269
+ has_dirty = true;
270
+ break; // 仅处理最新访问的脏节点,保留1在尾部
271
+ }
272
+ }
273
+
274
+ // 仅移动最新访问的脏节点到头部(修复点3:反向迭代器转正向迭代器)
275
+ if (has_dirty) {
276
+ // C++17:反向迭代器转正向迭代器(base()方法)
277
+ auto forward_it = latest_dirty_it.base();
278
+ --forward_it; // 反向迭代器base()返回的是下一个正向迭代器,需减1
279
+
280
+ const key_type& key = *forward_it;
281
+ auto cache_it = m_cache.find(key);
282
+ if (cache_it != m_cache.end()) {
283
+ // 清除脏标记
284
+ cache_it->second.second.second.store(false, std::memory_order_relaxed);
285
+ // 移动节点到链表头部(splice仅支持正向迭代器)
286
+ m_lru_list.splice(m_lru_list.begin(), m_lru_list, forward_it);
287
+ }
288
+ }
289
+ }
290
+
291
+ private:
292
+ size_type m_capacity;
293
+ size_type m_overflow;
294
+ LruList m_lru_list;
295
+ CacheMap m_cache;
296
+ mutable lock_type m_mutex;
297
+ };
298
+
299
+ } // namespace hku
@@ -503,6 +503,23 @@ inline void Parameter::set(const string& name, const boost::any& value) {
503
503
  m_params[name] = value;
504
504
  }
505
505
 
506
+ template <>
507
+ inline int64_t Parameter::get(const string& name) const {
508
+ param_map_t::const_iterator iter;
509
+ iter = m_params.find(name);
510
+ if (iter == m_params.end()) {
511
+ throw std::out_of_range("out_of_range in Parameter::get : " + name);
512
+ }
513
+ try {
514
+ if (iter->second.type() == typeid(int)) {
515
+ return boost::any_cast<int>(iter->second);
516
+ }
517
+ return boost::any_cast<int64_t>(iter->second);
518
+ } catch (...) {
519
+ throw std::runtime_error("failed conversion param: " + name);
520
+ }
521
+ }
522
+
506
523
  HKU_API bool operator==(const Parameter&, const Parameter&);
507
524
  HKU_API bool operator!=(const Parameter&, const Parameter&);
508
525
  HKU_API bool operator<(const Parameter&, const Parameter&);
@@ -209,12 +209,12 @@ extern template float HKU_UTILS_API roundDown(float number, int ndigits);
209
209
  #endif
210
210
 
211
211
  /** 转小写字符串 */
212
- inline void to_lower(std::string &s) {
212
+ inline void to_lower(std::string &s) noexcept {
213
213
  std::transform(s.begin(), s.end(), s.begin(), [](unsigned char c) { return std::tolower(c); });
214
214
  }
215
215
 
216
216
  /** 转大写字符串 */
217
- inline void to_upper(std::string &s) {
217
+ inline void to_upper(std::string &s) noexcept {
218
218
  std::transform(s.begin(), s.end(), s.begin(), [](unsigned char c) { return std::toupper(c); });
219
219
  }
220
220
 
@@ -6,33 +6,61 @@
6
6
 
7
7
  // clang-format off
8
8
 
9
+ #ifndef HKU_ENABLE_MYSQL
9
10
  #define HKU_ENABLE_MYSQL 1
10
11
  #if HKU_ENABLE_MYSQL && HKU_OS_WINDOWS
11
12
  #ifndef NOMINMAX
12
13
  #define NOMINMAX
13
14
  #endif
14
15
  #endif
16
+ #endif
15
17
 
18
+ #ifndef HKU_ENABLE_SQLITE
16
19
  #define HKU_ENABLE_SQLITE 1
20
+ #endif
21
+ #ifndef HKU_ENABLE_SQLCIPHER
17
22
  #define HKU_ENABLE_SQLCIPHER 0
23
+ #endif
24
+ #ifndef HKU_SQL_TRACE
18
25
  /* #define HKU_SQL_TRACE 0 */
26
+ #endif
19
27
 
28
+ #ifndef HKU_SUPPORT_DATETIME
20
29
  #define HKU_SUPPORT_DATETIME 1
30
+ #endif
21
31
 
32
+ #ifndef HKU_ENABLE_INI_PARSER
22
33
  #define HKU_ENABLE_INI_PARSER 1
34
+ #endif
23
35
 
36
+ #ifndef HKU_ENABLE_STACK_TRACE
24
37
  #define HKU_ENABLE_STACK_TRACE 0
38
+ #endif
25
39
 
40
+ #ifndef HKU_CLOSE_SPEND_TIME
26
41
  #define HKU_CLOSE_SPEND_TIME 0
42
+ #endif
27
43
 
44
+ #ifndef HKU_USE_SPDLOG_ASYNC_LOGGER
28
45
  #define HKU_USE_SPDLOG_ASYNC_LOGGER 0
46
+ #endif
47
+ #ifndef HKU_LOG_ACTIVE_LEVEL
29
48
  #define HKU_LOG_ACTIVE_LEVEL 2
49
+ #endif
30
50
 
51
+ #ifndef HKU_ENABLE_HTTP_CLIENT
31
52
  #define HKU_ENABLE_HTTP_CLIENT 1
53
+ #endif
54
+ #ifndef HKU_ENABLE_HTTP_CLIENT_SSL
32
55
  #define HKU_ENABLE_HTTP_CLIENT_SSL 0
56
+ #endif
57
+ #ifndef HKU_ENABLE_HTTP_CLIENT_ZIP
33
58
  #define HKU_ENABLE_HTTP_CLIENT_ZIP 0
59
+ #endif
34
60
 
61
+ #ifndef HKU_ENABLE_NODE
35
62
  #define HKU_ENABLE_NODE 1
63
+ #endif
36
64
 
37
65
  // clang-format on
38
66
 
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright (c) 2026 hikyuu.org
3
+ *
4
+ * Created on: 2026-01-16
5
+ * Author: fasiondog
6
+ */
7
+
8
+ #pragma once
9
+
10
+ #include "hikyuu/utilities/config.h"
11
+
12
+ #if defined(_OPENMP)
13
+ #include <omp.h>
14
+ #define HKU_OMP_PARALLEL_FOR _Pragma("omp parallel for")
15
+ #define HKU_OMP_SAFETY_PARALLEL_FOR \
16
+ _Pragma("omp parallel for num_threads(omp_get_max_threads()) if (!omp_in_parallel())")
17
+ #define HKU_OMP_CHECK_THRESHOLD(guard, threshold) \
18
+ if ((guard) > (threshold) && !omp_in_parallel()) { \
19
+ omp_set_num_threads(omp_get_max_threads()); \
20
+ }
21
+ #else
22
+ #define HKU_OMP_PARALLEL_FOR
23
+ #define HKU_OMP_SAFETY_PARALLEL_FOR
24
+ #define HKU_OMP_CHECK_THRESHOLD(guard, threshold)
25
+ #endif
@@ -12,6 +12,7 @@
12
12
  #include <string>
13
13
  #include "hikyuu/utilities/config.h"
14
14
  #include "hikyuu/utilities/osdef.h"
15
+ #include "hikyuu/utilities/Log.h"
15
16
 
16
17
  namespace hku {
17
18
 
@@ -35,12 +36,26 @@ public:
35
36
  #if HKU_OS_WINDOWS
36
37
  #define HKU_PLUGIN_DEFINE(plugin) \
37
38
  extern "C" __declspec(dllexport) hku::PluginBase* createPlugin() { \
38
- return new plugin(); \
39
+ try { \
40
+ return new plugin(); \
41
+ } catch (const std::exception& e) { \
42
+ HKU_ERROR("{}", e.what()); \
43
+ return nullptr; \
44
+ } catch (...) { \
45
+ return nullptr; \
46
+ } \
39
47
  }
40
48
  #else
41
49
  #define HKU_PLUGIN_DEFINE(plugin) \
42
50
  extern "C" hku::PluginBase* createPlugin() { \
43
- return new plugin(); \
51
+ try { \
52
+ return new plugin(); \
53
+ } catch (const std::exception& e) { \
54
+ HKU_ERROR("{}", e.what()); \
55
+ return nullptr; \
56
+ } catch (...) { \
57
+ return nullptr; \
58
+ } \
44
59
  }
45
60
  #endif
46
61
 
@@ -10,7 +10,7 @@
10
10
  #include <string>
11
11
  #include <memory>
12
12
  #include <unordered_map>
13
- #include <mutex>
13
+ #include <shared_mutex>
14
14
  #include "hikyuu/utilities/Log.h"
15
15
  #include "hikyuu/utilities/plugin/PluginLoader.h"
16
16
 
@@ -37,36 +37,60 @@ public:
37
37
  m_plugin_path = plugin_path;
38
38
  }
39
39
 
40
+ void clear() noexcept {
41
+ std::unique_lock<std::shared_mutex> write_lock(m_mutex);
42
+ m_plugins.clear();
43
+ }
44
+
40
45
  template <typename PluginInterfaceT>
41
- PluginInterfaceT* getPlugin(const std::string& pluginname) noexcept;
46
+ PluginInterfaceT* getPlugin(const std::string& pluginname) noexcept {
47
+ PluginInterfaceT* ret{nullptr};
48
+ try {
49
+ {
50
+ std::shared_lock<std::shared_mutex> read_lock(m_mutex);
51
+ auto it = m_plugins.find(pluginname);
52
+ if (it != m_plugins.end()) {
53
+ ret = it->second->instance<PluginInterfaceT>();
54
+ return ret;
55
+ }
56
+ }
42
57
 
43
- private:
44
- std::unordered_map<std::string, std::unique_ptr<PluginLoader>>::iterator load(
45
- const std::string& pluginname) noexcept {
46
- std::lock_guard<std::mutex> lock(m_mutex);
47
- std::unique_ptr<PluginLoader> loader = std::make_unique<PluginLoader>(m_plugin_path);
48
- if (loader->load(pluginname)) {
49
- auto [it, success] = m_plugins.insert(std::make_pair(pluginname, std::move(loader)));
50
- if (success) {
51
- return it;
58
+ std::unique_ptr<PluginLoader> loader = std::make_unique<PluginLoader>(m_plugin_path);
59
+ if (!loader->load(pluginname)) {
60
+ HKU_DEBUG("Load plugin {} failed: {}", pluginname, loader->getFileName(pluginname));
61
+ return ret;
52
62
  }
63
+
64
+ {
65
+ std::unique_lock<std::shared_mutex> write_lock(m_mutex);
66
+ auto it = m_plugins.find(pluginname);
67
+ if (it != m_plugins.end()) {
68
+ // 复用已插入的插件实例
69
+ ret = it->second->instance<PluginInterfaceT>();
70
+ } else {
71
+ // 插入新加载的插件
72
+ auto [it, success] =
73
+ m_plugins.insert(std::make_pair(pluginname, std::move(loader)));
74
+ if (success) {
75
+ ret = it->second->instance<PluginInterfaceT>();
76
+ }
77
+ }
78
+ return ret;
79
+ }
80
+ } catch (const std::exception& e) {
81
+ HKU_ERROR("Load plugin {} failed: {}", pluginname, e.what());
82
+ ret = nullptr;
83
+ } catch (...) {
84
+ HKU_ERROR("Load plugin {} failed: unknown exception", pluginname);
85
+ ret = nullptr;
53
86
  }
54
- return m_plugins.end();
87
+ return ret;
55
88
  }
56
89
 
57
90
  private:
58
91
  std::string m_plugin_path;
59
92
  std::unordered_map<std::string, std::unique_ptr<PluginLoader>> m_plugins;
60
- std::mutex m_mutex;
93
+ std::shared_mutex m_mutex;
61
94
  };
62
95
 
63
- template <typename PluginInterfaceT>
64
- PluginInterfaceT* PluginManager::getPlugin(const std::string& pluginname) noexcept {
65
- auto it = m_plugins.find(pluginname);
66
- if (it == m_plugins.end()) {
67
- it = load(pluginname);
68
- }
69
- return it != m_plugins.end() ? it->second->instance<PluginInterfaceT>() : nullptr;
70
- }
71
-
72
96
  } // namespace hku