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/draw/elder.pyi CHANGED
@@ -4,15 +4,15 @@
4
4
  参见:《走进我的交易室》(2007年 地震出版社) Alexander Elder
5
5
  """
6
6
  from __future__ import annotations
7
- import hikyuu.cpp.core312
8
- from hikyuu.cpp.core312 import CVAL
9
- from hikyuu.cpp.core312 import EMA
10
- from hikyuu.cpp.core312 import Indicator
11
- from hikyuu.cpp.core312 import MACD
12
- from hikyuu.cpp.core312 import PRICELIST
13
- from hikyuu.cpp.core312 import Query
14
- from hikyuu.cpp.core312 import SAFTYLOSS
15
- from hikyuu.cpp.core312 import VIGOR
7
+ import hikyuu.cpp.core313
8
+ from hikyuu.cpp.core313 import Indicator
9
+ from hikyuu.cpp.core313 import Query
10
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import CVAL
11
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import EMA
12
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import MACD
13
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import PRICELIST
14
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import SAFTYLOSS
15
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import VIGOR
16
16
  from hikyuu.draw.drawplot import adjust_axes_show
17
17
  from hikyuu.draw.drawplot import ax_draw_macd2
18
18
  from hikyuu.draw.drawplot import ax_set_locator_formatter
@@ -26,19 +26,18 @@ def _draw_ema_pipe(axes, kdata, ema, n = 22, w = 0.1):
26
26
  def _find_ema_coefficient(closes, emas, number = 66, percent = 0.95):
27
27
  """
28
28
  计算EMA通道系数。
29
- 在《走进我的交易室》中,艾尔德介绍的价格通道为:
30
- 通道上轨 = EMA + EMA*通道系数
31
- 通道下轨 = EMA - EMA*通道系数
32
- 其中一条绘制得恰到好处的通道应能将绝大多数价格包含在内,一般调节通道系数使其能够包含95%的价格
33
- 参数:closes:收盘价序列
34
- emas:收盘价对应的EMA序列
35
- number: 以最近多少天的数据来计算,即取最后N天的数据作为计算标准
36
- percent:通道包含多少的价格,如0.95表示通道将包含95%的价格
37
-
29
+ 在《走进我的交易室》中,艾尔德介绍的价格通道为:
30
+ 通道上轨 = EMA + EMA*通道系数
31
+ 通道下轨 = EMA - EMA*通道系数
32
+ 其中一条绘制得恰到好处的通道应能将绝大多数价格包含在内,一般调节通道系数使其能够包含95%的价格
33
+ 参数:closes:收盘价序列
34
+ emas:收盘价对应的EMA序列
35
+ number: 以最近多少天的数据来计算,即取最后N天的数据作为计算标准
36
+ percent:通道包含多少的价格,如0.95表示通道将包含95%的价格
38
37
  """
39
38
  def draw(stock, query = ..., ma_n = 22, ma_w = 'auto', vigor_n = 13):
40
39
  """
41
40
  绘制亚历山大.艾尔德交易系统图形
42
41
  """
43
- CLOSE: hikyuu.cpp.core312.Indicator # value = Indicator{...
44
- constant: hikyuu.cpp.core312.Constant # value = <hikyuu.cpp.core312.Constant object>
42
+ CLOSE: hikyuu.cpp.core313.Indicator # value = Indicator{...
43
+ constant: hikyuu.cpp.core313.Constant # value = <hikyuu.cpp.core313.Constant object>
hikyuu/draw/kaufman.py CHANGED
@@ -83,7 +83,7 @@ def draw(
83
83
  else:
84
84
  print("sg_type only in ('CORSS', 'SINGLE')")
85
85
 
86
- cer = PRICELIST(cama, 1)
86
+ cer = RESULT(cama, 1)
87
87
  label = "ER(%s)" % cer[-1]
88
88
  cer.plot(axes=ax2, color='b', marker='o', label=label, legend_on=False, text_on=True, kref=kdata)
89
89
 
hikyuu/draw/kaufman.pyi CHANGED
@@ -4,19 +4,19 @@
4
4
  参见:《精明交易者》(2006年 广东经济出版社)
5
5
  """
