hikyuu 2.6.6__py3-none-win_amd64.whl → 2.6.8__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 (175) hide show
  1. hikyuu/__init__.py +16 -2
  2. hikyuu/__init__.pyi +658 -627
  3. hikyuu/analysis/__init__.pyi +563 -519
  4. hikyuu/analysis/analysis.pyi +583 -541
  5. hikyuu/core.pyi +565 -521
  6. hikyuu/cpp/__init__.pyi +2 -2
  7. hikyuu/cpp/concrt140.dll +0 -0
  8. hikyuu/cpp/core310.pyd +0 -0
  9. hikyuu/cpp/core310.pyi +1424 -865
  10. hikyuu/cpp/core311.pyd +0 -0
  11. hikyuu/cpp/core311.pyi +1424 -865
  12. hikyuu/cpp/core312.pyd +0 -0
  13. hikyuu/cpp/core312.pyi +1424 -865
  14. hikyuu/cpp/core313.pyd +0 -0
  15. hikyuu/cpp/core313.pyi +1424 -863
  16. hikyuu/cpp/core39.pyd +0 -0
  17. hikyuu/cpp/core39.pyi +1424 -865
  18. hikyuu/cpp/hikyuu.dll +0 -0
  19. hikyuu/cpp/hikyuu.lib +0 -0
  20. hikyuu/cpp/hku_hdf5.dll +0 -0
  21. hikyuu/cpp/hku_hdf5_cpp.dll +0 -0
  22. hikyuu/cpp/hku_hdf5_hl.dll +0 -0
  23. hikyuu/cpp/hku_hdf5_hl_cpp.dll +0 -0
  24. hikyuu/cpp/i18n/zh_CN/__init__.py +0 -0
  25. hikyuu/cpp/i18n/zh_CN/hikyuu.mo +0 -0
  26. hikyuu/cpp/msvcp140.dll +0 -0
  27. hikyuu/cpp/msvcp140_1.dll +0 -0
  28. hikyuu/cpp/msvcp140_2.dll +0 -0
  29. hikyuu/cpp/msvcp140_atomic_wait.dll +0 -0
  30. hikyuu/cpp/msvcp140_codecvt_ids.dll +0 -0
  31. hikyuu/cpp/sqlite3.dll +0 -0
  32. hikyuu/cpp/vcruntime140.dll +0 -0
  33. hikyuu/cpp/vcruntime140_1.dll +0 -0
  34. hikyuu/data/common_clickhouse.py +0 -47
  35. hikyuu/data/tdx_to_h5.py +1 -1
  36. hikyuu/draw/drawplot/__init__.pyi +32 -37
  37. hikyuu/draw/drawplot/bokeh_draw.pyi +651 -632
  38. hikyuu/draw/drawplot/common.pyi +3 -4
  39. hikyuu/draw/drawplot/echarts_draw.py +9 -8
  40. hikyuu/draw/drawplot/echarts_draw.pyi +598 -567
  41. hikyuu/draw/drawplot/matplotlib_draw.py +3 -3
  42. hikyuu/draw/drawplot/matplotlib_draw.pyi +872 -874
  43. hikyuu/draw/elder.pyi +19 -20
  44. hikyuu/draw/kaufman.py +1 -1
  45. hikyuu/draw/kaufman.pyi +18 -18
  46. hikyuu/draw/volume.pyi +10 -10
  47. hikyuu/examples/notebook/000-Index.ipynb +1 -1
  48. hikyuu/examples/notebook/001-overview.ipynb +78 -63
  49. hikyuu/examples/notebook/002-HowToGetStock.ipynb +259 -40
  50. hikyuu/examples/notebook/003-HowToGetKDataAndDraw.ipynb +49 -41
  51. hikyuu/examples/notebook/004-IndicatorOverview.ipynb +29 -29
  52. hikyuu/examples/notebook/005-Drawplot.ipynb +66 -37
  53. hikyuu/examples/notebook/006-TradeManager.ipynb +808 -61
  54. hikyuu/examples/notebook/007-SystemDetails.ipynb +23 -23
  55. hikyuu/examples/notebook/009-RealData.ipynb +3 -3
  56. hikyuu/examples/notebook/010-Portfolio.ipynb +761 -122
  57. hikyuu/extend.py +32 -98
  58. hikyuu/extend.pyi +597 -593
  59. hikyuu/gui/HikyuuTDX.py +2 -4
  60. hikyuu/gui/data/MainWindow.py +185 -174
  61. hikyuu/hub.pyi +69 -67
  62. hikyuu/include/hikyuu/DataType.h +3 -12
  63. hikyuu/include/hikyuu/KData.h +83 -25
  64. hikyuu/include/hikyuu/KDataImp.h +31 -46
  65. hikyuu/include/hikyuu/KDataPrivatedBufferImp.h +73 -0
  66. hikyuu/include/hikyuu/KDataSharedBufferImp.h +69 -0
  67. hikyuu/include/hikyuu/KQuery.h +38 -32
  68. hikyuu/include/hikyuu/KRecord.h +4 -1
  69. hikyuu/include/hikyuu/MarketInfo.h +1 -1
  70. hikyuu/include/hikyuu/Stock.h +24 -6
  71. hikyuu/include/hikyuu/StockManager.h +15 -6
  72. hikyuu/include/hikyuu/StockTypeInfo.h +6 -0
  73. hikyuu/include/hikyuu/TransRecord.h +2 -8
  74. hikyuu/include/hikyuu/data_driver/KDataDriver.h +5 -0
  75. hikyuu/include/hikyuu/doc.h +4 -0
  76. hikyuu/include/hikyuu/global/GlobalSpotAgent.h +8 -0
  77. hikyuu/include/hikyuu/global/agent/SpotAgent.h +12 -7
  78. hikyuu/include/hikyuu/indicator/Indicator.h +48 -0
  79. hikyuu/include/hikyuu/indicator/Indicator2InImp.h +9 -0
  80. hikyuu/include/hikyuu/indicator/IndicatorImp.h +83 -15
  81. hikyuu/include/hikyuu/indicator/build_in.h +1 -0
  82. hikyuu/include/hikyuu/indicator/crt/AMA.h +2 -1
  83. hikyuu/include/hikyuu/indicator/crt/ATR.h +1 -1
  84. hikyuu/include/hikyuu/indicator/crt/CONTEXT.h +2 -0
  85. hikyuu/include/hikyuu/indicator/crt/CYCLE.h +3 -0
  86. hikyuu/include/hikyuu/indicator/crt/DMA.h +1 -1
  87. hikyuu/include/hikyuu/indicator/crt/IC.h +14 -6
  88. hikyuu/include/hikyuu/indicator/crt/ICIR.h +8 -4
  89. hikyuu/include/hikyuu/indicator/crt/INSUM.h +2 -0
  90. hikyuu/include/hikyuu/indicator/crt/PRICELIST.h +2 -0
  91. hikyuu/include/hikyuu/indicator/crt/REFX.h +25 -0
  92. hikyuu/include/hikyuu/indicator/crt/SLICE.h +4 -4
  93. hikyuu/include/hikyuu/indicator/crt/SPEARMAN.h +3 -2
  94. hikyuu/include/hikyuu/indicator/imp/IContext.h +5 -0
  95. hikyuu/include/hikyuu/indicator/imp/ICval.h +6 -0
  96. hikyuu/include/hikyuu/indicator/imp/IDropna.h +9 -0
  97. hikyuu/include/hikyuu/indicator/imp/IIc.h +2 -1
  98. hikyuu/include/hikyuu/indicator/imp/IPriceList.h +1 -0
  99. hikyuu/include/hikyuu/indicator/imp/IRefX.h +23 -0
  100. hikyuu/include/hikyuu/lang.h +27 -0
  101. hikyuu/include/hikyuu/plugin/KDataToHdf5Importer.h +6 -1
  102. hikyuu/include/hikyuu/plugin/backtest.h +2 -0
  103. hikyuu/include/hikyuu/plugin/extind.h +45 -0
  104. hikyuu/include/hikyuu/plugin/hkuextra.h +77 -0
  105. hikyuu/include/hikyuu/plugin/interface/HkuExtraPluginInterface.h +54 -0
  106. hikyuu/include/hikyuu/plugin/interface/ImportKDataToHdf5PluginInterface.h +10 -1
  107. hikyuu/include/hikyuu/plugin/interface/TMReportPluginInterface.h +1 -0
  108. hikyuu/include/hikyuu/plugin/interface/plugins.h +2 -0
  109. hikyuu/include/hikyuu/python/pybind_utils.h +28 -11
  110. hikyuu/include/hikyuu/trade_manage/Performance.h +0 -1
  111. hikyuu/include/hikyuu/trade_manage/TradeCostBase.h +5 -0
  112. hikyuu/include/hikyuu/trade_manage/TradeManager.h +4 -0
  113. hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +10 -1
  114. hikyuu/include/hikyuu/trade_manage/TradeRecord.h +1 -1
  115. hikyuu/include/hikyuu/trade_sys/allocatefunds/AllocateFundsBase.h +5 -0
  116. hikyuu/include/hikyuu/trade_sys/condition/ConditionBase.h +5 -0
  117. hikyuu/include/hikyuu/trade_sys/environment/EnvironmentBase.h +5 -0
  118. hikyuu/include/hikyuu/trade_sys/moneymanager/MoneyManagerBase.h +5 -0
  119. hikyuu/include/hikyuu/trade_sys/multifactor/MultiFactorBase.h +6 -3
  120. hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +4 -0
  121. hikyuu/include/hikyuu/trade_sys/profitgoal/ProfitGoalBase.h +5 -0
  122. hikyuu/include/hikyuu/trade_sys/selector/SelectorBase.h +5 -2
  123. hikyuu/include/hikyuu/trade_sys/signal/SignalBase.h +5 -0
  124. hikyuu/include/hikyuu/trade_sys/slippage/SlippageBase.h +5 -0
  125. hikyuu/include/hikyuu/trade_sys/stoploss/StoplossBase.h +6 -1
  126. hikyuu/include/hikyuu/trade_sys/system/System.h +5 -0
  127. hikyuu/include/hikyuu/utilities/config.h +0 -2
  128. hikyuu/include/hikyuu/utilities/datetime/Datetime.h +2 -2
  129. hikyuu/include/hikyuu/utilities/os.h +7 -0
  130. hikyuu/include/hikyuu/utilities/plugin/PluginLoader.h +2 -1
  131. hikyuu/include/hikyuu/utilities/thread/GlobalMQStealThreadPool.h +1 -1
  132. hikyuu/include/hikyuu/utilities/thread/GlobalMQThreadPool.h +1 -1
  133. hikyuu/include/hikyuu/utilities/thread/GlobalThreadPool.h +1 -1
  134. hikyuu/include/hikyuu/utilities/thread/MQThreadPool.h +1 -1
  135. hikyuu/include/hikyuu/version.h +4 -4
  136. hikyuu/include/hikyuu/views/arrow_common.h +38 -0
  137. hikyuu/include/hikyuu/views/arrow_views.h +117 -0
  138. hikyuu/indicator/__init__.py +0 -1
  139. hikyuu/indicator/indicator.py +17 -57
  140. hikyuu/plugin/backtest.dll +0 -0
  141. hikyuu/plugin/clickhousedriver.dll +0 -0
  142. hikyuu/plugin/dataserver.dll +0 -0
  143. hikyuu/plugin/device.dll +0 -0
  144. hikyuu/plugin/extind.dll +0 -0
  145. hikyuu/plugin/hkuextra.dll +0 -0
  146. hikyuu/plugin/import2hdf5.dll +0 -0
  147. hikyuu/plugin/tmreport.dll +0 -0
  148. hikyuu/strategy/strategy_demo1.py +1 -1
  149. hikyuu/test/test_init.py +73 -14
  150. hikyuu/test/test_real_tdx_import.py +336 -0
  151. hikyuu/test/test_tdx_import.py +315 -0
  152. hikyuu/test/test_tdx_real_data_import.py +281 -0
  153. hikyuu/trade_manage/__init__.pyi +583 -553
  154. hikyuu/trade_manage/broker.pyi +19 -18
  155. hikyuu/trade_manage/broker_easytrader.pyi +6 -4
  156. hikyuu/trade_manage/broker_mail.pyi +22 -24
  157. hikyuu/trade_manage/trade.py +10 -65
  158. hikyuu/trade_manage/trade.pyi +583 -565
  159. hikyuu/trade_sys/__init__.py +15 -0
  160. hikyuu/util/__init__.pyi +0 -1
  161. hikyuu/util/check.pyi +17 -15
  162. hikyuu/util/mylog.pyi +8 -7
  163. hikyuu/util/notebook.pyi +9 -11
  164. hikyuu/util/singleton.pyi +8 -6
  165. {hikyuu-2.6.6.dist-info → hikyuu-2.6.8.dist-info}/METADATA +8 -4
  166. {hikyuu-2.6.6.dist-info → hikyuu-2.6.8.dist-info}/RECORD +172 -160
  167. {hikyuu-2.6.6.dist-info → hikyuu-2.6.8.dist-info}/top_level.txt +2 -1
  168. hikyuu/cpp/i18n/zh_CN.mo +0 -0
  169. hikyuu/include/hikyuu/utilities/mo/mo.h +0 -64
  170. hikyuu/indicator/talib_wrap.py +0 -1273
  171. /hikyuu/include/hikyuu/utilities/{mo/moFileReader.h → moFileReader.h} +0 -0
  172. /hikyuu/include/hikyuu/{utilities/mo → views}/__init__.py +0 -0
  173. {hikyuu-2.6.6.dist-info → hikyuu-2.6.8.dist-info}/LICENSE +0 -0
  174. {hikyuu-2.6.6.dist-info → hikyuu-2.6.8.dist-info}/WHEEL +0 -0
  175. {hikyuu-2.6.6.dist-info → hikyuu-2.6.8.dist-info}/entry_points.txt +0 -0
