hikyuu 2.1.1__cp311-none-win_amd64.whl → 2.1.2__cp311-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 (55) hide show
  1. hikyuu/cpp/boost_date_time-mt.dll +0 -0
  2. hikyuu/cpp/boost_serialization-mt.dll +0 -0
  3. hikyuu/cpp/boost_wserialization-mt.dll +0 -0
  4. hikyuu/cpp/core311.pyd +0 -0
  5. hikyuu/cpp/hikyuu.dll +0 -0
  6. hikyuu/cpp/sqlite3.dll +0 -0
  7. hikyuu/examples/notebook/006-TradeManager.ipynb +41 -39
  8. hikyuu/examples/notebook/008-Pickle.ipynb +27 -35
  9. hikyuu/fetcher/stock/zh_stock_a_qmt.py +49 -0
  10. hikyuu/gui/HikyuuTDX.py +2 -1
  11. hikyuu/gui/data/MainWindow.py +126 -126
  12. hikyuu/gui/spot_server.py +16 -7
  13. hikyuu/gui/start_qmt.py +36 -0
  14. hikyuu/include/hikyuu/Stock.h +1 -1
  15. hikyuu/include/hikyuu/StrategyContext.h +7 -2
  16. hikyuu/include/hikyuu/data_driver/base_info/table/HistoryFinanceTable.h +2 -2
  17. hikyuu/include/hikyuu/doc.h +2 -2
  18. hikyuu/include/hikyuu/global/GlobalSpotAgent.h +1 -0
  19. hikyuu/include/hikyuu/global/GlobalTaskGroup.h +4 -2
  20. hikyuu/include/hikyuu/global/SpotRecord.h +52 -0
  21. hikyuu/include/hikyuu/global/agent/SpotAgent.h +14 -41
  22. hikyuu/include/hikyuu/hikyuu.h +1 -0
  23. hikyuu/include/hikyuu/strategy/{AccountTradeManager.h → BrokerTradeManager.h} +98 -98
  24. hikyuu/include/hikyuu/strategy/RunPortfolioInStrategy.h +36 -0
  25. hikyuu/include/hikyuu/strategy/RunSystemInStrategy.h +37 -0
  26. hikyuu/include/hikyuu/strategy/Strategy.h +174 -0
  27. hikyuu/include/hikyuu/trade_manage/FundsRecord.h +8 -8
  28. hikyuu/include/hikyuu/trade_manage/OrderBrokerBase.h +66 -14
  29. hikyuu/include/hikyuu/trade_manage/PositionRecord.h +12 -12
  30. hikyuu/include/hikyuu/trade_manage/TradeManager.h +9 -0
  31. hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +19 -0
  32. hikyuu/include/hikyuu/utilities/TimerManager.h +23 -9
  33. hikyuu/include/hikyuu/utilities/arithmetic.h +2 -2
  34. hikyuu/include/hikyuu/utilities/datetime/Datetime.h +1 -0
  35. hikyuu/include/hikyuu/utilities/exception.h +15 -17
  36. hikyuu/include/hikyuu/utilities/http_client/HttpClient.h +1 -1
  37. hikyuu/include/hikyuu/utilities/mo/moFileReader.h +1 -1
  38. hikyuu/include/hikyuu/version.h +4 -4
  39. hikyuu/interactive.py +42 -137
  40. hikyuu/strategy/__init__.py +0 -1
  41. hikyuu/strategy/strategy_demo1.py +53 -0
  42. hikyuu/strategy/strategy_demo2.py +47 -0
  43. hikyuu/strategy/strategy_demo3.py +24 -0
  44. hikyuu/trade_manage/broker.py +27 -11
  45. hikyuu/trade_manage/broker_easytrader.py +52 -6
  46. hikyuu/trade_manage/broker_mail.py +17 -20
  47. {hikyuu-2.1.1.dist-info → hikyuu-2.1.2.dist-info}/METADATA +1 -1
  48. {hikyuu-2.1.1.dist-info → hikyuu-2.1.2.dist-info}/RECORD +52 -46
  49. {hikyuu-2.1.1.dist-info → hikyuu-2.1.2.dist-info}/top_level.txt +0 -1
  50. hikyuu/include/hikyuu/strategy/StrategyBase.h +0 -156
  51. hikyuu/strategy/demo/__init__.py +0 -3
  52. hikyuu/strategy/strategy.py +0 -27
  53. {hikyuu-2.1.1.dist-info → hikyuu-2.1.2.dist-info}/LICENSE +0 -0
  54. {hikyuu-2.1.1.dist-info → hikyuu-2.1.2.dist-info}/WHEEL +0 -0
  55. {hikyuu-2.1.1.dist-info → hikyuu-2.1.2.dist-info}/entry_points.txt +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Form implementation generated from reading ui file 'MainWindow.ui'
4
4
  #
5
- # Created by: PyQt5 UI code generator 5.15.6
5
+ # Created by: PyQt5 UI code generator 5.15.10
6
6
  #
7
7
  # WARNING: Any manual changes made to this file will be lost when pyuic5 is
8
8
  # run again. Do not edit this file unless you know what you are doing.
@@ -343,122 +343,121 @@ class Ui_MainWindow(object):
343
343
  self.save_pushButton.setGeometry(QtCore.QRect(390, 190, 75, 23))
344
344
  self.save_pushButton.setObjectName("save_pushButton")
345
345
  self.layoutWidget4 = QtWidgets.QWidget(self.groupBox_6)
