hikyuu 2.5.6__py3-none-win_amd64.whl → 2.6.1__py3-none-win_amd64.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 (118) hide show
  1. hikyuu/__init__.py +33 -49
  2. hikyuu/__init__.pyi +530 -516
  3. hikyuu/analysis/__init__.pyi +498 -490
  4. hikyuu/analysis/analysis.pyi +499 -491
  5. hikyuu/core.pyi +500 -492
  6. hikyuu/cpp/__init__.pyi +2 -2
  7. hikyuu/cpp/boost_date_time-mt.dll +0 -0
  8. hikyuu/cpp/boost_serialization-mt.dll +0 -0
  9. hikyuu/cpp/boost_wserialization-mt.dll +0 -0
  10. hikyuu/cpp/core310.pyd +0 -0
  11. hikyuu/cpp/core310.pyi +187 -22
  12. hikyuu/cpp/core311.pyd +0 -0
  13. hikyuu/cpp/core311.pyi +187 -22
  14. hikyuu/cpp/core312.pyd +0 -0
  15. hikyuu/cpp/core312.pyi +187 -22
  16. hikyuu/cpp/core313.pyd +0 -0
  17. hikyuu/cpp/core313.pyi +186 -22
  18. hikyuu/cpp/core39.pyd +0 -0
  19. hikyuu/cpp/core39.pyi +187 -22
  20. hikyuu/cpp/hikyuu.dll +0 -0
  21. hikyuu/cpp/hikyuu.lib +0 -0
  22. hikyuu/draw/__init__.pyi +1 -1
  23. hikyuu/draw/drawplot/__init__.py +2 -0
  24. hikyuu/draw/drawplot/__init__.pyi +9 -8
  25. hikyuu/draw/drawplot/bokeh_draw.pyi +519 -506
  26. hikyuu/draw/drawplot/common.pyi +1 -1
  27. hikyuu/draw/drawplot/echarts_draw.pyi +521 -508
  28. hikyuu/draw/drawplot/matplotlib_draw.py +80 -0
  29. hikyuu/draw/drawplot/matplotlib_draw.pyi +540 -517
  30. hikyuu/draw/elder.pyi +11 -11
  31. hikyuu/draw/kaufman.pyi +18 -18
  32. hikyuu/draw/volume.pyi +10 -10
  33. hikyuu/examples/notebook/002-HowToGetStock.ipynb +1 -1
  34. hikyuu/examples/notebook/004-IndicatorOverview.ipynb +117 -52
  35. hikyuu/extend.pyi +507 -500
  36. hikyuu/gui/HikyuuTDX.py +85 -15
  37. hikyuu/gui/data/ImportQmtToH5Task.py +209 -0
  38. hikyuu/gui/data/ImportTdxToH5Task.py +8 -1
  39. hikyuu/gui/data/MainWindow.py +94 -13
  40. hikyuu/gui/data/UseQmtImportToH5Thread.py +316 -0
  41. hikyuu/gui/data/UseTdxImportToH5Thread.py +221 -65
  42. hikyuu/gui/dataserver.py +25 -0
  43. hikyuu/gui/images/star.png +0 -0
  44. hikyuu/gui/importdata.py +24 -11
  45. hikyuu/hub.pyi +6 -6
  46. hikyuu/include/hikyuu/KData.h +5 -0
  47. hikyuu/include/hikyuu/KDataImp.h +4 -0
  48. hikyuu/include/hikyuu/StockManager.h +23 -0
  49. hikyuu/include/hikyuu/data_driver/kdata/mysql/KRecordTable.h +41 -2
  50. hikyuu/include/hikyuu/global/agent/spot_generated.h +3 -3
  51. hikyuu/include/hikyuu/indicator/crt/COUNT.h +3 -3
  52. hikyuu/include/hikyuu/indicator/crt/DISCARD.h +1 -1
  53. hikyuu/include/hikyuu/indicator/crt/ISINF.h +1 -1
  54. hikyuu/include/hikyuu/indicator/crt/ISINFA.h +1 -1
  55. hikyuu/include/hikyuu/indicator/crt/ISNA.h +1 -1
  56. hikyuu/include/hikyuu/indicator/crt/LAST.h +2 -2
  57. hikyuu/include/hikyuu/indicator/crt/MAX.h +1 -1
  58. hikyuu/include/hikyuu/indicator/crt/MIN.h +1 -1
  59. hikyuu/include/hikyuu/indicator/crt/PRICELIST.h +1 -15
  60. hikyuu/include/hikyuu/indicator/crt/SUMBARS.h +1 -1
  61. hikyuu/include/hikyuu/plugin/KDataToHdf5Importer.h +33 -0
  62. hikyuu/include/hikyuu/plugin/__init__.py +1 -0
  63. hikyuu/include/hikyuu/plugin/backtest.h +37 -0
  64. hikyuu/include/hikyuu/plugin/dataserver.h +18 -0
  65. hikyuu/include/hikyuu/plugin/device.h +29 -0
  66. hikyuu/include/hikyuu/plugin/interface/BackTestPluginInterface.h +26 -0
  67. hikyuu/include/hikyuu/plugin/interface/DataServerPluginInterface.h +23 -0
  68. hikyuu/include/hikyuu/plugin/interface/DevicePluginInterface.h +25 -0
  69. hikyuu/include/hikyuu/plugin/interface/ImportKDataToHdf5PluginInterface.h +33 -0
  70. hikyuu/include/hikyuu/plugin/interface/__init__.py +1 -0
  71. hikyuu/include/hikyuu/plugin/interface/plugins.h +22 -0
  72. hikyuu/include/hikyuu/python/pybind_utils.h +8 -0
  73. hikyuu/include/hikyuu/strategy/BrokerTradeManager.h +2 -1
  74. hikyuu/include/hikyuu/strategy/RunPortfolioInStrategy.h +1 -0
  75. hikyuu/include/hikyuu/strategy/Strategy.h +93 -16
  76. hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +4 -2
  77. hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +2 -1
  78. hikyuu/include/hikyuu/trade_sys/selector/SelectorBase.h +12 -9
  79. hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector.h +1 -1
  80. hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorSelector.h +12 -12
  81. hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorValueSelector.h +2 -2
  82. hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/PerformanceOptimalSelector.h +1 -1
  83. hikyuu/include/hikyuu/trade_sys/system/System.h +12 -3
  84. hikyuu/include/hikyuu/trade_sys/system/imp/DelegateSystem.h +0 -1
  85. hikyuu/include/hikyuu/trade_sys/system/imp/WalkForwardSystem.h +0 -1
  86. hikyuu/include/hikyuu/trade_sys/system/imp/WalkForwardTradeManager.h +3 -2
  87. hikyuu/include/hikyuu/utilities/arithmetic.h +32 -22
  88. hikyuu/include/hikyuu/utilities/datetime/Datetime.h +1 -0
  89. hikyuu/include/hikyuu/utilities/plugin/PluginClient.h +2 -2
  90. hikyuu/include/hikyuu/utilities/plugin/PluginLoader.h +66 -13
  91. hikyuu/include/hikyuu/utilities/plugin/PluginManager.h +72 -0
  92. hikyuu/include/hikyuu/version.h +5 -5
  93. hikyuu/plugin/__init__.py +1 -0
  94. hikyuu/plugin/backtest.dll +0 -0
  95. hikyuu/plugin/dataserver.dll +0 -0
  96. hikyuu/plugin/device.dll +0 -0
  97. hikyuu/plugin/import2hdf5.dll +0 -0
  98. hikyuu/strategy/strategy_demo1.py +7 -8
  99. hikyuu/strategy/strategy_demo2.py +1 -1
  100. hikyuu/trade_manage/__init__.pyi +518 -505
  101. hikyuu/trade_manage/broker.pyi +3 -3
  102. hikyuu/trade_manage/broker_easytrader.pyi +1 -1
  103. hikyuu/trade_manage/trade.pyi +518 -505
  104. hikyuu/util/__init__.py +1 -0
  105. hikyuu/util/__init__.pyi +2 -1
  106. hikyuu/util/mylog.py +30 -3
  107. hikyuu/util/mylog.pyi +3 -1
  108. hikyuu/util/singleton.pyi +1 -1
  109. {hikyuu-2.5.6.dist-info → hikyuu-2.6.1.dist-info}/METADATA +6 -2
  110. {hikyuu-2.5.6.dist-info → hikyuu-2.6.1.dist-info}/RECORD +115 -97
  111. {hikyuu-2.5.6.dist-info → hikyuu-2.6.1.dist-info}/entry_points.txt +1 -0
  112. {hikyuu-2.5.6.dist-info → hikyuu-2.6.1.dist-info}/top_level.txt +4 -0
  113. hikyuu/cpp/core38.pyd +0 -0
  114. hikyuu/cpp/core38.pyi +0 -13173
  115. hikyuu/examples/notebook/011-PyechartsDrawplot.ipynb +0 -21821
  116. /hikyuu/gui/{hikyuu_small.png → images/hikyuu_small.png} +0 -0
  117. {hikyuu-2.5.6.dist-info → hikyuu-2.6.1.dist-info}/LICENSE +0 -0
  118. {hikyuu-2.5.6.dist-info → hikyuu-2.6.1.dist-info}/WHEEL +0 -0
