hikyuu 2.6.8.4__py3-none-macosx_11_0_arm64.whl → 2.7.0.4__py3-none-macosx_11_0_arm64.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 (208) hide show
  1. hikyuu/.style.yapf +350 -0
  2. hikyuu/__init__.py +31 -17
  3. hikyuu/__init__.pyi +677 -655
  4. hikyuu/analysis/__init__.pyi +584 -563
  5. hikyuu/analysis/analysis.pyi +604 -585
  6. hikyuu/core.py +2 -0
  7. hikyuu/core.pyi +586 -565
  8. hikyuu/cpp/__init__.pyi +2 -2
  9. hikyuu/cpp/core310.pyi +493 -108
  10. hikyuu/cpp/core310.so +0 -0
  11. hikyuu/cpp/core311.pyi +493 -108
  12. hikyuu/cpp/core311.so +0 -0
  13. hikyuu/cpp/core312.pyi +493 -108
  14. hikyuu/cpp/core312.so +0 -0
  15. hikyuu/cpp/core313.pyi +493 -108
  16. hikyuu/cpp/core313.so +0 -0
  17. hikyuu/cpp/i18n/zh_CN/hikyuu.mo +0 -0
  18. hikyuu/cpp/libboost_charconv-mt.dylib +0 -0
  19. hikyuu/cpp/libboost_chrono-mt.dylib +0 -0
  20. hikyuu/cpp/libboost_date_time-mt.dylib +0 -0
  21. hikyuu/cpp/libboost_serialization-mt.dylib +0 -0
  22. hikyuu/cpp/libboost_system-mt.dylib +0 -0
  23. hikyuu/cpp/libboost_thread-mt.dylib +0 -0
  24. hikyuu/cpp/libboost_wserialization-mt.dylib +0 -0
  25. hikyuu/cpp/libhikyuu.dylib +0 -0
  26. hikyuu/cpp/libsqlite3.dylib +0 -0
  27. hikyuu/data/clickhouse_upgrade/createdb.sql +105 -105
  28. hikyuu/data/common.py +3 -3
  29. hikyuu/data/common_clickhouse.py +1 -1
  30. hikyuu/data/download_block.py +351 -0
  31. hikyuu/data/em_block_to_clickhouse.py +26 -74
  32. hikyuu/data/em_block_to_mysql.py +25 -75
  33. hikyuu/data/em_block_to_sqlite.py +26 -78
  34. hikyuu/data/hku_config_template.py +3 -3
  35. hikyuu/data/pytdx_to_clickhouse.py +15 -11
  36. hikyuu/data/pytdx_to_h5.py +6 -2
  37. hikyuu/data/pytdx_to_mysql.py +5 -1
  38. hikyuu/data/pytdx_weight_to_clickhouse.py +1 -1
  39. hikyuu/data/pytdx_weight_to_mysql.py +1 -1
  40. hikyuu/data/pytdx_weight_to_sqlite.py +1 -1
  41. hikyuu/data/zh_bond10_to_clickhouse.py +1 -1
  42. hikyuu/draw/__init__.pyi +1 -1
  43. hikyuu/draw/drawplot/__init__.pyi +32 -37
  44. hikyuu/draw/drawplot/bokeh_draw.pyi +668 -659
  45. hikyuu/draw/drawplot/common.pyi +3 -4
  46. hikyuu/draw/drawplot/echarts_draw.pyi +615 -594
  47. hikyuu/draw/drawplot/matplotlib_draw.py +4 -74
  48. hikyuu/draw/drawplot/matplotlib_draw.pyi +889 -901
  49. hikyuu/draw/elder.pyi +19 -20
  50. hikyuu/draw/kaufman.pyi +18 -18
  51. hikyuu/draw/volume.pyi +10 -10
  52. hikyuu/examples/notebook/Demo/Demo1.ipynb +48 -33
  53. hikyuu/examples/notebook/LICENSE +20 -0
  54. hikyuu/extend.py +0 -7
  55. hikyuu/extend.pyi +615 -598
  56. hikyuu/fetcher/stock/zh_block_em.py +12 -40
  57. hikyuu/gui/HikyuuTDX.py +99 -31
  58. hikyuu/gui/data/CollectSpotThread.py +1 -1
  59. hikyuu/gui/data/EscapetimeThread.py +8 -14
  60. hikyuu/gui/data/ImportBlockInfoTask.py +3 -10
  61. hikyuu/gui/data/MainWindow.py +1196 -717
  62. hikyuu/gui/data/MainWindow.ui +2059 -0
  63. hikyuu/gui/data/SchedImportThread.py +2 -2
  64. hikyuu/gui/data/UsePytdxImportToH5Thread.py +3 -3
  65. hikyuu/gui/data/UseQmtImportToH5Thread.py +2 -2
  66. hikyuu/gui/data/UseTdxImportToH5Thread.py +3 -3
  67. hikyuu/gui/data/tool.py +32 -25
  68. hikyuu/gui/dataserver.py +5 -3
  69. hikyuu/gui/images/liandongxiaopu.png +0 -0
  70. hikyuu/hub.pyi +69 -67
  71. hikyuu/include/hikyuu/DataType.h +4 -16
  72. hikyuu/include/hikyuu/KData.h +6 -3
  73. hikyuu/include/hikyuu/KDataPrivatedBufferImp.h +1 -1
  74. hikyuu/include/hikyuu/KDataSharedBufferImp.h +1 -1
  75. hikyuu/include/hikyuu/KQuery.h +2 -2
  76. hikyuu/include/hikyuu/Stock.h +4 -1
  77. hikyuu/include/hikyuu/StockManager.h +13 -3
  78. hikyuu/include/hikyuu/data_driver/BaseInfoDriver.h +8 -0
  79. hikyuu/include/hikyuu/data_driver/BlockInfoDriver.h +6 -0
  80. hikyuu/include/hikyuu/data_driver/KDataDriver.h +26 -1
  81. hikyuu/include/hikyuu/data_driver/base_info/mysql/MySQLBaseInfoDriver.h +1 -1
  82. hikyuu/include/hikyuu/data_driver/base_info/sqlite/SQLiteBaseInfoDriver.h +1 -1
  83. hikyuu/include/hikyuu/data_driver/block_info/mysql/MySQLBlockInfoDriver.h +2 -1
  84. hikyuu/include/hikyuu/data_driver/block_info/qianlong/QLBlockInfoDriver.h +2 -1
  85. hikyuu/include/hikyuu/data_driver/block_info/sqlite/SQLiteBlockInfoDriver.h +2 -1
  86. hikyuu/include/hikyuu/data_driver/kdata/DoNothingKDataDriver.h +1 -1
  87. hikyuu/include/hikyuu/data_driver/kdata/cvs/KDataTempCsvDriver.h +1 -1
  88. hikyuu/include/hikyuu/data_driver/kdata/hdf5/H5KDataDriver.h +1 -1
  89. hikyuu/include/hikyuu/data_driver/kdata/mysql/MySQLKDataDriver.h +1 -1
  90. hikyuu/include/hikyuu/data_driver/kdata/sqlite/SQLiteKDataDriver.h +1 -1
  91. hikyuu/include/hikyuu/data_driver/kdata/tdx/TdxKDataDriver.h +1 -1
  92. hikyuu/include/hikyuu/hikyuu.h +1 -1
  93. hikyuu/include/hikyuu/indicator/build_in.h +1 -0
  94. hikyuu/include/hikyuu/indicator/crt/CYCLE.h +4 -4
  95. hikyuu/include/hikyuu/indicator/crt/HSL.h +2 -2
  96. hikyuu/include/hikyuu/indicator/crt/QUANTILE_TRUNC.h +30 -0
  97. hikyuu/include/hikyuu/indicator/crt/TURNOVER.h +1 -0
  98. hikyuu/include/hikyuu/indicator/crt/ZSCORE.h +2 -2
  99. hikyuu/include/hikyuu/indicator/imp/IQuantileTrunc.h +25 -0
  100. hikyuu/include/hikyuu/misc.h +38 -0
  101. hikyuu/include/hikyuu/plugin/dataserver.h +2 -1
  102. hikyuu/include/hikyuu/plugin/device.h +10 -0
  103. hikyuu/include/hikyuu/plugin/extind.h +37 -0
  104. hikyuu/include/hikyuu/plugin/hkuextra.h +0 -18
  105. hikyuu/include/hikyuu/plugin/interface/DataServerPluginInterface.h +2 -2
  106. hikyuu/include/hikyuu/plugin/interface/DevicePluginInterface.h +2 -0
  107. hikyuu/include/hikyuu/plugin/interface/ExtendIndicatorsPluginInterface.h +12 -0
  108. hikyuu/include/hikyuu/plugin/interface/HkuExtraPluginInterface.h +0 -14
  109. hikyuu/include/hikyuu/plugin/interface/plugins.h +3 -1
  110. hikyuu/include/hikyuu/python/pybind_utils.h +1 -8
  111. hikyuu/include/hikyuu/strategy/RunSystemInStrategy.h +3 -0
  112. hikyuu/include/hikyuu/trade_manage/Performance.h +4 -4
  113. hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +10 -1
  114. hikyuu/include/hikyuu/trade_sys/moneymanager/imp/FixedCapitalFundsMM.h +0 -4
  115. hikyuu/include/hikyuu/trade_sys/multifactor/MultiFactorBase.h +36 -3
  116. hikyuu/include/hikyuu/trade_sys/multifactor/NormalizeBase.h +125 -0
  117. hikyuu/include/hikyuu/trade_sys/multifactor/ScoresFilterBase.h +125 -0
  118. hikyuu/include/hikyuu/trade_sys/multifactor/build_in.h +3 -0
  119. hikyuu/include/hikyuu/trade_sys/multifactor/buildin_norm.h +36 -0
  120. hikyuu/include/hikyuu/trade_sys/multifactor/buildin_scfilter.h +51 -0
  121. hikyuu/include/hikyuu/trade_sys/multifactor/filter/GroupSCFilter.h +24 -0
  122. hikyuu/include/hikyuu/trade_sys/multifactor/filter/IgnoreLessOrEqualValueSCFilter.h +24 -0
  123. hikyuu/include/hikyuu/trade_sys/multifactor/filter/IgnoreNanSCFilter.h +24 -0
  124. hikyuu/include/hikyuu/trade_sys/multifactor/filter/MinAmountPercentSCFilter.h +25 -0
  125. hikyuu/include/hikyuu/trade_sys/multifactor/filter/PriceSCFilter.h +24 -0
  126. hikyuu/include/hikyuu/trade_sys/multifactor/filter/TopNSCFilter.h +24 -0
  127. hikyuu/include/hikyuu/trade_sys/multifactor/imp/EqualWeightMultiFactor.h +1 -1
  128. hikyuu/include/hikyuu/trade_sys/multifactor/imp/ICIRMultiFactor.h +1 -1
  129. hikyuu/include/hikyuu/trade_sys/multifactor/imp/ICMultiFactor.h +1 -1
  130. hikyuu/include/hikyuu/trade_sys/multifactor/imp/WeightMultiFactor.h +1 -1
  131. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormMinMax.h +23 -0
  132. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormQuantile.h +28 -0
  133. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormQuantileUniform.h +28 -0
  134. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormZScore.h +25 -0
  135. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/__init__.py +1 -0
  136. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/quantile_trunc.h +16 -0
  137. hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +7 -0
  138. hikyuu/include/hikyuu/trade_sys/portfolio/imp/SimplePortfolio.h +7 -0
  139. hikyuu/include/hikyuu/trade_sys/portfolio/imp/WithoutAFPortfolio.h +7 -0
  140. hikyuu/include/hikyuu/trade_sys/selector/SelectorBase.h +49 -0
  141. hikyuu/include/hikyuu/trade_sys/selector/build_in.h +1 -0
  142. hikyuu/include/hikyuu/trade_sys/selector/crt/SE_MultiFactor2.h +40 -0
  143. hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector.h +0 -3
  144. hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector2.h +49 -0
  145. hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorSelector.h +1 -1
  146. hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorValueSelector.h +1 -1
  147. hikyuu/include/hikyuu/trade_sys/signal/imp/BandSignal2.h +0 -4
  148. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/AddValueSignal.h +2 -2
  149. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/DivValueSignal.h +2 -2
  150. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/MulValueSignal.h +2 -2
  151. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorSignal.h +1 -1
  152. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorValueSignal.h +4 -4
  153. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/SubValueSignal.h +2 -2
  154. hikyuu/include/hikyuu/trade_sys/slippage/build_in.h +5 -1
  155. hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_LogNormal.h +22 -0
  156. hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_Normal.h +22 -0
  157. hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_TruncNormal.h +25 -0
  158. hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_Uniform.h +23 -0
  159. hikyuu/include/hikyuu/trade_sys/slippage/imp/LogNormalSlippage.h +28 -0
  160. hikyuu/include/hikyuu/trade_sys/slippage/imp/NormalSlippage.h +28 -0
  161. hikyuu/include/hikyuu/trade_sys/slippage/imp/TruncNormalSlippage.h +28 -0
  162. hikyuu/include/hikyuu/trade_sys/slippage/imp/UniformSlippage.h +24 -0
  163. hikyuu/include/hikyuu/trade_sys/system/System.h +14 -1
  164. hikyuu/include/hikyuu/utilities/SpendTimer.h +17 -7
  165. hikyuu/include/hikyuu/utilities/arithmetic.h +55 -0
  166. hikyuu/include/hikyuu/utilities/db_connect/mysql/MySQLConnect.h +1 -1
  167. hikyuu/include/hikyuu/utilities/db_connect/mysql/MySQLStatement.h +1 -1
  168. hikyuu/include/hikyuu/utilities/db_connect/sqlite/SQLiteConnect.h +1 -1
  169. hikyuu/include/hikyuu/utilities/db_connect/sqlite/SQLiteStatement.h +1 -1
  170. hikyuu/include/hikyuu/utilities/plugin/PluginLoader.h +4 -1
  171. hikyuu/include/hikyuu/version.h +5 -5
  172. hikyuu/matplotlibrc +349 -0
  173. hikyuu/plugin/libbacktest.dylib +0 -0
  174. hikyuu/plugin/libclickhousedriver.dylib +0 -0
  175. hikyuu/plugin/libdataserver.dylib +0 -0
  176. hikyuu/plugin/libdataserver_parquet.dylib +0 -0
  177. hikyuu/plugin/libdevice.dylib +0 -0
  178. hikyuu/plugin/libextind.dylib +0 -0
  179. hikyuu/plugin/libhkuextra.dylib +0 -0
  180. hikyuu/plugin/libimport2hdf5.dylib +0 -0
  181. hikyuu/plugin/libtmreport.dylib +0 -0
  182. hikyuu/trade_manage/__init__.pyi +599 -579
  183. hikyuu/trade_manage/broker.pyi +19 -18
  184. hikyuu/trade_manage/broker_easytrader.pyi +6 -4
  185. hikyuu/trade_manage/broker_mail.pyi +22 -24
  186. hikyuu/trade_manage/trade.py +0 -2
  187. hikyuu/trade_manage/trade.pyi +599 -579
  188. hikyuu/util/check.pyi +17 -15
  189. hikyuu/util/mylog.pyi +8 -7
  190. hikyuu/util/notebook.pyi +9 -11
  191. hikyuu/util/singleton.pyi +8 -6
  192. {hikyuu-2.6.8.4.dist-info → hikyuu-2.7.0.4.dist-info}/METADATA +35 -34
  193. {hikyuu-2.6.8.4.dist-info → hikyuu-2.7.0.4.dist-info}/RECORD +197 -165
  194. {hikyuu-2.6.8.4.dist-info → hikyuu-2.7.0.4.dist-info}/top_level.txt +2 -2
  195. hikyuu/data_driver/__init__.py +0 -49
  196. hikyuu/data_driver/jqdata_data_driver.py +0 -277
  197. hikyuu/data_driver/pytdx_data_driver.py +0 -292
  198. hikyuu/fetcher/stock/zh_stock_a_huatai.py +0 -51
  199. hikyuu/fetcher/stock/zh_stock_a_pytdx.py +0 -129
  200. hikyuu/gui/data/CollectToMemThread.py +0 -123
  201. hikyuu/gui/data/CollectToMySQLThread.py +0 -178
  202. hikyuu/gui/start_huatai_insight.py +0 -510
  203. hikyuu/include/hikyuu/views/arrow_common.h +0 -38
  204. hikyuu/include/hikyuu/views/arrow_views.h +0 -117
  205. hikyuu/tools/update_block_info.py +0 -168
  206. /hikyuu/include/hikyuu/{views → trade_sys/multifactor/filter}/__init__.py +0 -0
  207. {hikyuu-2.6.8.4.dist-info → hikyuu-2.7.0.4.dist-info}/WHEEL +0 -0
  208. {hikyuu-2.6.8.4.dist-info → hikyuu-2.7.0.4.dist-info}/entry_points.txt +0 -0