hikyuu/cpp/hikyuu.dll CHANGED
Binary file
hikyuu/cpp/hikyuu.lib CHANGED
Binary file
hikyuu/cpp/hku_hdf5.dll CHANGED
Binary file
Binary file
Binary file
Binary file
File without changes
Binary file
hikyuu/cpp/msvcp140.dll CHANGED
Binary file
hikyuu/cpp/msvcp140_1.dll CHANGED
Binary file
hikyuu/cpp/msvcp140_2.dll CHANGED
Binary file
Binary file
Binary file
hikyuu/cpp/sqlite3.dll CHANGED
Binary file
Binary file
Binary file
@@ -136,58 +136,11 @@ def get_table(connect, market, code, ktype):
136
136
  'transdata': 'transdata',
137
137
  }
138
138
  nktype = ktype_dict[ktype.lower()]
139
- connect.command(f"create database if not exists hku_data")
140
139
  if nktype == 'timeline':
141
- sql = f"""
142
- CREATE table if not exists hku_data.timeline (
143
- `market` String,
144
- `code` String,
145
- `date` DateTime,
146
- `price` DOUBLE,
147
- `vol` DOUBLE
148
- )
149
- ENGINE = MergeTree()
150
- PRIMARY KEY (market, code, date);
151
- """
152
- # print(sql)
153
- connect.command(sql)
154
140
  return (f'hku_data.timeline', market.upper(), code.upper())
