hikyuu 2.3.1__py3-none-win_amd64.whl → 2.5.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 (157) hide show
  1. hikyuu/__init__.py +438 -6
  2. hikyuu/__init__.pyi +647 -496
  3. hikyuu/analysis/__init__.pyi +478 -466
  4. hikyuu/analysis/analysis.pyi +500 -486
  5. hikyuu/core.pyi +480 -468
  6. hikyuu/cpp/core310.pyd +0 -0
  7. hikyuu/cpp/core311.pyd +0 -0
  8. hikyuu/cpp/core312.pyd +0 -0
  9. hikyuu/cpp/core313.pyd +0 -0
  10. hikyuu/cpp/core38.pyd +0 -0
  11. hikyuu/cpp/core39.pyd +0 -0
  12. hikyuu/cpp/hikyuu.dll +0 -0
  13. hikyuu/cpp/hikyuu.lib +0 -0
  14. hikyuu/cpp/sqlite3.dll +0 -0
  15. hikyuu/data/common_mysql.py +24 -7
  16. hikyuu/data/common_pytdx.py +17 -1
  17. hikyuu/data/em_block_to_mysql.py +3 -2
  18. hikyuu/data/em_block_to_sqlite.py +8 -3
  19. hikyuu/data/mysql_upgrade/0026.sql +9 -0
  20. hikyuu/data/sqlite_upgrade/0026.sql +10 -0
  21. hikyuu/draw/__init__.pyi +35 -0
  22. hikyuu/draw/drawplot/__init__.pyi +134 -0
  23. hikyuu/draw/drawplot/bokeh_draw.pyi +796 -0
  24. hikyuu/draw/drawplot/common.pyi +10 -0
  25. hikyuu/draw/drawplot/echarts_draw.py +5 -12
  26. hikyuu/draw/drawplot/echarts_draw.pyi +682 -0
  27. hikyuu/draw/drawplot/matplotlib_draw.py +18 -3
  28. hikyuu/draw/drawplot/matplotlib_draw.pyi +1101 -0
  29. hikyuu/draw/elder.pyi +44 -0
  30. hikyuu/draw/kaufman.pyi +38 -0
  31. hikyuu/draw/volume.pyi +31 -0
  32. hikyuu/examples/notebook/Demo/Demo2.ipynb +1 -1
  33. hikyuu/extend.py +9 -3
  34. hikyuu/extend.pyi +524 -504
  35. hikyuu/fetcher/stock/zh_block_em.py +118 -51
  36. hikyuu/gui/data/EscapetimeThread.py +4 -4
  37. hikyuu/gui/data/ImportBlockInfoTask.py +3 -2
  38. hikyuu/gui/data/ImportHistoryFinanceTask.py +2 -0
  39. hikyuu/gui/data/MainWindow.py +48 -42
  40. hikyuu/gui/importdata.py +13 -26
  41. hikyuu/hub.py +2 -4
  42. hikyuu/hub.pyi +52 -58
  43. hikyuu/include/hikyuu/DataType.h +5 -0
  44. hikyuu/include/hikyuu/Stock.h +7 -0
  45. hikyuu/include/hikyuu/indicator/Indicator.h +1 -1
  46. hikyuu/include/hikyuu/indicator/Indicator2InImp.h +65 -0
  47. hikyuu/include/hikyuu/indicator/IndicatorImp.h +1 -3
  48. hikyuu/include/hikyuu/indicator/build_in.h +7 -0
  49. hikyuu/include/hikyuu/indicator/crt/COST.h +3 -0
  50. hikyuu/include/hikyuu/indicator/crt/CYCLE.h +24 -0
  51. hikyuu/include/hikyuu/indicator/crt/DISCARD.h +27 -0
  52. hikyuu/include/hikyuu/indicator/crt/HSL.h +1 -13
  53. hikyuu/include/hikyuu/indicator/crt/INBLOCK.h +31 -0
  54. hikyuu/include/hikyuu/indicator/crt/INDEX.h +35 -23
  55. hikyuu/include/hikyuu/indicator/crt/JUMPDOWN.h +24 -0
  56. hikyuu/include/hikyuu/indicator/crt/JUMPUP.h +24 -0
  57. hikyuu/include/hikyuu/indicator/crt/LASTVALUE.h +29 -0
  58. hikyuu/include/hikyuu/indicator/crt/LIUTONGPAN.h +1 -0
  59. hikyuu/include/hikyuu/indicator/crt/WINNER.h +38 -0
  60. hikyuu/include/hikyuu/indicator/imp/ICorr.h +6 -21
  61. hikyuu/include/hikyuu/indicator/imp/ICost.h +31 -0
  62. hikyuu/include/hikyuu/indicator/imp/ICycle.h +30 -0
  63. hikyuu/include/hikyuu/indicator/imp/IDiscard.h +28 -0
  64. hikyuu/include/hikyuu/indicator/imp/IDma.h +6 -23
  65. hikyuu/include/hikyuu/indicator/imp/IHsl.h +30 -0
  66. hikyuu/include/hikyuu/indicator/imp/IInBlock.h +30 -0
  67. hikyuu/include/hikyuu/indicator/imp/IIndex.h +26 -0
  68. hikyuu/include/hikyuu/indicator/imp/IJumpDown.h +24 -0
  69. hikyuu/include/hikyuu/indicator/imp/IJumpUp.h +24 -0
  70. hikyuu/include/hikyuu/indicator/imp/ILastValue.h +26 -0
  71. hikyuu/include/hikyuu/indicator/imp/ISpearman.h +5 -20
  72. hikyuu/include/hikyuu/indicator/imp/IWinner.h +26 -0
  73. hikyuu/include/hikyuu/indicator_talib/imp/TaMavp.h +5 -19
  74. hikyuu/include/hikyuu/indicator_talib/imp/ta_defines.h +12 -63
  75. hikyuu/include/hikyuu/indicator_talib/imp/ta_imp.h +7 -53
  76. hikyuu/include/hikyuu/strategy/RunPortfolioInStrategy.h +3 -4
  77. hikyuu/include/hikyuu/strategy/Strategy.h +4 -5
  78. hikyuu/include/hikyuu/trade_manage/TradeRecord.h +5 -1
  79. hikyuu/include/hikyuu/trade_sys/allocatefunds/build_in.h +1 -0
  80. hikyuu/include/hikyuu/trade_sys/allocatefunds/crt/AF_FixedWeightList.h +22 -0
  81. hikyuu/include/hikyuu/trade_sys/allocatefunds/imp/FixedWeightListAllocateFunds.h +25 -0
  82. hikyuu/include/hikyuu/trade_sys/moneymanager/MoneyManagerBase.h +17 -4
  83. hikyuu/include/hikyuu/trade_sys/moneymanager/build_in.h +2 -0
  84. hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedCapital.h +6 -0
  85. hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedCapitalFunds.h +26 -0
  86. hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedCountTps.h +27 -0
  87. hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedRisk.h +6 -0
  88. hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedUnits.h +6 -0
  89. hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_WilliamsFixedRisk.h +7 -0
  90. hikyuu/include/hikyuu/trade_sys/moneymanager/imp/FixedCapitalFundsMM.h +28 -0
  91. hikyuu/include/hikyuu/trade_sys/moneymanager/imp/FixedCountTpsMM.h +44 -0
  92. hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +38 -37
  93. hikyuu/include/hikyuu/trade_sys/portfolio/build_in.h +1 -0
  94. hikyuu/include/hikyuu/trade_sys/portfolio/crt/PF_Simple.h +25 -1
  95. hikyuu/include/hikyuu/trade_sys/portfolio/crt/PF_WithoutAF.h +50 -0
  96. hikyuu/include/hikyuu/trade_sys/portfolio/imp/SimplePortfolio.h +53 -0
  97. hikyuu/include/hikyuu/trade_sys/portfolio/imp/WithoutAFPortfolio.h +57 -0
  98. hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector.h +7 -0
  99. hikyuu/include/hikyuu/trade_sys/signal/SignalBase.h +51 -5
  100. hikyuu/include/hikyuu/trade_sys/signal/build_in.h +2 -0
  101. hikyuu/include/hikyuu/trade_sys/signal/crt/SG_Bool.h +2 -1
  102. hikyuu/include/hikyuu/trade_sys/signal/crt/SG_Logic.h +37 -0
  103. hikyuu/include/hikyuu/trade_sys/signal/crt/SG_OneSide.h +28 -0
  104. hikyuu/include/hikyuu/trade_sys/signal/imp/OneSideSignal.h +46 -0
  105. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/AddSignal.h +19 -0
  106. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/AddValueSignal.h +19 -0
  107. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/DivSignal.h +19 -0
  108. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/DivValueSignal.h +22 -0
  109. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/MulSignal.h +19 -0
  110. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/MulValueSignal.h +19 -0
  111. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorSignal.h +68 -0
  112. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorValueSignal.h +67 -0
  113. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/SubSignal.h +19 -0
  114. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/SubValueSignal.h +22 -0
  115. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/__init__.py +1 -0
  116. hikyuu/include/hikyuu/trade_sys/stoploss/crt/ST_Indicator.h +1 -1
  117. hikyuu/include/hikyuu/trade_sys/stoploss/imp/IndicatorStoploss.h +3 -4
  118. hikyuu/include/hikyuu/utilities/FilterNode.h +2 -2
  119. hikyuu/include/hikyuu/utilities/Log.h +42 -15
  120. hikyuu/include/hikyuu/utilities/datetime/Datetime.h +1 -1
  121. hikyuu/include/hikyuu/utilities/datetime/TimeDelta.h +2 -2
  122. hikyuu/include/hikyuu/utilities/db_connect/DBCondition.h +4 -0
  123. hikyuu/include/hikyuu/utilities/db_connect/SQLResultSet.h +2 -2
  124. hikyuu/include/hikyuu/utilities/db_connect/mysql/MySQLConnect.h +5 -1
  125. hikyuu/include/hikyuu/utilities/node/NodeServer.h +4 -4
  126. hikyuu/include/hikyuu/utilities/thread/MQStealThreadPool.h +2 -2
  127. hikyuu/include/hikyuu/utilities/thread/MQThreadPool.h +2 -2
  128. hikyuu/include/hikyuu/utilities/thread/StealThreadPool.h +5 -5
  129. hikyuu/include/hikyuu/utilities/thread/ThreadPool.h +2 -2
  130. hikyuu/include/hikyuu/utilities/thread/algorithm.h +16 -10
  131. hikyuu/include/hikyuu/version.h +4 -4
  132. hikyuu/indicator/indicator.py +1 -0
  133. hikyuu/interactive.py +1 -318
  134. hikyuu/trade_manage/__init__.pyi +492 -478
  135. hikyuu/trade_manage/broker.pyi +18 -19
  136. hikyuu/trade_manage/broker_easytrader.pyi +4 -6
  137. hikyuu/trade_manage/broker_mail.pyi +24 -22
  138. hikyuu/trade_manage/trade.pyi +492 -478
  139. hikyuu/util/check.pyi +15 -17
  140. hikyuu/util/mylog.pyi +7 -8
  141. hikyuu/util/notebook.pyi +11 -9
  142. hikyuu/util/singleton.pyi +6 -8
  143. hikyuu/util/slice.pyi +2 -1
  144. {hikyuu-2.3.1.dist-info → hikyuu-2.5.1.dist-info}/METADATA +2 -2
  145. {hikyuu-2.3.1.dist-info → hikyuu-2.5.1.dist-info}/RECORD +149 -105
  146. {hikyuu-2.3.1.dist-info → hikyuu-2.5.1.dist-info}/top_level.txt +1 -0
  147. hikyuu/cpp/__init__.pyi +0 -3
  148. hikyuu/cpp/core310.pyi +0 -12503
  149. hikyuu/cpp/core311.pyi +0 -12503
  150. hikyuu/cpp/core312.pyi +0 -12503
  151. hikyuu/cpp/core313.pyi +0 -12494
  152. hikyuu/cpp/core38.pyi +0 -12503
  153. hikyuu/cpp/core39.pyi +0 -12503
  154. hikyuu/deprecated.py +0 -651
  155. {hikyuu-2.3.1.dist-info → hikyuu-2.5.1.dist-info}/LICENSE +0 -0
  156. {hikyuu-2.3.1.dist-info → hikyuu-2.5.1.dist-info}/WHEEL +0 -0
  157. {hikyuu-2.3.1.dist-info → hikyuu-2.5.1.dist-info}/entry_points.txt +0 -0