6
6
  from __future__ import annotations
7
- import hikyuu.cpp.core312
8
- from hikyuu.cpp.core312 import AMA
9
- from hikyuu.cpp.core312 import CVAL
10
- from hikyuu.cpp.core312 import EMA
11
- from hikyuu.cpp.core312 import POS
12
- from hikyuu.cpp.core312 import PRICELIST
13
- from hikyuu.cpp.core312 import Query
14
- from hikyuu.cpp.core312 import RESULT
15
- from hikyuu.cpp.core312 import SG_Cross
16
- from hikyuu.cpp.core312 import SG_Flex
17
- from hikyuu.cpp.core312 import SG_Single
18
- from hikyuu.cpp.core312 import STDEV
19
- from hikyuu.cpp.core312 import StockManager
7
+ import hikyuu.cpp.core313
8
+ from hikyuu.cpp.core313 import Query
9
+ from hikyuu.cpp.core313 import StockManager
10
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import AMA
11
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import CVAL
12
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import EMA
13
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import POS
14
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import PRICELIST
15
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import RESULT
16
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import SG_Cross
17
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import SG_Flex
18
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import SG_Single
19
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import STDEV
20
20
  from hikyuu.draw.drawplot import adjust_axes_show
21
21
  from hikyuu.draw.drawplot import ax_draw_macd
22
22
  from hikyuu.draw.drawplot import ax_set_locator_formatter