hikyuu/util/__init__.py CHANGED
@@ -16,6 +16,7 @@ from .notebook import *
16
16
 
17
17
  __all__ = [
18
18
  'spend_time',
19
+ 'hku_benchmark',
19
20
  'timeout',
20
21
  'hku_logger',
21
22
  'class_logger',
hikyuu/util/__init__.pyi CHANGED
@@ -16,6 +16,7 @@ from hikyuu.util.mylog import add_class_logger_handler
16
16
  from hikyuu.util.mylog import capture_multiprocess_all_logger
17
17
  from hikyuu.util.mylog import class_logger
18
18
  from hikyuu.util.mylog import get_default_logger
19
+ from hikyuu.util.mylog import hku_benchmark
19
20
  from hikyuu.util.mylog import hku_debug
20
21
  from hikyuu.util.mylog import hku_debug as hku_trace
21
22
  from hikyuu.util.mylog import hku_debug_if
@@ -48,7 +49,7 @@ from . import mylog
48
49
  from . import notebook
49
50
  from . import singleton
50
51
  from . import slice
51
- __all__: list = ['spend_time', 'timeout', 'hku_logger', 'class_logger', 'add_class_logger_handler', 'HKUCheckError', 'hku_check', 'hku_check_throw', 'hku_check_ignore', 'hku_catch', 'hku_to_async', 'hku_trace', 'hku_debug', 'hku_info', 'hku_warn', 'hku_error', 'hku_fatal', 'hku_trace_if', 'hku_debug_if', 'hku_info_if', 'hku_warn_if', 'hku_info_if', 'hku_warn_if', 'hku_error_if', 'hku_fatal_if', 'with_trace', 'set_my_logger_file', 'capture_multiprocess_all_logger', 'LoggingContext', 'in_interactive_session', 'in_ipython_frontend']
52
+ __all__: list = ['spend_time', 'hku_benchmark', 'timeout', 'hku_logger', 'class_logger', 'add_class_logger_handler', 'HKUCheckError', 'hku_check', 'hku_check_throw', 'hku_check_ignore', 'hku_catch', 'hku_to_async', 'hku_trace', 'hku_debug', 'hku_info', 'hku_warn', 'hku_error', 'hku_fatal', 'hku_trace_if', 'hku_debug_if', 'hku_info_if', 'hku_warn_if', 'hku_info_if', 'hku_warn_if', 'hku_error_if', 'hku_fatal_if', 'with_trace', 'set_my_logger_file', 'capture_multiprocess_all_logger', 'LoggingContext', 'in_interactive_session', 'in_ipython_frontend']
52
53
  FORMAT: str = '%(asctime)-15s [%(levelname)s] %(message)s [%(name)s::%(funcName)s]'
53
54
  g_hku_logger_lock: multiprocessing.synchronize.Lock # value = <Lock(owner=None)>
54
55
  hku_logger: logging.Logger # value = <Logger hikyuu (INFO)>
hikyuu/util/mylog.py CHANGED
@@ -15,16 +15,43 @@ import multiprocessing
15
15
  def spend_time(func):
16
16
  @functools.wraps(func)
17
17
  def wrappedFunc(*args, **kargs):
18
- starttime = time.time()
18
+ starttime = time.perf_counter()
19
19
  try:
20
20
  print("\nCalling: %s" % func.__name__)
21
21
  return func(*args, **kargs)
22
22
  finally:
23
- endtime = time.time()
24
- print("spend time: %.4fs, %.2fm" % (endtime - starttime, (endtime - starttime) / 60))
23
+ endtime = time.perf_counter()
24
+ print("spend time: %.6fs, %.4fm" % (endtime - starttime, (endtime - starttime) / 60))
25
25
 
26
26
  return wrappedFunc
27
27
 
28
+ # 统计函数运行时间
29
+
30
+
31
+ def hku_benchmark(count=10):
32
+ def hku_benchmark_wrap(func):
33
+ @functools.wraps(func)
34
+ def wrappedFunc(*args, **kargs):
35
+ starttime = time.perf_counter()
36
+ try:
37
+ print(f"\nstart benchmark: {func.__name__}")
38
+ for i in range(count):
39
+ ret = func(*args, **kargs)
40
+ return ret
41
+ finally:
42
+ endtime = time.perf_counter()
43
+ total_sec = endtime - starttime
44
+ total_min = total_sec / 60.0
45
+ seconds = total_sec / count
46
+ minutes = seconds / 60.0
47
+ print("+--------------------------------------------------------------------------")
48
+ print(f"| run count: {count}")
49
+ print(f"| total time: {total_sec: <.6f}s, {total_min: <.4f}m")
50
+ print(f"| mean time: {seconds: <.6f}s, {minutes: <.4f}m")
51
+ print("+--------------------------------------------------------------------------")
52
+ return wrappedFunc
53
+ return hku_benchmark_wrap
54
+
28
55
 
29
56
  FORMAT = '%(asctime)-15s [%(levelname)s] %(message)s [%(name)s::%(funcName)s]'
30
57
  logging.basicConfig(format=FORMAT, level=logging.INFO)
hikyuu/util/mylog.pyi CHANGED
@@ -5,7 +5,7 @@ import multiprocessing as multiprocessing
5
5
  import os as os
6
6
  import time as time
7
7
  import traceback as traceback
8
- __all__ = ['FORMAT', 'LoggingContext', 'add_class_logger_handler', 'capture_multiprocess_all_logger', 'class_logger', 'functools', 'g_hku_logger_lock', 'get_default_logger', 'hku_debug', 'hku_debug_if', 'hku_error', 'hku_error_if', 'hku_fatal', 'hku_fatal_if', 'hku_info', 'hku_info_if', 'hku_logger', 'hku_logger_name', 'hku_trace', 'hku_trace_if', 'hku_warn', 'hku_warn_if', 'logging', 'multiprocessing', 'os', 'set_my_logger_file', 'spend_time', 'time', 'traceback', 'with_trace']
8
+ __all__ = ['FORMAT', 'LoggingContext', 'add_class_logger_handler', 'capture_multiprocess_all_logger', 'class_logger', 'functools', 'g_hku_logger_lock', 'get_default_logger', 'hku_benchmark', 'hku_debug', 'hku_debug_if', 'hku_error', 'hku_error_if', 'hku_fatal', 'hku_fatal_if', 'hku_info', 'hku_info_if', 'hku_logger', 'hku_logger_name', 'hku_trace', 'hku_trace_if', 'hku_warn', 'hku_warn_if', 'logging', 'multiprocessing', 'os', 'set_my_logger_file', 'spend_time', 'time', 'traceback', 'with_trace']
9
9
  class LoggingContext:
10
10
  def __enter__(self):
11
11
  ...
@@ -34,6 +34,8 @@ def class_logger(cls, enable = False):
34
34
  ...
35
35
  def get_default_logger():
36
36
  ...
37
+ def hku_benchmark(count = 10):
38
+ ...
37
39
  def hku_debug(msg, *args, **kwargs):
38
40
  ...
39
41
  def hku_debug_if(exp, msg, *args, **kwargs):
hikyuu/util/singleton.pyi CHANGED
@@ -12,7 +12,7 @@ class SingletonType(type):
12
12
  self.name = name
13
13
 
14
14
  """
15
- _instance_lock: typing.ClassVar[_thread.lock] # value = <unlocked _thread.lock object at 0x000001B279161B00>
15
+ _instance_lock: typing.ClassVar[_thread.lock] # value = <unlocked _thread.lock object at 0x000001DFA58CA660>
16
16
  @classmethod
17
17
  def __call__(cls, *args, **kwargs):
18
18
  ...
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hikyuu
3
- Version: 2.5.6
3
+ Version: 2.6.1
4
4
  Summary: Hikyuu Quant Framework for System Trading Analysis and backtester
5
5
  Home-page: http://hikyuu.org/
6
6
  Author: fasiondog
@@ -56,7 +56,9 @@ Requires-Dist: tdqm
56
56
 
57
57
  ![img](https://static.pepy.tech/badge/hikyuu) ![img](https://static.pepy.tech/badge/hikyuu/month) ![img](https://static.pepy.tech/badge/hikyuu/week) ![img](https://github.com/fasiondog/hikyuu/workflows/win-build/badge.svg) ![img](https://github.com/fasiondog/hikyuu/workflows/ubuntu-build/badge.svg) ![img](https://img.shields.io/github/license/mashape/apistatus.svg)
58
58
 
59
- Hikyuu Quant Framework是一款基于C++/Python的开源量化交易研究框架,用于策略分析及回测(目前主要用于国内A股市场)。其核心思想基于当前成熟的系统化交易方法,将整个系统化交易抽象为由市场环境判断策略、系统有效条件、信号指示器、止损/止盈策略、资金管理策略、盈利目标策略、移滑价差算法等组件,你可以分别构建这些组件的策略资产库,在实际研究中对它们自由组合来观察系统的有效性、稳定性以及单一种类策略的效果。
59
+ Hikyuu Quant Framework是一款基于C++/Python的开源量化交易研究框架,用于策略分析及回测(目前主要用于国内A股市场)。专注于量化交易领域的核心技术构建,涵盖**交易模型开发、极速计算引擎、高效回测框架及实盘拓展能力**。其核心思想基于当前成熟的系统化交易方法,将整个系统化交易抽象为由市场环境判断策略、系统有效条件、信号指示器、止损/止盈策略、资金管理策略、盈利目标策略、移滑价差算法等组件,你可以分别构建这些组件的策略资产库,在实际研究中对它们自由组合来观察系统的有效性、稳定性以及单一种类策略的效果。
60
+
61
+ 安装及使用,请先看帮助文档,谢谢!
60
62
 
61
63
  👉 **项目地址:**
62
64
 
@@ -111,6 +113,8 @@ Hikyuu Quant Framework是一款基于C++/Python的开源量化交易研究框架
111
113
 
112
114
  # 想要更多了解Hikyuu?请使用以下方式联系:
113
115
 
116
+ ## [项目支持与捐赠-VIP计划](vip-plan.md)
117
+
114
118
  ## **加入知识星球**
115
119
 
116
120
  更多示例与程序化交易的分享(您的加入将视为对项目的捐赠)。**作者只保证对知识星球用户有问必答,其他渠道视情况。**