346
- self.layoutWidget4.setGeometry(QtCore.QRect(40, 80, 321, 282))
346
+ self.layoutWidget4.setGeometry(QtCore.QRect(40, 80, 321, 296))
347
347
  self.layoutWidget4.setObjectName("layoutWidget4")
348
348
  self.gridLayout_6 = QtWidgets.QGridLayout(self.layoutWidget4)
349
349
  self.gridLayout_6.setContentsMargins(0, 0, 0, 0)
350
350
  self.gridLayout_6.setObjectName("gridLayout_6")
351
- self.preload_day_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
352
- self.preload_day_checkBox.setObjectName("preload_day_checkBox")
353
- self.gridLayout_6.addWidget(self.preload_day_checkBox, 0, 0, 1, 1)
351
+ self.preload_week_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
352
+ self.preload_week_checkBox.setObjectName("preload_week_checkBox")
353
+ self.gridLayout_6.addWidget(self.preload_week_checkBox, 1, 0, 1, 1)
354
354
  self.label_24 = QtWidgets.QLabel(self.layoutWidget4)
355
355
  self.label_24.setObjectName("label_24")
356
356
  self.gridLayout_6.addWidget(self.label_24, 0, 1, 1, 1)
357
+ self.preload_day_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
358
+ self.preload_day_checkBox.setObjectName("preload_day_checkBox")
359
+ self.gridLayout_6.addWidget(self.preload_day_checkBox, 0, 0, 1, 1)
360
+ self.preload_min15_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
361
+ self.preload_min15_checkBox.setObjectName("preload_min15_checkBox")
362
+ self.gridLayout_6.addWidget(self.preload_min15_checkBox, 8, 0, 1, 1)
363
+ self.preload_month_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
364
+ self.preload_month_checkBox.setObjectName("preload_month_checkBox")
365
+ self.gridLayout_6.addWidget(self.preload_month_checkBox, 2, 0, 1, 1)
357
366
  self.preload_day_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
358
367
  self.preload_day_spinBox.setMaximum(999999)
359
368
  self.preload_day_spinBox.setObjectName("preload_day_spinBox")
360
369
  self.gridLayout_6.addWidget(self.preload_day_spinBox, 0, 2, 1, 1)
361
- self.preload_week_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
362
- self.preload_week_checkBox.setObjectName("preload_week_checkBox")
363
- self.gridLayout_6.addWidget(self.preload_week_checkBox, 1, 0, 1, 1)
364
- self.label_25 = QtWidgets.QLabel(self.layoutWidget4)
365
- self.label_25.setObjectName("label_25")
366
- self.gridLayout_6.addWidget(self.label_25, 1, 1, 1, 1)
367
- self.preload_week_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
368
- self.preload_week_spinBox.setMaximum(999999)
369
- self.preload_week_spinBox.setObjectName("preload_week_spinBox")
370
- self.gridLayout_6.addWidget(self.preload_week_spinBox, 1, 2, 1, 1)
371
- self.preload_month_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
372
- self.preload_month_checkBox.setObjectName("preload_month_checkBox")
373
- self.gridLayout_6.addWidget(self.preload_month_checkBox, 2, 0, 1, 1)
370
+ self.preload_min5_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
371
+ self.preload_min5_checkBox.setObjectName("preload_min5_checkBox")
372
+ self.gridLayout_6.addWidget(self.preload_min5_checkBox, 7, 0, 1, 1)
373
+ self.preload_halfyear_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
374
+ self.preload_halfyear_spinBox.setMaximum(999999)
375
+ self.preload_halfyear_spinBox.setObjectName("preload_halfyear_spinBox")
376
+ self.gridLayout_6.addWidget(self.preload_halfyear_spinBox, 4, 2, 1, 1)
377
+ self.label_30 = QtWidgets.QLabel(self.layoutWidget4)
378
+ self.label_30.setObjectName("label_30")
379
+ self.gridLayout_6.addWidget(self.label_30, 6, 1, 1, 1)
380
+ self.label_32 = QtWidgets.QLabel(self.layoutWidget4)
381
+ self.label_32.setObjectName("label_32")
382
+ self.gridLayout_6.addWidget(self.label_32, 8, 1, 1, 1)
374
383
  self.label_26 = QtWidgets.QLabel(self.layoutWidget4)
375
384
  self.label_26.setObjectName("label_26")
376
385
  self.gridLayout_6.addWidget(self.label_26, 2, 1, 1, 1)
377
- self.preload_month_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
378
- self.preload_month_spinBox.setMaximum(999999)
379
- self.preload_month_spinBox.setObjectName("preload_month_spinBox")
380
- self.gridLayout_6.addWidget(self.preload_month_spinBox, 2, 2, 1, 1)
381
- self.preload_quarter_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
382
- self.preload_quarter_checkBox.setObjectName("preload_quarter_checkBox")
383
- self.gridLayout_6.addWidget(self.preload_quarter_checkBox, 3, 0, 1, 1)
384
- self.label_27 = QtWidgets.QLabel(self.layoutWidget4)
385
- self.label_27.setObjectName("label_27")
386
- self.gridLayout_6.addWidget(self.label_27, 3, 1, 1, 1)
387
386
  self.preload_quarter_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
388
387
  self.preload_quarter_spinBox.setMaximum(999999)
389
388
  self.preload_quarter_spinBox.setObjectName("preload_quarter_spinBox")
390
389
  self.gridLayout_6.addWidget(self.preload_quarter_spinBox, 3, 2, 1, 1)
