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/__init__.py CHANGED
@@ -1,31 +1,12 @@
1
1
  #!/usr/bin/python
2
2
  # -*- coding: utf8 -*-
3
3
  # cp936
4
- #
5
- # The MIT License (MIT)
6
- #
7
- # Copyright (c) 2010-2017 fasiondog
8
- #
9
- # Permission is hereby granted, free of charge, to any person obtaining a copy
10
- # of this software and associated documentation files (the "Software"), to deal
11
- # in the Software without restriction, including without limitation the rights
12
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- # copies of the Software, and to permit persons to whom the Software is
14
- # furnished to do so, subject to the following conditions:
15
- #
16
- # The above copyright notice and this permission notice shall be included in all
17
- # copies or substantial portions of the Software.
18
- #
19
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
- # SOFTWARE.
26
4
 
5
+ from pathlib import Path
6
+ import pickle
7
+ import traceback
27
8
  __copyright__ = """
28
- MIT License
9
+ Apache License Version 2.0
29
10
 
30
11
  Copyright (c) 2010-2017 fasiondog
31
12
 
@@ -48,10 +29,23 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
48
29
  SOFTWARE.
49
30
  """
50
31
 
51
- import traceback
52
32
  import sys
53
- import pickle
54
33
  import os
34
+ BASE_DIR = os.path.dirname(__file__)
35
+ if sys.platform == 'win32':
36
+ # add_dll_directory() 有时不生效
37
+ os.add_dll_directory(os.path.join(os.path.dirname(__file__), 'cpp'))
38
+ # 添加动态库所在的目录路径
39
+ current_path = os.environ.get('PATH', '')
40
+ dll_directory = os.path.join(BASE_DIR, 'cpp')
41
+ new_path = f"{dll_directory};{current_path}"
42
+ os.environ['PATH'] = new_path
43
+ else:
44
+ current_path = os.environ.get('LD_LIBRARY_PATH', '')
45
+ dll_directory = os.path.join(BASE_DIR, 'cpp')
46
+ new_path = f"{dll_directory}:{current_path}" if current_path else dll_directory
47
+ os.environ['LD_LIBRARY_PATH'] = new_path
48
+
55
49
 
56
50
  try:
57
51
  from .util import *
@@ -74,34 +68,18 @@ except Exception as e:
74
68
  raise e
75
69
 
76
70
 
77
- __copyright__ = """
78
- MIT License
79
-
80
- Copyright (c) 2010-2017 fasiondog
81
-
82
- Permission is hereby granted, free of charge, to any person obtaining a copy
83
- of this software and associated documentation files (the "Software"), to deal
84
- in the Software without restriction, including without limitation the rights
85
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
86
- copies of the Software, and to permit persons to whom the Software is
87
- furnished to do so, subject to the following conditions:
88
-
89
- The above copyright notice and this permission notice shall be included in all
90
- copies or substantial portions of the Software.
91
-
92
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
93
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
94
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
95
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
96
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
97
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
98
- SOFTWARE.
99
- """
100
-
101
71
  __version__ = get_version()
102
72
 
103
73
  sm = StockManager.instance()
104
74
 
75
+ plugin_path = Path.home() / '.hikyuu' / 'plugin'
76
+ if plugin_path.exists():
77
+ plugin_path = str(plugin_path)
78
+ else:
79
+ plugin_path = os.path.join(os.path.dirname(__file__), 'plugin')
80
+ sm.set_plugin_path(plugin_path)
81
+ print(f"current plugin path: {plugin_path}")
82
+
105
83
 
106
84
  class iodog:
107
85
  # Only for compatibility with old code
@@ -252,6 +230,12 @@ def load_hikyuu(**kwargs):
252
230
  hku_param["datadir"] = ini.get('hikyuu', 'datadir')
253
231
  if ini.has_option('hikyuu', 'quotation_server'):
254
232
  hku_param["quotation_server"] = ini['hikyuu']['quotation_server']
233
+ hku_param["load_history_finance"] = ini.getboolean("hikyuu", "load_history_finance", fallback=True)
234
+ hku_param["load_stock_weight"] = ini.getboolean("hikyuu", "load_stock_weight", fallback=True)
235
+ if ini.has_option('hikyuu', 'plugindir'):
236
+ hku_param["plugindir"] = ini.get('hikyuu', 'plugindir')
237
+ else:
238
+ hku_param["plugindir"] = os.path.join(os.path.dirname(__file__), "plugin")
255
239
 
256
240
  base_param = Parameter()
257
241
  base_info_config = ini.options('baseinfo')