hikyuu 2.1.5__cp38-none-win_amd64.whl → 2.2.0__cp38-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/analysis/analysis.py +20 -0
- hikyuu/cpp/boost_date_time-mt.dll +0 -0
- hikyuu/cpp/boost_serialization-mt.dll +0 -0
- hikyuu/cpp/boost_wserialization-mt.dll +0 -0
- hikyuu/cpp/core38.pyd +0 -0
- hikyuu/cpp/hikyuu.dll +0 -0
- hikyuu/data/common.py +3 -3
- hikyuu/data/mysql_upgrade/0023.sql +4 -0
- hikyuu/data/pytdx_weight_to_mysql.py +14 -15
- hikyuu/data/pytdx_weight_to_sqlite.py +14 -15
- hikyuu/data/sqlite_upgrade/0024.sql +22 -0
- hikyuu/gui/HikyuuTDX.py +3 -2
- hikyuu/gui/data/ImportHistoryFinanceTask.py +7 -0
- hikyuu/gui/data/ImportWeightToSqliteTask.py +2 -2
- hikyuu/gui/data/MainWindow.py +1 -1
- hikyuu/include/hikyuu/StockWeight.h +16 -10
- hikyuu/include/hikyuu/analysis/analysis_sys.h +42 -12
- hikyuu/include/hikyuu/data_driver/base_info/table/StockWeightTable.h +6 -4
- hikyuu/include/hikyuu/global/agent/SpotAgent.h +5 -6
- hikyuu/include/hikyuu/indicator/crt/IC.h +7 -6
- hikyuu/include/hikyuu/indicator/crt/ICIR.h +7 -4
- hikyuu/include/hikyuu/indicator/imp/IIc.h +1 -1
- hikyuu/include/hikyuu/serialization/StockWeight_serialization.h +5 -2
- hikyuu/include/hikyuu/strategy/BrokerTradeManager.h +27 -25
- hikyuu/include/hikyuu/strategy/Strategy.h +1 -2
- hikyuu/include/hikyuu/trade_manage/Performance.h +3 -0
- hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +16 -6
- hikyuu/include/hikyuu/trade_manage/TradeRecord.h +1 -1
- hikyuu/include/hikyuu/trade_sys/allocatefunds/AllocateFundsBase.h +0 -3
- hikyuu/include/hikyuu/trade_sys/condition/ConditionBase.h +2 -2
- hikyuu/include/hikyuu/trade_sys/condition/build_in.h +1 -0
- hikyuu/include/hikyuu/trade_sys/condition/crt/CN_Manual.h +20 -0
- hikyuu/include/hikyuu/trade_sys/condition/imp/ManualCondition.h +23 -0
- hikyuu/include/hikyuu/trade_sys/condition/imp/{AddCondition.h → logic/AddCondition.h} +1 -1
- hikyuu/include/hikyuu/trade_sys/condition/imp/{AndCondition.h → logic/AndCondition.h} +1 -1
- hikyuu/include/hikyuu/trade_sys/condition/imp/{DivCondition.h → logic/DivCondition.h} +1 -1
- hikyuu/include/hikyuu/trade_sys/condition/imp/{MultiCondition.h → logic/MultiCondition.h} +1 -1
- hikyuu/include/hikyuu/trade_sys/condition/imp/{OrCondition.h → logic/OrCondition.h} +1 -1
- hikyuu/include/hikyuu/trade_sys/condition/imp/logic/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/environment/EnvironmentBase.h +6 -6
- hikyuu/include/hikyuu/trade_sys/environment/build_in.h +1 -0
- hikyuu/include/hikyuu/trade_sys/environment/crt/EV_Manual.h +20 -0
- hikyuu/include/hikyuu/trade_sys/environment/imp/ManualEnvironment.h +23 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/MultiFactorBase.h +1 -1
- hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_EqualWeight.h +3 -1
- hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_ICIRWeight.h +3 -2
- hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_ICWeight.h +4 -2
- hikyuu/include/hikyuu/trade_sys/multifactor/imp/EqualWeightMultiFactor.h +1 -1
- hikyuu/include/hikyuu/trade_sys/multifactor/imp/ICIRMultiFactor.h +1 -1
- hikyuu/include/hikyuu/trade_sys/multifactor/imp/ICMultiFactor.h +1 -1
- hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +2 -2
- hikyuu/include/hikyuu/trade_sys/selector/SelectorBase.h +3 -1
- hikyuu/include/hikyuu/trade_sys/selector/build_in.h +2 -1
- hikyuu/include/hikyuu/trade_sys/selector/crt/SE_MultiFactor.h +2 -1
- hikyuu/include/hikyuu/trade_sys/selector/crt/SE_Optimal.h +26 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/{OperatorSelector.h → logic/OperatorSelector.h} +1 -1
- hikyuu/include/hikyuu/trade_sys/selector/imp/{OperatorValueSelector.h → logic/OperatorValueSelector.h} +1 -1
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/MaxFundsOptimalSelector.h +27 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/OptimalSelectorBase.h +86 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/PerformanceOptimalSelector.h +42 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/signal/build_in.h +1 -0
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_Manual.h +20 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/ManualSignal.h +23 -0
- hikyuu/include/hikyuu/trade_sys/system/System.h +30 -13
- hikyuu/include/hikyuu/trade_sys/system/TradeRequest.h +19 -11
- hikyuu/include/hikyuu/trade_sys/system/build_in.h +1 -0
- hikyuu/include/hikyuu/trade_sys/system/crt/SYS_WalkForward.h +27 -0
- hikyuu/include/hikyuu/trade_sys/system/imp/DelegateSystem.h +51 -0
- hikyuu/include/hikyuu/trade_sys/system/imp/WalkForwardSystem.h +70 -0
- hikyuu/include/hikyuu/trade_sys/system/imp/WalkForwardTradeManager.h +465 -0
- hikyuu/include/hikyuu/utilities/base64.h +25 -31
- hikyuu/include/hikyuu/version.h +5 -5
- hikyuu/strategy/strategy_demo1.py +2 -1
- hikyuu/trade_sys/trade_sys.py +28 -9
- {hikyuu-2.1.5.dist-info → hikyuu-2.2.0.dist-info}/METADATA +1 -1
- {hikyuu-2.1.5.dist-info → hikyuu-2.2.0.dist-info}/RECORD +93 -74
- {hikyuu-2.1.5.dist-info → hikyuu-2.2.0.dist-info}/top_level.txt +3 -0
- /hikyuu/include/hikyuu/trade_sys/selector/crt/{SE_Operator.h → SE_Logic.h} +0 -0
- /hikyuu/include/hikyuu/trade_sys/selector/imp/{OperatorAddSelector.h → logic/OperatorAddSelector.h} +0 -0
- /hikyuu/include/hikyuu/trade_sys/selector/imp/{OperatorAddValueSelector.h → logic/OperatorAddValueSelector.h} +0 -0
- /hikyuu/include/hikyuu/trade_sys/selector/imp/{OperatorDivSelector.h → logic/OperatorDivSelector.h} +0 -0
- /hikyuu/include/hikyuu/trade_sys/selector/imp/{OperatorDivValueSelector.h → logic/OperatorDivValueSelector.h} +0 -0
- /hikyuu/include/hikyuu/trade_sys/selector/imp/{OperatorInvertDivValueSelector.h → logic/OperatorInvertDivValueSelector.h} +0 -0
- /hikyuu/include/hikyuu/trade_sys/selector/imp/{OperatorInvertSubValueSelector.h → logic/OperatorInvertSubValueSelector.h} +0 -0
- /hikyuu/include/hikyuu/trade_sys/selector/imp/{OperatorMulSelector.h → logic/OperatorMulSelector.h} +0 -0
- /hikyuu/include/hikyuu/trade_sys/selector/imp/{OperatorMulValueSelector.h → logic/OperatorMulValueSelector.h} +0 -0
- /hikyuu/include/hikyuu/trade_sys/selector/imp/{OperatorSubSelector.h → logic/OperatorSubSelector.h} +0 -0
- /hikyuu/include/hikyuu/trade_sys/selector/imp/{OperatorSubValueSelector.h → logic/OperatorSubValueSelector.h} +0 -0
- {hikyuu-2.1.5.dist-info → hikyuu-2.2.0.dist-info}/LICENSE +0 -0
- {hikyuu-2.1.5.dist-info → hikyuu-2.2.0.dist-info}/WHEEL +0 -0
- {hikyuu-2.1.5.dist-info → hikyuu-2.2.0.dist-info}/entry_points.txt +0 -0
hikyuu/analysis/analysis.py
CHANGED
|
@@ -31,6 +31,11 @@ def combinate_ind_analysis(
|
|
|
31
31
|
:param list keys: 输出 Performance 统计项
|
|
32
32
|
:rtype: pd.DataFrame
|
|
33
33
|
'''
|
|
34
|
+
if not keys:
|
|
35
|
+
for key in keys:
|
|
36
|
+
if not Performance.exist(key):
|
|
37
|
+
raise Exception(f'Invalid key: {key}')
|
|
38
|
+
|
|
34
39
|
pers = inner_combinate_ind_analysis(stk, query, tm, sys, buy_inds, sell_inds, n)
|
|
35
40
|
|
|
36
41
|
if not keys:
|
|
@@ -75,6 +80,11 @@ def combinate_ind_analysis_multi(
|
|
|
75
80
|
:param int n: 买入信号组合时的周期
|
|
76
81
|
:param list keys: 输出 Performance 统计项
|
|
77
82
|
'''
|
|
83
|
+
if not keys:
|
|
84
|
+
for key in keys:
|
|
85
|
+
if not Performance.exist(key):
|
|
86
|
+
raise Exception(f'Invalid key: {key}')
|
|
87
|
+
|
|
78
88
|
if isinstance(stks, Block):
|
|
79
89
|
blks = stks
|
|
80
90
|
else:
|
|
@@ -95,6 +105,11 @@ def combinate_ind_analysis_multi(
|
|
|
95
105
|
|
|
96
106
|
|
|
97
107
|
def analysis_sys_list(stks, query, sys_proto, keys=["累计投入本金", "当前总资产", "现金余额", "未平仓头寸净值", "赢利交易比例%", "赢利交易数", "亏损交易数"]):
|
|
108
|
+
if not keys:
|
|
109
|
+
for key in keys:
|
|
110
|
+
if not Performance.exist(key):
|
|
111
|
+
raise Exception(f'Invalid key: {key}')
|
|
112
|
+
|
|
98
113
|
names = ["证券代码", "证券名称"]
|
|
99
114
|
names.extend(keys)
|
|
100
115
|
ret = {}
|
|
@@ -119,6 +134,11 @@ def analysis_sys_list(stks, query, sys_proto, keys=["累计投入本金", "当
|
|
|
119
134
|
|
|
120
135
|
|
|
121
136
|
def analysis_sys_list_multi(stks, query, sys_proto, keys=["累计投入本金", "当前总资产", "现金余额", "未平仓头寸净值", "赢利交易比例%", "赢利交易数", "亏损交易数"]):
|
|
137
|
+
if not keys:
|
|
138
|
+
for key in keys:
|
|
139
|
+
if not Performance.exist(key):
|
|
140
|
+
raise Exception(f'Invalid key: {key}')
|
|
141
|
+
|
|
122
142
|
out = inner_analysis_sys_list(stks, query, sys_proto)
|
|
123
143
|
if not keys:
|
|
124
144
|
ret = out
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
hikyuu/cpp/core38.pyd
CHANGED
|
Binary file
|
hikyuu/cpp/hikyuu.dll
CHANGED
|
Binary file
|
hikyuu/data/common.py
CHANGED
|
@@ -91,7 +91,7 @@ def get_stktype_list(quotations=None):
|
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
@hku_catch(ret=[], trace=True)
|
|
94
|
-
@timeout(
|
|
94
|
+
@timeout(30)
|
|
95
95
|
def get_stk_code_name_list(market: str) -> list:
|
|
96
96
|
"""
|
|
97
97
|
获取指定证券交易所股票代码与名称列表
|
|
@@ -128,7 +128,7 @@ def get_stk_code_name_list(market: str) -> list:
|
|
|
128
128
|
|
|
129
129
|
|
|
130
130
|
@hku_catch(ret=[], trace=True)
|
|
131
|
-
@timeout(
|
|
131
|
+
@timeout(60)
|
|
132
132
|
def get_index_code_name_list() -> list:
|
|
133
133
|
"""
|
|
134
134
|
获取所有股票指数代码名称列表
|
|
@@ -191,7 +191,7 @@ def get_new_holidays():
|
|
|
191
191
|
|
|
192
192
|
|
|
193
193
|
@hku_catch(ret=[], trace=True)
|
|
194
|
-
@timeout(
|
|
194
|
+
@timeout(60)
|
|
195
195
|
def get_china_bond10_rate(start_date="19901219"):
|
|
196
196
|
"""获取中国国债收益率10年"""
|
|
197
197
|
bond_zh_us_rate_df = ak.bond_zh_us_rate(start_date)
|
|
@@ -51,7 +51,7 @@ def pytdx_import_weight_to_mysql(pytdx_api, connect, market):
|
|
|
51
51
|
cur.execute(
|
|
52
52
|
"select id, stockid, date, countAsGift, countForSell, priceForSell, \
|
|
53
53
|
bonus, countOfIncreasement, totalCount, \
|
|
54
|
-
freeCount from `hku_base`.`stkweight` where stockid=%s \
|
|
54
|
+
freeCount, suogu from `hku_base`.`stkweight` where stockid=%s \
|
|
55
55
|
order by date desc limit 1" % stockid
|
|
56
56
|
)
|
|
57
57
|
a = [x for x in cur.fetchall()]
|
|
@@ -79,10 +79,6 @@ def pytdx_import_weight_to_mysql(pytdx_api, connect, market):
|
|
|
79
79
|
if xdxr['songzhuangu'] is not None:
|
|
80
80
|
new_last_db_weight[3] = 10000 * xdxr['songzhuangu']
|
|
81
81
|
update_last_db_weight = True
|
|
82
|
-
if xdxr['suogu'] is not None:
|
|
83
|
-
# etf 扩股
|
|
84
|
-
new_last_db_weight[3] += 100000 * (xdxr['suogu']-1)
|
|
85
|
-
update_last_db_weight = True
|
|
86
82
|
if xdxr['peigu'] is not None:
|
|
87
83
|
new_last_db_weight[4] = 10000 * xdxr['peigu']
|
|
88
84
|
update_last_db_weight = True
|
|
@@ -100,26 +96,27 @@ def pytdx_import_weight_to_mysql(pytdx_api, connect, market):
|
|
|
100
96
|
new_last_db_weight[9] = xdxr['panhouliutong']
|
|
101
97
|
update_last_db_weight = True
|
|
102
98
|
last_free_count = new_last_db_weight[9]
|
|
99
|
+
if xdxr['suogu'] is not None:
|
|
100
|
+
# etf 扩缩股
|
|
101
|
+
new_last_db_weight[10] = xdxr['suogu']
|
|
102
|
+
update_last_db_weight = True
|
|
103
103
|
continue
|
|
104
104
|
if date not in records:
|
|
105
|
-
songzhuangu = 10000 * xdxr['songzhuangu'] if xdxr['songzhuangu'] is not None else 0
|
|
106
|
-
songzhuangu += 100000 * (xdxr['suogu']-1) if xdxr['suogu'] is not None else 0
|
|
107
105
|
records[date] = [
|
|
108
106
|
stockid,
|
|
109
107
|
date,
|
|
110
|
-
songzhuangu, # countAsGift
|
|
108
|
+
10000 * xdxr['songzhuangu'] if xdxr['songzhuangu'] is not None else 0, # countAsGift
|
|
111
109
|
10000 * xdxr['peigu'] if xdxr['peigu'] is not None else 0, # countForSell
|
|
112
110
|
1000 * xdxr['peigujia'] if xdxr['peigujia'] is not None else 0, # priceForSell
|
|
113
111
|
1000 * xdxr['fenhong'] if xdxr['fenhong'] is not None else 0, # bonus
|
|
114
112
|
0, # countOfIncreasement, pytdx 不区分送股和转增股,统一记在送股
|
|
115
113
|
xdxr['houzongguben'] if xdxr['houzongguben'] is not None else last_total_count, # totalCount
|
|
116
|
-
xdxr['panhouliutong'] if xdxr['panhouliutong'] is not None else last_free_count # freeCount
|
|
114
|
+
xdxr['panhouliutong'] if xdxr['panhouliutong'] is not None else last_free_count, # freeCount
|
|
115
|
+
xdxr["suogu"] if xdxr["suogu"] is not None else 0
|
|
117
116
|
]
|
|
118
117
|
else:
|
|
119
118
|
if xdxr['songzhuangu'] is not None:
|
|
120
119
|
records[date][2] = 10000 * xdxr['songzhuangu']
|
|
121
|
-
if xdxr['suogu'] is not None:
|
|
122
|
-
records[date][2] += 100000 * (xdxr['suogu']-1)
|
|
123
120
|
if xdxr['peigu'] is not None:
|
|
124
121
|
records[date][3] = 10000 * xdxr['peigu']
|
|
125
122
|
if xdxr['peigujia'] is not None:
|
|
@@ -130,6 +127,8 @@ def pytdx_import_weight_to_mysql(pytdx_api, connect, market):
|
|
|
130
127
|
records[date][7] = xdxr['houzongguben']
|
|
131
128
|
if xdxr['panhouliutong'] is not None:
|
|
132
129
|
records[date][8] = xdxr['panhouliutong']
|
|
130
|
+
if xdxr['suogu'] is not None:
|
|
131
|
+
records[date][9] = xdxr['suogu']
|
|
133
132
|
if xdxr['houzongguben'] is not None:
|
|
134
133
|
last_total_count = xdxr['houzongguben']
|
|
135
134
|
if xdxr['panhouliutong'] is not None:
|
|
@@ -144,8 +143,8 @@ def pytdx_import_weight_to_mysql(pytdx_api, connect, market):
|
|
|
144
143
|
x = new_last_db_weight
|
|
145
144
|
cur.execute(
|
|
146
145
|
"UPDATE `hku_base`.`stkweight` SET countAsGift=%s, countForSell=%s, priceForSell=%s, \
|
|
147
|
-
bonus=%s, totalCount=%s, freeCount=%s \
|
|
148
|
-
where id=%s" % (x[3], x[4], x[5], x[6], x[8], x[9], x[0])
|
|
146
|
+
bonus=%s, totalCount=%s, freeCount=%s, suogu=%s \
|
|
147
|
+
where id=%s" % (x[3], x[4], x[5], x[6], x[8], x[9], x[10], x[0])
|
|
149
148
|
)
|
|
150
149
|
connect.commit()
|
|
151
150
|
cur.close()
|
|
@@ -154,8 +153,8 @@ def pytdx_import_weight_to_mysql(pytdx_api, connect, market):
|
|
|
154
153
|
cur = connect.cursor()
|
|
155
154
|
cur.executemany(
|
|
156
155
|
"INSERT INTO `hku_base`.`stkweight` (stockid, date, countAsGift, \
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
countForSell, priceForSell, bonus, countOfIncreasement, totalCount, freeCount, suogu) \
|
|
157
|
+
VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)", [x for x in records.values()]
|
|
159
158
|
)
|
|
160
159
|
connect.commit()
|
|
161
160
|
cur.close()
|
|
@@ -48,7 +48,7 @@ def pytdx_import_weight_to_sqlite(pytdx_api, connect, market):
|
|
|
48
48
|
a = cur.execute(
|
|
49
49
|
"select id, stockid, date, countAsGift, countForSell, priceForSell, \
|
|
50
50
|
bonus, countOfIncreasement, totalCount, \
|
|
51
|
-
freeCount from stkweight where stockid=%s \
|
|
51
|
+
freeCount, suogu from stkweight where stockid=%s \
|
|
52
52
|
order by date desc limit 1" % stockid
|
|
53
53
|
)
|
|
54
54
|
a = [x for x in a]
|
|
@@ -76,10 +76,6 @@ def pytdx_import_weight_to_sqlite(pytdx_api, connect, market):
|
|
|
76
76
|
if xdxr['songzhuangu'] is not None:
|
|
77
77
|
new_last_db_weight[3] = int(10000 * xdxr['songzhuangu'])
|
|
78
78
|
update_last_db_weight = True
|
|
79
|
-
if xdxr['suogu'] is not None:
|
|
80
|
-
# etf 扩股
|
|
81
|
-
new_last_db_weight[3] += int(100000 * (xdxr['suogu']-1))
|
|
82
|
-
update_last_db_weight = True
|
|
83
79
|
if xdxr['peigu'] is not None:
|
|
84
80
|
new_last_db_weight[4] = int(10000 * xdxr['peigu'])
|
|
85
81
|
update_last_db_weight = True
|
|
@@ -97,14 +93,16 @@ def pytdx_import_weight_to_sqlite(pytdx_api, connect, market):
|
|
|
97
93
|
new_last_db_weight[9] = round(xdxr['panhouliutong'])
|
|
98
94
|
update_last_db_weight = True
|
|
99
95
|
last_free_count = new_last_db_weight[9]
|
|
96
|
+
if xdxr['suogu'] is not None:
|
|
97
|
+
# etf 扩股
|
|
98
|
+
new_last_db_weight[10] = xdxr['suogu']
|
|
99
|
+
update_last_db_weight = True
|
|
100
100
|
continue
|
|
101
101
|
if date not in records:
|
|
102
|
-
songzhuangu = int(10000 * xdxr['songzhuangu']) if xdxr['songzhuangu'] is not None else 0
|
|
103
|
-
songzhuangu += int(100000 * (xdxr['suogu']-1)) if xdxr['suogu'] is not None else 0
|
|
104
102
|
records[date] = [
|
|
105
103
|
stockid,
|
|
106
104
|
date,
|
|
107
|
-
songzhuangu, # countForGift
|
|
105
|
+
int(10000 * xdxr['songzhuangu']) if xdxr['songzhuangu'] is not None else 0, # countForGift
|
|
108
106
|
int(10000 * xdxr['peigu']) if xdxr['peigu'] is not None else 0, # countForSell
|
|
109
107
|
int(1000 * xdxr['peigujia']) if xdxr['peigujia'] is not None else 0, # priceForSell
|
|
110
108
|
int(1000 * xdxr['fenhong']) if xdxr['fenhong'] is not None else 0, # bonus
|
|
@@ -112,13 +110,12 @@ def pytdx_import_weight_to_sqlite(pytdx_api, connect, market):
|
|
|
112
110
|
round(xdxr['houzongguben'])
|
|
113
111
|
if xdxr['houzongguben'] is not None else last_total_count, # totalCount
|
|
114
112
|
round(xdxr['panhouliutong'])
|
|
115
|
-
if xdxr['panhouliutong'] is not None else last_free_count # freeCount
|
|
113
|
+
if xdxr['panhouliutong'] is not None else last_free_count, # freeCount
|
|
114
|
+
xdxr["suogu"] if xdxr["suogu"] is not None else 0
|
|
116
115
|
]
|
|
117
116
|
else:
|
|
118
117
|
if xdxr['songzhuangu'] is not None:
|
|
119
118
|
records[date][2] = int(10000 * xdxr['songzhuangu'])
|
|
120
|
-
if xdxr['suogu'] is not None:
|
|
121
|
-
records[date][2] += int(100000 * (xdxr['suogu']-1))
|
|
122
119
|
if xdxr['peigu'] is not None:
|
|
123
120
|
records[date][3] = int(10000 * xdxr['peigu'])
|
|
124
121
|
if xdxr['peigujia'] is not None:
|
|
@@ -129,6 +126,8 @@ def pytdx_import_weight_to_sqlite(pytdx_api, connect, market):
|
|
|
129
126
|
records[date][7] = round(xdxr['houzongguben'])
|
|
130
127
|
if xdxr['panhouliutong'] is not None:
|
|
131
128
|
records[date][8] = round(xdxr['panhouliutong'])
|
|
129
|
+
if xdxr['suogu'] is not None:
|
|
130
|
+
records[date][9] = xdxr['suogu']
|
|
132
131
|
if xdxr['houzongguben'] is not None:
|
|
133
132
|
last_total_count = round(xdxr['houzongguben'])
|
|
134
133
|
if xdxr['panhouliutong'] is not None:
|
|
@@ -143,8 +142,8 @@ def pytdx_import_weight_to_sqlite(pytdx_api, connect, market):
|
|
|
143
142
|
x = new_last_db_weight
|
|
144
143
|
cur.execute(
|
|
145
144
|
"UPDATE StkWeight SET countAsGift=%s, countForSell=%s, priceForSell=%s, \
|
|
146
|
-
bonus=%s, totalCount=%s, freeCount=%s \
|
|
147
|
-
where id=%s" % (x[3], x[4], x[5], x[6], x[8], x[9], x[0])
|
|
145
|
+
bonus=%s, totalCount=%s, freeCount=%s, suogu=%s \
|
|
146
|
+
where id=%s" % (x[3], x[4], x[5], x[6], x[8], x[9], x[10], x[0])
|
|
148
147
|
)
|
|
149
148
|
connect.commit()
|
|
150
149
|
cur.close()
|
|
@@ -153,8 +152,8 @@ def pytdx_import_weight_to_sqlite(pytdx_api, connect, market):
|
|
|
153
152
|
cur = connect.cursor()
|
|
154
153
|
cur.executemany(
|
|
155
154
|
"INSERT INTO StkWeight(stockid, date, countAsGift, \
|
|
156
|
-
countForSell, priceForSell, bonus, countOfIncreasement, totalCount, freeCount) \
|
|
157
|
-
VALUES (
|
|
155
|
+
countForSell, priceForSell, bonus, countOfIncreasement, totalCount, freeCount, suogu) \
|
|
156
|
+
VALUES (?,?,?,?,?,?,?,?,?,?)", [x for x in records.values()]
|
|
158
157
|
)
|
|
159
158
|
connect.commit()
|
|
160
159
|
cur.close()
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
BEGIN TRANSACTION;
|
|
2
|
+
DROP TABLE `stkWeight`;
|
|
3
|
+
CREATE TABLE "stkWeight" (
|
|
4
|
+
id INTEGER NOT NULL,
|
|
5
|
+
stockid INTEGER,
|
|
6
|
+
date INTEGER,
|
|
7
|
+
"countAsGift" INTEGER,
|
|
8
|
+
"countForSell" INTEGER,
|
|
9
|
+
"priceForSell" INTEGER,
|
|
10
|
+
bonus INTEGER,
|
|
11
|
+
"countOfIncreasement" INTEGER,
|
|
12
|
+
"totalCount" INTEGER,
|
|
13
|
+
"freeCount" INTEGER,
|
|
14
|
+
"suogu" NUMBER,
|
|
15
|
+
PRIMARY KEY (id AUTOINCREMENT),
|
|
16
|
+
FOREIGN KEY(stockid) REFERENCES "Stock" (stockid)
|
|
17
|
+
);
|
|
18
|
+
CREATE INDEX "ix_stkWeight_stockid" ON "stkWeight" (stockid);
|
|
19
|
+
CREATE INDEX "ix_stkWeight_date" ON "stkWeight" (date);
|
|
20
|
+
CREATE INDEX "ix_stkWeight" ON "stkWeight" (stockid, date);
|
|
21
|
+
UPDATE `version` set `version` = 24;
|
|
22
|
+
COMMIT;
|
hikyuu/gui/HikyuuTDX.py
CHANGED
|
@@ -267,8 +267,6 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
267
267
|
|
|
268
268
|
current_dir = os.path.dirname(__file__)
|
|
269
269
|
self.setWindowIcon(QIcon("{}/hikyuu.ico".format(current_dir)))
|
|
270
|
-
# self.setFixedSize(self.width(), self.height())
|
|
271
|
-
self.import_status_label.setText('')
|
|
272
270
|
self.import_detail_textEdit.clear()
|
|
273
271
|
self.reset_progress_bar()
|
|
274
272
|
self.day_start_dateEdit.setMinimumDate(datetime.date(1990, 12, 19))
|
|
@@ -703,6 +701,9 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
703
701
|
self.start_import_pushButton.setEnabled(False)
|
|
704
702
|
self.reset_progress_bar()
|
|
705
703
|
|
|
704
|
+
if config.getboolean('weight', 'enable', fallback=False):
|
|
705
|
+
self.hdf5_weight_label.setText("正在导入")
|
|
706
|
+
|
|
706
707
|
self.import_status_label.setText("正在启动任务....")
|
|
707
708
|
QApplication.processEvents()
|
|
708
709
|
|
|
@@ -115,6 +115,13 @@ class ImportHistoryFinanceTask:
|
|
|
115
115
|
old_md5 = hashlib.md5(f.read()).hexdigest()
|
|
116
116
|
if old_md5 != item['hash']:
|
|
117
117
|
self.download_file(item)
|
|
118
|
+
else:
|
|
119
|
+
# 不管是否有变化,都导入一次,以便切换引擎时可以导入
|
|
120
|
+
shutil.unpack_archive(dest_file, extract_dir=self.dest_dir)
|
|
121
|
+
filename = item['filename']
|
|
122
|
+
filename = f'{self.dest_dir}/{filename[0:-4]}.dat'
|
|
123
|
+
self.import_to_db(filename)
|
|
124
|
+
hku_info(f"Import finance file: {filename}")
|
|
118
125
|
count += 1
|
|
119
126
|
self.queue.put([self.task_name, None, None, int(100 * count / self.total_count), self.total_count])
|
|
120
127
|
except Exception as e:
|
|
@@ -91,8 +91,8 @@ class ImportWeightToSqliteTask:
|
|
|
91
91
|
hku_check(api.connect(self.host, self.port), "failed connect pytdx {}:{}!", self.host, self.port)
|
|
92
92
|
|
|
93
93
|
if self.cmd == 'weight':
|
|
94
|
-
|
|
95
|
-
self.logger.info("导入 {} 权息记录数: {}".format(self.market,
|
|
94
|
+
total_count = pytdx_import_weight(api, connect, self.market)
|
|
95
|
+
self.logger.info("导入 {} 权息记录数: {}".format(self.market, total_count))
|
|
96
96
|
self.queue.put([self.msg_name, '导入权息数据完毕!', 0, 0, f'{self.market} {total_count}'])
|
|
97
97
|
elif self.cmd == 'finance':
|
|
98
98
|
self.queue.put([self.msg_name, f'下载通达信当前财务信息({self.market})...', 0, 0, 0])
|
hikyuu/gui/data/MainWindow.py
CHANGED
|
@@ -653,7 +653,7 @@ class Ui_MainWindow(object):
|
|
|
653
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
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
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>"))
|
|
656
|
-
self.import_status_label.setText(_translate("MainWindow", "
|
|
656
|
+
self.import_status_label.setText(_translate("MainWindow", "请勿盘中导入!"))
|
|
657
657
|
self.sched_import_pushButton.setText(_translate("MainWindow", "启动定时导入"))
|
|
658
658
|
self.label_40.setText(_translate("MainWindow", "导入执行时间:"))
|
|
659
659
|
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "执行导入"))
|
|
@@ -20,13 +20,13 @@ namespace hku {
|
|
|
20
20
|
class HKU_API StockWeight {
|
|
21
21
|
public:
|
|
22
22
|
/** 默认构造函数,返回Null<StockWeight>() */
|
|
23
|
-
StockWeight();
|
|
23
|
+
StockWeight() = default;
|
|
24
24
|
|
|
25
25
|
explicit StockWeight(const Datetime& datetime);
|
|
26
26
|
|
|
27
27
|
StockWeight(const Datetime& datetime, price_t countAsGift, price_t countForSell,
|
|
28
28
|
price_t priceForSell, price_t bonus, price_t increasement, price_t totalCount,
|
|
29
|
-
price_t freeCount);
|
|
29
|
+
price_t freeCount, price_t suogu);
|
|
30
30
|
|
|
31
31
|
/** 权息日期 */
|
|
32
32
|
Datetime datetime() const {
|
|
@@ -68,15 +68,21 @@ public:
|
|
|
68
68
|
return m_freeCount;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
/** 扩缩股比例 */
|
|
72
|
+
price_t suogu() const {
|
|
73
|
+
return m_suogu;
|
|
74
|
+
}
|
|
75
|
+
|
|
71
76
|
private:
|
|
72
|
-
Datetime m_datetime;
|
|
73
|
-
price_t m_countAsGift; // 每10股送X股
|
|
74
|
-
price_t m_countForSell; // 每10股配X股
|
|
75
|
-
price_t m_priceForSell; // 配股价
|
|
76
|
-
price_t m_bonus; // 每10股红利
|
|
77
|
-
price_t m_increasement; // 每10股转增X股
|
|
78
|
-
price_t m_totalCount; // 总股本(万股)
|
|
79
|
-
price_t m_freeCount; // 流通股(万股)
|
|
77
|
+
Datetime m_datetime; // 权息日期
|
|
78
|
+
price_t m_countAsGift{0.}; // 每10股送X股
|
|
79
|
+
price_t m_countForSell{0.}; // 每10股配X股
|
|
80
|
+
price_t m_priceForSell{0.}; // 配股价
|
|
81
|
+
price_t m_bonus{0.}; // 每10股红利
|
|
82
|
+
price_t m_increasement{0.}; // 每10股转增X股
|
|
83
|
+
price_t m_totalCount{0.}; // 总股本(万股)
|
|
84
|
+
price_t m_freeCount{0.}; // 流通股(万股)
|
|
85
|
+
price_t m_suogu{0.}; // 扩缩股比例
|
|
80
86
|
};
|
|
81
87
|
|
|
82
88
|
/** @ingroup StockManage */
|
|
@@ -13,20 +13,20 @@
|
|
|
13
13
|
|
|
14
14
|
namespace hku {
|
|
15
15
|
|
|
16
|
-
struct HKU_API
|
|
16
|
+
struct HKU_API AnalysisSystemOutput {
|
|
17
17
|
string market_code; ///< 证券代码
|
|
18
18
|
string name; ///< 证券名称
|
|
19
19
|
PriceList values; ///< 统计各项指标值
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
AnalysisSystemOutput() = default;
|
|
22
|
+
AnalysisSystemOutput(const AnalysisSystemOutput& other) = default;
|
|
23
|
+
AnalysisSystemOutput(AnalysisSystemOutput&& rv)
|
|
24
24
|
: market_code(std::move(rv.market_code)),
|
|
25
25
|
name(std::move(rv.name)),
|
|
26
26
|
values(std::move(rv.values)) {}
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
AnalysisSystemOutput& operator=(const AnalysisSystemOutput&) = default;
|
|
29
|
+
AnalysisSystemOutput& operator=(AnalysisSystemOutput&& rv) {
|
|
30
30
|
HKU_IF_RETURN(this == &rv, *this);
|
|
31
31
|
market_code = std::move(rv.market_code);
|
|
32
32
|
name = std::move(rv.name);
|
|
@@ -35,12 +35,42 @@ struct HKU_API AnalysisSystemWithBlockOut {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
/**
|
|
39
|
+
* 统计所有指定系统策略, 系统列表中的每一个系统都应该是独立的系统实例
|
|
40
|
+
* @note 系统实例列表和证券列表是一一对应,不是两两组合
|
|
41
|
+
* @param sys_list 系统策略实例列表
|
|
42
|
+
* @param stk_list 证券列表,须与系统策略列表一一对应
|
|
43
|
+
* @param query 查询条件
|
|
44
|
+
* @return vector<AnalysisSystemOutput>
|
|
45
|
+
*/
|
|
46
|
+
vector<AnalysisSystemOutput> HKU_API analysisSystemList(const SystemList& sys_list,
|
|
47
|
+
const StockList& stk_list,
|
|
48
|
+
const KQuery& query);
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 以指定的 stock 统计执行所有的系统策略
|
|
52
|
+
* @param sys_list 系统策略思路列表,每一个都应是单独的实例
|
|
53
|
+
* @param stk 指定证券
|
|
54
|
+
* @param query 查询条件
|
|
55
|
+
* @return vector<AnalysisSystemOutput>
|
|
56
|
+
*/
|
|
57
|
+
vector<AnalysisSystemOutput> HKU_API analysisSystemList(const SystemList& sys_list,
|
|
58
|
+
const Stock& stk, const KQuery& query);
|
|
41
59
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
60
|
+
/**
|
|
61
|
+
* 以指定的 stock 统计执行所有的系统策略,并按指定的统计项返回统计项最高或最低的系统实例及其统计值
|
|
62
|
+
* @param sys_list 系统策略思路列表,每一个都应是单独的实例
|
|
63
|
+
* @param stk 指定证券
|
|
64
|
+
* @param query 查询条件
|
|
65
|
+
* @param sort_key Performance 中的统计项名称,按该统计项返回
|
|
66
|
+
* @param sort_mode 0 为取统计最高值的系统,其他值为取统计最低值的系统
|
|
67
|
+
* @return std::pair<double, SYSPtr>
|
|
68
|
+
*/
|
|
69
|
+
std::pair<double, SYSPtr> HKU_API findOptimalSystem(const SystemList& sys_list, const Stock& stk,
|
|
70
|
+
const KQuery& query, const string& sort_key,
|
|
71
|
+
int sort_mode = 0);
|
|
45
72
|
|
|
73
|
+
std::pair<double, SYSPtr> HKU_API findOptimalSystemMulti(const SystemList& sys_list,
|
|
74
|
+
const Stock& stk, const KQuery& query,
|
|
75
|
+
const string& sort_key, int sort_mode = 0);
|
|
46
76
|
} // namespace hku
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
namespace hku {
|
|
17
17
|
|
|
18
18
|
class StockWeightTable {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
TABLE_BIND10(StockWeightTable, stkweight, stockid, date, countAsGift, countForSell,
|
|
20
|
+
priceForSell, bonus, countOfIncreasement, totalCount, freeCount, suogu)
|
|
21
21
|
|
|
22
22
|
public:
|
|
23
23
|
uint64_t stockid{0};
|
|
@@ -29,11 +29,12 @@ public:
|
|
|
29
29
|
double countOfIncreasement{0.};
|
|
30
30
|
double totalCount{0.};
|
|
31
31
|
double freeCount{0.};
|
|
32
|
+
double suogu{0.};
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
struct StockWeightTableView {
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
TABLE_BIND10(StockWeightTableView, stkweight, market_code, date, countAsGift, countForSell,
|
|
37
|
+
priceForSell, bonus, countOfIncreasement, totalCount, freeCount, suogu)
|
|
37
38
|
string market_code;
|
|
38
39
|
uint64_t date{0};
|
|
39
40
|
double countAsGift{0.};
|
|
@@ -43,6 +44,7 @@ struct StockWeightTableView {
|
|
|
43
44
|
double countOfIncreasement{0.};
|
|
44
45
|
double totalCount{0.};
|
|
45
46
|
double freeCount{0.};
|
|
47
|
+
double suogu{0.0};
|
|
46
48
|
};
|
|
47
49
|
|
|
48
50
|
} // namespace hku
|
|
@@ -125,12 +125,11 @@ private:
|
|
|
125
125
|
enum STATUS m_status = WAITING; // 当前内部状态
|
|
126
126
|
std::atomic_bool m_stop = true; // 结束代理工作标识
|
|
127
127
|
|
|
128
|
-
int m_revTimeout = 100;
|
|
129
|
-
|
|
130
|
-
std::
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
vector<std::future<void>> m_process_task_list;
|
|
128
|
+
int m_revTimeout = 100; // 连接数据服务超时时长(毫秒)
|
|
129
|
+
std::thread m_receiveThread; // 数据接收线程
|
|
130
|
+
std::unique_ptr<ThreadPool> m_tg; // 数据处理任务线程池
|
|
131
|
+
size_t m_work_num = 1; // 数据处理任务线程池线程数
|
|
132
|
+
std::unique_ptr<ThreadPool> m_receive_data_tg; // 数据接收任务组
|
|
134
133
|
|
|
135
134
|
bool m_print = true; // 是否打印连接信息
|
|
136
135
|
string m_server_addr; // 服务器地址
|
|
@@ -18,23 +18,24 @@ namespace hku {
|
|
|
18
18
|
* @param query 查询条件
|
|
19
19
|
* @param ref_stk 参照证券,默认 sh000300 沪深300
|
|
20
20
|
* @param n 时间窗口 (对应 n 日收益率)
|
|
21
|
+
* @param spearman 使用 spearman 相关系数,否则为 pearson
|
|
21
22
|
* @return Indicator
|
|
22
23
|
* @ingroup Indicator
|
|
23
24
|
*/
|
|
24
25
|
Indicator HKU_API IC(const StockList& stks, const KQuery& query,
|
|
25
|
-
const Stock& ref_stk = getStock("sh000300"), int n = 1);
|
|
26
|
+
const Stock& ref_stk = getStock("sh000300"), int n = 1, bool spearman = true);
|
|
26
27
|
|
|
27
28
|
Indicator HKU_API IC(const Block& blk, const KQuery& query,
|
|
28
|
-
const Stock& ref_stk = getStock("sh000300"), int n = 1);
|
|
29
|
+
const Stock& ref_stk = getStock("sh000300"), int n = 1, bool spearman = true);
|
|
29
30
|
|
|
30
31
|
inline Indicator IC(const Indicator& ind, const StockList& stks, const KQuery& query,
|
|
31
|
-
const Stock& ref_stk = getStock("sh000300"), int n = 1) {
|
|
32
|
-
return IC(stks, query, ref_stk, n)(ind);
|
|
32
|
+
const Stock& ref_stk = getStock("sh000300"), int n = 1, bool spearman = true) {
|
|
33
|
+
return IC(stks, query, ref_stk, n, spearman)(ind);
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
inline Indicator IC(const Indicator& ind, const Block& blk, const KQuery& query,
|
|
36
|
-
const Stock& ref_stk = getStock("sh000300"), int n = 1) {
|
|
37
|
-
return IC(blk, query, ref_stk, n)(ind);
|
|
37
|
+
const Stock& ref_stk = getStock("sh000300"), int n = 1, bool spearman = true) {
|
|
38
|
+
return IC(blk, query, ref_stk, n, spearman)(ind);
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
} // namespace hku
|
|
@@ -22,12 +22,14 @@ namespace hku {
|
|
|
22
22
|
* @param ref_stk 参照证券,默认 sh000300 沪深300
|
|
23
23
|
* @param n IC对应的N日收益率
|
|
24
24
|
* @param rolling_n 滚动时间窗口
|
|
25
|
+
* @param spearman 使用 spearman 相关系数,否则为 pearson
|
|
25
26
|
* @return Indicator
|
|
26
27
|
* @ingroup Indicator
|
|
27
28
|
*/
|
|
28
29
|
inline Indicator ICIR(const Indicator& ind, const StockList& stks, const KQuery& query,
|
|
29
|
-
const Stock& ref_stk = getStock("sh000300"), int n = 1, int rolling_n = 120
|
|
30
|
-
|
|
30
|
+
const Stock& ref_stk = getStock("sh000300"), int n = 1, int rolling_n = 120,
|
|
31
|
+
bool spearman = true) {
|
|
32
|
+
Indicator ic = IC(ind, stks, query, ref_stk, n, spearman);
|
|
31
33
|
Indicator x = MA(ic, rolling_n) / STDEV(ic, rolling_n);
|
|
32
34
|
x.name("ICIR");
|
|
33
35
|
x.setParam<int>("n", n);
|
|
@@ -36,8 +38,9 @@ inline Indicator ICIR(const Indicator& ind, const StockList& stks, const KQuery&
|
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
inline Indicator ICIR(const Indicator& ind, const Block& blk, const KQuery& query,
|
|
39
|
-
const Stock& ref_stk = getStock("sh000300"), int n = 1, int rolling_n = 120
|
|
40
|
-
|
|
41
|
+
const Stock& ref_stk = getStock("sh000300"), int n = 1, int rolling_n = 120,
|
|
42
|
+
bool spearman = true) {
|
|
43
|
+
Indicator ic = IC(ind, blk, query, ref_stk, n, spearman);
|
|
41
44
|
Indicator x = MA(ic, rolling_n) / STDEV(ic, rolling_n);
|
|
42
45
|
x.name("ICIR");
|
|
43
46
|
x.setParam<int>("n", n);
|
|
@@ -14,7 +14,7 @@ namespace hku {
|
|
|
14
14
|
class IIc : public IndicatorImp {
|
|
15
15
|
public:
|
|
16
16
|
IIc();
|
|
17
|
-
IIc(const StockList& stks, const KQuery& query, int n, const Stock& ref_stk);
|
|
17
|
+
IIc(const StockList& stks, const KQuery& query, int n, const Stock& ref_stk, bool spearman);
|
|
18
18
|
virtual ~IIc();
|
|
19
19
|
|
|
20
20
|
virtual void _checkParam(const string& name) const override;
|
|
@@ -26,6 +26,7 @@ void save(Archive& ar, const hku::StockWeight& record, unsigned int version) {
|
|
|
26
26
|
hku::price_t increasement = record.increasement();
|
|
27
27
|
hku::price_t totalCount = record.totalCount();
|
|
28
28
|
hku::price_t freeCount = record.freeCount();
|
|
29
|
+
hku::price_t suogu = record.suogu();
|
|
29
30
|
ar& BOOST_SERIALIZATION_NVP(datetime);
|
|
30
31
|
ar& BOOST_SERIALIZATION_NVP(countAsGift);
|
|
31
32
|
ar& BOOST_SERIALIZATION_NVP(countForSell);
|
|
@@ -34,13 +35,14 @@ void save(Archive& ar, const hku::StockWeight& record, unsigned int version) {
|
|
|
34
35
|
ar& BOOST_SERIALIZATION_NVP(increasement);
|
|
35
36
|
ar& BOOST_SERIALIZATION_NVP(totalCount);
|
|
36
37
|
ar& BOOST_SERIALIZATION_NVP(freeCount);
|
|
38
|
+
ar& BOOST_SERIALIZATION_NVP(suogu);
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
template <class Archive>
|
|
40
42
|
void load(Archive& ar, hku::StockWeight& record, unsigned int version) {
|
|
41
43
|
hku::uint64_t datetime;
|
|
42
44
|
hku::price_t countAsGift, countForSell, priceForSell, bonus;
|
|
43
|
-
hku::price_t increasement, totalCount, freeCount;
|
|
45
|
+
hku::price_t increasement, totalCount, freeCount, suogu;
|
|
44
46
|
ar& BOOST_SERIALIZATION_NVP(datetime);
|
|
45
47
|
ar& BOOST_SERIALIZATION_NVP(countAsGift);
|
|
46
48
|
ar& BOOST_SERIALIZATION_NVP(countForSell);
|
|
@@ -49,8 +51,9 @@ void load(Archive& ar, hku::StockWeight& record, unsigned int version) {
|
|
|
49
51
|
ar& BOOST_SERIALIZATION_NVP(increasement);
|
|
50
52
|
ar& BOOST_SERIALIZATION_NVP(totalCount);
|
|
51
53
|
ar& BOOST_SERIALIZATION_NVP(freeCount);
|
|
54
|
+
ar& BOOST_SERIALIZATION_NVP(suogu);
|
|
52
55
|
record = hku::StockWeight(hku::Datetime(datetime), countAsGift, countForSell, priceForSell,
|
|
53
|
-
bonus, increasement, totalCount, freeCount);
|
|
56
|
+
bonus, increasement, totalCount, freeCount, suogu);
|
|
54
57
|
}
|
|
55
58
|
} // namespace serialization
|
|
56
59
|
} // namespace boost
|