390
+ self.preload_min60_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
391
+ self.preload_min60_checkBox.setObjectName("preload_min60_checkBox")
392
+ self.gridLayout_6.addWidget(self.preload_min60_checkBox, 10, 0, 1, 1)
393
+ self.preload_min1_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
394
+ self.preload_min1_checkBox.setObjectName("preload_min1_checkBox")
395
+ self.gridLayout_6.addWidget(self.preload_min1_checkBox, 6, 0, 1, 1)
396
+ self.preload_week_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
397
+ self.preload_week_spinBox.setMaximum(999999)
398
+ self.preload_week_spinBox.setObjectName("preload_week_spinBox")
399
+ self.gridLayout_6.addWidget(self.preload_week_spinBox, 1, 2, 1, 1)
391
400
  self.preload_halfyear_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
392
401
  self.preload_halfyear_checkBox.setObjectName("preload_halfyear_checkBox")
393
402
  self.gridLayout_6.addWidget(self.preload_halfyear_checkBox, 4, 0, 1, 1)
394
- self.label_28 = QtWidgets.QLabel(self.layoutWidget4)
395
- self.label_28.setObjectName("label_28")
396
- self.gridLayout_6.addWidget(self.label_28, 4, 1, 1, 1)
397
- self.preload_halfyear_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
398
- self.preload_halfyear_spinBox.setMaximum(999999)
399
- self.preload_halfyear_spinBox.setObjectName("preload_halfyear_spinBox")
400
- self.gridLayout_6.addWidget(self.preload_halfyear_spinBox, 4, 2, 1, 1)
401
- self.preload_year_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
402
- self.preload_year_checkBox.setObjectName("preload_year_checkBox")
403
- self.gridLayout_6.addWidget(self.preload_year_checkBox, 5, 0, 1, 1)
403
+ self.preload_min30_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
404
+ self.preload_min30_checkBox.setObjectName("preload_min30_checkBox")
405
+ self.gridLayout_6.addWidget(self.preload_min30_checkBox, 9, 0, 1, 1)
404
406
  self.label_29 = QtWidgets.QLabel(self.layoutWidget4)
405
407
  self.label_29.setObjectName("label_29")
406
408
  self.gridLayout_6.addWidget(self.label_29, 5, 1, 1, 1)
409
+ self.preload_min30_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
410
+ self.preload_min30_spinBox.setMaximum(999999)
411
+ self.preload_min30_spinBox.setObjectName("preload_min30_spinBox")
412
+ self.gridLayout_6.addWidget(self.preload_min30_spinBox, 9, 2, 1, 1)
413
+ self.label_34 = QtWidgets.QLabel(self.layoutWidget4)
414
+ self.label_34.setObjectName("label_34")
415
+ self.gridLayout_6.addWidget(self.label_34, 10, 1, 1, 1)
416
+ self.preload_min5_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
417
+ self.preload_min5_spinBox.setMaximum(999999)
418
+ self.preload_min5_spinBox.setObjectName("preload_min5_spinBox")
419
+ self.gridLayout_6.addWidget(self.preload_min5_spinBox, 7, 2, 1, 1)
420
+ self.preload_min60_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
421
+ self.preload_min60_spinBox.setMaximum(999999)
422
+ self.preload_min60_spinBox.setObjectName("preload_min60_spinBox")
423
+ self.gridLayout_6.addWidget(self.preload_min60_spinBox, 10, 2, 1, 1)
407
424
  self.preload_year_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
408
425
  self.preload_year_spinBox.setMaximum(999999)
409
426
  self.preload_year_spinBox.setObjectName("preload_year_spinBox")
410
427
  self.gridLayout_6.addWidget(self.preload_year_spinBox, 5, 2, 1, 1)
411
- self.preload_min1_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
412
- self.preload_min1_checkBox.setObjectName("preload_min1_checkBox")
413
- self.gridLayout_6.addWidget(self.preload_min1_checkBox, 6, 0, 1, 1)
414
- self.label_30 = QtWidgets.QLabel(self.layoutWidget4)
415
- self.label_30.setObjectName("label_30")
416
- self.gridLayout_6.addWidget(self.label_30, 6, 1, 1, 1)
428
+ self.preload_month_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
429
+ self.preload_month_spinBox.setMaximum(999999)
430
+ self.preload_month_spinBox.setObjectName("preload_month_spinBox")
431
+ self.gridLayout_6.addWidget(self.preload_month_spinBox, 2, 2, 1, 1)
432
+ self.label_25 = QtWidgets.QLabel(self.layoutWidget4)
433
+ self.label_25.setObjectName("label_25")
434
+ self.gridLayout_6.addWidget(self.label_25, 1, 1, 1, 1)
435
+ self.label_33 = QtWidgets.QLabel(self.layoutWidget4)
436
+ self.label_33.setObjectName("label_33")
437
+ self.gridLayout_6.addWidget(self.label_33, 9, 1, 1, 1)
438
+ self.label_27 = QtWidgets.QLabel(self.layoutWidget4)
439
+ self.label_27.setObjectName("label_27")
440
+ self.gridLayout_6.addWidget(self.label_27, 3, 1, 1, 1)
441
+ self.label_28 = QtWidgets.QLabel(self.layoutWidget4)
442
+ self.label_28.setObjectName("label_28")
443
+ self.gridLayout_6.addWidget(self.label_28, 4, 1, 1, 1)
444
+ self.label_31 = QtWidgets.QLabel(self.layoutWidget4)
445
+ self.label_31.setObjectName("label_31")
446
+ self.gridLayout_6.addWidget(self.label_31, 7, 1, 1, 1)
417
447
  self.preload_min1_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