hikyuu/cpp/core310.pyd CHANGED
Binary file
hikyuu/cpp/core311.pyd CHANGED
Binary file
hikyuu/cpp/core312.pyd CHANGED
Binary file
hikyuu/cpp/core313.pyd CHANGED
Binary file
hikyuu/cpp/core38.pyd CHANGED
Binary file
hikyuu/cpp/core39.pyd CHANGED
Binary file
hikyuu/cpp/hikyuu.dll CHANGED
Binary file
hikyuu/cpp/hikyuu.lib CHANGED
Binary file
hikyuu/cpp/sqlite3.dll CHANGED
Binary file
@@ -29,7 +29,12 @@ from pathlib import Path
29
29
  import mysql.connector
30
30
 
31
31
  from hikyuu.data.common import get_stktype_list, get_new_holidays
32
- from hikyuu.util import hku_debug
32
+ from hikyuu.util import hku_debug, hku_info
33
+
34
+
35
+ def get_mysql_connect_version():
36
+ m, n, _ = mysql.connector.__version__.split('.')
37
+ return int(m) + float(n) * 0.1
33
38
 
34
39
 
35
40
  def is_exist_db(connect):
@@ -56,13 +61,19 @@ def create_database(connect):
56
61
  """创建数据库"""
57
62
  sql_dir = os.path.dirname(__file__) + "/mysql_upgrade"
