hikyuu 2.6.5__py3-none-win_amd64.whl → 2.6.6__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 (108) hide show
  1. hikyuu/__init__.py +6 -0
  2. hikyuu/__init__.pyi +548 -545
  3. hikyuu/analysis/__init__.pyi +519 -518
  4. hikyuu/analysis/analysis.pyi +520 -519
  5. hikyuu/core.pyi +521 -520
  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 +35 -25
  12. hikyuu/cpp/core311.pyd +0 -0
  13. hikyuu/cpp/core311.pyi +35 -25
  14. hikyuu/cpp/core312.pyd +0 -0
  15. hikyuu/cpp/core312.pyi +35 -25
  16. hikyuu/cpp/core313.pyd +0 -0
  17. hikyuu/cpp/core313.pyi +35 -25
  18. hikyuu/cpp/core39.pyd +0 -0
  19. hikyuu/cpp/core39.pyi +35 -25
  20. hikyuu/cpp/hikyuu.dll +0 -0
  21. hikyuu/cpp/hikyuu.lib +0 -0
  22. hikyuu/cpp/i18n/__init__.py +0 -0
  23. hikyuu/cpp/i18n/zh_CN.mo +0 -0
  24. hikyuu/cpp/sqlite3.dll +0 -0
  25. hikyuu/data/clickhouse_upgrade/__init__.py +1 -0
  26. hikyuu/data/clickhouse_upgrade/createdb.sql +1085 -0
  27. hikyuu/data/common_clickhouse.py +512 -0
  28. hikyuu/data/em_block_to_clickhouse.py +120 -0
  29. hikyuu/data/hku_config_template.py +58 -3
  30. hikyuu/data/pytdx_finance_to_clickhouse.py +107 -0
  31. hikyuu/data/pytdx_to_clickhouse.py +841 -0
  32. hikyuu/data/pytdx_to_mysql.py +4 -4
  33. hikyuu/data/pytdx_weight_to_clickhouse.py +191 -0
  34. hikyuu/data/tdx_to_clickhouse.py +448 -0
  35. hikyuu/data/zh_bond10_to_clickhouse.py +49 -0
  36. hikyuu/draw/drawplot/__init__.pyi +9 -9
  37. hikyuu/draw/drawplot/bokeh_draw.pyi +537 -534
  38. hikyuu/draw/drawplot/common.pyi +1 -1
  39. hikyuu/draw/drawplot/echarts_draw.pyi +539 -536
  40. hikyuu/draw/drawplot/matplotlib_draw.pyi +549 -546
  41. hikyuu/draw/elder.pyi +11 -11
  42. hikyuu/draw/kaufman.pyi +18 -18
  43. hikyuu/draw/volume.pyi +10 -10
  44. hikyuu/extend.pyi +527 -526
  45. hikyuu/fetcher/stock/zh_stock_a_pytdx.py +9 -20
  46. hikyuu/fetcher/stock/zh_stock_a_qmt.py +4 -5
  47. hikyuu/fetcher/stock/zh_stock_a_sina_qq.py +16 -60
  48. hikyuu/flat/Spot.py +96 -200
  49. hikyuu/gui/HikyuuTDX.py +132 -3
  50. hikyuu/gui/data/ImportBlockInfoTask.py +11 -0
  51. hikyuu/gui/data/ImportHistoryFinanceTask.py +15 -1
  52. hikyuu/gui/data/ImportPytdxTimeToH5Task.py +11 -1
  53. hikyuu/gui/data/ImportPytdxToH5Task.py +13 -1
  54. hikyuu/gui/data/ImportPytdxTransToH5Task.py +11 -1
  55. hikyuu/gui/data/ImportTdxToH5Task.py +13 -1
  56. hikyuu/gui/data/ImportWeightToSqliteTask.py +14 -1
  57. hikyuu/gui/data/ImportZhBond10Task.py +11 -0
  58. hikyuu/gui/data/MainWindow.py +76 -12
  59. hikyuu/gui/data/UsePytdxImportToH5Thread.py +45 -26
  60. hikyuu/gui/data/UseTdxImportToH5Thread.py +19 -1
  61. hikyuu/gui/dataserver.py +12 -4
  62. hikyuu/gui/spot_server.py +30 -40
  63. hikyuu/gui/start_qmt.py +20 -3
  64. hikyuu/hub.pyi +6 -6
  65. hikyuu/include/hikyuu/DataType.h +11 -0
  66. hikyuu/include/hikyuu/StockManager.h +8 -0
  67. hikyuu/include/hikyuu/data_driver/kdata/mysql/KRecordTable.h +1 -0
  68. hikyuu/include/hikyuu/global/GlobalSpotAgent.h +1 -1
  69. hikyuu/include/hikyuu/global/SpotRecord.h +15 -31
  70. hikyuu/include/hikyuu/global/agent/spot_generated.h +48 -232
  71. hikyuu/include/hikyuu/global/schedule/scheduler.h +1 -1
  72. hikyuu/include/hikyuu/plugin/KDataToHdf5Importer.h +3 -0
  73. hikyuu/include/hikyuu/plugin/dataserver.h +26 -1
  74. hikyuu/include/hikyuu/plugin/device.h +2 -1
  75. hikyuu/include/hikyuu/plugin/interface/DataDriverPluginInterface.h +27 -0
  76. hikyuu/include/hikyuu/plugin/interface/DataServerPluginInterface.h +2 -1
  77. hikyuu/include/hikyuu/plugin/interface/DevicePluginInterface.h +1 -1
  78. hikyuu/include/hikyuu/plugin/interface/ImportKDataToHdf5PluginInterface.h +3 -0
  79. hikyuu/include/hikyuu/plugin/interface/plugins.h +2 -0
  80. hikyuu/include/hikyuu/strategy/Strategy.h +0 -9
  81. hikyuu/include/hikyuu/utilities/config.h +1 -1
  82. hikyuu/include/hikyuu/utilities/mo/mo.h +30 -14
  83. hikyuu/include/hikyuu/utilities/os.h +6 -0
  84. hikyuu/include/hikyuu/version.h +4 -4
  85. hikyuu/plugin/backtest.dll +0 -0
  86. hikyuu/plugin/clickhousedriver.dll +0 -0
  87. hikyuu/plugin/dataserver.dll +0 -0
  88. hikyuu/plugin/device.dll +0 -0
  89. hikyuu/plugin/extind.dll +0 -0
  90. hikyuu/plugin/import2hdf5.dll +0 -0
  91. hikyuu/plugin/tmreport.dll +0 -0
  92. hikyuu/trade_manage/__init__.pyi +537 -534
  93. hikyuu/trade_manage/broker.pyi +3 -3
  94. hikyuu/trade_manage/broker_easytrader.pyi +1 -1
  95. hikyuu/trade_manage/trade.pyi +537 -534
  96. hikyuu/util/__init__.py +1 -0
  97. hikyuu/util/__init__.pyi +4 -3
  98. hikyuu/util/check.py +8 -0
  99. hikyuu/util/check.pyi +5 -1
  100. hikyuu/util/singleton.pyi +1 -1
  101. {hikyuu-2.6.5.dist-info → hikyuu-2.6.6.dist-info}/METADATA +2 -2
  102. {hikyuu-2.6.5.dist-info → hikyuu-2.6.6.dist-info}/RECORD +106 -95
  103. {hikyuu-2.6.5.dist-info → hikyuu-2.6.6.dist-info}/top_level.txt +2 -2
  104. hikyuu/include/hikyuu/global/agent/hikyuu/__init__.py +0 -1
  105. hikyuu/include/hikyuu/global/agent/hikyuu/flat/__init__.py +0 -1
  106. {hikyuu-2.6.5.dist-info → hikyuu-2.6.6.dist-info}/LICENSE +0 -0
  107. {hikyuu-2.6.5.dist-info → hikyuu-2.6.6.dist-info}/WHEEL +0 -0
  108. {hikyuu-2.6.5.dist-info → hikyuu-2.6.6.dist-info}/entry_points.txt +0 -0