418
448
  self.preload_min1_spinBox.setMaximum(999999)
419
449
  self.preload_min1_spinBox.setObjectName("preload_min1_spinBox")
420
450
  self.gridLayout_6.addWidget(self.preload_min1_spinBox, 6, 2, 1, 1)
421
- self.preload_min5_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
422
- self.preload_min5_checkBox.setObjectName("preload_min5_checkBox")
423
- self.gridLayout_6.addWidget(self.preload_min5_checkBox, 7, 0, 1, 1)
424
- self.label_31 = QtWidgets.QLabel(self.layoutWidget4)
425
- self.label_31.setObjectName("label_31")
426
- self.gridLayout_6.addWidget(self.label_31, 7, 1, 1, 1)
427
- self.preload_min5_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
428
- self.preload_min5_spinBox.setMaximum(999999)
429
- self.preload_min5_spinBox.setObjectName("preload_min5_spinBox")
430
- self.gridLayout_6.addWidget(self.preload_min5_spinBox, 7, 2, 1, 1)
431
- self.preload_min15_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
432
- self.preload_min15_checkBox.setObjectName("preload_min15_checkBox")
433
- self.gridLayout_6.addWidget(self.preload_min15_checkBox, 8, 0, 1, 1)
434
- self.label_32 = QtWidgets.QLabel(self.layoutWidget4)
435
- self.label_32.setObjectName("label_32")
436
- self.gridLayout_6.addWidget(self.label_32, 8, 1, 1, 1)
437
451
  self.preload_min15_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
438
452
  self.preload_min15_spinBox.setMaximum(999999)
439
453
  self.preload_min15_spinBox.setObjectName("preload_min15_spinBox")
440
454
  self.gridLayout_6.addWidget(self.preload_min15_spinBox, 8, 2, 1, 1)
441
- self.preload_min30_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
442
- self.preload_min30_checkBox.setObjectName("preload_min30_checkBox")
443
- self.gridLayout_6.addWidget(self.preload_min30_checkBox, 9, 0, 1, 1)
444
- self.label_33 = QtWidgets.QLabel(self.layoutWidget4)
445
- self.label_33.setObjectName("label_33")
446
- self.gridLayout_6.addWidget(self.label_33, 9, 1, 1, 1)
447
- self.preload_min30_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
448
- self.preload_min30_spinBox.setMaximum(999999)
449
- self.preload_min30_spinBox.setObjectName("preload_min30_spinBox")
450
- self.gridLayout_6.addWidget(self.preload_min30_spinBox, 9, 2, 1, 1)
451
- self.preload_min60_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
452
- self.preload_min60_checkBox.setObjectName("preload_min60_checkBox")
453
- self.gridLayout_6.addWidget(self.preload_min60_checkBox, 10, 0, 1, 1)
454
- self.label_34 = QtWidgets.QLabel(self.layoutWidget4)
455
- self.label_34.setObjectName("label_34")
456
- self.gridLayout_6.addWidget(self.label_34, 10, 1, 1, 1)
457
- self.preload_min60_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
458
- self.preload_min60_spinBox.setMaximum(999999)
459
- self.preload_min60_spinBox.setObjectName("preload_min60_spinBox")
460
- self.gridLayout_6.addWidget(self.preload_min60_spinBox, 10, 2, 1, 1)
461
-
455
+ self.preload_year_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
456
+ self.preload_year_checkBox.setObjectName("preload_year_checkBox")
457
+ self.gridLayout_6.addWidget(self.preload_year_checkBox, 5, 0, 1, 1)
458
+ self.preload_quarter_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
459
+ self.preload_quarter_checkBox.setObjectName("preload_quarter_checkBox")
460
+ self.gridLayout_6.addWidget(self.preload_quarter_checkBox, 3, 0, 1, 1)
462
461
  self.preload_hour2_checkBox = QtWidgets.QCheckBox(self.layoutWidget4)
463
462
  self.preload_hour2_checkBox.setObjectName("preload_hour2_checkBox")
464
463
  self.gridLayout_6.addWidget(self.preload_hour2_checkBox, 11, 0, 1, 1)
@@ -467,9 +466,8 @@ class Ui_MainWindow(object):
467
466
  self.gridLayout_6.addWidget(self.label_42, 11, 1, 1, 1)
468
467
  self.preload_hour2_spinBox = QtWidgets.QSpinBox(self.layoutWidget4)
469
468
  self.preload_hour2_spinBox.setMaximum(999999)
470
- self.preload_hour2_spinBox.setObjectName("preload_hour20_spinBox")
469
+ self.preload_hour2_spinBox.setObjectName("preload_hour2_spinBox")
471
470
  self.gridLayout_6.addWidget(self.preload_hour2_spinBox, 11, 2, 1, 1)
472
-
473
471
  self.layoutWidget5 = QtWidgets.QWidget(self.groupBox_6)
474
472
  self.layoutWidget5.setGeometry(QtCore.QRect(40, 30, 362, 40))
475
473
  self.layoutWidget5.setObjectName("layoutWidget5")
@@ -499,7 +497,7 @@ class Ui_MainWindow(object):
499
497
  self.collect_sample_spinBox.setObjectName("collect_sample_spinBox")
500
498
  self.horizontalLayout_10.addWidget(self.collect_sample_spinBox)
501
499
  self.collect_use_zhima_checkBox = QtWidgets.QCheckBox(self.tab)