155
-
156
141
  elif nktype == 'transdata':
157
- sql = f"""
158
- CREATE table if not exists hku_data.transdata (
159
- `market` String,
160
- `code` String,
161
- `date` DateTime,
162
- `price` DOUBLE,
163
- `vol` DOUBLE,
164
- `buyorsell` int
165
- )
166
- ENGINE = MergeTree()
167
- PRIMARY KEY (market, code, date);
168
- """
169
- # print(sql)
170
- connect.command(sql)
171
142
  return (f'hku_data.transdata', market.upper(), code.upper())
172
-
173
143
  else:
174
- sql = f"""
175
- CREATE table if not exists hku_data.{nktype}_k (
176
- `market` String,
177
- `code` String,
178
- `date` DateTime,
179
- `open` DOUBLE,
180
- `high` DOUBLE,
181
- `low` DOUBLE,
182
- `close` DOUBLE,
183
- `amount` DOUBLE,
184
- `volume` DOUBLE
185
- )
186
- ENGINE = MergeTree()
187
- PRIMARY KEY (market, code, date);
188
- """
189
- # print(sql)
190
- connect.command(sql)
191
144
  return (f'hku_data.{nktype}_k', market.upper(), code.upper())
192
145
 
193
146
 
hikyuu/data/tdx_to_h5.py CHANGED
@@ -363,7 +363,7 @@ def tdx_import_data(connect, market, ktype, quotations, src_dir, dest_dir, progr
363
363
  progress(i, total)
364
364
  continue
365
365
 
366
- filename = src_dir + "\\" + market.lower() + stock[2] + suffix
366
+ filename = os.path.join(src_dir, f"{market.lower()}{stock[2]}{suffix}")
367
367
  this_count = func_import_from_file(connect, filename, h5file, market, stock)
368
368
  add_record_count += this_count
369
369
  if this_count > 0:
@@ -1,12 +1,12 @@
1
1
  from __future__ import annotations
2
- from hikyuu.cpp.core312 import ConditionBase
3
- from hikyuu.cpp.core312 import EnvironmentBase
4
- from hikyuu.cpp.core312 import Indicator
5
- from hikyuu.cpp.core312 import KData
6
- from hikyuu.cpp.core312 import Portfolio
7
- from hikyuu.cpp.core312 import SignalBase
8
- from hikyuu.cpp.core312 import System
9
- from hikyuu.cpp.core312 import TradeManager
2
+ from hikyuu.cpp.core313 import ConditionBase
3
+ from hikyuu.cpp.core313 import EnvironmentBase
4
+ from hikyuu.cpp.core313 import Indicator
5
+ from hikyuu.cpp.core313 import KData
6
+ from hikyuu.cpp.core313 import Portfolio
7
+ from hikyuu.cpp.core313 import SignalBase
8
+ from hikyuu.cpp.core313 import System
9
+ from hikyuu.cpp.core313 import TradeManager
10
10
  from hikyuu.draw.drawplot.bokeh_draw import ax_draw_macd as bk_ax_draw_macd
11
11
  from hikyuu.draw.drawplot.bokeh_draw import ax_draw_macd2 as bk_ax_draw_macd2
12
12
  from hikyuu.draw.drawplot.bokeh_draw import create_figure as bk_create_figure
@@ -25,8 +25,8 @@ from hikyuu.draw.drawplot.echarts_draw import sys_performance as ec_sys_performa
25
25
  from hikyuu.draw.drawplot.echarts_draw import sysplot as ec_sysplot
26
26
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWBAND
27
27
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWICON
28
- from hikyuu.draw.drawplot.matplotlib_draw import DRAWIMG
29
28
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWIMG as DRAWBMP
29
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWIMG
30
30
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWLINE
31
31
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWNUMBER
32
32
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWNUMBER_FIX
@@ -68,54 +68,49 @@ __all__: list = ['use_draw_engine', 'get_current_draw_engine', 'create_figure',
68
68
  def adjust_axes_show(axeslist):
69
69
  """
70
70
  用于调整上下紧密相连的坐标轴显示时,其上一坐标轴最小值刻度和下一坐标轴最大值刻度
71
- 显示重叠的问题。
71
+ 显示重叠的问题。
72
72
 
73
- :param axeslist: 上下相连的坐标轴列表 (ax1,ax2,...)
74
-
73
+ :param axeslist: 上下相连的坐标轴列表 (ax1,ax2,...)
75
74
  """
76
75
  def ax_draw_macd(axes, kdata, n1 = 12, n2 = 26, n3 = 9):
77
76
  """
78
77
  绘制MACD
79
78
 
80
- :param axes: 指定的坐标轴
81
- :param KData kdata: KData
82
- :param int n1: 指标 MACD 的参数1
83
- :param int n2: 指标 MACD 的参数2
84
- :param int n3: 指标 MACD 的参数3
85
-
79
+ :param axes: 指定的坐标轴
80
+ :param KData kdata: KData
81
+ :param int n1: 指标 MACD 的参数1
82
+ :param int n2: 指标 MACD 的参数2
83
+ :param int n3: 指标 MACD 的参数3
86
84
  """
87
85
  def ax_draw_macd2(axes, ref, kdata, n1 = 12, n2 = 26, n3 = 9):
88
86
  """
89
87
  绘制MACD。
90
- 当BAR值变化与参考序列ref变化不一致时,显示为灰色,
91
- 当BAR和参考序列ref同时上涨,显示红色
92
- 当BAR和参考序列ref同时下跌,显示绿色
88
+ 当BAR值变化与参考序列ref变化不一致时,显示为灰色,
89
+ 当BAR和参考序列ref同时上涨,显示红色
90
+ 当BAR和参考序列ref同时下跌,显示绿色
93
91
 
94
- :param axes: 指定的坐标轴
95
- :param ref: 参考序列,EMA
96
- :param KData kdata: KData
97
- :param int n1: 指标 MACD 的参数1
98
- :param int n2: 指标 MACD 的参数2
99
- :param int n3: 指标 MACD 的参数3
100
-
92
+ :param axes: 指定的坐标轴
93
+ :param ref: 参考序列,EMA
94
+ :param KData kdata: KData
95
+ :param int n1: 指标 MACD 的参数1
96
+ :param int n2: 指标 MACD 的参数2
97
+ :param int n3: 指标 MACD 的参数3
101
98
  """
102
99
  def ax_set_locator_formatter(axes, dates, typ):
103
100
  """
104
- 设置指定坐标轴的日期显示,根据指定的K线类型优化X轴坐标显示
101
+ 设置指定坐标轴的日期显示,根据指定的K线类型优化X轴坐标显示
105
102
 
106
- :param axes: 指定的坐标轴
107
- :param dates: Datetime构成可迭代序列
108
- :param Query.KType typ: K线类型
109
-
103
+ :param axes: 指定的坐标轴
104
+ :param dates: Datetime构成可迭代序列
105
+ :param Query.KType typ: K线类型
110
106
  """
111
107
  def create_figure(n = 1, figsize = None):
112
108
  """
113
109
  生成含有指定坐标轴数量的窗口,最大只支持4个坐标轴。
114
110
 
115
- :param int n: 坐标轴数量
116
- :param figsize: (宽, 高)
117
- :return: (ax1, ax2, ...) 根据指定的坐标轴数量而定,超出[1,4]个坐标轴时,返回None
118
-
111
+ :param int n: 坐标轴数量
112
+ :param figsize: (宽, 高)
113
+ :return: (ax1, ax2, ...) 根据指定的坐标轴数量而定,超出[1,4]个坐标轴时,返回None
119
114
  """
120
115
  def gca():
121
116
  ...