@@ -36,26 +36,10 @@ struct Spot FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
36
36
  VT_CLOSE = 20,
37
37
  VT_AMOUNT = 22,
38
38
  VT_VOLUME = 24,
39
- VT_BID1 = 26,
40
- VT_BID1_AMOUNT = 28,
41
- VT_BID2 = 30,
42
- VT_BID2_AMOUNT = 32,
43
- VT_BID3 = 34,
44
- VT_BID3_AMOUNT = 36,
45
- VT_BID4 = 38,
46
- VT_BID4_AMOUNT = 40,
47
- VT_BID5 = 42,
48
- VT_BID5_AMOUNT = 44,
49
- VT_ASK1 = 46,
50
- VT_ASK1_AMOUNT = 48,
51
- VT_ASK2 = 50,
52
- VT_ASK2_AMOUNT = 52,
53
- VT_ASK3 = 54,
54
- VT_ASK3_AMOUNT = 56,
55
- VT_ASK4 = 58,
56
- VT_ASK4_AMOUNT = 60,
57
- VT_ASK5 = 62,
58
- VT_ASK5_AMOUNT = 64
39
+ VT_BID = 26,
40
+ VT_BID_AMOUNT = 28,
41
+ VT_ASK = 30,
42
+ VT_ASK_AMOUNT = 32
59
43
  };