502
- self.collect_use_zhima_checkBox.setGeometry(QtCore.QRect(40, 280, 141, 16))
500
+ self.collect_use_zhima_checkBox.setGeometry(QtCore.QRect(40, 275, 141, 16))
503
501
  self.collect_use_zhima_checkBox.setObjectName("collect_use_zhima_checkBox")
504
502
  self.layoutWidget7 = QtWidgets.QWidget(self.tab)
505
503
  self.layoutWidget7.setGeometry(QtCore.QRect(40, 190, 214, 24))
@@ -546,7 +544,7 @@ class Ui_MainWindow(object):
546
544
  self.horizontalLayout_7.addWidget(self.collect_phase2_last_timeEdit)
547
545
  self.horizontalLayout_9.addLayout(self.horizontalLayout_7)
548
546
  self.textBrowser = QtWidgets.QTextBrowser(self.tab)
549
- self.textBrowser.setGeometry(QtCore.QRect(30, 321, 511, 181))
547
+ self.textBrowser.setGeometry(QtCore.QRect(30, 311, 511, 191))
550
548
  self.textBrowser.setObjectName("textBrowser")
551
549
  self.layoutWidget8 = QtWidgets.QWidget(self.tab)
552
550
  self.layoutWidget8.setGeometry(QtCore.QRect(40, 90, 141, 23))
@@ -560,6 +558,7 @@ class Ui_MainWindow(object):
560
558
  self.collect_source_comboBox = QtWidgets.QComboBox(self.layoutWidget8)
561
559
  self.collect_source_comboBox.setObjectName("collect_source_comboBox")
562
560
  self.collect_source_comboBox.addItem("")
561
+ self.collect_source_comboBox.addItem("")
563
562
  self.horizontalLayout_13.addWidget(self.collect_source_comboBox)
564
563
  self.collect_start_pushButton = QtWidgets.QPushButton(self.tab)
565
564
  self.collect_start_pushButton.setGeometry(QtCore.QRect(40, 30, 141, 23))
@@ -639,50 +638,50 @@ class Ui_MainWindow(object):
639
638
  self.label_9.setText(_translate("MainWindow", "导入权息数据:"))
640
639
  self.hdf5_weight_label.setText(_translate("MainWindow", "TextLabel"))
641
640
  self.import_detail_textEdit.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
642
- "<html><head><meta name=\"qrichtext\" content=\"1\" /><meta charset=\"utf-8\" /><style type=\"text/css\">\n"
643
- "p, li { white-space: pre-wrap; }\n"
644
- "</style></head><body style=\" font-family:\'Microsoft YaHei UI\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
645
- "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SimSun\';\">导入上证日线记录:</span></p>\n"
646
- "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SimSun\';\">导入深证日线记录:</span></p>\n"
647
- "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SimSun\';\">导入上证5分钟线记录:</span></p>\n"
648
- "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SimSun\';\">导入深证5分钟线记录:</span></p>\n"
649
- "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SimSun\';\">导入上证1分钟线记录:</span></p>\n"
650
- "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SimSun\';\">导入深证1分钟线记录:</span></p>\n"
651
- "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SimSun\';\">导入上证分笔记录:</span></p>\n"
652
- "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SimSun\';\">导入深证分笔记录:</span></p>\n"
653
- "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SimSun\';\">导入上证分时数据:</span></p>\n"
654
- "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SimSun\';\">导入深证分时数据:</span></p>\n"
655
- "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SimSun\';\">导入权息数据数:</span></p>\n"
656
- "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SimSun\';\">导入完毕!</span></p></body></html>"))
641
+ "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
642
+ "p, li { white-space: pre-wrap; }\n"
643
+ "</style></head><body style=\" font-family:\'SimSun\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
644
+ "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">导入上证日线记录:</p>\n"
645
+ "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">导入深证日线记录:</p>\n"
646
+ "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">导入上证5分钟线记录:</p>\n"
647
+ "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">导入深证5分钟线记录:</p>\n"
648
+ "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">导入上证1分钟线记录:</p>\n"
649
+ "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">导入深证1分钟线记录:</p>\n"
650
+ "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">导入上证分笔记录:</p>\n"
651
+ "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">导入深证分笔记录:</p>\n"
652
+ "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">导入上证分时数据:</p>\n"
653
+ "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">导入深证分时数据:</p>\n"
654
+ "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">导入权息数据数:</p>\n"
655
+ "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">导入完毕!</p></body></html>"))
657
656
  self.import_status_label.setText(_translate("MainWindow", "import_status_label"))
658
657
  self.sched_import_pushButton.setText(_translate("MainWindow", "启动定时导入"))
659
658
  self.label_40.setText(_translate("MainWindow", "导入执行时间:"))
660
659
  self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "执行导入"))
661
660
  self.groupBox_6.setTitle(_translate("MainWindow", "预加载设置"))
662
661
  self.save_pushButton.setText(_translate("MainWindow", "保存设置"))
663
- self.preload_day_checkBox.setText(_translate("MainWindow", "预加载日线"))
664
- self.label_24.setText(_translate("MainWindow", "最大缓存数量:"))
665
662
  self.preload_week_checkBox.setText(_translate("MainWindow", "预加载周线"))
666
- self.label_25.setText(_translate("MainWindow", "最大缓存数量:"))
663
+ self.label_24.setText(_translate("MainWindow", "最大缓存数量:"))
664
+ self.preload_day_checkBox.setText(_translate("MainWindow", "预加载日线"))
665
+ self.preload_min15_checkBox.setText(_translate("MainWindow", "预加载15分钟线"))
667
666
  self.preload_month_checkBox.setText(_translate("MainWindow", "预加载月线"))