hikyuu/.style.yapf ADDED
@@ -0,0 +1,350 @@
1
+ [style]
2
+ # Align closing bracket with visual indentation.
3
+ align_closing_bracket_with_visual_indent=True
4
+
5
+ # Allow dictionary keys to exist on multiple lines. For example:
6
+ #
7
+ # x = {
8
+ # ('this is the first element of a tuple',
9
+ # 'this is the second element of a tuple'):
10
+ # value,
11
+ # }
12
+ allow_multiline_dictionary_keys=False
13
+
14
+ # Allow lambdas to be formatted on more than one line.
15
+ allow_multiline_lambdas=False
16
+
17
+ # Allow splitting before a default / named assignment in an argument list.
18
+ allow_split_before_default_or_named_assigns=True
19
+
20
+ # Allow splits before the dictionary value.
21
+ allow_split_before_dict_value=True
22
+
23
+ # Let spacing indicate operator precedence. For example:
24
+ #
25
+ # a = 1 * 2 + 3 / 4
26
+ # b = 1 / 2 - 3 * 4
27
+ # c = (1 + 2) * (3 - 4)
28
+ # d = (1 - 2) / (3 + 4)
29
+ # e = 1 * 2 - 3
30
+ # f = 1 + 2 + 3 + 4
31
+ #
32
+ # will be formatted as follows to indicate precedence:
33
+ #
34
+ # a = 1*2 + 3/4
35
+ # b = 1/2 - 3*4
36
+ # c = (1+2) * (3-4)
37
+ # d = (1-2) / (3+4)
38
+ # e = 1*2 - 3
39
+ # f = 1 + 2 + 3 + 4
40
+ #
41
+ arithmetic_precedence_indication=False
42
+
43
+ # Number of blank lines surrounding top-level function and class
44
+ # definitions.
45
+ blank_lines_around_top_level_definition=2
46
+
47
+ # Insert a blank line before a class-level docstring.
48
+ blank_line_before_class_docstring=False
49
+
50
+ # Insert a blank line before a module docstring.
51
+ blank_line_before_module_docstring=False
52
+
53
+ # Insert a blank line before a 'def' or 'class' immediately nested
54
+ # within another 'def' or 'class'. For example:
55
+ #
56
+ # class Foo:
57
+ # # <------ this blank line
58
+ # def method():
59
+ # ...
60
+ blank_line_before_nested_class_or_def=False
61
+
62
+ # Do not split consecutive brackets. Only relevant when
63
+ # dedent_closing_brackets is set. For example:
64
+ #
65
+ # call_func_that_takes_a_dict(
66
+ # {
67
+ # 'key1': 'value1',
68
+ # 'key2': 'value2',
69
+ # }
70
+ # )
71
+ #
72
+ # would reformat to:
73
+ #
74
+ # call_func_that_takes_a_dict({
75
+ # 'key1': 'value1',
76
+ # 'key2': 'value2',
77
+ # })
78
+ coalesce_brackets=False
79
+
80
+ # The column limit.
81
+ column_limit=120
82
+
83
+ # The style for continuation alignment. Possible values are:
84
+ #
85
+ # - SPACE: Use spaces for continuation alignment. This is default behavior.
86
+ # - FIXED: Use fixed number (CONTINUATION_INDENT_WIDTH) of columns
87
+ # (ie: CONTINUATION_INDENT_WIDTH/INDENT_WIDTH tabs) for continuation
88
+ # alignment.
89
+ # - VALIGN-RIGHT: Vertically align continuation lines with indent
90
+ # characters. Slightly right (one more indent character) if cannot
91
+ # vertically align continuation lines with indent characters.
92
+ #
93
+ # For options FIXED, and VALIGN-RIGHT are only available when USE_TABS is
94
+ # enabled.
95
+ continuation_align_style=SPACE
96
+
97
+ # Indent width used for line continuations.
98
+ continuation_indent_width=4
99
+
100
+ # Put closing brackets on a separate line, dedented, if the bracketed
101
+ # expression can't fit in a single line. Applies to all kinds of brackets,
102
+ # including function definitions and calls. For example:
103
+ #
104
+ # config = {
105
+ # 'key1': 'value1',
106
+ # 'key2': 'value2',
107
+ # } # <--- this bracket is dedented and on a separate line
108
+ #
109
+ # time_series = self.remote_client.query_entity_counters(
110
+ # entity='dev3246.region1',
111
+ # key='dns.query_latency_tcp',
112
+ # transform=Transformation.AVERAGE(window=timedelta(seconds=60)),
113
+ # start_ts=now()-timedelta(days=3),
114
+ # end_ts=now(),
115
+ # ) # <--- this bracket is dedented and on a separate line
116
+ dedent_closing_brackets=True
117
+
118
+ # Disable the heuristic which places each list element on a separate line
119
+ # if the list is comma-terminated.
120
+ disable_ending_comma_heuristic=False
121
+
122
+ # Place each dictionary entry onto its own line.
123
+ each_dict_entry_on_separate_line=True
124
+
125
+ # The regex for an i18n comment. The presence of this comment stops
126
+ # reformatting of that line, because the comments are required to be
127
+ # next to the string they translate.
128
+ i18n_comment=
129
+
130
+ # The i18n function call names. The presence of this function stops
131
+ # reformattting on that line, because the string it has cannot be moved
132
+ # away from the i18n comment.
133
+ i18n_function_call=
134
+
135
+ # Indent blank lines.
136
+ indent_blank_lines=False
137
+
138
+ # Put closing brackets on a separate line, indented, if the bracketed
139
+ # expression can't fit in a single line. Applies to all kinds of brackets,
140
+ # including function definitions and calls. For example:
141
+ #
142
+ # config = {
143
+ # 'key1': 'value1',
144
+ # 'key2': 'value2',
145
+ # } # <--- this bracket is indented and on a separate line
146
+ #
147
+ # time_series = self.remote_client.query_entity_counters(
148
+ # entity='dev3246.region1',
149
+ # key='dns.query_latency_tcp',
150
+ # transform=Transformation.AVERAGE(window=timedelta(seconds=60)),
151
+ # start_ts=now()-timedelta(days=3),
152
+ # end_ts=now(),
153
+ # ) # <--- this bracket is indented and on a separate line
154
+ indent_closing_brackets=False
155
+
156
+ # Indent the dictionary value if it cannot fit on the same line as the
157
+ # dictionary key. For example:
158
+ #
159
+ # config = {
160
+ # 'key1':
161
+ # 'value1',
162
+ # 'key2': value1 +
163
+ # value2,
164
+ # }
165
+ indent_dictionary_value=False
166
+
167
+ # The number of columns to use for indentation.
168
+ indent_width=4
169
+
170
+ # Join short lines into one line. E.g., single line 'if' statements.
171
+ join_multiple_lines=True
172
+
173
+ # Do not include spaces around selected binary operators. For example:
174
+ #
175
+ # 1 + 2 * 3 - 4 / 5
176
+ #
177
+ # will be formatted as follows when configured with "*,/":
178
+ #
179
+ # 1 + 2*3 - 4/5
180
+ no_spaces_around_selected_binary_operators=
181
+
182
+ # Use spaces around default or named assigns.
183
+ spaces_around_default_or_named_assign=False
184
+
185
+ # Use spaces around the power operator.
186
+ spaces_around_power_operator=False
187
+
188
+ # The number of spaces required before a trailing comment.
189
+ # This can be a single value (representing the number of spaces
190
+ # before each trailing comment) or list of values (representing
191
+ # alignment column values; trailing comments within a block will
192
+ # be aligned to the first column value that is greater than the maximum
193
+ # line length within the block). For example:
194
+ #
195
+ # With spaces_before_comment=5:
196
+ #
197
+ # 1 + 1 # Adding values
198
+ #
199
+ # will be formatted as:
200
+ #
201
+ # 1 + 1 # Adding values <-- 5 spaces between the end of the statement and comment
202
+ #
203
+ # With spaces_before_comment=15, 20:
204
+ #
205
+ # 1 + 1 # Adding values
206
+ # two + two # More adding
207
+ #
208
+ # longer_statement # This is a longer statement
209
+ # short # This is a shorter statement
210
+ #
211
+ # a_very_long_statement_that_extends_beyond_the_final_column # Comment
212
+ # short # This is a shorter statement
213
+ #
214
+ # will be formatted as:
215
+ #
216
+ # 1 + 1 # Adding values <-- end of line comments in block aligned to col 15
217
+ # two + two # More adding
218
+ #
219
+ # longer_statement # This is a longer statement <-- end of line comments in block aligned to col 20
220
+ # short # This is a shorter statement
221
+ #
222
+ # a_very_long_statement_that_extends_beyond_the_final_column # Comment <-- the end of line comments are aligned based on the line length
223
+ # short # This is a shorter statement
224
+ #
225
+ spaces_before_comment=2
226
+
227
+ # Insert a space between the ending comma and closing bracket of a list,
228
+ # etc.
229
+ space_between_ending_comma_and_closing_bracket=True
230
+
231
+ # Split before arguments
232
+ split_all_comma_separated_values=False
233
+
234
+ # Split before arguments, but do not split all subexpressions recursively
235
+ # (unless needed).
236
+ split_all_top_level_comma_separated_values=False
237
+
238
+ # Split before arguments if the argument list is terminated by a
239
+ # comma.
240
+ split_arguments_when_comma_terminated=False
241
+
242
+ # Set to True to prefer splitting before '+', '-', '*', '/', '//', or '@'
243
+ # rather than after.
244
+ split_before_arithmetic_operator=False
245
+
246
+ # Set to True to prefer splitting before '&', '|' or '^' rather than
247
+ # after.
248
+ split_before_bitwise_operator=True
249
+
250
+ # Split before the closing bracket if a list or dict literal doesn't fit on
251
+ # a single line.
252
+ split_before_closing_bracket=True
253
+
254
+ # Split before a dictionary or set generator (comp_for). For example, note
255
+ # the split before the 'for':
256
+ #
257
+ # foo = {
258
+ # variable: 'Hello world, have a nice day!'
259
+ # for variable in bar if variable != 42
260
+ # }
261
+ split_before_dict_set_generator=True
262
+
263
+ # Split before the '.' if we need to split a longer expression:
264
+ #
265
+ # foo = ('This is a really long string: {}, {}, {}, {}'.format(a, b, c, d))
266
+ #
267
+ # would reformat to something like:
268
+ #
269
+ # foo = ('This is a really long string: {}, {}, {}, {}'
270
+ # .format(a, b, c, d))
271
+ split_before_dot=False
272
+
273
+ # Split after the opening paren which surrounds an expression if it doesn't
274
+ # fit on a single line.
275
+ split_before_expression_after_opening_paren=False
276
+
277
+ # If an argument / parameter list is going to be split, then split before
278
+ # the first argument.
279
+ split_before_first_argument=False
280
+
281
+ # Set to True to prefer splitting before 'and' or 'or' rather than
282
+ # after.
283
+ split_before_logical_operator=True
284
+
285
+ # Split named assignments onto individual lines.
286
+ split_before_named_assigns=True
287
+
288
+ # Set to True to split list comprehensions and generators that have
289
+ # non-trivial expressions and multiple clauses before each of these
290
+ # clauses. For example:
291
+ #
292
+ # result = [
293
+ # a_long_var + 100 for a_long_var in xrange(1000)
294
+ # if a_long_var % 10]
295
+ #
296
+ # would reformat to something like:
297
+ #
298
+ # result = [
299
+ # a_long_var + 100
300
+ # for a_long_var in xrange(1000)
301
+ # if a_long_var % 10]
302
+ split_complex_comprehension=False
303
+
304
+ # The penalty for splitting right after the opening bracket.
305
+ split_penalty_after_opening_bracket=300
306
+
307
+ # The penalty for splitting the line after a unary operator.
308
+ split_penalty_after_unary_operator=10000
309
+
310
+ # The penalty of splitting the line around the '+', '-', '*', '/', '//',
311
+ # ``%``, and '@' operators.
312
+ split_penalty_arithmetic_operator=300
313
+
314
+ # The penalty for splitting right before an if expression.
315
+ split_penalty_before_if_expr=0
316
+
317
+ # The penalty of splitting the line around the '&', '|', and '^'
318
+ # operators.
319
+ split_penalty_bitwise_operator=300
320
+
321
+ # The penalty for splitting a list comprehension or generator
322
+ # expression.
323
+ split_penalty_comprehension=80
324
+
325
+ # The penalty for characters over the column limit.
326
+ split_penalty_excess_character=7000
327
+
328
+ # The penalty incurred by adding a line split to the unwrapped line. The
329
+ # more line splits added the higher the penalty.
330
+ split_penalty_for_added_line_split=30
331
+
332
+ # The penalty of splitting a list of "import as" names. For example:
333
+ #
334
+ # from a_very_long_or_indented_module_name_yada_yad import (long_argument_1,
335
+ # long_argument_2,
336
+ # long_argument_3)
337
+ #
338
+ # would reformat to something like:
339
+ #
340
+ # from a_very_long_or_indented_module_name_yada_yad import (
341
+ # long_argument_1, long_argument_2, long_argument_3)
342
+ split_penalty_import_names=0
343
+
344
+ # The penalty of splitting the line around the 'and' and 'or'
345
+ # operators.
346
+ split_penalty_logical_operator=300
347
+
348
+ # Use the Tab character for indentation.
349
+ use_tabs=False
350
+
hikyuu/__init__.py CHANGED
@@ -2,7 +2,6 @@
2
2
  # -*- coding: utf8 -*-