@@ -31,8 +31,8 @@ def draw2(block, query = ..., ama1 = None, ama2 = None, n = 10, filter_n = 20, f
31
31
  """
32
32
  绘制佩里.J.考夫曼(Perry J.Kaufman) 自适应移动平均系统(AMA)
33
33
  """
34
- CLOSE: hikyuu.cpp.core312.Indicator # value = Indicator{...
35
- HIGH: hikyuu.cpp.core312.Indicator # value = Indicator{...
36
- KDATA: hikyuu.cpp.core312.Indicator # value = Indicator{...
37
- LOW: hikyuu.cpp.core312.Indicator # value = Indicator{...
38
- OPEN: hikyuu.cpp.core312.Indicator # value = Indicator{...
34
+ CLOSE: hikyuu.cpp.core313.Indicator # value = Indicator{...
35
+ HIGH: hikyuu.cpp.core313.Indicator # value = Indicator{...
36
+ KDATA: hikyuu.cpp.core313.Indicator # value = Indicator{...
37
+ LOW: hikyuu.cpp.core313.Indicator # value = Indicator{...
38
+ OPEN: hikyuu.cpp.core313.Indicator # value = Indicator{...
hikyuu/draw/volume.pyi CHANGED
@@ -3,14 +3,14 @@
3
3
  绘制普通K线图 + 成交量(成交金额)
4
4
  """
5
5
  from __future__ import annotations
6
- import hikyuu.cpp.core312
7
- from hikyuu.cpp.core312 import CVAL
8
- from hikyuu.cpp.core312 import IF
9
- from hikyuu.cpp.core312 import Indicator
10
- from hikyuu.cpp.core312 import MA
11
- from hikyuu.cpp.core312 import PRICELIST
12
- from hikyuu.cpp.core312 import Query
13
- from hikyuu.cpp.core312 import SG_Cross
6
+ import hikyuu.cpp.core313
7
+ from hikyuu.cpp.core313 import Indicator
8
+ from hikyuu.cpp.core313 import Query
9
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import CVAL
10
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import IF
11
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import MA
12
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import PRICELIST
13
+ from hikyuu.cpp.core313.pybind11_detail_function_record_v1_msvc_md_mscver19 import SG_Cross
14
14
  from hikyuu.draw.drawplot import adjust_axes_show
15
15
  from hikyuu.draw.drawplot import ax_draw_macd
16
16
  from hikyuu.draw.drawplot import ax_set_locator_formatter
@@ -27,5 +27,5 @@ def draw2(stock, query = ..., ma1_n = 7, ma2_n = 20, ma3_n = 30, ma4_n = 42, ma5
27
27
  """
28
28
  绘制普通K线图 + 成交量(成交金额)+ MACD
29
29
  """
30
- CLOSE: hikyuu.cpp.core312.Indicator # value = Indicator{...
31
- VOL: hikyuu.cpp.core312.Indicator # value = Indicator{...
30
+ CLOSE: hikyuu.cpp.core313.Indicator # value = Indicator{...
31
+ VOL: hikyuu.cpp.core313.Indicator # value = Indicator{...
@@ -68,7 +68,7 @@
68
68
  "name": "python",
69
69
  "nbconvert_exporter": "python",
70
70
  "pygments_lexer": "ipython3",
71
- "version": "3.9.16"
71
+ "version": "3.12.7"
72
72
  }
73
73
  },
74
74
  "nbformat": 4,
@@ -19,20 +19,39 @@
19
19
  },
20
20
  {
21
21
  "cell_type": "code",
22
- "execution_count": 9,
22
+ "execution_count": 1,
23
23
  "metadata": {},
24
24
  "outputs": [
25
+ {
26
+ "name": "stderr",
27
+ "output_type": "stream",
28
+ "text": [
29
+ "2025-08-11 23:22:04,241 [INFO] runing in interactive session [<module>] (D:\\workspace\\hikyuu\\hikyuu\\__init__.py:109) [hikyuu::hku_info]\n",
30
+ "2025-08-11 23:22:04,241 [INFO] running in jupyter [<module>] (D:\\workspace\\hikyuu\\hikyuu\\__init__.py:116) [hikyuu::hku_info]\n"
31
+ ]
32
+ },
25
33
  {
26
34
  "name": "stdout",
27
35
  "output_type": "stream",
28
36
  "text": [
29
- "CPU times: user 127 μs, sys: 183 μs, total: 310 μs\n",
30
- "Wall time: 312 μs\n"
37
+ "current plugin path: D:\\workspace\\hikyuu\\hikyuu\\plugin\n",
38
+ "2025-08-11 23:22:04.300 [HKU-I] - Using MYSQL BaseInfoDriver (BaseInfoDriver.cpp:57)\n",
39
+ "2025-08-11 23:22:04.326 [HKU-I] - 加载市场信息…… (StockManager.cpp:572)\n",
40
+ "2025-08-11 23:22:04.331 [HKU-I] - 加载证券类型信息…… (StockManager.cpp:590)\n",
41
+ "2025-08-11 23:22:04.336 [HKU-I] - 加载证券信息…… (StockManager.cpp:476)\n",
42
+ "2025-08-11 23:22:04.471 [HKU-I] - 加载权息数据…… (StockManager.cpp:608)\n",
43
+ "2025-08-11 23:22:05.420 [HKU-I] - 加载板块信息…… (StockManager.cpp:181)\n",
44
+ "2025-08-11 23:22:06.582 [HKU-I] - 加载K线数据…… (StockManager.cpp:185)\n",
45
+ "2025-08-11 23:22:06.582 [HKU-I] - 预加载 day K线数据至缓存 (最大数量: 100000)! (StockManager.cpp:229)\n",
46
+ "2025-08-11 23:22:06.583 [HKU-I] - 2.27 秒数据加载完毕. (StockManager.cpp:191)\n",
47
+ "2025-08-11 23:22:06.583 [HKU-I] - 启动行情接收. (SpotAgent.cpp:39)\n",
48
+ "CPU times: total: 1.62 s\n",
49
+ "Wall time: 3.75 s\n"
31
50
  ]
32
51
  }
33
52
  ],
34
53
  "source": [
35
- "%matplotlib inline\n",
54
+ "#%matplotlib inline\n",
36
55
  "%time from hikyuu.interactive import *\n",
37
56
  "#use_draw_engine('echarts') #use_draw_engine('matplotlib') #默认为'matplotlib'绘图"
38
57
  ]
@@ -47,7 +66,7 @@
47
66
  },
48
67
  {
49
68
  "cell_type": "code",
50
- "execution_count": 10,
69
+ "execution_count": 2,
51
70
  "metadata": {},
52
71
  "outputs": [],
53
72
  "source": [
@@ -75,7 +94,7 @@
75
94
  },
76
95
  {
77
96
  "cell_type": "code",
78
- "execution_count": 11,
97
+ "execution_count": 3,
79
98
  "metadata": {},
80
99
  "outputs": [],
81
100
  "source": [
@@ -102,7 +121,7 @@
102
121
  },
103
122
  {
104
123
  "cell_type": "code",
105
- "execution_count": 12,
124
+ "execution_count": 4,
106
125
  "metadata": {},
107
126
  "outputs": [],
108
127
  "source": [
@@ -122,7 +141,7 @@
122
141
  },
123
142
  {
124
143
  "cell_type": "code",
125
- "execution_count": 13,
144
+ "execution_count": 5,
126
145
  "metadata": {},
127
146
  "outputs": [
128
147
  {
@@ -134,57 +153,53 @@
134
153
  "累计投入资产: 0.00\n",
135
154
  "累计借入现金: 0.00\n",
136
155
  "累计借入资产: 0.00\n",
137
- "累计红利: 0.00\n",
138
- "现金余额: 287880.00\n",
139
- "未平仓头寸净值: 11460.00\n",
140
- "当前总资产: 299340.00\n",
156
+ "累计红利: 362.00\n",
157
+ "现金余额: 301532.00\n",
158
+ "未平仓头寸净值: 0.00\n",
159
+ "当前总资产: 301532.00\n",
141
160
  "已平仓交易总成本: 0.00\n",
142
- "已平仓净利润总额: -1050.00\n",
143
- "单笔交易最大占用现金比例%: 3.98\n",
161
+ "已平仓净利润总额: 1532.00\n",
162
+ "单笔交易最大占用现金比例%: 4.14\n",
144
163
  "交易平均占用现金比例%: 3.84\n",
145
- "已平仓帐户收益率%: -0.35\n",
146
- "帐户年复合收益率%: -0.39\n",
147
- "帐户平均年收益率%: -0.39\n",
148
- "赢利交易赢利总额: 130.00\n",
149
- "亏损交易亏损总额: -1180.00\n",
150
- "已平仓交易总数: 7.00\n",
151
- "赢利交易数: 1.00\n",
152
- "亏损交易数: 6.00\n",
153
- "赢利交易比例%: 14.29\n",
154
- "赢利期望值: -150.00\n",
155
- "赢利交易平均赢利: 130.00\n",
156
- "亏损交易平均亏损: -196.67\n",
157
- "平均赢利/平均亏损比例: 0.66\n",
158
- "净赢利/亏损比例: 0.11\n",
159
- "最大单笔赢利: 130.00\n",
160
- "最大单笔盈利百分比%: 1.14\n",
161
- "最大单笔亏损: -470.00\n",
162
- "最大单笔亏损百分比%: -4.00\n",
163
- "赢利交易平均持仓时间: 16.00\n",
164
- "赢利交易最大持仓时间: 16.00\n",
165
- "亏损交易平均持仓时间: 9.67\n",
166
- "亏损交易最大持仓时间: 28.00\n",
167
- "空仓总时间: 130.00\n",
168
- "空仓时间/总时间%: 63.00\n",
169
- "平均空仓时间: 18.00\n",
170
- "最长空仓时间: 38.00\n",
164
+ "已平仓帐户收益率%: 0.51\n",
165
+ "帐户年复合收益率%: 1.03\n",
166
+ "帐户平均年收益率%: 1.02\n",
167
+ "赢利交易赢利总额: 1882.00\n",
168
+ "亏损交易亏损总额: -350.00\n",
169
+ "已平仓交易总数: 6.00\n",
170
+ "赢利交易数: 2.00\n",
171
+ "亏损交易数: 4.00\n",
172
+ "赢利交易比例%: 33.33\n",
173
+ "赢利期望值: 255.33\n",
174
+ "赢利交易平均赢利: 941.00\n",
175
+ "亏损交易平均亏损: -87.50\n",
176
+ "平均赢利/平均亏损比例: 10.75\n",
177
+ "净赢利/亏损比例: 5.38\n",
178
+ "最大单笔赢利: 1752.00\n",
179
+ "最大单笔盈利百分比%: 15.83\n",
180
+ "最大单笔亏损: -210.00\n",
181
+ "最大单笔亏损百分比%: -1.80\n",
182
+ "赢利交易平均持仓时间: 45.50\n",
183
+ "赢利交易最大持仓时间: 75.00\n",
184
+ "亏损交易平均持仓时间: 5.50\n",
185
+ "亏损交易最大持仓时间: 13.00\n",
186
+ "空仓总时间: 69.00\n",
187
+ "空仓时间/总时间%: 37.00\n",
188
+ "平均空仓时间: 11.00\n",
189
+ "最长空仓时间: 32.00\n",
171
190
  "最大连续赢利笔数: 1.00\n",
172
- "最大连续亏损笔数: 3.00\n",
173
- "最大连续赢利金额: 130.00\n",
174
- "最大连续亏损金额: -910.00\n",
175
- "R乘数期望值: -0.01\n",
176
- "交易机会频率/年: 12.52\n",
177
- "年度期望R乘数: -0.13\n",
178
- "赢利交易平均R乘数: 0.01\n",
179
- "亏损交易平均R乘数: -0.02\n",
180
- "最大单笔赢利R乘数: 0.01\n",
181
- "最大单笔亏损R乘数: -0.04\n",
182
- "最大连续赢利R乘数: 0.01\n",
191
+ "最大连续亏损笔数: 1.00\n",
192
+ "最大连续赢利金额: 1752.00\n",
193
+ "最大连续亏损金额: -270.00\n",
194
+ "R乘数期望值: 0.02\n",
195
+ "交易机会频率/年: 12.03\n",
196
+ "年度期望R乘数: 0.24\n",
197
+ "赢利交易平均R乘数: 0.09\n",
198
+ "亏损交易平均R乘数: -0.01\n",
199
+ "最大单笔赢利R乘数: 0.16\n",
200
+ "最大单笔亏损R乘数: -0.02\n",
201
+ "最大连续赢利R乘数: 0.16\n",
183
202
  "最大连续亏损R乘数: -0.03\n",
184
- "最大回撤百分比: -0.28\n",
185
- "夏普比率: -1.59\n",
186
- "单笔交易盈亏百分比均值: -1.27\n",
187
- "单笔交易盈亏百分比标准差: 1.96\n",
188
203
  "\n"
189
204
  ]
190
205
  }
@@ -209,7 +224,7 @@
209
224
  },
210
225
  {
211
226
  "cell_type": "code",
212
- "execution_count": 14,
227
+ "execution_count": 6,
213
228
  "metadata": {},
214
229
  "outputs": [],
215
230
  "source": [
@@ -251,24 +266,24 @@
251
266
  },
252
267
  {
253
268
  "cell_type": "code",
254
- "execution_count": 15,
269
+ "execution_count": 7,
255
270
  "metadata": {},
256
271
  "outputs": [
257
272
  {
258
273
  "name": "stdout",
259
274
  "output_type": "stream",
260
275
  "text": [
261
- "CPU times: user 1.51 s, sys: 76.2 ms, total: 1.59 s\n",
262
- "Wall time: 1.12 s\n"
276
+ "CPU times: total: 5.75 s\n",
277
+ "Wall time: 13.2 s\n"
263
278
  ]
264
279
  },
265
280
  {
266
281
  "data": {
267
282
  "text/plain": [
268
- "6790"
283
+ "6902"
269
284
  ]
270
285
  },
271
- "execution_count": 15,
286
+ "execution_count": 7,
272
287
  "metadata": {},
273
288
  "output_type": "execute_result"
274
289
  }
@@ -288,7 +303,7 @@
288
303
  ],
289
304
  "metadata": {
290
305
  "kernelspec": {
291
- "display_name": "base",
306
+ "display_name": "Python 3 (ipykernel)",
292
307
  "language": "python",
293
308
  "name": "python3"
294
309
  },
@@ -302,7 +317,7 @@
302
317
  "name": "python",
303
318
  "nbconvert_exporter": "python",
304
319
  "pygments_lexer": "ipython3",
305
- "version": "3.12.7"
320
+ "version": "3.12.9"
306
321
  }
307
322
  },
308
323
  "nbformat": 4,