668
- self.label_26.setText(_translate("MainWindow", "最大缓存数量:"))
669
- self.preload_quarter_checkBox.setText(_translate("MainWindow", "预加载季线"))
670
- self.label_27.setText(_translate("MainWindow", "最大缓存数量:"))
671
- self.preload_halfyear_checkBox.setText(_translate("MainWindow", "预加载半年线"))
672
- self.label_28.setText(_translate("MainWindow", "最大缓存数量:"))
673
- self.preload_year_checkBox.setText(_translate("MainWindow", "预加载年线"))
674
- self.label_29.setText(_translate("MainWindow", "最大缓存数量:"))
675
- self.preload_min1_checkBox.setText(_translate("MainWindow", "预加载1分钟线"))
676
- self.label_30.setText(_translate("MainWindow", "最大缓存数量:"))
677
667
  self.preload_min5_checkBox.setText(_translate("MainWindow", "预加载5分钟线"))
678
- self.label_31.setText(_translate("MainWindow", "最大缓存数量:"))
679
- self.preload_min15_checkBox.setText(_translate("MainWindow", "预加载15分钟线"))
668
+ self.label_30.setText(_translate("MainWindow", "最大缓存数量:"))
680
669
  self.label_32.setText(_translate("MainWindow", "最大缓存数量:"))
681
- self.preload_min30_checkBox.setText(_translate("MainWindow", "预加载30分钟线"))
682
- self.label_33.setText(_translate("MainWindow", "最大缓存数量:"))
670
+ self.label_26.setText(_translate("MainWindow", "最大缓存数量:"))
683
671
  self.preload_min60_checkBox.setText(_translate("MainWindow", "预加载60分钟线"))
672
+ self.preload_min1_checkBox.setText(_translate("MainWindow", "预加载1分钟线"))
673
+ self.preload_halfyear_checkBox.setText(_translate("MainWindow", "预加载半年线"))
674
+ self.preload_min30_checkBox.setText(_translate("MainWindow", "预加载30分钟线"))
675
+ self.label_29.setText(_translate("MainWindow", "最大缓存数量:"))
684
676
  self.label_34.setText(_translate("MainWindow", "最大缓存数量:"))
685
- self.preload_hour2_checkBox.setText(_translate("MainWindow", "预加载2小时线"))
677
+ self.label_25.setText(_translate("MainWindow", "最大缓存数量:"))
678
+ self.label_33.setText(_translate("MainWindow", "最大缓存数量:"))
679
+ self.label_27.setText(_translate("MainWindow", "最大缓存数量:"))
680
+ self.label_28.setText(_translate("MainWindow", "最大缓存数量:"))
681
+ self.label_31.setText(_translate("MainWindow", "最大缓存数量:"))
682
+ self.preload_year_checkBox.setText(_translate("MainWindow", "预加载年线"))
683
+ self.preload_quarter_checkBox.setText(_translate("MainWindow", "预加载季线"))
684
+ self.preload_hour2_checkBox.setText(_translate("MainWindow", "预加载120分钟线"))
686
685
  self.label_42.setText(_translate("MainWindow", "最大缓存数量:"))
687
686
  self.label_35.setText(_translate("MainWindow", "此处为 Hikyuu 运行时的数据预加载设置,请根据机器内存大小选择"))
688
687
  self.label_36.setText(_translate("MainWindow", "(目前加载全部日线数据目前需要约需900M内存)"))
@@ -694,17 +693,18 @@ class Ui_MainWindow(object):
694
693
  self.label_37.setText(_translate("MainWindow", "执行时间段2:"))
695
694
  self.label_38.setText(_translate("MainWindow", "-"))
696
695
  self.textBrowser.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
697
- "<html><head><meta name=\"qrichtext\" content=\"1\" /><meta charset=\"utf-8\" /><style type=\"text/css\">\n"
698
- "p, li { white-space: pre-wrap; }\n"
699
- "</style></head><body style=\" font-family:\'Microsoft YaHei UI\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
700
- "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SimSun\';\">注:</span></p>\n"
701
- "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SimSun\'; font-size:10pt; font-weight:600; color:#ff0000;\">1、行情采集服务仅对预加载数据有效</span><span style=\" font-family:\'SimSun\';\">,在行情采集服务运行期间,hikyuu.interactive运行时将自动连接采集服务获取行情数据,并更新预加载的内容数据。</span></p>\n"
702
- "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'SimSun\';\"><br /></p>\n"
703
- "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SimSun\';\">2、如使用芝麻代理(</span><a href=\"http://h.zhimaruanjian.com/\"><span style=\" font-family:\'SimSun\'; text-decoration: underline; color:#0000ff;\">http://h.zhimaruanjian.com/</span></a><span style=\" font-family:\'SimSun\';\">),请自行申请(需付费),并确保ip为其白名单。</span></p>\n"
704
- "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'SimSun\';\"><br /></p>\n"
705
- "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'SimSun\'; font-weight:700; color:#0000ff;\">3、此处采集为网络采集,更推荐直接运行安装目录下gui子目录下的 start_huatai_insight.py ,使用华泰 insight 的实时服务。运行前,需手工修改该文件最下方 __main__ 中的 login,放入自己的账号和密码。该程序独立运行,不用关闭,和这里的采集效果一样。</span></p></body></html>"))
696
+ "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
697
+ "p, li { white-space: pre-wrap; }\n"
698
+ "</style></head><body style=\" font-family:\'SimSun\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
699
+ "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">注:</p>\n"
700
+ "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:10pt; font-weight:600; color:#ff0000;\">1、行情采集服务仅对预加载数据有效</span>,在行情采集服务运行期间,hikyuu.interactive运行时将自动连接采集服务获取行情数据,并更新预加载的内容数据。</p>\n"
701
+ "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n"
702
+ "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">2、如使用芝麻代理(<a href=\"http://h.zhimaruanjian.com/\"><span style=\" text-decoration: underline; color:#0000ff;\">http://h.zhimaruanjian.com/</span></a>),请自行申请(需付费),并确保ip为其白名单。</p>\n"
703
+ "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n"
704
+ "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:696; color:#0000ff;\">3、此处采集为网络采集,更推荐直接运行安装目录下gui子目录下的 start_qmt.py ,使用miniqmt 实时服务。该程序独立运行,不用关闭,和这里的采集效果一样。注意:miniqmt需要QMT交易端配合,且在同一机器上执行。</span></p></body></html>"))
706
705
  self.label_39.setText(_translate("MainWindow", "行情数据源:"))