3
3
  # cp936
4
4
 
5
- import pyarrow as pa
6
5
  import atexit
7
6
  import io
8
7
  import locale
@@ -85,11 +84,32 @@ atexit.register(hku_cleanup)
85
84
 
86
85
  sm = StockManager.instance()
87
86
 
88
- plugin_path = Path.home() / '.hikyuu' / 'plugin'
89
- if plugin_path.exists():
90
- plugin_path = str(plugin_path)
91
- else:
92
- plugin_path = os.path.join(os.path.dirname(__file__), 'plugin')
87
+ # 尝试寻找 hikyuu_plugin python包,并获取其所在目录
88
+ try:
89
+ import hikyuu_plugin
90
+ plugin_path = os.path.dirname(hikyuu_plugin.__file__)
91
+ plugin_version = hikyuu_plugin.__version__
92
+
93
+ # 获取主版本号(格式为x.x.x)
94
+ def get_major_version(version_str):
95
+ parts = version_str.split('.')
96
+ return '.'.join(parts[:3]) if len(parts) >= 3 else version_str
97
+
98
+ # 比较hikyuu和hikyuu_plugin的版本号
99
+ hikyuu_major_version = get_major_version(__version__)
100
+ plugin_major_version = get_major_version(plugin_version)
101
+
102
+ if hikyuu_major_version != plugin_major_version:
103
+ hku_warn("hikyuu版本 ({}) 与 hikyuu_plugin版本 ({}) 不匹配,请确保使用兼容版本!".format(__version__, plugin_version))
104
+
105
+ except ImportError:
106
+ plugin_path = Path.home() / '.hikyuu' / 'plugin'
107
+ if plugin_path.exists():
108
+ plugin_path = str(plugin_path)
109
+ else:
110
+ plugin_path = os.path.join(os.path.dirname(__file__), 'plugin')
111
+
112
+
93
113
  sm.set_plugin_path(plugin_path)