60
44
  const ::flatbuffers::String *market() const {
61
45
  return GetPointer<const ::flatbuffers::String *>(VT_MARKET);
@@ -90,65 +74,17 @@ struct Spot FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
90
74
  double volume() const {
91
75
  return GetField<double>(VT_VOLUME, 0.0);
92
76
  }
93
- double bid1() const {
94
- return GetField<double>(VT_BID1, 0.0);
77
+ const ::flatbuffers::Vector<double> *bid() const {
78
+ return GetPointer<const ::flatbuffers::Vector<double> *>(VT_BID);
95
79
  }
96
- double bid1_amount() const {
97
- return GetField<double>(VT_BID1_AMOUNT, 0.0);
80
+ const ::flatbuffers::Vector<double> *bid_amount() const {
81
+ return GetPointer<const ::flatbuffers::Vector<double> *>(VT_BID_AMOUNT);
98
82
  }
99
- double bid2() const {
100
- return GetField<double>(VT_BID2, 0.0);
83
+ const ::flatbuffers::Vector<double> *ask() const {
84
+ return GetPointer<const ::flatbuffers::Vector<double> *>(VT_ASK);
101
85
  }
102
- double bid2_amount() const {
103
- return GetField<double>(VT_BID2_AMOUNT, 0.0);
104
- }
105
- double bid3() const {
106
- return GetField<double>(VT_BID3, 0.0);
107
- }
108
- double bid3_amount() const {
109
- return GetField<double>(VT_BID3_AMOUNT, 0.0);
110
- }
111
- double bid4() const {
112
- return GetField<double>(VT_BID4, 0.0);
113
- }
114
- double bid4_amount() const {
115
- return GetField<double>(VT_BID4_AMOUNT, 0.0);
116
- }
117
- double bid5() const {
118
- return GetField<double>(VT_BID5, 0.0);
119
- }
120
- double bid5_amount() const {
121
- return GetField<double>(VT_BID5_AMOUNT, 0.0);
122
- }
123
- double ask1() const {
124
- return GetField<double>(VT_ASK1, 0.0);
125
- }
126
- double ask1_amount() const {
127
- return GetField<double>(VT_ASK1_AMOUNT, 0.0);
128
- }
129
- double ask2() const {
130
- return GetField<double>(VT_ASK2, 0.0);
131
- }
132
- double ask2_amount() const {
133
- return GetField<double>(VT_ASK2_AMOUNT, 0.0);
134
- }
135
- double ask3() const {
136
- return GetField<double>(VT_ASK3, 0.0);
137
- }
138
- double ask3_amount() const {
139
- return GetField<double>(VT_ASK3_AMOUNT, 0.0);
140
- }
141
- double ask4() const {
142
- return GetField<double>(VT_ASK4, 0.0);
143
- }
144
- double ask4_amount() const {
145
- return GetField<double>(VT_ASK4_AMOUNT, 0.0);
146
- }
147
- double ask5() const {
148
- return GetField<double>(VT_ASK5, 0.0);
149
- }
150
- double ask5_amount() const {
151
- return GetField<double>(VT_ASK5_AMOUNT, 0.0);
86
+ const ::flatbuffers::Vector<double> *ask_amount() const {
87
+ return GetPointer<const ::flatbuffers::Vector<double> *>(VT_ASK_AMOUNT);
152
88
  }
153
89
  bool Verify(::flatbuffers::Verifier &verifier) const {
154
90
  return VerifyTableStart(verifier) &&
@@ -167,26 +103,14 @@ struct Spot FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
167
103
  VerifyField<double>(verifier, VT_CLOSE, 8) &&
168
104
  VerifyField<double>(verifier, VT_AMOUNT, 8) &&
169
105
  VerifyField<double>(verifier, VT_VOLUME, 8) &&
170
- VerifyField<double>(verifier, VT_BID1, 8) &&
171
- VerifyField<double>(verifier, VT_BID1_AMOUNT, 8) &&
172
- VerifyField<double>(verifier, VT_BID2, 8) &&
173
- VerifyField<double>(verifier, VT_BID2_AMOUNT, 8) &&
174
- VerifyField<double>(verifier, VT_BID3, 8) &&
175
- VerifyField<double>(verifier, VT_BID3_AMOUNT, 8) &&
176
- VerifyField<double>(verifier, VT_BID4, 8) &&
177
- VerifyField<double>(verifier, VT_BID4_AMOUNT, 8) &&
178
- VerifyField<double>(verifier, VT_BID5, 8) &&
179
- VerifyField<double>(verifier, VT_BID5_AMOUNT, 8) &&
180
- VerifyField<double>(verifier, VT_ASK1, 8) &&
181
- VerifyField<double>(verifier, VT_ASK1_AMOUNT, 8) &&
182
- VerifyField<double>(verifier, VT_ASK2, 8) &&
183
- VerifyField<double>(verifier, VT_ASK2_AMOUNT, 8) &&
184
- VerifyField<double>(verifier, VT_ASK3, 8) &&
185
- VerifyField<double>(verifier, VT_ASK3_AMOUNT, 8) &&
186
- VerifyField<double>(verifier, VT_ASK4, 8) &&
187
- VerifyField<double>(verifier, VT_ASK4_AMOUNT, 8) &&
188
- VerifyField<double>(verifier, VT_ASK5, 8) &&
189
- VerifyField<double>(verifier, VT_ASK5_AMOUNT, 8) &&
106
+ VerifyOffset(verifier, VT_BID) &&
107
+ verifier.VerifyVector(bid()) &&
108
+ VerifyOffset(verifier, VT_BID_AMOUNT) &&
109
+ verifier.VerifyVector(bid_amount()) &&
110
+ VerifyOffset(verifier, VT_ASK) &&
111
+ verifier.VerifyVector(ask()) &&
112
+ VerifyOffset(verifier, VT_ASK_AMOUNT) &&
113
+ verifier.VerifyVector(ask_amount()) &&
190
114
  verifier.EndTable();
191
115
  }
192
116
  };
@@ -228,65 +152,17 @@ struct SpotBuilder {
228
152
  void add_volume(double volume) {
229
153
  fbb_.AddElement<double>(Spot::VT_VOLUME, volume, 0.0);
230
154
  }
231
- void add_bid1(double bid1) {
232
- fbb_.AddElement<double>(Spot::VT_BID1, bid1, 0.0);
233
- }
234
- void add_bid1_amount(double bid1_amount) {
235
- fbb_.AddElement<double>(Spot::VT_BID1_AMOUNT, bid1_amount, 0.0);
236
- }
237
- void add_bid2(double bid2) {
238
- fbb_.AddElement<double>(Spot::VT_BID2, bid2, 0.0);
239
- }
240
- void add_bid2_amount(double bid2_amount) {
241
- fbb_.AddElement<double>(Spot::VT_BID2_AMOUNT, bid2_amount, 0.0);
242
- }
243
- void add_bid3(double bid3) {
244
- fbb_.AddElement<double>(Spot::VT_BID3, bid3, 0.0);
245
- }
246
- void add_bid3_amount(double bid3_amount) {
247
- fbb_.AddElement<double>(Spot::VT_BID3_AMOUNT, bid3_amount, 0.0);
248
- }
249
- void add_bid4(double bid4) {
250
- fbb_.AddElement<double>(Spot::VT_BID4, bid4, 0.0);
251
- }
252
- void add_bid4_amount(double bid4_amount) {
253
- fbb_.AddElement<double>(Spot::VT_BID4_AMOUNT, bid4_amount, 0.0);
254
- }
255
- void add_bid5(double bid5) {
256
- fbb_.AddElement<double>(Spot::VT_BID5, bid5, 0.0);
257
- }
258
- void add_bid5_amount(double bid5_amount) {
259
- fbb_.AddElement<double>(Spot::VT_BID5_AMOUNT, bid5_amount, 0.0);
260
- }
261
- void add_ask1(double ask1) {
262
- fbb_.AddElement<double>(Spot::VT_ASK1, ask1, 0.0);
263
- }
264
- void add_ask1_amount(double ask1_amount) {
265
- fbb_.AddElement<double>(Spot::VT_ASK1_AMOUNT, ask1_amount, 0.0);
266
- }
267
- void add_ask2(double ask2) {
268
- fbb_.AddElement<double>(Spot::VT_ASK2, ask2, 0.0);
269
- }
270
- void add_ask2_amount(double ask2_amount) {
271
- fbb_.AddElement<double>(Spot::VT_ASK2_AMOUNT, ask2_amount, 0.0);
272
- }
273
- void add_ask3(double ask3) {
274
- fbb_.AddElement<double>(Spot::VT_ASK3, ask3, 0.0);
275
- }
276
- void add_ask3_amount(double ask3_amount) {
277
- fbb_.AddElement<double>(Spot::VT_ASK3_AMOUNT, ask3_amount, 0.0);
278
- }
279
- void add_ask4(double ask4) {
280
- fbb_.AddElement<double>(Spot::VT_ASK4, ask4, 0.0);
155
+ void add_bid(::flatbuffers::Offset<::flatbuffers::Vector<double>> bid) {
156
+ fbb_.AddOffset(Spot::VT_BID, bid);
281
157
  }
282
- void add_ask4_amount(double ask4_amount) {
283
- fbb_.AddElement<double>(Spot::VT_ASK4_AMOUNT, ask4_amount, 0.0);
158
+ void add_bid_amount(::flatbuffers::Offset<::flatbuffers::Vector<double>> bid_amount) {
159
+ fbb_.AddOffset(Spot::VT_BID_AMOUNT, bid_amount);
284
160
  }
285
- void add_ask5(double ask5) {
286
- fbb_.AddElement<double>(Spot::VT_ASK5, ask5, 0.0);
161
+ void add_ask(::flatbuffers::Offset<::flatbuffers::Vector<double>> ask) {
162
+ fbb_.AddOffset(Spot::VT_ASK, ask);
287
163
  }
288
- void add_ask5_amount(double ask5_amount) {
289
- fbb_.AddElement<double>(Spot::VT_ASK5_AMOUNT, ask5_amount, 0.0);
164
+ void add_ask_amount(::flatbuffers::Offset<::flatbuffers::Vector<double>> ask_amount) {
165
+ fbb_.AddOffset(Spot::VT_ASK_AMOUNT, ask_amount);
290
166
  }
291
167
  explicit SpotBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
292
168
  : fbb_(_fbb) {
@@ -312,47 +188,11 @@ inline ::flatbuffers::Offset<Spot> CreateSpot(
312
188
  double close = 0.0,
313
189
  double amount = 0.0,
314
190
  double volume = 0.0,
315
- double bid1 = 0.0,
316
- double bid1_amount = 0.0,
317
- double bid2 = 0.0,
318
- double bid2_amount = 0.0,
319
- double bid3 = 0.0,
320
- double bid3_amount = 0.0,
321
- double bid4 = 0.0,
322
- double bid4_amount = 0.0,
323
- double bid5 = 0.0,
324
- double bid5_amount = 0.0,
325
- double ask1 = 0.0,
326
- double ask1_amount = 0.0,
327
- double ask2 = 0.0,
328
- double ask2_amount = 0.0,
329
- double ask3 = 0.0,
330
- double ask3_amount = 0.0,
331
- double ask4 = 0.0,
332
- double ask4_amount = 0.0,
333
- double ask5 = 0.0,
334
- double ask5_amount = 0.0) {
191
+ ::flatbuffers::Offset<::flatbuffers::Vector<double>> bid = 0,
192
+ ::flatbuffers::Offset<::flatbuffers::Vector<double>> bid_amount = 0,
193
+ ::flatbuffers::Offset<::flatbuffers::Vector<double>> ask = 0,
194
+ ::flatbuffers::Offset<::flatbuffers::Vector<double>> ask_amount = 0) {
335
195
  SpotBuilder builder_(_fbb);
336
- builder_.add_ask5_amount(ask5_amount);
337
- builder_.add_ask5(ask5);
338
- builder_.add_ask4_amount(ask4_amount);
339
- builder_.add_ask4(ask4);
340
- builder_.add_ask3_amount(ask3_amount);
341
- builder_.add_ask3(ask3);
342
- builder_.add_ask2_amount(ask2_amount);
343
- builder_.add_ask2(ask2);
344
- builder_.add_ask1_amount(ask1_amount);
345
- builder_.add_ask1(ask1);
346
- builder_.add_bid5_amount(bid5_amount);
347
- builder_.add_bid5(bid5);
348
- builder_.add_bid4_amount(bid4_amount);
349
- builder_.add_bid4(bid4);
350
- builder_.add_bid3_amount(bid3_amount);
351
- builder_.add_bid3(bid3);
352
- builder_.add_bid2_amount(bid2_amount);
353
- builder_.add_bid2(bid2);
354
- builder_.add_bid1_amount(bid1_amount);
355
- builder_.add_bid1(bid1);
356
196
  builder_.add_volume(volume);
357
197
  builder_.add_amount(amount);
358
198
  builder_.add_close(close);
@@ -360,6 +200,10 @@ inline ::flatbuffers::Offset<Spot> CreateSpot(
360
200
  builder_.add_high(high);
361
201
  builder_.add_open(open);
362
202
  builder_.add_yesterday_close(yesterday_close);
203
+ builder_.add_ask_amount(ask_amount);
204
+ builder_.add_ask(ask);
205
+ builder_.add_bid_amount(bid_amount);
206
+ builder_.add_bid(bid);
363
207
  builder_.add_datetime(datetime);
364
208
  builder_.add_name(name);
365
209
  builder_.add_code(code);
@@ -380,30 +224,18 @@ inline ::flatbuffers::Offset<Spot> CreateSpotDirect(
380
224
  double close = 0.0,
381
225
  double amount = 0.0,
382
226
  double volume = 0.0,
383
- double bid1 = 0.0,
384
- double bid1_amount = 0.0,
385
- double bid2 = 0.0,
386
- double bid2_amount = 0.0,
387
- double bid3 = 0.0,
388
- double bid3_amount = 0.0,
389
- double bid4 = 0.0,
390
- double bid4_amount = 0.0,
391
- double bid5 = 0.0,
392
- double bid5_amount = 0.0,
393
- double ask1 = 0.0,
394
- double ask1_amount = 0.0,
395
- double ask2 = 0.0,
396
- double ask2_amount = 0.0,
397
- double ask3 = 0.0,
398
- double ask3_amount = 0.0,
399
- double ask4 = 0.0,
400
- double ask4_amount = 0.0,
401
- double ask5 = 0.0,
402
- double ask5_amount = 0.0) {
227
+ const std::vector<double> *bid = nullptr,
228
+ const std::vector<double> *bid_amount = nullptr,
229
+ const std::vector<double> *ask = nullptr,
230
+ const std::vector<double> *ask_amount = nullptr) {
403
231
  auto market__ = market ? _fbb.CreateString(market) : 0;
404
232
  auto code__ = code ? _fbb.CreateString(code) : 0;
405
233
  auto name__ = name ? _fbb.CreateString(name) : 0;
406
234
  auto datetime__ = datetime ? _fbb.CreateString(datetime) : 0;
235
+ auto bid__ = bid ? _fbb.CreateVector<double>(*bid) : 0;
236
+ auto bid_amount__ = bid_amount ? _fbb.CreateVector<double>(*bid_amount) : 0;
237
+ auto ask__ = ask ? _fbb.CreateVector<double>(*ask) : 0;
238
+ auto ask_amount__ = ask_amount ? _fbb.CreateVector<double>(*ask_amount) : 0;
407
239
  return hikyuu::flat::CreateSpot(
408
240
  _fbb,
409
241
  market__,
@@ -417,26 +249,10 @@ inline ::flatbuffers::Offset<Spot> CreateSpotDirect(
417
249
  close,
418
250
  amount,
419
251
  volume,
420
- bid1,
421
- bid1_amount,
422
- bid2,
423
- bid2_amount,
424
- bid3,
425
- bid3_amount,
426
- bid4,
427
- bid4_amount,
428
- bid5,
429
- bid5_amount,
430
- ask1,
431
- ask1_amount,
432
- ask2,
433
- ask2_amount,
434
- ask3,
435
- ask3_amount,
436
- ask4,
437
- ask4_amount,
438
- ask5,
439
- ask5_amount);
252
+ bid__,
253
+ bid_amount__,
254
+ ask__,
255
+ ask_amount__);
440
256
  }
441
257
 
442
258
  struct SpotList FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
@@ -14,7 +14,7 @@ namespace hku {
14
14
  /**
15
15
  * 获取全局调度实例指针
16
16
  */
17
- TimerManager *getScheduler();
17
+ HKU_API TimerManager* getScheduler();
18
18
 
19
19
  /**
20
20
  * 用于程序退出时释放全局调度实例,仅内部使用
@@ -26,6 +26,9 @@ public:
26
26
 
27
27
  void updateIndex(const string& market, const string& code, const KQuery::KType& ktype);
28
28
 
29
+ void remove(const string& market, const string& code, const KQuery::KType& ktype,
30
+ Datetime start);
31
+
29
32
  private:
30
33
  ImportKDataToHdf5PluginInterface* m_plugin{nullptr};
31
34
  };
@@ -8,11 +8,36 @@
8
8
  #pragma once
9
9
 
10
10
  #include "hikyuu/DataType.h"
11
+ #include "hikyuu/Stock.h"
12
+ #include "hikyuu/global/SpotRecord.h"
11
13
 
12
14
  namespace hku {
13
15
 
14
- void HKU_API startDataServer(const std::string& addr = "tcp://0.0.0.0:9201", size_t work_num = 2);
16
+ void HKU_API startDataServer(const std::string& addr = "tcp://0.0.0.0:9201", size_t work_num = 2,
17
+ bool save_tick = false, bool buf_tick = false);
15
18
 
16
19
  void HKU_API stopDataServer();
17
20
 
21
+ /**
22
+ * 从 dataserver 数据缓存服务器拉取更新最新的缓存数据
23
+ * @param addr 缓存服务地址,如: tcp://192.168.1.1:9201
24
+ * @param stklist 待更新的股票列表
25
+ * @param ktype 指定更新的K线类型
26
+ */
27
+ void HKU_API getDataFromBufferServer(const std::string& addr, const StockList& stklist,
28
+ const KQuery::KType& ktype);
29
+
30
+ /**
31
+ * @brief 从 dataserver 获取指定证券大于等于指定日期的缓存 spot 数据
32
+ * @param addr 缓存服务地址,如: tcp://192.168.1.1:9201
33
+ * @param market 市场代码
34
+ * @param code 证券代码
35
+ * @param datetime 查询时间
36
+ * @return vector<SpotRecord>
37
+ */
38
+ vector<SpotRecord> HKU_API getSpotFromBufferServer(const std::string& addr,
39
+ const std::string& market,
40
+ const std::string& code,
41
+ const Datetime& datetime);
42
+
18
43
  } // namespace hku
@@ -14,8 +14,9 @@ namespace hku {
14
14
  /**
15
15
  * @brief 激活设备
16
16
  * @param active_code 授权码
17
+ * @param replace 超过设备限制时,强制替换最早激活的设备
17
18
  */
18
- void HKU_API activeDevice(const std::string& active_code);
19
+ void HKU_API activeDevice(const std::string& active_code, bool replace = false);
19
20
 
20
21
  /** 查看授权信息 */
21
22
  std::string HKU_API viewLicense();
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Copyright (c) 2025 hikyuu.org
3
+ *
4
+ * Created on: 2025-07-01
5
+ * Author: fasiondog
6
+ */
7
+
8
+ #pragma once
9
+
10
+ #include "hikyuu/data_driver/KDataDriver.h"
11
+ #include "hikyuu/data_driver/BlockInfoDriver.h"
12
+ #include "hikyuu/data_driver/BaseInfoDriver.h"
13
+ #include "hikyuu/utilities/plugin/PluginBase.h"
14
+
15
+ namespace hku {
16
+
17
+ class DataDriverPluginInterface : public PluginBase {
18
+ public:
19
+ DataDriverPluginInterface() = default;
20
+ virtual ~DataDriverPluginInterface() = default;
21
+
22
+ virtual KDataDriverPtr getKDataDriver() = 0;
23
+ virtual BlockInfoDriverPtr getBlockInfoDriver() = 0;
24
+ virtual BaseInfoDriverPtr getBaseInfoDriver() = 0;
25
+ };
26
+
27
+ } // namespace hku
@@ -16,7 +16,8 @@ public:
16
16
  DataServerPluginInterface() = default;
17
17
  virtual ~DataServerPluginInterface() = default;
18
18
 
19
- virtual void start(const std::string& addr, size_t work_num) noexcept = 0;
19
+ virtual void start(const std::string& addr, size_t work_num, bool save_tick,
20
+ bool buf_tick) noexcept = 0;
20
21
  virtual void stop() noexcept = 0;
21
22
  };
22
23
 
@@ -16,7 +16,7 @@ public:
16
16
  DevicePluginInterface() = default;
17
17
  virtual ~DevicePluginInterface() = default;
18
18
 
19
- virtual void activate(const std::string& active_code) noexcept = 0;
19
+ virtual void activate(const std::string& active_code, bool replace) noexcept = 0;
20
20
  virtual std::string viewLicense() noexcept = 0;
21
21
  virtual void removeLicense() noexcept = 0;
22
22
  virtual std::string fetchTrialLicense(const std::string& email) noexcept = 0;
@@ -28,6 +28,9 @@ public:
28
28
 
29
29
  virtual void updateIndex(const string& market, const string& code,
30
30
  const KQuery::KType& ktype) = 0;
31
+
32
+ virtual void remove(const string& market, const string& code, const KQuery::KType& ktype,
33
+ Datetime start) = 0;
31
34
  };
32
35
 
33
36
  } // namespace hku
@@ -13,6 +13,7 @@
13
13
  #include "ImportKDataToHdf5PluginInterface.h"
14
14
  #include "ExtendIndicatorsPluginInterface.h"
15
15
  #include "TMReportPluginInterface.h"
16
+ #include "DataDriverPluginInterface.h"
16
17
 
17
18
  namespace hku {
18
19
 
@@ -22,5 +23,6 @@ namespace hku {
22
23
  #define HKU_PLUGIN_IMPORTKDATATOHDF5 "import2hdf5"
23
24
  #define HKU_PLUGIN_EXTEND_INDICATOR "extind"
24
25
  #define HKU_PLUGIN_TMREPORT "tmreport"
26
+ #define HKU_PLUGIN_CLICKHOUSE_DRIVER "clickhousedriver"
25
27
 
26
28
  }
@@ -267,14 +267,5 @@ void HKU_API runInStrategy(const PFPtr& pf, const KQuery& query, const OrderBrok
267
267
  const TradeCostPtr& costfunc,
268
268
  const std::vector<OrderBrokerPtr>& other_brokers = {});
269
269
 
270
- /**
271
- * 从 hikyuu 数据缓存服务器拉取更新最新的缓存数据
272
- * @param addr 缓存服务地址,如: tcp://192.168.1.1:9201
273
- * @param stklist 待更新的股票列表
274
- * @param ktype 指定更新的K线类型
275
- */
276
- void HKU_API getDataFromBufferServer(const std::string& addr, const StockList& stklist,
277
- const KQuery::KType& ktype);
278
-
279
270
  /** @} */
280
271
  } // namespace hku
@@ -28,7 +28,7 @@
28
28
  #define HKU_USE_SPDLOG_ASYNC_LOGGER 0
29
29
  #define HKU_LOG_ACTIVE_LEVEL 2
30
30
 
31
- #define HKU_ENABLE_MO 0
31
+ #define HKU_ENABLE_MO 1
32
32
 
33
33
  #define HKU_ENABLE_HTTP_CLIENT 1
34
34
  #define HKU_ENABLE_HTTP_CLIENT_SSL 0
@@ -26,23 +26,39 @@
26
26
  #endif
27
27
 
28
28
  namespace hku {
29
+ namespace mo {
29
30
 
30
- class HKU_UTILS_API MOHelper {
31
- public:
32
- static void init();
31
+ /**
32
+ * @brief 初始化多语言支持
33
+ * @param path 翻译文件路径
34
+ */
35
+ void HKU_UTILS_API init(const std::string &path = "i18n");
36
+
37
+ /**
38
+ * @brief 按指定语言获取翻译
39
+ * @param lang
40
+ * @param id
41
+ * @return std::string
42
+ */
43
+ std::string HKU_UTILS_API translate(const std::string &lang, const char *id);
44
+
45
+ /**
46
+ * @brief 按指定语言和上下文获取翻译
47
+ * @param lang
48
+ * @param ctx
49
+ * @param id
50
+ * @return std::string
51
+ */
52
+ std::string HKU_UTILS_API translate(const std::string &lang, const char *ctx, const char *id);
33
53
 
34
- static std::string translate(const std::string &lang, const char *id) {
35
- auto iter = ms_dict.find(lang);
36
- return iter != ms_dict.end() ? ms_dict[lang].Lookup(id) : std::string(id);
37
- }
54
+ /** 获取系统语言 */
55
+ std::string HKU_UTILS_API getSystemLanguage();
38
56
 
39
- static std::string translate(const std::string &lang, const char *ctx, const char *id) {
40
- auto iter = ms_dict.find(lang);
41
- return iter != ms_dict.end() ? ms_dict[lang].LookupWithContext(ctx, id) : std::string(id);
42
- }
57
+ /** 按系统语言获取翻译 */
58
+ std::string HKU_UTILS_API _tr(const char *id);
43
59
 
44
- private:
45
- static std::unordered_map<std::string, moFileLib::moFileReader> ms_dict;
46
- };
60
+ /** 按系统语言和上下文获取翻译 */
61
+ std::string HKU_UTILS_API _ctr(const char *ctx, const char *id);
47
62
 
63
+ } // namespace mo
48
64
  } // namespace hku
@@ -79,6 +79,12 @@ std::string HKU_UTILS_API getUserDir();
79
79
  */
80
80
  std::string HKU_UTILS_API getCurrentDir();
81
81
 
82
+ /**
83
+ * 获取dll自身所在目录
84
+ * @note 仅支持linux/macos。windows下获取的是exe所在路径!
85
+ */
86
+ std::string HKU_UTILS_API getDllSelfDir();
87
+
82
88
  /**
83
89
  * 输出终端是否支持彩色控制字符
84
90
  */
@@ -12,13 +12,13 @@
12
12
  #define HKU_VERSION_H
13
13
 
14
14
  // clang-format off
15
- #define HKU_VERSION "2.6.5"
15
+ #define HKU_VERSION "2.6.6"
16
16
  #define HKU_VERSION_MAJOR 2
17
17
  #define HKU_VERSION_MINOR 6
18
- #define HKU_VERSION_ALTER 5
19
- #define HKU_VERSION_BUILD 202507031531
18
+ #define HKU_VERSION_ALTER 6
19
+ #define HKU_VERSION_BUILD 202507291558
20
20
  #define HKU_VERSION_MODE "RELEASE"
21
- #define HKU_VERSION_GIT "2.6.5 release.113bf7ee (RELEASE)"
21
+ #define HKU_VERSION_GIT "2.6.6 master.c4a12bf4 (RELEASE)"
22
22
  // clang-format on
23
23
 
24
24
  #endif /* HKU_VERSION_H */
Binary file
Binary file
Binary file
hikyuu/plugin/device.dll CHANGED
Binary file
hikyuu/plugin/extind.dll CHANGED
Binary file
Binary file
Binary file