707
706
  self.collect_source_comboBox.setItemText(0, _translate("MainWindow", "qq"))
707
+ self.collect_source_comboBox.setItemText(1, _translate("MainWindow", "qmt"))
708
708
  self.collect_start_pushButton.setText(_translate("MainWindow", "启动采集"))
709
709
  self.collect_status_label.setText(_translate("MainWindow", "TextLabel"))
710
710
  self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "行情采集服务"))
hikyuu/gui/spot_server.py CHANGED
@@ -18,7 +18,8 @@ import threading
18
18
  import hikyuu.flat as fb
19
19
 
20
20
  from hikyuu.util import *
21
- from hikyuu.fetcher.stock.zh_stock_a_sina_qq import get_spot
21
+ from hikyuu.fetcher.stock.zh_stock_a_sina_qq import get_spot as qq_get_spot
22
+ from hikyuu.fetcher.stock.zh_stock_a_qmt import get_spot as qmt_get_spot
22
23
  from hikyuu import hikyuu_init, StockManager, constant, Datetime, TimeDelta
23
24
 
24
25
 
@@ -269,14 +270,22 @@ def collect(server, use_proxy, source, seconds, phase1, phase2, ignore_weekend):
269
270
  hikyuu_init(config_file, ignore_preload=True)
270
271
 
271
272
  sm = StockManager.instance()
272
- stk_list = [
273
- stk.market_code.lower() for stk in sm if stk.valid and stk.type in
274
- (constant.STOCKTYPE_A, constant.STOCKTYPE_INDEX, constant.STOCKTYPE_GEM,
275
- constant.STOCKTYPE_START, constant.STOCKTYPE_A_BJ)
276
- ]
273
+ if source == 'qmt':
274
+ stk_list = [s for s in sm if s.valid]
275
+ else:
276
+ stk_list = [
277
+ stk.market_code.lower() for stk in sm if stk.valid and stk.type in
278
+ (constant.STOCKTYPE_A, constant.STOCKTYPE_INDEX, constant.STOCKTYPE_GEM,
279
+ constant.STOCKTYPE_START, constant.STOCKTYPE_A_BJ)
280
+ ]
277
281
 
278
282
  _ = get_nng_senders()
279
283
 
284
+ if source == 'qmt':
285
+ get_spot = qmt_get_spot
286
+ elif source == 'qq':
287
+ get_spot = qq_get_spot
288
+
280
289
  start_time = Datetime.now()
281
290
  delta = next_delta(start_time, seconds, phase1_delta, phase2_delta, ignore_weekend)
282
291
  next_time = start_time + delta
@@ -308,7 +317,7 @@ def collect(server, use_proxy, source, seconds, phase1, phase2, ignore_weekend):
308
317
  @click.command()
309
318
  @click.option('-server', '--server', default='tcp://*:9200')
310
319
  @click.option('-use_proxy', '--use_proxy', is_flag=True, help='是否使用代理,须自行申请芝麻http代理并加入ip白名单')
311
- @click.option('-source', '--source', default='qq', type=click.Choice(['sina', 'qq']), help='数据来源')
320
+ @click.option('-source', '--source', default='qq', type=click.Choice(['qmt', 'qq']), help='数据来源')
312
321
  @click.option('-seconds', '--seconds', default=10)
313
322
  @click.option('-phase1', '--phase1', default='9:00-12:00')
