hikyuu 2.6.9__py3-none-win_amd64.whl → 2.7.0__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.
- hikyuu/__init__.py +26 -5
- hikyuu/__init__.pyi +609 -614
- hikyuu/analysis/__init__.pyi +584 -589
- hikyuu/analysis/analysis.pyi +585 -590
- hikyuu/core.pyi +586 -591
- hikyuu/cpp/__init__.pyi +2 -2
- hikyuu/cpp/core310.pyd +0 -0
- hikyuu/cpp/core310.pyi +60 -100
- hikyuu/cpp/core311.pyd +0 -0
- hikyuu/cpp/core311.pyi +60 -100
- hikyuu/cpp/core312.pyd +0 -0
- hikyuu/cpp/core312.pyi +60 -100
- hikyuu/cpp/core313.pyd +0 -0
- hikyuu/cpp/core313.pyi +60 -100
- hikyuu/cpp/hikyuu.dll +0 -0
- hikyuu/cpp/hikyuu.lib +0 -0
- hikyuu/cpp/sqlite3.dll +0 -0
- hikyuu/data/download_block.py +61 -28
- hikyuu/draw/drawplot/__init__.pyi +8 -8
- hikyuu/draw/drawplot/bokeh_draw.pyi +600 -605
- hikyuu/draw/drawplot/common.pyi +1 -1
- hikyuu/draw/drawplot/echarts_draw.pyi +602 -607
- hikyuu/draw/drawplot/matplotlib_draw.pyi +612 -617
- hikyuu/draw/elder.pyi +11 -11
- hikyuu/draw/kaufman.pyi +18 -18
- hikyuu/draw/volume.pyi +10 -10
- hikyuu/extend.py +0 -7
- hikyuu/extend.pyi +594 -599
- hikyuu/fetcher/stock/zh_block_em.py +0 -60
- hikyuu/gui/HikyuuTDX.py +18 -1
- hikyuu/gui/data/MainWindow.py +36 -10
- hikyuu/gui/images/liandongxiaopu.png +0 -0
- hikyuu/hub.pyi +6 -6
- hikyuu/include/hikyuu/Stock.h +2 -2
- hikyuu/include/hikyuu/config.h +0 -3
- hikyuu/include/hikyuu/plugin/device.h +10 -0
- hikyuu/include/hikyuu/plugin/interface/DevicePluginInterface.h +2 -0
- hikyuu/include/hikyuu/plugin/interface/plugins.h +0 -5
- hikyuu/include/hikyuu/python/pybind_utils.h +0 -12
- hikyuu/include/hikyuu/trade_sys/slippage/build_in.h +5 -1
- hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_LogNormal.h +22 -0
- hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_Normal.h +22 -0
- hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_TruncNormal.h +25 -0
- hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_Uniform.h +23 -0
- hikyuu/include/hikyuu/trade_sys/slippage/imp/LogNormalSlippage.h +28 -0
- hikyuu/include/hikyuu/trade_sys/slippage/imp/NormalSlippage.h +28 -0
- hikyuu/include/hikyuu/trade_sys/slippage/imp/TruncNormalSlippage.h +28 -0
- hikyuu/include/hikyuu/trade_sys/slippage/imp/UniformSlippage.h +24 -0
- hikyuu/include/hikyuu/version.h +5 -5
- hikyuu/plugin/backtest.dll +0 -0
- hikyuu/plugin/clickhousedriver.dll +0 -0
- hikyuu/plugin/dataserver.dll +0 -0
- hikyuu/plugin/dataserver_parquet.dll +0 -0
- hikyuu/plugin/device.dll +0 -0
- hikyuu/plugin/extind.dll +0 -0
- hikyuu/plugin/hkuextra.dll +0 -0
- hikyuu/plugin/import2hdf5.dll +0 -0
- hikyuu/plugin/tmreport.dll +0 -0
- hikyuu/trade_manage/__init__.pyi +600 -605
- hikyuu/trade_manage/broker.pyi +3 -3
- hikyuu/trade_manage/broker_easytrader.pyi +1 -1
- hikyuu/trade_manage/trade.py +0 -2
- hikyuu/trade_manage/trade.pyi +600 -605
- hikyuu/util/singleton.pyi +1 -1
- {hikyuu-2.6.9.dist-info → hikyuu-2.7.0.dist-info}/METADATA +24 -20
- {hikyuu-2.6.9.dist-info → hikyuu-2.7.0.dist-info}/RECORD +69 -70
- {hikyuu-2.6.9.dist-info → hikyuu-2.7.0.dist-info}/top_level.txt +0 -1
- hikyuu/cpp/arrow.dll +0 -0
- hikyuu/cpp/core39.pyd +0 -0
- hikyuu/cpp/core39.pyi +0 -14818
- hikyuu/cpp/msvcp140-a118642f3ae8774fb9dc223e15c4a52e.dll +0 -0
- hikyuu/cpp/parquet.dll +0 -0
- hikyuu/include/hikyuu/plugin/hkuviews.h +0 -36
- hikyuu/include/hikyuu/plugin/interface/HkuViewsPluginInterface.h +0 -34
- hikyuu/include/hikyuu/views/__init__.py +0 -1
- hikyuu/include/hikyuu/views/arrow_common.h +0 -38
- hikyuu/include/hikyuu/views/arrow_views.h +0 -117
- hikyuu/plugin/hkuviews.dll +0 -0
- {hikyuu-2.6.9.dist-info → hikyuu-2.7.0.dist-info}/WHEEL +0 -0
- {hikyuu-2.6.9.dist-info → hikyuu-2.7.0.dist-info}/entry_points.txt +0 -0
|
@@ -17,7 +17,6 @@ from hikyuu.util import *
|
|
|
17
17
|
em_num_per_page = 100
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
@hku_catch(ret=[], trace=False)
|
|
21
20
|
def get_hybk_names():
|
|
22
21
|
"""获取所有行业(板块代码,板块名称)列表"""
|
|
23
22
|
url = "https://19.push2.eastmoney.com/api/qt/clist/get"
|
|
@@ -50,7 +49,6 @@ def get_hybk_names():
|
|
|
50
49
|
return ret
|
|
51
50
|
|
|
52
51
|
|
|
53
|
-
@hku_catch(ret=[], trace=False)
|
|
54
52
|
def get_hybk_cons_code(blk_code):
|
|
55
53
|
"获取指定行业板块成分代码列表"
|
|
56
54
|
url = "http://30.push2.eastmoney.com/api/qt/clist/get"
|
|
@@ -83,7 +81,6 @@ def get_hybk_cons_code(blk_code):
|
|
|
83
81
|
return ret
|
|
84
82
|
|
|
85
83
|
|
|
86
|
-
@hku_catch(ret={}, trace=False)
|
|
87
84
|
def get_all_hybk_info(code_market_dict, sep=""):
|
|
88
85
|
"""获取所有行业板块列表"""
|
|
89
86
|
blk_list = get_hybk_names()
|
|
@@ -434,7 +431,6 @@ def stock_board_concept_cons_em(symbol: str = "融资融券") -> pd.DataFrame:
|
|
|
434
431
|
return temp_df
|
|
435
432
|
|
|
436
433
|
|
|
437
|
-
@hku_catch(ret={}, trace=False)
|
|
438
434
|
def get_all_gnbk_info(code_market_dict, sep=""):
|
|
439
435
|
"""获取所有概念版本列表"""
|
|
440
436
|
blk_names = stock_board_concept_name_em()['板块名称']
|
|
@@ -450,7 +446,6 @@ def get_all_gnbk_info(code_market_dict, sep=""):
|
|
|
450
446
|
return ret
|
|
451
447
|
|
|
452
448
|
|
|
453
|
-
@hku_catch(ret=[], trace=False)
|
|
454
449
|
def get_dybk_names():
|
|
455
450
|
"""获取所有地域板块名称列表"""
|
|
456
451
|
url = "http://13.push2.eastmoney.com/api/qt/clist/get"
|
|
@@ -483,7 +478,6 @@ def get_dybk_names():
|
|
|
483
478
|
return ret
|
|
484
479
|
|
|
485
480
|
|
|
486
|
-
@hku_catch(ret={}, trace=False)
|
|
487
481
|
def get_all_dybk_info(code_market_dict, sep=""):
|
|
488
482
|
"""获取所有地域板块列表"""
|
|
489
483
|
blk_list = get_dybk_names()
|
|
@@ -534,60 +528,6 @@ def get_all_dybk_info(code_market_dict, sep=""):
|
|
|
534
528
|
return ret
|
|
535
529
|
|
|
536
530
|
|
|
537
|
-
@hku_catch(ret={}, trace=False)
|
|
538
|
-
def get_all_zsbk_info(code_market_dict, sep=""):
|
|
539
|
-
"""获取所有指数成分股列表"""
|
|
540
|
-
blk_info = ak.index_stock_info()
|
|
541
|
-
blk_info['index_code'] = blk_info['index_code'].astype(str) # 确保是字符串类型
|
|
542
|
-
df_000 = blk_info[blk_info['index_code'].str.startswith('000')].reset_index(drop=True) # 000前缀
|
|
543
|
-
df_399 = blk_info[blk_info['index_code'].str.startswith('399')].reset_index(drop=True) # 399前缀
|
|
544
|
-
|
|
545
|
-
# 2. 交替合并两个DataFrame
|
|
546
|
-
merged_rows = []
|
|
547
|
-
max_length = max(len(df_000), len(df_399)) # 取两个DataFrame的最大长度
|
|
548
|
-
|
|
549
|
-
for i in range(max_length):
|
|
550
|
-
# 先加000前缀的行(如果存在)
|
|
551
|
-
if i < len(df_000):
|
|
552
|
-
merged_rows.append(df_000.iloc[i])
|
|
553
|
-
# 再加399前缀的行(如果存在)
|
|
554
|
-
if i < len(df_399):
|
|
555
|
-
merged_rows.append(df_399.iloc[i])
|
|
556
|
-
|
|
557
|
-
# 3. 转换为DataFrame
|
|
558
|
-
blk_info = pd.DataFrame(merged_rows).reset_index(drop=True)
|
|
559
|
-
|
|
560
|
-
blk_codes = blk_info["index_code"]
|
|
561
|
-
blk_names = blk_info["display_name"]
|
|
562
|
-
ret = {}
|
|
563
|
-
total = len(blk_codes)
|
|
564
|
-
for i in range(total):
|
|
565
|
-
blk_name = blk_names[i]
|
|
566
|
-
blk_code = blk_codes[i]
|
|
567
|
-
# print(i, blk_name)
|
|
568
|
-
# 沪深指数有重复,避免深指覆盖
|
|
569
|
-
if blk_name in ret:
|
|
570
|
-
continue
|
|
571
|
-
|
|
572
|
-
time.sleep(random.uniform(1, 3))
|
|
573
|
-
try:
|
|
574
|
-
if blk_code[:3] == "399":
|
|
575
|
-
stk_codes = ak.index_stock_cons(symbol=blk_code)
|
|
576
|
-
stk_codes = stk_codes['品种代码'].to_list()
|
|
577
|
-
else:
|
|
578
|
-
stk_codes = ak.index_stock_cons_csindex(symbol=blk_code)
|
|
579
|
-
stk_codes = stk_codes['成分券代码'].to_list()
|
|
580
|
-
hku_info("{}|{} 获取指数板块 {}|{} 成分: {}", i, total, blk_code, blk_name, len(stk_codes))
|
|
581
|
-
ret[blk_name] = [
|
|
582
|
-
f"{code_market_dict[stk_code]}{sep}{stk_code}" for stk_code in stk_codes if stk_code in code_market_dict]
|
|
583
|
-
except KeyboardInterrupt:
|
|
584
|
-
break
|
|
585
|
-
except Exception as e:
|
|
586
|
-
print(f"Failed! {i}, {blk_code}, {blk_name}")
|
|
587
|
-
# raise e
|
|
588
|
-
return ret
|
|
589
|
-
|
|
590
|
-
|
|
591
531
|
if __name__ == "__main__":
|
|
592
532
|
blks = get_hybk_names()
|
|
593
533
|
# blks = get_hybk_cons_code('BK0480')
|
hikyuu/gui/HikyuuTDX.py
CHANGED
|
@@ -35,7 +35,8 @@ from hikyuu.gui.data.CollectSpotThread import CollectSpotThread
|
|
|
35
35
|
from hikyuu.gui.data.SchedImportThread import SchedImportThread
|
|
36
36
|
from hikyuu.gui.spot_server import release_nng_senders
|
|
37
37
|
|
|
38
|
-
from hikyuu import can_upgrade, get_last_version, fetch_trial_license,
|
|
38
|
+
from hikyuu import (can_upgrade, get_last_version, fetch_trial_license,
|
|
39
|
+
view_license, is_valid_license, get_expire_date, Datetime, TimeDelta)
|
|
39
40
|
from hikyuu.data import hku_config_template
|
|
40
41
|
from hikyuu.util import *
|
|
41
42
|
|
|
@@ -313,6 +314,7 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
313
314
|
if os.path.exists(this_dir + '/importdata-gui.ini'):
|
|
314
315
|
import_config.read(this_dir + '/importdata-gui.ini', encoding='utf-8')
|
|
315
316
|
|
|
317
|
+
self.use_download = 'pytdx'
|
|
316
318
|
self._is_sched_import_running = False
|
|
317
319
|
self._is_collect_running = False
|
|
318
320
|
self._stream = None
|
|
@@ -332,6 +334,9 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
332
334
|
icon = QIcon(f"{current_dir}/images/hikyuu_small.png")
|
|
333
335
|
star_img = QPixmap(f"{current_dir}/images/star.png")
|
|
334
336
|
self.label_44.setPixmap(star_img)
|
|
337
|
+
liandong_img = QPixmap(f"{current_dir}/images/liandongxiaopu.png")
|
|
338
|
+
self.label_56.setPixmap(liandong_img)
|
|
339
|
+
|
|
335
340
|
# 修改 label_46 的 HTML 文本,直接在 HTML 中设置字体大小
|
|
336
341
|
|
|
337
342
|
label_46_txt = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
|
@@ -863,6 +868,17 @@ li.checked::marker { content: "\2612"; }
|
|
|
863
868
|
"Hikyuu 新版本 ({}) 已发布,建议更新".format(get_last_version()))
|
|
864
869
|
self.import_detail_textEdit.append("更新命令: pip instal hikyuu --upgrade")
|
|
865
870
|
self.import_detail_textEdit.append("========================================================")
|
|
871
|
+
if is_valid_license():
|
|
872
|
+
expire_date = get_expire_date()
|
|
873
|
+
if expire_date != Datetime.min():
|
|
874
|
+
delta = expire_date - Datetime.now()
|
|
875
|
+
if delta < TimeDelta(3):
|
|
876
|
+
self.import_detail_textEdit.append(
|
|
877
|
+
"========================================================")
|
|
878
|
+
self.import_detail_textEdit.append(
|
|
879
|
+
"您的授权即将到期,截止日期:{}!".format(expire_date))
|
|
880
|
+
self.import_detail_textEdit.append(
|
|
881
|
+
"========================================================")
|
|
866
882
|
self.import_running = False
|
|
867
883
|
|
|
868
884
|
elif msg_task_name == 'IMPORT_KDATA':
|
|
@@ -1109,5 +1125,6 @@ if __name__ == "__main__":
|
|
|
1109
1125
|
else:
|
|
1110
1126
|
myWin = MyMainWindow(capture_output=True)
|
|
1111
1127
|
|
|
1128
|
+
myWin.resize(1100, 400)
|
|
1112
1129
|
myWin.show()
|
|
1113
1130
|
sys.exit(app.exec())
|
hikyuu/gui/data/MainWindow.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
################################################################################
|
|
4
4
|
## Form generated from reading UI file 'MainWindow.ui'
|
|
5
5
|
##
|
|
6
|
-
## Created by: Qt User Interface Compiler version 6.
|
|
6
|
+
## Created by: Qt User Interface Compiler version 6.10.0
|
|
7
7
|
##
|
|
8
8
|
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
|
9
9
|
################################################################################
|
|
@@ -17,16 +17,17 @@ from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
|
|
17
17
|
QPalette, QPixmap, QRadialGradient, QTransform)
|
|
18
18
|
from PySide6.QtWidgets import (QApplication, QCheckBox, QComboBox, QDateEdit,
|
|
19
19
|
QDateTimeEdit, QFrame, QGridLayout, QGroupBox,
|
|
20
|
-
QHBoxLayout, QLabel,
|
|
21
|
-
QProgressBar, QPushButton, QRadioButton,
|
|
22
|
-
QSpacerItem, QSpinBox, QTabWidget,
|
|
23
|
-
QTextEdit, QTimeEdit, QVBoxLayout,
|
|
20
|
+
QHBoxLayout, QLabel, QLayout, QLineEdit,
|
|
21
|
+
QMainWindow, QProgressBar, QPushButton, QRadioButton,
|
|
22
|
+
QSizePolicy, QSpacerItem, QSpinBox, QTabWidget,
|
|
23
|
+
QTextBrowser, QTextEdit, QTimeEdit, QVBoxLayout,
|
|
24
|
+
QWidget)
|
|
24
25
|
|
|
25
26
|
class Ui_MainWindow(object):
|
|
26
27
|
def setupUi(self, MainWindow):
|
|
27
28
|
if not MainWindow.objectName():
|
|
28
29
|
MainWindow.setObjectName(u"MainWindow")
|
|
29
|
-
MainWindow.resize(
|
|
30
|
+
MainWindow.resize(1139, 713)
|
|
30
31
|
self.centralwidget = QWidget(MainWindow)
|
|
31
32
|
self.centralwidget.setObjectName(u"centralwidget")
|
|
32
33
|
self.horizontalLayout_12 = QHBoxLayout(self.centralwidget)
|
|
@@ -250,7 +251,7 @@ class Ui_MainWindow(object):
|
|
|
250
251
|
|
|
251
252
|
self.min5_start_dateEdit = QDateEdit(self.groupBox_7)
|
|
252
253
|
self.min5_start_dateEdit.setObjectName(u"min5_start_dateEdit")
|
|
253
|
-
self.min5_start_dateEdit.setMinimumDateTime(QDateTime(QDate(1989, 12, 21), QTime(
|
|
254
|
+
self.min5_start_dateEdit.setMinimumDateTime(QDateTime(QDate(1989, 12, 21), QTime(0, 0, 0)))
|
|
254
255
|
self.min5_start_dateEdit.setCalendarPopup(True)
|
|
255
256
|
|
|
256
257
|
self.gridLayout_4.addWidget(self.min5_start_dateEdit, 1, 1, 1, 1)
|
|
@@ -284,7 +285,7 @@ class Ui_MainWindow(object):
|
|
|
284
285
|
|
|
285
286
|
self.day_start_dateEdit = QDateEdit(self.groupBox_7)
|
|
286
287
|
self.day_start_dateEdit.setObjectName(u"day_start_dateEdit")
|
|
287
|
-
self.day_start_dateEdit.setMinimumDateTime(QDateTime(QDate(1989, 12, 21), QTime(
|
|
288
|
+
self.day_start_dateEdit.setMinimumDateTime(QDateTime(QDate(1989, 12, 21), QTime(0, 0, 0)))
|
|
288
289
|
self.day_start_dateEdit.setCalendarPopup(True)
|
|
289
290
|
|
|
290
291
|
self.gridLayout_4.addWidget(self.day_start_dateEdit, 0, 1, 1, 1)
|
|
@@ -1211,6 +1212,14 @@ class Ui_MainWindow(object):
|
|
|
1211
1212
|
|
|
1212
1213
|
self.verticalLayout_16.addWidget(self.label_48)
|
|
1213
1214
|
|
|
1215
|
+
self.horizontalLayout_22 = QHBoxLayout()
|
|
1216
|
+
self.horizontalLayout_22.setObjectName(u"horizontalLayout_22")
|
|
1217
|
+
|
|
1218
|
+
self.verticalLayout_16.addLayout(self.horizontalLayout_22)
|
|
1219
|
+
|
|
1220
|
+
self.horizontalLayout_26 = QHBoxLayout()
|
|
1221
|
+
self.horizontalLayout_26.setObjectName(u"horizontalLayout_26")
|
|
1222
|
+
self.horizontalLayout_26.setSizeConstraint(QLayout.SetFixedSize)
|
|
1214
1223
|
self.label_44 = QLabel(self.tab_star)
|
|
1215
1224
|
self.label_44.setObjectName(u"label_44")
|
|
1216
1225
|
sizePolicy3 = QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
|
|
@@ -1222,7 +1231,23 @@ class Ui_MainWindow(object):
|
|
|
1222
1231
|
self.label_44.setPixmap(QPixmap(u"../images/star.png"))
|
|
1223
1232
|
self.label_44.setScaledContents(True)
|
|
1224
1233
|
|
|
1225
|
-
self.
|
|
1234
|
+
self.horizontalLayout_26.addWidget(self.label_44, 0, Qt.AlignLeft)
|
|
1235
|
+
|
|
1236
|
+
self.label_56 = QLabel(self.tab_star)
|
|
1237
|
+
self.label_56.setObjectName(u"label_56")
|
|
1238
|
+
self.label_56.setMaximumSize(QSize(160, 160))
|
|
1239
|
+
self.label_56.setFrameShape(QFrame.NoFrame)
|
|
1240
|
+
self.label_56.setPixmap(QPixmap(u"../images/liandongxiaopu.png"))
|
|
1241
|
+
self.label_56.setScaledContents(True)
|
|
1242
|
+
|
|
1243
|
+
self.horizontalLayout_26.addWidget(self.label_56, 0, Qt.AlignLeft)
|
|
1244
|
+
|
|
1245
|
+
self.horizontalSpacer_15 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
|
|
1246
|
+
|
|
1247
|
+
self.horizontalLayout_26.addItem(self.horizontalSpacer_15)
|
|
1248
|
+
|
|
1249
|
+
|
|
1250
|
+
self.verticalLayout_16.addLayout(self.horizontalLayout_26)
|
|
1226
1251
|
|
|
1227
1252
|
|
|
1228
1253
|
self.verticalLayout_18.addLayout(self.verticalLayout_16)
|
|
@@ -1446,8 +1471,9 @@ class Ui_MainWindow(object):
|
|
|
1446
1471
|
self.label_47.setText(QCoreApplication.translate("MainWindow", u"\u7533\u8bf7\u6350\u8d60\u529f\u80fd\u8bd5\u7528\uff0830\u5929\u8bd5\u7528\uff09", None))
|
|
1447
1472
|
self.label_45.setText(QCoreApplication.translate("MainWindow", u"\u7535\u5b50\u90ae\u4ef6\u5730\u5740:", None))
|
|
1448
1473
|
self.fetch_trial_pushButton.setText(QCoreApplication.translate("MainWindow", u"\u7533\u8bf7\u8bd5\u7528\u8bb8\u53ef", None))
|
|
1449
|
-
self.label_48.setText(QCoreApplication.translate("MainWindow", u"\u52a0\u5165\u77e5\u8bc6\u661f\u7403\u8fdb\u884c\u6350\u8d60\uff08\u53ef\u540c\u65f6\u57283\u53f0\u8bbe\u5907\u4e0a\u4f7f\u7528\u6350\u8d60\u529f\u80fd\uff09", None))
|
|
1474
|
+
self.label_48.setText(QCoreApplication.translate("MainWindow", u"\u52a0\u5165\u77e5\u8bc6\u661f\u7403\u8fdb\u884c\u6350\u8d60\uff08\u53ef\u540c\u65f6\u57283\u53f0\u8bbe\u5907\u4e0a\u4f7f\u7528\u6350\u8d60\u529f\u80fd\uff09,\u6216\u8005\u8bf7\u4f5c\u8005\u559d\u676f\u2615\ufe0f\uff0c\u8c22\u8c22", None))
|
|
1450
1475
|
self.label_44.setText("")
|
|
1476
|
+
self.label_56.setText("")
|
|
1451
1477
|
self.label_49.setText(QCoreApplication.translate("MainWindow", u"\u5f53\u524d\u6350\u8d60\u6388\u6743\u4fe1\u606f", None))
|
|
1452
1478
|
self.label_license.setText(QCoreApplication.translate("MainWindow", u"TextLabel", None))
|
|
1453
1479
|
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_star), QCoreApplication.translate("MainWindow", u"\u9879\u76ee\u6350\u8d60", None))
|
|
Binary file
|
hikyuu/hub.pyi
CHANGED
|
@@ -28,11 +28,11 @@ import sys as sys
|
|
|
28
28
|
import typing
|
|
29
29
|
__all__: list = ['add_remote_hub', 'add_local_hub', 'update_hub', 'remove_hub', 'build_hub', 'help_part', 'get_part', 'get_part_list', 'get_hub_path', 'get_part_info', 'get_part_module', 'print_part_info', 'get_hub_name_list', 'get_part_name_list', 'get_current_hub', 'search_part']
|
|
30
30
|
class ConfigModel(sqlalchemy.orm.decl_api.Base):
|
|
31
|
-
__mapper__: typing.ClassVar[sqlalchemy.orm.mapper.Mapper] # value = <Mapper at
|
|
31
|
+
__mapper__: typing.ClassVar[sqlalchemy.orm.mapper.Mapper] # value = <Mapper at 0x1ab4346acb0; ConfigModel>
|
|
32
32
|
__table__: typing.ClassVar[sqlalchemy.sql.schema.Table] # value = Table('hub_config', MetaData(), Column('id', Integer(), table=<hub_config>, primary_key=True, nullable=False, default=Sequence('config_id_seq', metadata=MetaData())), Column('key', String(), table=<hub_config>), Column('value', String(), table=<hub_config>), schema=None)
|
|
33
33
|
__table_args__: typing.ClassVar[tuple] # value = (UniqueConstraint(Column('key', String(), table=<hub_config>)))
|
|
34
34
|
__tablename__: typing.ClassVar[str] = 'hub_config'
|
|
35
|
-
_sa_class_manager: typing.ClassVar[sqlalchemy.orm.instrumentation.ClassManager] # value = <ClassManager of <class 'hikyuu.hub.ConfigModel'> at
|
|
35
|
+
_sa_class_manager: typing.ClassVar[sqlalchemy.orm.instrumentation.ClassManager] # value = <ClassManager of <class 'hikyuu.hub.ConfigModel'> at 1ab43480e50>
|
|
36
36
|
def __init__(self, **kwargs):
|
|
37
37
|
"""
|
|
38
38
|
A simple constructor that allows initialization from kwargs.
|
|
@@ -109,11 +109,11 @@ class HubManager:
|
|
|
109
109
|
def print_part_info(self, name):
|
|
110
110
|
...
|
|
111
111
|
class HubModel(sqlalchemy.orm.decl_api.Base):
|
|
112
|
-
__mapper__: typing.ClassVar[sqlalchemy.orm.mapper.Mapper] # value = <Mapper at
|
|
112
|
+
__mapper__: typing.ClassVar[sqlalchemy.orm.mapper.Mapper] # value = <Mapper at 0x1ab4346bdc0; HubModel>
|
|
113
113
|
__table__: typing.ClassVar[sqlalchemy.sql.schema.Table] # value = Table('hub_repo', MetaData(), Column('id', Integer(), table=<hub_repo>, primary_key=True, nullable=False, default=Sequence('remote_id_seq', metadata=MetaData())), Column('name', String(), table=<hub_repo>), Column('hub_type', String(), table=<hub_repo>), Column('local_base', String(), table=<hub_repo>), Column('local', String(), table=<hub_repo>), Column('url', String(), table=<hub_repo>), Column('branch', String(), table=<hub_repo>), schema=None)
|
|
114
114
|
__table_args__: typing.ClassVar[tuple] # value = (UniqueConstraint(Column('name', String(), table=<hub_repo>)))
|
|
115
115
|
__tablename__: typing.ClassVar[str] = 'hub_repo'
|
|
116
|
-
_sa_class_manager: typing.ClassVar[sqlalchemy.orm.instrumentation.ClassManager] # value = <ClassManager of <class 'hikyuu.hub.HubModel'> at
|
|
116
|
+
_sa_class_manager: typing.ClassVar[sqlalchemy.orm.instrumentation.ClassManager] # value = <ClassManager of <class 'hikyuu.hub.HubModel'> at 1ab434a5b20>
|
|
117
117
|
def __init__(self, **kwargs):
|
|
118
118
|
"""
|
|
119
119
|
A simple constructor that allows initialization from kwargs.
|
|
@@ -146,11 +146,11 @@ class ModuleConflictError(Exception):
|
|
|
146
146
|
def __str__(self):
|
|
147
147
|
...
|
|
148
148
|
class PartModel(sqlalchemy.orm.decl_api.Base):
|
|
149
|
-
__mapper__: typing.ClassVar[sqlalchemy.orm.mapper.Mapper] # value = <Mapper at
|
|
149
|
+
__mapper__: typing.ClassVar[sqlalchemy.orm.mapper.Mapper] # value = <Mapper at 0x1ab434b8280; PartModel>
|
|
150
150
|
__table__: typing.ClassVar[sqlalchemy.sql.schema.Table] # value = Table('hub_part', MetaData(), Column('id', Integer(), table=<hub_part>, primary_key=True, nullable=False, default=Sequence('part_id_seq', metadata=MetaData())), Column('hub_name', String(), table=<hub_part>), Column('part', String(), table=<hub_part>), Column('name', String(), table=<hub_part>), Column('author', String(), table=<hub_part>), Column('version', String(), table=<hub_part>), Column('doc', String(), table=<hub_part>), Column('module_name', String(), table=<hub_part>), Column('label', String(), table=<hub_part>), schema=None)
|
|
151
151
|
__table_args__: typing.ClassVar[tuple] # value = (UniqueConstraint(Column('name', String(), table=<hub_part>)))
|
|
152
152
|
__tablename__: typing.ClassVar[str] = 'hub_part'
|
|
153
|
-
_sa_class_manager: typing.ClassVar[sqlalchemy.orm.instrumentation.ClassManager] # value = <ClassManager of <class 'hikyuu.hub.PartModel'> at
|
|
153
|
+
_sa_class_manager: typing.ClassVar[sqlalchemy.orm.instrumentation.ClassManager] # value = <ClassManager of <class 'hikyuu.hub.PartModel'> at 1ab434a6a70>
|
|
154
154
|
def __init__(self, **kwargs):
|
|
155
155
|
"""
|
|
156
156
|
A simple constructor that allows initialization from kwargs.
|
hikyuu/include/hikyuu/Stock.h
CHANGED
|
@@ -240,6 +240,8 @@ public:
|
|
|
240
240
|
/** 指定类型的K线数据是否被缓存 */
|
|
241
241
|
bool isBuffer(KQuery::KType) const;
|
|
242
242
|
|
|
243
|
+
bool isPreload(KQuery::KType ktype) const;
|
|
244
|
+
|
|
243
245
|
/** 是否为Null */
|
|
244
246
|
bool isNull() const;
|
|
245
247
|
|
|
@@ -274,8 +276,6 @@ private:
|
|
|
274
276
|
// 仅供 StockManager 初始化时调用
|
|
275
277
|
void setPreload(const vector<KQuery::KType>& preload_ktypes);
|
|
276
278
|
|
|
277
|
-
bool isPreload(KQuery::KType ktype) const;
|
|
278
|
-
|
|
279
279
|
void loadKDataToBufferFromKRecordList(const KQuery::KType& ktype, KRecordList&& ks) const;
|
|
280
280
|
void setHistoryFinance(vector<HistoryFinanceInfo>&&);
|
|
281
281
|
|
hikyuu/include/hikyuu/config.h
CHANGED
|
@@ -11,6 +11,13 @@
|
|
|
11
11
|
|
|
12
12
|
namespace hku {
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* @brief 绑定授权码
|
|
16
|
+
* @param email 邮箱
|
|
17
|
+
* @param active_code 授权码
|
|
18
|
+
*/
|
|
19
|
+
void HKU_API bindEmail(const std::string& email, const std::string& active_code);
|
|
20
|
+
|
|
14
21
|
/**
|
|
15
22
|
* @brief 激活设备
|
|
16
23
|
* @param active_code 授权码
|
|
@@ -30,4 +37,7 @@ std::string HKU_API fetchTrialLicense(const std::string& email);
|
|
|
30
37
|
/** 检查授权是否有效 */
|
|
31
38
|
bool HKU_API isValidLicense();
|
|
32
39
|
|
|
40
|
+
/** 获取授权到期时间 */
|
|
41
|
+
Datetime HKU_API getExpireDate();
|
|
42
|
+
|
|
33
43
|
} // namespace hku
|
|
@@ -16,11 +16,13 @@ public:
|
|
|
16
16
|
DevicePluginInterface() = default;
|
|
17
17
|
virtual ~DevicePluginInterface() = default;
|
|
18
18
|
|
|
19
|
+
virtual void bind(const std::string& email, const std::string& active_code) noexcept = 0;
|
|
19
20
|
virtual void activate(const std::string& active_code, bool replace) noexcept = 0;
|
|
20
21
|
virtual std::string viewLicense() noexcept = 0;
|
|
21
22
|
virtual void removeLicense() noexcept = 0;
|
|
22
23
|
virtual std::string fetchTrialLicense(const std::string& email) noexcept = 0;
|
|
23
24
|
virtual bool isValidLicsense() noexcept = 0;
|
|
25
|
+
virtual Datetime getExpireDate() const noexcept = 0;
|
|
24
26
|
};
|
|
25
27
|
|
|
26
28
|
} // namespace hku
|
|
@@ -18,10 +18,6 @@
|
|
|
18
18
|
#include "DataDriverPluginInterface.h"
|
|
19
19
|
#include "HkuExtraPluginInterface.h"
|
|
20
20
|
|
|
21
|
-
#if HKU_ENABLE_ARROW
|
|
22
|
-
#include "HkuViewsPluginInterface.h"
|
|
23
|
-
#endif
|
|
24
|
-
|
|
25
21
|
namespace hku {
|
|
26
22
|
|
|
27
23
|
#define HKU_PLUGIN_BACKTEST "backtest"
|
|
@@ -32,6 +28,5 @@ namespace hku {
|
|
|
32
28
|
#define HKU_PLUGIN_TMREPORT "tmreport"
|
|
33
29
|
#define HKU_PLUGIN_CLICKHOUSE_DRIVER "clickhousedriver"
|
|
34
30
|
#define HKU_PLUGIN_HKU_EXTRA "hkuextra"
|
|
35
|
-
#define HKU_PLUGIN_HKU_VIEWS "hkuviews"
|
|
36
31
|
|
|
37
32
|
} // namespace hku
|
|
@@ -10,9 +10,6 @@
|
|
|
10
10
|
#define HIKYUU_PYTHON_BIND_UTILS_H
|
|
11
11
|
|
|
12
12
|
#include <hikyuu/config.h>
|
|
13
|
-
#if HKU_ENABLE_ARROW
|
|
14
|
-
#include <arrow/api.h>
|
|
15
|
-
#endif
|
|
16
13
|
#include <pybind11/pybind11.h>
|
|
17
14
|
|
|
18
15
|
#include <pybind11/operators.h>
|
|
@@ -127,15 +124,6 @@ inline bool check_pyfunction_arg_num(const py::object& func, size_t arg_num) {
|
|
|
127
124
|
*/
|
|
128
125
|
size_t utf8_to_utf32(const std::string& utf8_str, int32_t* out, size_t out_len) noexcept;
|
|
129
126
|
|
|
130
|
-
#if HKU_ENABLE_ARROW
|
|
131
|
-
/*
|
|
132
|
-
* 将arrow::Table转换为 pyarrow::Table
|
|
133
|
-
* @param table 待转换的arrow::Table
|
|
134
|
-
* @return 转换后的py::object
|
|
135
|
-
*/
|
|
136
|
-
py::object to_pyarrow_table(const std::shared_ptr<arrow::Table>& table);
|
|
137
|
-
#endif
|
|
138
|
-
|
|
139
127
|
} // namespace hku
|
|
140
128
|
|
|
141
129
|
#endif // HIKYUU_PYTHON_BIND_UTILS_H
|
|
@@ -11,5 +11,9 @@
|
|
|
11
11
|
|
|
12
12
|
#include "crt/SP_FixedPercent.h"
|
|
13
13
|
#include "crt/SP_FixedValue.h"
|
|
14
|
+
#include "crt/SP_Uniform.h"
|
|
15
|
+
#include "crt/SP_Normal.h"
|
|
16
|
+
#include "crt/SP_LogNormal.h"
|
|
17
|
+
#include "crt/SP_TruncNormal.h"
|
|
14
18
|
|
|
15
|
-
#endif /* SLIPPAGE_BUILD_IN_H_ */
|
|
19
|
+
#endif /* SLIPPAGE_BUILD_IN_H_ */
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SP_LogNormal.h
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025年10月25日
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../SlippageBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 对数正态分布随机价格移滑价差算法, 买入和卖出操作是基于对数正态分布的随机价格偏移
|
|
16
|
+
* @param mean 对数正态分布的均值参数
|
|
17
|
+
* @param stddev 对数正态分布的标准差参数
|
|
18
|
+
* @return 滑点对象指针
|
|
19
|
+
*/
|
|
20
|
+
SlippagePtr HKU_API SP_LogNormal(double mean = 0.0, double stddev = 0.05);
|
|
21
|
+
|
|
22
|
+
} /* namespace hku */
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SP_Normal.h
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025年10月25日
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../SlippageBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 正态分布随机价格移滑价差算法, 买入和卖出操作是基于正态分布的随机价格偏移
|
|
16
|
+
* @param mean 正态分布均值
|
|
17
|
+
* @param stddev 正态分布标准差
|
|
18
|
+
* @return 滑点对象指针
|
|
19
|
+
*/
|
|
20
|
+
SlippagePtr HKU_API SP_Normal(double mean = 0.0, double stddev = 0.05);
|
|
21
|
+
|
|
22
|
+
} /* namespace hku */
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SP_TruncNormal.h
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025年10月25日
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../SlippageBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 截断正态分布随机价格移滑价差算法, 买入和卖出操作是基于截断正态分布的随机价格偏移
|
|
16
|
+
* @param mean 正态分布均值
|
|
17
|
+
* @param stddev 正态分布标准差
|
|
18
|
+
* @param min_value 截断最小值
|
|
19
|
+
* @param max_value 截断最大值
|
|
20
|
+
* @return 滑点对象指针
|
|
21
|
+
*/
|
|
22
|
+
SlippagePtr HKU_API SP_TruncNormal(double mean = 0.0, double stddev = 0.05, double min_value = -0.1,
|
|
23
|
+
double max_value = 0.1);
|
|
24
|
+
|
|
25
|
+
} /* namespace hku */
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SL_FixedValue.h
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2016年5月7日
|
|
5
|
+
* Author: Administrator
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../SlippageBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 均匀分布随机价格移滑价差算法, 买入和卖出操作是价格在[min_value,
|
|
16
|
+
* max_value]范围内的均匀分布随机偏移
|
|
17
|
+
* @param min_value 偏移价格下限
|
|
18
|
+
* @param max_value 偏移价格上限
|
|
19
|
+
* @return
|
|
20
|
+
*/
|
|
21
|
+
SlippagePtr HKU_API SP_Uniform(double min_value = -0.05, double max_value = 0.05);
|
|
22
|
+
|
|
23
|
+
} /* namespace hku */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-25
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../SlippageBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class LogNormalSlippage : public SlippageBase {
|
|
15
|
+
SLIPPAGE_IMP(LogNormalSlippage)
|
|
16
|
+
SLIPPAGE_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
|
+
|
|
18
|
+
public:
|
|
19
|
+
LogNormalSlippage();
|
|
20
|
+
virtual ~LogNormalSlippage();
|
|
21
|
+
virtual void _checkParam(const string& name) const override;
|
|
22
|
+
|
|
23
|
+
private:
|
|
24
|
+
static std::random_device ms_rd;
|
|
25
|
+
static std::mt19937 ms_gen;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
} /* namespace hku */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-25
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../SlippageBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class NormalSlippage : public SlippageBase {
|
|
15
|
+
SLIPPAGE_IMP(NormalSlippage)
|
|
16
|
+
SLIPPAGE_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
|
+
|
|
18
|
+
public:
|
|
19
|
+
NormalSlippage();
|
|
20
|
+
virtual ~NormalSlippage();
|
|
21
|
+
virtual void _checkParam(const string& name) const override;
|
|
22
|
+
|
|
23
|
+
private:
|
|
24
|
+
static std::random_device ms_rd;
|
|
25
|
+
static std::mt19937 ms_gen;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
} /* namespace hku */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-25
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../SlippageBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class TruncNormalSlippage : public SlippageBase {
|
|
15
|
+
SLIPPAGE_IMP(TruncNormalSlippage)
|
|
16
|
+
SLIPPAGE_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
|
+
|
|
18
|
+
public:
|
|
19
|
+
TruncNormalSlippage();
|
|
20
|
+
virtual ~TruncNormalSlippage();
|
|
21
|
+
virtual void _checkParam(const string& name) const override;
|
|
22
|
+
|
|
23
|
+
private:
|
|
24
|
+
static std::random_device ms_rd;
|
|
25
|
+
static std::mt19937 ms_gen;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
} /* namespace hku */
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-25
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../SlippageBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class UniformSlippage : public SlippageBase {
|
|
15
|
+
SLIPPAGE_IMP(UniformSlippage)
|
|
16
|
+
SLIPPAGE_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
|
+
|
|
18
|
+
public:
|
|
19
|
+
UniformSlippage();
|
|
20
|
+
virtual ~UniformSlippage();
|
|
21
|
+
virtual void _checkParam(const string& name) const override;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
} /* namespace hku */
|
hikyuu/include/hikyuu/version.h
CHANGED
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
#define HKU_VERSION_H
|
|
13
13
|
|
|
14
14
|
// clang-format off
|
|
15
|
-
#define HKU_VERSION "2.
|
|
15
|
+
#define HKU_VERSION "2.7.0"
|
|
16
16
|
#define HKU_VERSION_MAJOR 2
|
|
17
|
-
#define HKU_VERSION_MINOR
|
|
18
|
-
#define HKU_VERSION_ALTER
|
|
19
|
-
#define HKU_VERSION_BUILD
|
|
17
|
+
#define HKU_VERSION_MINOR 7
|
|
18
|
+
#define HKU_VERSION_ALTER 0
|
|
19
|
+
#define HKU_VERSION_BUILD 202511012109
|
|
20
20
|
#define HKU_VERSION_MODE "RELEASE"
|
|
21
|
-
#define HKU_VERSION_GIT "2.
|
|
21
|
+
#define HKU_VERSION_GIT "2.7.0 release.31701445 (RELEASE)"
|
|
22
22
|
// clang-format on
|
|
23
23
|
|
|
24
24
|
#endif /* HKU_VERSION_H */
|
hikyuu/plugin/backtest.dll
CHANGED
|
Binary file
|
|
Binary file
|
hikyuu/plugin/dataserver.dll
CHANGED
|
Binary file
|