58
63
  cur = connect.cursor()
64
+ mysql_version = get_mysql_connect_version()
59
65
  if not is_exist_db(connect):
60
66
  filename = sql_dir + "/createdb.sql"
61
67
  with open(filename, 'r', encoding='utf8') as f:
62
68
  sql = f.read()
63
- for x in cur.execute(sql, multi=True):
64
- # print(x.statement)
65
- pass
69
+ if mysql_version >= 9.2:
70
+ cur.execute(sql)
71
+ _ = cur.fetchall()
72
+ while cur.nextset():
73
+ _ = cur.fetchall()
74
+ else:
75
+ for x in cur.execute(sql, multi=True):
76
+ pass
66
77
 
67
78
  db_version = get_db_version(connect)
68
79
  files = [x for x in Path(sql_dir).iterdir()
@@ -73,9 +84,15 @@ def create_database(connect):
73
84
  files.sort()
74
85
  for file in files:
75
86
  sql = file.read_text(encoding='utf8')
76
- for x in cur.execute(sql, multi=True):
77
- # print(x.statement)
78
- pass
87
+ if mysql_version >= 9.2:
88
+ cur.execute(sql, map_results=False)
89
+ _ = cur.fetchall()
90
+ while cur.nextset():
91
+ _ = cur.fetchall()
92
+ else:
93
+ for x in cur.execute(sql, multi=True):
94
+ # print(x.statement)
95
+ pass
79
96
 
80
97
  connect.commit()
81
98
  cur.close()
@@ -77,7 +77,23 @@ def search_best_tdx():
77
77
  res = executor.map(ping2, hosts, timeout=2)
78
78
  x = [i for i in res if i[0] == True]
79
79
  x.sort(key=lambda item: item[1])
80
- return x
80
+
81
+ # 校验 host 是否存在错误,取同样数据,相同结果最多的集合
82
+ values = {}
83
+ for host in x:
84
+ api = TdxHq_API(multithread=False)
85
+ if api.connect(host[2], host[3]):
86
+ x = api.get_security_bars(9, 0, '159915', 0, 1)
87
+ if x and len(x) > 0:
88
+ if x[0]['close'] not in values:
89
+ values[x[0]['close']] = [host]
90
+ else:
91
+ values[x[0]['close']].append(host)
92
+ ret = []
93
+ for _, host in values.items():
94
+ if len(host) > len(ret):
95
+ ret = host
96
+ return ret
81
97
 
82
98
 
83
99
  def pytdx_get_day_trans(api, pymarket, code, date):
@@ -74,7 +74,7 @@ def em_import_block_to_mysql(connect, code_market_dict, categorys=('行业板块
74
74
  hku_info("更新数据库")
75
75
  cur = connect.cursor()
76
76
  if len(blks) == 1:
77
- sql = f"delete from hku_base.block where category in ({blks[0]})"
77
+ sql = f"delete from hku_base.block where category in ('{blks[0]}')"
78
78
  else:
79
79
  sql = f"delete from hku_base.block where category in {tuple(blks)}"
80
80
  cur.execute(sql)
@@ -88,11 +88,12 @@ def em_import_block_to_mysql(connect, code_market_dict, categorys=('行业板块
88
88
 
89
89
  if insert_records:
90
90
  sql = "insert into hku_base.block (category, name, market_code) values (%s,%s,%s)"
91
+ hku_info(f"insert block records: {len(insert_records)}")
91
92
  cur.executemany(sql, insert_records)
92
93
 
93
94
  connect.commit()
94
95
  cur.close()
95
- pass
96
+ return len(insert_records)
96
97
 
97
98
 
98
99
  if __name__ == "__main__":
@@ -69,13 +69,15 @@ def em_import_block_to_sqlite(connect, code_market_dict, categorys=('行业板
69
69
  if success_fetch_zs:
70
70
  blks.append('指数板块')
71
71
 
72
+ print(blks)
73
+
72
74
  if not blks:
73
75
  return
74
76
 
75
77
  hku_info("更新数据库")
76
78
  cur = connect.cursor()
77
79
  if len(blks) == 1:
78
- sql = f"delete from block where category in ({blks[0]})"
80
+ sql = f"delete from block where category in ('{blks[0]}')"
79
81
  else:
80
82
  sql = f"delete from block where category in {tuple(blks)}"
81
83
  hku_info(sql)
@@ -90,10 +92,12 @@ def em_import_block_to_sqlite(connect, code_market_dict, categorys=('行业板
90
92
 
91
93
  if insert_records:
92
94
  sql = "insert into block (category, name, market_code) values (?,?,?)"
95
+ hku_info(f"insert block records: {len(insert_records)}")
93
96
  cur.executemany(sql, insert_records)
94
97
 
95
98
  connect.commit()
96
99
  cur.close()
100
+ return len(insert_records)
97
101
 
98
102
 
99
103
  if __name__ == "__main__":
@@ -101,7 +105,8 @@ if __name__ == "__main__":
101
105
  from hikyuu.data.common_sqlite3 import create_database
102
106
 
103
107
  # dest_dir = "/home/fasiondog/stock"
104
- dest_dir = "d:\\stock"
108
+ dest_dir = "/Users/fasiondog/stock"
109
+ # dest_dir = "d:\\stock"
105
110
 
106
111
  connect = sqlite3.connect(dest_dir + "/stock.db")
107
112
  create_database(connect)
@@ -112,6 +117,6 @@ if __name__ == "__main__":
112
117
  code_market_dict[v["code"]] = MARKET.SH
113
118
  # print(code_market_dict)
114
119
 
115
- em_import_block_to_sqlite(connect, code_market_dict)
120
+ em_import_block_to_sqlite(connect, code_market_dict, categorys=('地域板块',))
116
121
 
117
122
  connect.close()
@@ -0,0 +1,9 @@
1
+ ALTER TABLE `hku_base`.`coderuletype` modify `id` int(11) auto_increment;
2
+ INSERT INTO `hku_base`.`coderuletype` (`marketid`,`codepre`,`type`,`description`) VALUES (3,'899',2,'北证指数');
3
+ UPDATE `hku_base`.`market` SET `code`='899050' WHERE `marketid`=3;
4
+ INSERT INTO `hku_base`.`stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
5
+ SELECT 3, '899050', '北证50', 2, 1, 20220429, 99999999
6
+ WHERE NOT EXISTS (
7
+ SELECT `stockid` FROM `hku_base`.`stock` WHERE `marketid`=3 and `code`='899050'
8
+ );
9
+ UPDATE `hku_base`.`version` set `version` = 26;
@@ -0,0 +1,10 @@
1
+ BEGIN TRANSACTION;
2
+ INSERT INTO `coderuletype` (marketid,codepre,type,description) VALUES (3,'899',2,'北证指数');
3
+ UPDATE `market` SET `code`='899050' WHERE `marketid`=3;
4
+ INSERT INTO `Stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
5
+ SELECT 3, '899050', '北证50', 2, 1, 20220429, 99999999
6
+ WHERE NOT EXISTS (
7
+ SELECT stockid FROM `Stock` WHERE `marketid`=3 and `code`='899050'
8
+ );
9
+ UPDATE `version` set `version` = 26;
10
+ COMMIT;
@@ -0,0 +1,35 @@
1
+ from __future__ import annotations
2
+ from hikyuu.draw.drawplot import adjust_axes_show
3
+ from hikyuu.draw.drawplot import ax_draw_macd
4
+ from hikyuu.draw.drawplot import ax_draw_macd2
5
+ from hikyuu.draw.drawplot import ax_set_locator_formatter
6
+ from hikyuu.draw.drawplot import create_figure
7
+ from hikyuu.draw.drawplot import gca
8
+ from hikyuu.draw.drawplot import gcf
9
+ from hikyuu.draw.drawplot import get_current_draw_engine
10
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWBAND
11
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWICON
12
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWIMG
13
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWIMG as DRAWBMP
14
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWLINE
15
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWNUMBER
16
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWNUMBER_FIX
17
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWRECTREL
18
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWSL
19
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWTEXT
20
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWTEXT_FIX
21
+ from hikyuu.draw.drawplot.matplotlib_draw import PLOYLINE
22
+ from hikyuu.draw.drawplot.matplotlib_draw import RGB
23
+ from hikyuu.draw.drawplot.matplotlib_draw import SHOWICONS
24
+ from hikyuu.draw.drawplot.matplotlib_draw import STICKLINE
25
+ from hikyuu.draw.drawplot import show_gcf
26
+ from hikyuu.draw.drawplot import use_draw_engine
27
+ from . import drawplot
28
+ from . import elder
29
+ from . import kaufman
30
+ from . import volume
31
+ __all__: list = ['vl', 'el', 'kf', 'use_draw_engine', 'get_current_draw_engine', 'create_figure', 'ax_set_locator_formatter', 'adjust_axes_show', 'ax_draw_macd', 'ax_draw_macd2', 'gcf', 'gca', 'show_gcf', 'DRAWNULL', 'STICKLINE', 'DRAWBAND', 'RGB', 'PLOYLINE', 'DRAWLINE', 'DRAWTEXT', 'DRAWNUMBER', 'DRAWTEXT_FIX', 'DRAWNUMBER_FIX', 'DRAWSL', 'DRAWIMG', 'DRAWICON', 'DRAWBMP', 'SHOWICONS', 'DRAWRECTREL']
32
+ DRAWNULL: float # value = nan
33
+ el = elder
34
+ kf = kaufman
35
+ vl = volume
@@ -0,0 +1,134 @@
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.draw.drawplot.bokeh_draw import ax_draw_macd as bk_ax_draw_macd
10
+ from hikyuu.draw.drawplot.bokeh_draw import ax_draw_macd2 as bk_ax_draw_macd2
11
+ from hikyuu.draw.drawplot.bokeh_draw import create_figure as bk_create_figure
12
+ from hikyuu.draw.drawplot.bokeh_draw import gca as bk_gca
13
+ from hikyuu.draw.drawplot.bokeh_draw import gcf as bk_gcf
14
+ from hikyuu.draw.drawplot.bokeh_draw import ibar as bk_ibar
15
+ from hikyuu.draw.drawplot.bokeh_draw import iplot as bk_iplot
16
+ from hikyuu.draw.drawplot.bokeh_draw import kplot as bk_kplot
17
+ from hikyuu.draw.drawplot.bokeh_draw import sgplot as bk_sgplot
18
+ from hikyuu.draw.drawplot.bokeh_draw import show_gcf as bk_show_gcf
19
+ from hikyuu.draw.drawplot.bokeh_draw import use_bokeh_in_notebook
20
+ from hikyuu.draw.drawplot.echarts_draw import ibar as ec_ibar
21
+ from hikyuu.draw.drawplot.echarts_draw import iplot as ec_iplot
22
+ from hikyuu.draw.drawplot.echarts_draw import kplot as ec_kplot
23
+ from hikyuu.draw.drawplot.echarts_draw import sys_performance as ec_sys_performance
24
+ from hikyuu.draw.drawplot.echarts_draw import sysplot as ec_sysplot
25
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWBAND
26
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWICON
27
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWIMG
28
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWIMG as DRAWBMP
29
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWLINE
30
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWNUMBER
31
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWNUMBER_FIX
32
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWRECTREL
33
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWSL
34
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWTEXT
35
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWTEXT_FIX
36
+ from hikyuu.draw.drawplot.matplotlib_draw import PLOYLINE
37
+ from hikyuu.draw.drawplot.matplotlib_draw import RGB
38
+ from hikyuu.draw.drawplot.matplotlib_draw import SHOWICONS
39
+ from hikyuu.draw.drawplot.matplotlib_draw import STICKLINE
40
+ from hikyuu.draw.drawplot.matplotlib_draw import adjust_axes_show as mpl_adjust_axes_show
41
+ from hikyuu.draw.drawplot.matplotlib_draw import ax_draw_macd as mpl_ax_draw_macd
42
+ from hikyuu.draw.drawplot.matplotlib_draw import ax_draw_macd2 as mpl_ax_draw_macd2
43
+ from hikyuu.draw.drawplot.matplotlib_draw import ax_set_locator_formatter as mpl_ax_set_locator_formatter
44
+ from hikyuu.draw.drawplot.matplotlib_draw import cnplot as mpl_cnplot
45
+ from hikyuu.draw.drawplot.matplotlib_draw import create_figure as mpl_create_figure
46
+ from hikyuu.draw.drawplot.matplotlib_draw import evplot as mpl_evplot
47
+ from hikyuu.draw.drawplot.matplotlib_draw import ibar as mpl_ibar
48
+ from hikyuu.draw.drawplot.matplotlib_draw import iplot as mpl_iplot
49
+ from hikyuu.draw.drawplot.matplotlib_draw import kplot as mpl_kplot
50
+ from hikyuu.draw.drawplot.matplotlib_draw import mkplot as mpl_mkplot
51
+ from hikyuu.draw.drawplot.matplotlib_draw import set_mpl_params
52
+ from hikyuu.draw.drawplot.matplotlib_draw import sgplot as mpl_sgplot
53
+ from hikyuu.draw.drawplot.matplotlib_draw import sys_performance as mpl_sys_performance
54
+ from hikyuu.draw.drawplot.matplotlib_draw import sysplot as mpl_sysplot
55
+ import matplotlib as matplotlib
56
+ from matplotlib.pyplot import gca as mpl_gca
57
+ from matplotlib.pyplot import gcf as mpl_gcf
58
+ from . import bokeh_draw
59
+ from . import common
60
+ from . import echarts_draw
61
+ from . import matplotlib_draw
62
+ __all__: list = ['use_draw_engine', 'get_current_draw_engine', 'create_figure', 'gcf', 'show_gcf', 'gca', 'ax_draw_macd', 'ax_draw_macd2', 'use_bokeh_in_notebook', 'use_draw_with_echarts', 'DRAWNULL', 'STICKLINE', 'DRAWBAND', 'RGB', 'PLOYLINE', 'DRAWLINE', 'DRAWTEXT', 'DRAWNUMBER', 'DRAWTEXT_FIX', 'DRAWNUMBER_FIX', 'DRAWSL', 'DRAWIMG', 'DRAWICON', 'DRAWBMP', 'SHOWICONS', 'DRAWRECTREL']
63
+ def adjust_axes_show(axeslist):
64
+ """
65
+ 用于调整上下紧密相连的坐标轴显示时,其上一坐标轴最小值刻度和下一坐标轴最大值刻度
66
+ 显示重叠的问题。
67
+
68
+ :param axeslist: 上下相连的坐标轴列表 (ax1,ax2,...)
69
+
70
+ """
71
+ def ax_draw_macd(axes, kdata, n1 = 12, n2 = 26, n3 = 9):
72
+ """
73
+ 绘制MACD
74
+
75
+ :param axes: 指定的坐标轴
76
+ :param KData kdata: KData
77
+ :param int n1: 指标 MACD 的参数1
78
+ :param int n2: 指标 MACD 的参数2
79
+ :param int n3: 指标 MACD 的参数3
80
+
81
+ """
82
+ def ax_draw_macd2(axes, ref, kdata, n1 = 12, n2 = 26, n3 = 9):
83
+ """
84
+ 绘制MACD。
85
+ 当BAR值变化与参考序列ref变化不一致时,显示为灰色,
86
+ 当BAR和参考序列ref同时上涨,显示红色
87
+ 当BAR和参考序列ref同时下跌,显示绿色
88
+
89
+ :param axes: 指定的坐标轴
90
+ :param ref: 参考序列,EMA
91
+ :param KData kdata: KData
92
+ :param int n1: 指标 MACD 的参数1
93
+ :param int n2: 指标 MACD 的参数2
94
+ :param int n3: 指标 MACD 的参数3
95
+
96
+ """
97
+ def ax_set_locator_formatter(axes, dates, typ):
98
+ """
99
+ 设置指定坐标轴的日期显示,根据指定的K线类型优化X轴坐标显示
100
+
101
+ :param axes: 指定的坐标轴
102
+ :param dates: Datetime构成可迭代序列
103
+ :param Query.KType typ: K线类型
104
+
105
+ """
106
+ def create_figure(n = 1, figsize = None):
107
+ """
108
+ 生成含有指定坐标轴数量的窗口,最大只支持4个坐标轴。
109
+
110
+ :param int n: 坐标轴数量
111
+ :param figsize: (宽, 高)
112
+ :return: (ax1, ax2, ...) 根据指定的坐标轴数量而定,超出[1,4]个坐标轴时,返回None
113
+
114
+ """
115
+ def gca():
116
+ ...
117
+ def gcf():
118
+ ...
119
+ def get_current_draw_engine():
120
+ ...
121
+ def set_current_draw_engine(engine):
122
+ ...
123
+ def show_gcf():
124
+ ...
125
+ def use_draw_engine(engine = 'matplotlib'):
126
+ ...
127
+ def use_draw_with_bokeh():
128
+ ...
129
+ def use_draw_with_echarts():
130
+ ...
131
+ def use_draw_with_matplotlib():
132
+ ...
133
+ DRAWNULL: float # value = nan
134
+ g_draw_engine: str = 'matplotlib'