94
114
  # print(f"current plugin path: {plugin_path}")
95
115
 
@@ -312,7 +332,8 @@ def load_hikyuu(**kwargs):
312
332
 
313
333
  sm.init(base_param, block_param, kdata_param, preload_param, hku_param, context)
314
334
 
315
- start_spot = True
335
+ # 默认不启动行情接收, 防止启动在开盘后因自身合成缺失导致从 dataserver 获取行情也缺失
336
+ start_spot = False
316
337
  if 'HKU_START_SPOT' in os.environ:
317
338
  spot_str = os.environ['HKU_START_SPOT'].upper()
318
339
  start_spot = spot_str in ('1', 'TRUE')
@@ -513,16 +534,9 @@ def select2(inds, start=Datetime(201801010000), end=Datetime.now(), stks=None):
513
534
 
514
535
  def realtime_update_inner(source='qq', stk_list=None):
515
536
  if stk_list is None:
516
- if source == 'qmt':
517
- stk_list = [s for s in sm if s.valid and s.type in (
518
- constant.STOCKTYPE_A, constant.STOCKTYPE_INDEX, constant.STOCKTYPE_ETF,
519
- constant.STOCKTYPE_GEM, constant.STOCKTYPE_START, constant.STOCKTYPE_A_BJ)]
520
- else:
521
- stk_list = [
522
- stk.market_code.lower() for stk in sm if stk.valid and stk.type in
523
- (constant.STOCKTYPE_A, constant.STOCKTYPE_INDEX, constant.STOCKTYPE_GEM,
524
- constant.STOCKTYPE_START, constant.STOCKTYPE_A_BJ)
525
- ]
537
+ stk_list = [s for s in sm if s.valid and s.type in (
538
+ constant.STOCKTYPE_A, constant.STOCKTYPE_INDEX, constant.STOCKTYPE_ETF,
539
+ constant.STOCKTYPE_GEM, constant.STOCKTYPE_START, constant.STOCKTYPE_A_BJ)]
526
540
 
527
541
  if source == 'qq':
528
542
  from hikyuu.fetcher.stock.zh_stock_a_sina_qq import get_spot