314
323
  @click.option('-phase2', '--phase2', default='13:00-15:00')
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/python3
2
+ # -*- coding: utf-8 -*-
3
+
4
+
5
+ from hikyuu.fetcher.stock.zh_stock_a_qmt import parse_one_result_qmt
6
+ from hikyuu.gui.spot_server import release_nng_senders, start_send_spot, end_send_spot, send_spot
7
+
8
+
9
+ def callback(datas):
10
+ records = []
11
+ for stock_code, data in datas.items():
12
+ # print(stock_code, data)
13
+ records.append(parse_one_result_qmt(stock_code, data))
14
+
15
+ if records:
16
+ start_send_spot()
17
+ send_spot(records)
18
+ end_send_spot()
19
+
20
+
21
+ if __name__ == "__main__":
22
+ from hikyuu.interactive import *
23
+ from xtquant import xtdata
24
+
25
+ code_list = [f'{s.code}.{s.market}' for s in sm if s.valid]
26
+ # code_list = ['000001.SZ']
27
+
28
+ xtdata.subscribe_whole_quote(code_list, callback)
29
+
30
+ try:
31
+ xtdata.run()
32
+ except Exception as e:
33
+ hku_error(e)
34
+ finally:
35
+ # 退出释放资源
36
+ release_nng_senders()
@@ -278,7 +278,7 @@ struct HKU_API Stock::Data {
278
278
 
279
279
  mutable vector<HistoryFinanceInfo>
280
280
  m_history_finance; // 历史财务信息 [财务报告日期, 字段1, 字段2, ...]
281
- mutable bool m_history_finance_ready{false};
281
+ mutable std::atomic_bool m_history_finance_ready{false};
282
282
  mutable std::mutex m_history_finance_mutex;
283
283
 
284
284
  price_t m_tick;
@@ -22,11 +22,16 @@ public:
22
22
  explicit StrategyContext(vector<string>&& stockCodeList)
23
23
  : m_stockCodeList(std::move(stockCodeList)) {}
24
24
 
25
+ StrategyContext(const vector<string>& stockCodeList, const vector<KQuery::KType>& ktypeList)
26
+ : m_stockCodeList(stockCodeList), m_ktypeList(ktypeList) {}
27
+
25
28
  virtual ~StrategyContext() = default;
26
29
 
27
- bool isAll() const;
30
+ bool isAll() const noexcept;
31
+
32
+ bool isValid() const noexcept;
28
33
 
29
- Datetime startDatetime() const {
34
+ Datetime startDatetime() const noexcept {
30
35
  return m_startDatetime;
31
36
  }
32
37
 
@@ -13,8 +13,8 @@ namespace hku {
13
13
 
14
14
  struct HistoryFinanceTable {
15
15
  TABLE_BIND4(HistoryFinanceTable, HistoryFinance, file_date, report_date, market_code, values)
16
- uint64_t file_date;
17
- uint64_t report_date;
16
+ uint64_t file_date{0};
17
+ uint64_t report_date{0};
18
18
  std::string market_code;
19
19
  // std::vector<float> values;
20
20
  std::vector<char> values;
@@ -137,8 +137,8 @@
137
137
  * @details 合成多因子
138
138
  * @ingroup TradeSystem
139
139
  *
140
- * @defgroup SystemInstance SystemInstance 系统实例
141
- * @details 系统实例
140
+ * @defgroup Stratgy Strategy 策略运行时
141
+ * @details 策略运行时
142
142
  * @ingroup Hikyuu
143
143
  *
144
144
  * @defgroup Agent Agent 对外数据接收发送代理
@@ -5,6 +5,7 @@
5
5
  * Author: fasiondog
6
6
  */
7
7
 
8
+ #pragma once
8
9
  #include "agent/SpotAgent.h"
9
10
 
10
11
  namespace hku {
@@ -11,15 +11,17 @@
11
11
  #ifndef HKU_GLOBAL_TASK_GROUP
12
12
  #define HKU_GLOBAL_TASK_GROUP
13
13
 
14
- #include "../utilities/thread/StealThreadPool.h"
14
+ #include "../utilities/thread/thread.h"
15
15
 
16
16
  namespace hku {
17
17
 
18
+ using TaskGroup = ThreadPool;
19
+
18
20
  /**
19
21
  * 获取全局线程池任务组
20
22
  * @note 请使用 future 获取任务返回
21
23
  */
22
- StealThreadPool* getGlobalTaskGroup();
24
+ TaskGroup* getGlobalTaskGroup();
23
25
 
24
26
  template <typename ResultType>
25
27
  using task_handle = std::future<ResultType>;
@@ -0,0 +1,52 @@
1
+ /*
2
+ * Copyright (c) 2024 hikyuu.org
3
+ *
4
+ * Created on: 2024-08-15
5
+ * Author: fasiondog
6
+ */
7
+
8
+ #pragma once
9
+
10
+ #include "hikyuu/DataType.h"
11
+
12
+ namespace hku {
13
+
14
+ /**
15
+ * 接收外部实时数据结构
16
+ * @ingroup Agent
17
+ */
18
+ struct HKU_API SpotRecord {
19
+ string market; ///< 市场标识
20
+ string code; ///< 证券代码
21
+ string name; ///< 证券名称
22
+ Datetime datetime; ///< 数据时间
23
+ price_t yesterday_close; ///< 昨日收盘价
24
+ price_t open; ///< 开盘价
25
+ price_t high; ///< 最高价
26
+ price_t low; ///< 最低价
27
+ price_t close; ///< 收盘价
28
+ price_t amount; ///< 成交金额 (千元)
29
+ price_t volume; ///< 成交量(手)
30
+ price_t bid1; ///< 买一价
31
+ price_t bid1_amount; ///< 买一数量(手)
32
+ price_t bid2; ///< 买二价
33
+ price_t bid2_amount; ///< 买二数量
34
+ price_t bid3; ///< 买三价
35
+ price_t bid3_amount; ///< 买三数量
36
+ price_t bid4; ///< 买四价
37
+ price_t bid4_amount; ///< 买四数量
38
+ price_t bid5; ///< 买五价
39
+ price_t bid5_amount; ///< 买五数量
40
+ price_t ask1; ///< 卖一价
41
+ price_t ask1_amount; ///< 卖一数量
42
+ price_t ask2; ///< 卖二价
43
+ price_t ask2_amount; ///< 卖二数量
44
+ price_t ask3; ///< 卖三价
45
+ price_t ask3_amount; ///< 卖三数量
46
+ price_t ask4; ///< 卖四价
47
+ price_t ask4_amount; ///< 卖四数量
48
+ price_t ask5; ///< 卖五价
49
+ price_t ask5_amount; ///< 卖五数量
50
+ };
51
+
52
+ } // namespace hku