hikyuu 2.6.8.3__py3-none-manylinux2014_x86_64.whl → 2.6.9__py3-none-manylinux2014_x86_64.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 +5 -12
- hikyuu/__init__.pyi +612 -587
- hikyuu/analysis/__init__.pyi +589 -563
- hikyuu/analysis/analysis.pyi +590 -564
- hikyuu/core.py +2 -0
- hikyuu/core.pyi +591 -565
- hikyuu/cpp/__init__.pyi +2 -2
- hikyuu/cpp/core310.pyi +446 -13
- hikyuu/cpp/core310.so +0 -0
- hikyuu/cpp/core311.pyi +440 -13
- hikyuu/cpp/core311.so +0 -0
- hikyuu/cpp/core312.pyi +440 -13
- hikyuu/cpp/core312.so +0 -0
- hikyuu/cpp/core313.pyi +446 -13
- hikyuu/cpp/core313.so +0 -0
- hikyuu/cpp/i18n/zh_CN/hikyuu.mo +0 -0
- hikyuu/cpp/libboost_charconv-mt.so +0 -0
- hikyuu/cpp/libboost_charconv-mt.so.1.88.0 +0 -0
- hikyuu/cpp/libboost_chrono-mt.so +0 -0
- hikyuu/cpp/libboost_chrono-mt.so.1.88.0 +0 -0
- hikyuu/cpp/libboost_date_time-mt.so +0 -0
- hikyuu/cpp/libboost_date_time-mt.so.1.88.0 +0 -0
- hikyuu/cpp/libboost_serialization-mt.so +0 -0
- hikyuu/cpp/libboost_serialization-mt.so.1.88.0 +0 -0
- hikyuu/cpp/libboost_system-mt.so +0 -0
- hikyuu/cpp/libboost_system-mt.so.1.88.0 +0 -0
- hikyuu/cpp/libboost_thread-mt.so +0 -0
- hikyuu/cpp/libboost_thread-mt.so.1.88.0 +0 -0
- hikyuu/cpp/libboost_wserialization-mt.so +0 -0
- hikyuu/cpp/libboost_wserialization-mt.so.1.88.0 +0 -0
- hikyuu/cpp/libhikyuu.so +0 -0
- hikyuu/cpp/libsqlite3.so +0 -0
- hikyuu/data/clickhouse_upgrade/createdb.sql +105 -105
- hikyuu/data/common.py +3 -3
- hikyuu/data/common_clickhouse.py +1 -1
- hikyuu/data/download_block.py +318 -0
- hikyuu/data/em_block_to_clickhouse.py +26 -74
- hikyuu/data/em_block_to_mysql.py +25 -75
- hikyuu/data/em_block_to_sqlite.py +26 -78
- hikyuu/data/hku_config_template.py +3 -3
- hikyuu/data/pytdx_to_clickhouse.py +15 -11
- hikyuu/data/pytdx_to_h5.py +6 -2
- hikyuu/data/pytdx_to_mysql.py +5 -1
- hikyuu/data/pytdx_weight_to_clickhouse.py +1 -1
- hikyuu/data/pytdx_weight_to_mysql.py +1 -1
- hikyuu/data/pytdx_weight_to_sqlite.py +1 -1
- hikyuu/data/zh_bond10_to_clickhouse.py +1 -1
- hikyuu/draw/drawplot/__init__.pyi +8 -8
- hikyuu/draw/drawplot/bokeh_draw.pyi +603 -578
- hikyuu/draw/drawplot/common.pyi +1 -1
- hikyuu/draw/drawplot/echarts_draw.pyi +605 -580
- hikyuu/draw/drawplot/matplotlib_draw.py +4 -74
- hikyuu/draw/drawplot/matplotlib_draw.pyi +615 -590
- hikyuu/draw/elder.pyi +11 -11
- hikyuu/draw/kaufman.pyi +18 -18
- hikyuu/draw/volume.pyi +10 -10
- hikyuu/examples/notebook/Demo/Demo1.ipynb +48 -33
- hikyuu/extend.pyi +599 -573
- hikyuu/fetcher/stock/zh_block_em.py +50 -18
- hikyuu/gui/HikyuuTDX.py +81 -30
- hikyuu/gui/data/CollectSpotThread.py +1 -1
- hikyuu/gui/data/EscapetimeThread.py +8 -14
- hikyuu/gui/data/ImportBlockInfoTask.py +3 -10
- hikyuu/gui/data/MainWindow.py +1168 -715
- hikyuu/gui/data/SchedImportThread.py +2 -2
- hikyuu/gui/data/UsePytdxImportToH5Thread.py +3 -3
- hikyuu/gui/data/UseQmtImportToH5Thread.py +2 -2
- hikyuu/gui/data/UseTdxImportToH5Thread.py +3 -3
- hikyuu/gui/data/tool.py +32 -25
- hikyuu/gui/dataserver.py +5 -3
- hikyuu/gui/importdata.py +4 -0
- hikyuu/hub.pyi +6 -6
- hikyuu/include/hikyuu/DataType.h +4 -16
- hikyuu/include/hikyuu/KData.h +6 -3
- hikyuu/include/hikyuu/KDataPrivatedBufferImp.h +1 -1
- hikyuu/include/hikyuu/KDataSharedBufferImp.h +1 -1
- hikyuu/include/hikyuu/KQuery.h +2 -2
- hikyuu/include/hikyuu/Stock.h +3 -0
- hikyuu/include/hikyuu/StockManager.h +13 -3
- hikyuu/include/hikyuu/config.h +3 -0
- hikyuu/include/hikyuu/data_driver/BaseInfoDriver.h +8 -0
- hikyuu/include/hikyuu/data_driver/BlockInfoDriver.h +6 -0
- hikyuu/include/hikyuu/data_driver/KDataDriver.h +26 -1
- hikyuu/include/hikyuu/data_driver/base_info/mysql/MySQLBaseInfoDriver.h +1 -1
- hikyuu/include/hikyuu/data_driver/base_info/sqlite/SQLiteBaseInfoDriver.h +1 -1
- hikyuu/include/hikyuu/data_driver/block_info/mysql/MySQLBlockInfoDriver.h +2 -1
- hikyuu/include/hikyuu/data_driver/block_info/qianlong/QLBlockInfoDriver.h +2 -1
- hikyuu/include/hikyuu/data_driver/block_info/sqlite/SQLiteBlockInfoDriver.h +2 -1
- hikyuu/include/hikyuu/data_driver/kdata/DoNothingKDataDriver.h +1 -1
- hikyuu/include/hikyuu/data_driver/kdata/cvs/KDataTempCsvDriver.h +1 -1
- hikyuu/include/hikyuu/data_driver/kdata/hdf5/H5KDataDriver.h +1 -1
- hikyuu/include/hikyuu/data_driver/kdata/mysql/MySQLKDataDriver.h +1 -1
- hikyuu/include/hikyuu/data_driver/kdata/sqlite/SQLiteKDataDriver.h +1 -1
- hikyuu/include/hikyuu/data_driver/kdata/tdx/TdxKDataDriver.h +1 -1
- hikyuu/include/hikyuu/hikyuu.h +1 -1
- hikyuu/include/hikyuu/indicator/build_in.h +1 -0
- hikyuu/include/hikyuu/indicator/crt/CYCLE.h +4 -4
- hikyuu/include/hikyuu/indicator/crt/HSL.h +2 -2
- hikyuu/include/hikyuu/indicator/crt/QUANTILE_TRUNC.h +30 -0
- hikyuu/include/hikyuu/indicator/crt/TURNOVER.h +1 -0
- hikyuu/include/hikyuu/indicator/crt/ZSCORE.h +2 -2
- hikyuu/include/hikyuu/indicator/imp/IQuantileTrunc.h +25 -0
- hikyuu/include/hikyuu/lang.h +15 -2
- hikyuu/include/hikyuu/misc.h +38 -0
- hikyuu/include/hikyuu/plugin/dataserver.h +2 -1
- hikyuu/include/hikyuu/plugin/extind.h +37 -0
- hikyuu/include/hikyuu/plugin/hkuextra.h +0 -18
- hikyuu/include/hikyuu/plugin/hkuviews.h +36 -0
- hikyuu/include/hikyuu/plugin/interface/DataServerPluginInterface.h +2 -2
- hikyuu/include/hikyuu/plugin/interface/ExtendIndicatorsPluginInterface.h +12 -0
- hikyuu/include/hikyuu/plugin/interface/HkuExtraPluginInterface.h +0 -14
- hikyuu/include/hikyuu/plugin/interface/HkuViewsPluginInterface.h +34 -0
- hikyuu/include/hikyuu/plugin/interface/plugins.h +8 -1
- hikyuu/include/hikyuu/python/pybind_utils.h +8 -3
- hikyuu/include/hikyuu/strategy/RunSystemInStrategy.h +3 -0
- hikyuu/include/hikyuu/trade_manage/Performance.h +4 -4
- hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +10 -1
- hikyuu/include/hikyuu/trade_sys/moneymanager/imp/FixedCapitalFundsMM.h +0 -4
- hikyuu/include/hikyuu/trade_sys/multifactor/MultiFactorBase.h +36 -3
- hikyuu/include/hikyuu/trade_sys/multifactor/NormalizeBase.h +125 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/ScoresFilterBase.h +125 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/build_in.h +3 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/buildin_norm.h +36 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/buildin_scfilter.h +51 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/filter/GroupSCFilter.h +24 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/filter/IgnoreLessOrEqualValueSCFilter.h +24 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/filter/IgnoreNanSCFilter.h +24 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/filter/MinAmountPercentSCFilter.h +25 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/filter/PriceSCFilter.h +24 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/filter/TopNSCFilter.h +24 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/filter/__init__.py +1 -0
- 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/multifactor/imp/WeightMultiFactor.h +1 -1
- hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormMinMax.h +23 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormQuantile.h +28 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormQuantileUniform.h +28 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormZScore.h +25 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/normalize/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/normalize/quantile_trunc.h +16 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +7 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/imp/SimplePortfolio.h +7 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/imp/WithoutAFPortfolio.h +7 -0
- hikyuu/include/hikyuu/trade_sys/selector/SelectorBase.h +49 -0
- hikyuu/include/hikyuu/trade_sys/selector/build_in.h +1 -0
- hikyuu/include/hikyuu/trade_sys/selector/crt/SE_MultiFactor2.h +40 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector.h +0 -3
- hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector2.h +49 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorSelector.h +1 -1
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorValueSelector.h +1 -1
- hikyuu/include/hikyuu/trade_sys/signal/imp/BandSignal2.h +0 -4
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/AddValueSignal.h +2 -2
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/DivValueSignal.h +2 -2
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/MulValueSignal.h +2 -2
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorSignal.h +1 -1
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorValueSignal.h +4 -4
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/SubValueSignal.h +2 -2
- hikyuu/include/hikyuu/trade_sys/system/System.h +14 -1
- hikyuu/include/hikyuu/utilities/SpendTimer.h +17 -7
- hikyuu/include/hikyuu/utilities/arithmetic.h +55 -0
- hikyuu/include/hikyuu/utilities/db_connect/mysql/MySQLConnect.h +1 -1
- hikyuu/include/hikyuu/utilities/db_connect/mysql/MySQLStatement.h +1 -1
- hikyuu/include/hikyuu/utilities/db_connect/sqlite/SQLiteConnect.h +1 -1
- hikyuu/include/hikyuu/utilities/db_connect/sqlite/SQLiteStatement.h +1 -1
- hikyuu/include/hikyuu/utilities/plugin/PluginLoader.h +4 -1
- hikyuu/include/hikyuu/version.h +4 -4
- hikyuu/plugin/libbacktest.so +0 -0
- hikyuu/plugin/libclickhousedriver.so +0 -0
- hikyuu/plugin/libdataserver.so +0 -0
- hikyuu/plugin/libdevice.so +0 -0
- hikyuu/plugin/libextind.so +0 -0
- hikyuu/plugin/libhkuextra.so +0 -0
- hikyuu/plugin/libhkuviews.so +0 -0
- hikyuu/plugin/libimport2hdf5.so +0 -0
- hikyuu/plugin/libtmreport.so +0 -0
- hikyuu/trade_manage/__init__.pyi +602 -577
- hikyuu/trade_manage/broker.pyi +3 -3
- hikyuu/trade_manage/broker_easytrader.pyi +1 -1
- hikyuu/trade_manage/trade.pyi +602 -577
- hikyuu/util/__init__.pyi +1 -1
- hikyuu/util/singleton.pyi +1 -1
- {hikyuu-2.6.8.3.dist-info → hikyuu-2.6.9.dist-info}/METADATA +13 -13
- {hikyuu-2.6.8.3.dist-info → hikyuu-2.6.9.dist-info}/RECORD +187 -158
- {hikyuu-2.6.8.3.dist-info → hikyuu-2.6.9.dist-info}/top_level.txt +2 -1
- hikyuu/cpp/core39.pyi +0 -14385
- hikyuu/cpp/core39.so +0 -0
- hikyuu/data_driver/__init__.py +0 -49
- hikyuu/data_driver/jqdata_data_driver.py +0 -277
- hikyuu/data_driver/pytdx_data_driver.py +0 -292
- hikyuu/fetcher/stock/zh_stock_a_huatai.py +0 -51
- hikyuu/fetcher/stock/zh_stock_a_pytdx.py +0 -129
- hikyuu/gui/data/CollectToMemThread.py +0 -123
- hikyuu/gui/data/CollectToMySQLThread.py +0 -178
- hikyuu/gui/start_huatai_insight.py +0 -510
- hikyuu/tools/update_block_info.py +0 -168
- {hikyuu-2.6.8.3.dist-info → hikyuu-2.6.9.dist-info}/WHEEL +0 -0
- {hikyuu-2.6.8.3.dist-info → hikyuu-2.6.9.dist-info}/entry_points.txt +0 -0
|
@@ -28,6 +28,13 @@ public:
|
|
|
28
28
|
SimplePortfolio(const TradeManagerPtr& tm, const SelectorPtr& se, const AFPtr& af);
|
|
29
29
|
virtual ~SimplePortfolio();
|
|
30
30
|
|
|
31
|
+
virtual void _runMomentOnOpen(const Datetime& date, const Datetime& nextCycle,
|
|
32
|
+
bool adjust) override;
|
|
33
|
+
virtual void _runMomentOnClose(const Datetime& date, const Datetime& nextCycle,
|
|
34
|
+
bool adjust) override;
|
|
35
|
+
|
|
36
|
+
virtual json lastSuggestion() const override;
|
|
37
|
+
|
|
31
38
|
private:
|
|
32
39
|
SystemList m_dlist_sys_list; // 因证券退市,无法执行卖出的系统(资产全部损失)
|
|
33
40
|
SystemWeightList m_delay_adjust_sys_list; // 延迟调仓卖出的系统列表
|
|
@@ -25,6 +25,13 @@ public:
|
|
|
25
25
|
WithoutAFPortfolio(const TradeManagerPtr& tm, const SelectorPtr& se);
|
|
26
26
|
virtual ~WithoutAFPortfolio();
|
|
27
27
|
|
|
28
|
+
virtual void _runMomentOnOpen(const Datetime& date, const Datetime& nextCycle,
|
|
29
|
+
bool adjust) override;
|
|
30
|
+
virtual void _runMomentOnClose(const Datetime& date, const Datetime& nextCycle,
|
|
31
|
+
bool adjust) override;
|
|
32
|
+
|
|
33
|
+
virtual json lastSuggestion() const override;
|
|
34
|
+
|
|
28
35
|
private:
|
|
29
36
|
void initParam();
|
|
30
37
|
void _runMomentWithoutAFNotForceSell(const Datetime& date, const Datetime& nextCycle,
|
|
@@ -13,10 +13,13 @@
|
|
|
13
13
|
#include "../../KData.h"
|
|
14
14
|
#include "../../utilities/Parameter.h"
|
|
15
15
|
#include "hikyuu/trade_sys/allocatefunds/AllocateFundsBase.h"
|
|
16
|
+
#include "hikyuu/trade_sys/multifactor/MultiFactorBase.h"
|
|
16
17
|
#include "SystemWeight.h"
|
|
17
18
|
|
|
18
19
|
namespace hku {
|
|
19
20
|
|
|
21
|
+
class HKU_API Portfolio;
|
|
22
|
+
|
|
20
23
|
/**
|
|
21
24
|
* 交易对象选择模块
|
|
22
25
|
* @ingroup Selector
|
|
@@ -44,6 +47,15 @@ public:
|
|
|
44
47
|
/** 设置算法名称 */
|
|
45
48
|
void name(const string& name);
|
|
46
49
|
|
|
50
|
+
using PFPtr = shared_ptr<Portfolio>;
|
|
51
|
+
PFPtr getPF() const {
|
|
52
|
+
return m_pf.lock();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
void setPF(const PFPtr& pf) {
|
|
56
|
+
m_pf = pf;
|
|
57
|
+
}
|
|
58
|
+
|
|
47
59
|
/**
|
|
48
60
|
* 添加备选股票及其交易策略原型
|
|
49
61
|
* @param stock 备选股票
|
|
@@ -132,6 +144,25 @@ public:
|
|
|
132
144
|
|
|
133
145
|
virtual string str() const;
|
|
134
146
|
|
|
147
|
+
public:
|
|
148
|
+
//------------------------------------------------------------------------
|
|
149
|
+
// 和 MF 相关的 Selector 才有用,放在这里主要为了 SEPtr 可以直接获取 MF 相关信息
|
|
150
|
+
// 非 MF 相关的 Selecter 无用
|
|
151
|
+
//------------------------------------------------------------------------
|
|
152
|
+
MFPtr getMF() const {
|
|
153
|
+
return m_mf;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
ScoresFilterPtr getScoresFilter() const {
|
|
157
|
+
return m_sc_filter;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** 设置截面评分记录过滤,仅用于 MF 相关的 Selector,从 MF 获取 Score 列表时进行过滤 */
|
|
161
|
+
void setScoresFilter(const ScoresFilterPtr& filter);
|
|
162
|
+
|
|
163
|
+
/** 在已有过滤基础上追加过滤,仅用于 MF 相关的 Selector,从 MF 获取 Score 列表时进行过滤 */
|
|
164
|
+
void addScoresFilter(const ScoresFilterPtr& filter);
|
|
165
|
+
|
|
135
166
|
protected:
|
|
136
167
|
virtual bool isPythonObject() const {
|
|
137
168
|
return false;
|
|
@@ -140,6 +171,10 @@ protected:
|
|
|
140
171
|
private:
|
|
141
172
|
void initParam();
|
|
142
173
|
|
|
174
|
+
protected:
|
|
175
|
+
ScoresFilterPtr m_sc_filter;
|
|
176
|
+
MFPtr m_mf;
|
|
177
|
+
|
|
143
178
|
protected:
|
|
144
179
|
string m_name;
|
|
145
180
|
bool m_calculated{false}; // 是否已计算过
|
|
@@ -150,6 +185,8 @@ protected:
|
|
|
150
185
|
SystemList m_pro_sys_list; // 原型系统列表
|
|
151
186
|
SystemList m_real_sys_list; // PF组合中实际运行的系统,有PF执行时设定,顺序与原型列表一一对应
|
|
152
187
|
|
|
188
|
+
std::weak_ptr<Portfolio> m_pf; // 仅存储不序列化,对 PF 的引用
|
|
189
|
+
|
|
153
190
|
//============================================
|
|
154
191
|
// 序列化支持
|
|
155
192
|
//============================================
|
|
@@ -161,6 +198,8 @@ private:
|
|
|
161
198
|
ar& BOOST_SERIALIZATION_NVP(m_name);
|
|
162
199
|
ar& BOOST_SERIALIZATION_NVP(m_params);
|
|
163
200
|
ar& BOOST_SERIALIZATION_NVP(m_pro_sys_list);
|
|
201
|
+
ar& BOOST_SERIALIZATION_NVP(m_sc_filter);
|
|
202
|
+
ar& BOOST_SERIALIZATION_NVP(m_mf);
|
|
164
203
|
}
|
|
165
204
|
|
|
166
205
|
template <class Archive>
|
|
@@ -168,6 +207,8 @@ private:
|
|
|
168
207
|
ar& BOOST_SERIALIZATION_NVP(m_name);
|
|
169
208
|
ar& BOOST_SERIALIZATION_NVP(m_params);
|
|
170
209
|
ar& BOOST_SERIALIZATION_NVP(m_pro_sys_list);
|
|
210
|
+
ar& BOOST_SERIALIZATION_NVP(m_sc_filter);
|
|
211
|
+
ar& BOOST_SERIALIZATION_NVP(m_mf);
|
|
171
212
|
}
|
|
172
213
|
|
|
173
214
|
BOOST_SERIALIZATION_SPLIT_MEMBER()
|
|
@@ -238,6 +279,14 @@ inline const SystemList& SelectorBase::getProtoSystemList() const {
|
|
|
238
279
|
return m_pro_sys_list;
|
|
239
280
|
}
|
|
240
281
|
|
|
282
|
+
inline void SelectorBase::setScoresFilter(const ScoresFilterPtr& filter) {
|
|
283
|
+
m_sc_filter = filter;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
inline void SelectorBase::addScoresFilter(const ScoresFilterPtr& filter) {
|
|
287
|
+
m_sc_filter = m_sc_filter | filter;
|
|
288
|
+
}
|
|
289
|
+
|
|
241
290
|
} /* namespace hku */
|
|
242
291
|
|
|
243
292
|
#if FMT_VERSION >= 90000
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2024-03-30
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "hikyuu/trade_sys/multifactor/MultiFactorBase.h"
|
|
11
|
+
#include "hikyuu/trade_sys/multifactor/buildin_scfilter.h"
|
|
12
|
+
#include "../SelectorBase.h"
|
|
13
|
+
|
|
14
|
+
namespace hku {
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 基于 MultiFactor 选股算法
|
|
18
|
+
* @return SelectorPtr
|
|
19
|
+
* @ingroup Selector
|
|
20
|
+
*/
|
|
21
|
+
SelectorPtr HKU_API SE_MultiFactor2(const MFPtr& mf,
|
|
22
|
+
const ScoresFilterPtr& filter = SCFilter_IgnoreNan());
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 基于 MultiFactor 选股算法
|
|
26
|
+
* @param src_inds 原始因子公式
|
|
27
|
+
* @param ic_n ic 对应的 ic_n 日收益率
|
|
28
|
+
* @param ic_rolling_n 计算滚动 IC (即 IC 的 n 日移动平均)周期
|
|
29
|
+
* @param ref_stk 参照对比证券,未指定时,默认使用 sh000300 沪深300指数
|
|
30
|
+
* @param spearman 默认使用 spearman 计算相关系数,否则为 pearson
|
|
31
|
+
* @param mode "MF_ICIRWeight" | "MF_ICWeight" | "MF_EqualWeight" 因子合成算法名称
|
|
32
|
+
* @return SelectorPtr
|
|
33
|
+
* @ingroup Selector
|
|
34
|
+
*/
|
|
35
|
+
SelectorPtr HKU_API SE_MultiFactor2(const IndicatorList& src_inds, int ic_n = 5,
|
|
36
|
+
int ic_rolling_n = 120, const Stock& ref_stk = Stock(),
|
|
37
|
+
bool spearman = true, const string& mode = "MF_ICIRWeight",
|
|
38
|
+
const ScoresFilterPtr& filter = SCFilter_IgnoreNan());
|
|
39
|
+
|
|
40
|
+
} // namespace hku
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
|
-
#include "hikyuu/trade_sys/multifactor/MultiFactorBase.h"
|
|
11
10
|
#include "../SelectorBase.h"
|
|
12
11
|
|
|
13
12
|
namespace hku {
|
|
@@ -39,7 +38,6 @@ private:
|
|
|
39
38
|
|
|
40
39
|
private:
|
|
41
40
|
IndicatorList m_inds;
|
|
42
|
-
MFPtr m_mf;
|
|
43
41
|
unordered_map<Stock, SYSPtr> m_stk_sys_dict;
|
|
44
42
|
|
|
45
43
|
//============================================
|
|
@@ -51,7 +49,6 @@ private:
|
|
|
51
49
|
void serialize(Archive& ar, const unsigned int version) {
|
|
52
50
|
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(SelectorBase);
|
|
53
51
|
ar& BOOST_SERIALIZATION_NVP(m_inds);
|
|
54
|
-
ar& BOOST_SERIALIZATION_NVP(m_mf);
|
|
55
52
|
}
|
|
56
53
|
#endif
|
|
57
54
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2024-xx-xx
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../SelectorBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class MultiFactorSelector2 : public SelectorBase {
|
|
15
|
+
public:
|
|
16
|
+
MultiFactorSelector2();
|
|
17
|
+
MultiFactorSelector2(const MFPtr& mf);
|
|
18
|
+
virtual ~MultiFactorSelector2();
|
|
19
|
+
|
|
20
|
+
virtual void _checkParam(const string& name) const override;
|
|
21
|
+
virtual void _reset() override;
|
|
22
|
+
virtual SelectorPtr _clone() override;
|
|
23
|
+
virtual SystemWeightList _getSelected(Datetime date) override;
|
|
24
|
+
virtual bool isMatchAF(const AFPtr& af) override;
|
|
25
|
+
virtual void _calculate() override;
|
|
26
|
+
|
|
27
|
+
void setIndicators(const IndicatorList& inds) {
|
|
28
|
+
HKU_ASSERT(!inds.empty());
|
|
29
|
+
m_inds = inds;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private:
|
|
33
|
+
IndicatorList m_inds;
|
|
34
|
+
unordered_map<Stock, SYSPtr> m_stk_sys_dict;
|
|
35
|
+
|
|
36
|
+
//============================================
|
|
37
|
+
// 序列化支持
|
|
38
|
+
//============================================
|
|
39
|
+
#if HKU_SUPPORT_SERIALIZATION
|
|
40
|
+
friend class boost::serialization::access;
|
|
41
|
+
template <class Archive>
|
|
42
|
+
void serialize(Archive& ar, const unsigned int version) {
|
|
43
|
+
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(SelectorBase);
|
|
44
|
+
ar& BOOST_SERIALIZATION_NVP(m_inds);
|
|
45
|
+
}
|
|
46
|
+
#endif
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
} // namespace hku
|
|
@@ -85,7 +85,7 @@ public: \
|
|
|
85
85
|
classname() : OperatorSelector(name) {} \
|
|
86
86
|
classname(const SelectorPtr& se1, const SelectorPtr& se2) \
|
|
87
87
|
: OperatorSelector(name, se1, se2) {} \
|
|
88
|
-
virtual ~classname() {}
|
|
88
|
+
virtual ~classname() override {} \
|
|
89
89
|
\
|
|
90
90
|
virtual SystemWeightList _getSelected(Datetime date) override; \
|
|
91
91
|
\
|
|
@@ -66,7 +66,7 @@ private:
|
|
|
66
66
|
public: \
|
|
67
67
|
classname() : OperatorValueSelector(name) {} \
|
|
68
68
|
classname(const SelectorPtr& se, double value) : OperatorValueSelector(name, se, value) {} \
|
|
69
|
-
virtual ~classname() {}
|
|
69
|
+
virtual ~classname() override {} \
|
|
70
70
|
\
|
|
71
71
|
virtual SystemWeightList _getSelected(Datetime date) override; \
|
|
72
72
|
\
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
9
|
-
#ifndef TRADE_SYS_SIGNAL_IMP_BANDSIGNAL_H_
|
|
10
|
-
#define TRADE_SYS_SIGNAL_IMP_BANDSIGNAL_H_
|
|
11
9
|
|
|
12
10
|
#include "../../../indicator/Indicator.h"
|
|
13
11
|
#include "../SignalBase.h"
|
|
@@ -43,5 +41,3 @@ private:
|
|
|
43
41
|
#endif
|
|
44
42
|
};
|
|
45
43
|
} // namespace hku
|
|
46
|
-
|
|
47
|
-
#endif
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
namespace hku {
|
|
13
13
|
|
|
14
14
|
class AddValueSignal : public OperatorValueSignal {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
OPERATOR_VALUE_SIGNAL_IMP(AddValueSignal, "SG_AddValue")
|
|
16
|
+
OPERATOR_VALUE_SIGNAL_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
} /* namespace hku */
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
namespace hku {
|
|
13
13
|
|
|
14
14
|
class DivValueSignal : public OperatorValueSignal {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
OPERATOR_VALUE_SIGNAL_IMP(DivValueSignal, "SG_DivValue")
|
|
16
|
+
OPERATOR_VALUE_SIGNAL_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
17
|
|
|
18
18
|
public:
|
|
19
19
|
DivValueSignal(double value, const SignalPtr& sg);
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
namespace hku {
|
|
13
13
|
|
|
14
14
|
class MulValueSignal : public OperatorValueSignal {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
OPERATOR_VALUE_SIGNAL_IMP(MulValueSignal, "SG_MulValue")
|
|
16
|
+
OPERATOR_VALUE_SIGNAL_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
} /* namespace hku */
|
|
@@ -48,7 +48,7 @@ protected:
|
|
|
48
48
|
public: \
|
|
49
49
|
classname() : OperatorSignal(name) {} \
|
|
50
50
|
classname(const SignalPtr& sg1, const SignalPtr& sg2) : OperatorSignal(name, sg1, sg2) {} \
|
|
51
|
-
virtual ~classname() {}
|
|
51
|
+
virtual ~classname() override {} \
|
|
52
52
|
virtual SignalPtr _clone() override { \
|
|
53
53
|
return make_shared<classname>(m_sg1, m_sg2); \
|
|
54
54
|
} \
|
|
@@ -42,18 +42,18 @@ protected:
|
|
|
42
42
|
#endif
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
#define
|
|
45
|
+
#define OPERATOR_VALUE_SIGNAL_IMP(classname, name) \
|
|
46
46
|
public: \
|
|
47
47
|
classname() : OperatorValueSignal(name) {} \
|
|
48
48
|
classname(const SignalPtr& sg, double value) : OperatorValueSignal(name, sg, value) {} \
|
|
49
|
-
virtual ~classname() {}
|
|
49
|
+
virtual ~classname() override {} \
|
|
50
50
|
virtual SignalPtr _clone() override { \
|
|
51
51
|
return make_shared<classname>(m_sg, m_value); \
|
|
52
52
|
} \
|
|
53
53
|
virtual void _calculate(const KData&) override;
|
|
54
54
|
|
|
55
55
|
#if HKU_SUPPORT_SERIALIZATION
|
|
56
|
-
#define
|
|
56
|
+
#define OPERATOR_VALUE_SIGNAL_NO_PRIVATE_MEMBER_SERIALIZATION \
|
|
57
57
|
private: \
|
|
58
58
|
friend class boost::serialization::access; \
|
|
59
59
|
template <class Archive> \
|
|
@@ -62,7 +62,7 @@ private: \
|
|
|
62
62
|
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(OperatorValueSignal); \
|
|
63
63
|
}
|
|
64
64
|
#else
|
|
65
|
-
#define
|
|
65
|
+
#define OPERATOR_VALUE_SIGNAL_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
66
66
|
#endif
|
|
67
67
|
|
|
68
68
|
} /* namespace hku */
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
namespace hku {
|
|
13
13
|
|
|
14
14
|
class SubValueSignal : public OperatorValueSignal {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
OPERATOR_VALUE_SIGNAL_IMP(SubValueSignal, "SG_AddValue")
|
|
16
|
+
OPERATOR_VALUE_SIGNAL_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
17
|
|
|
18
18
|
public:
|
|
19
19
|
SubValueSignal(double value, const SignalPtr& sg);
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
#ifndef SYSTEMBASE_H_
|
|
10
10
|
#define SYSTEMBASE_H_
|
|
11
11
|
|
|
12
|
+
#include <nlohmann/json.hpp>
|
|
12
13
|
// #include "../../KData.h"
|
|
13
14
|
// #include "../../utilities/Parameter.h"
|
|
14
15
|
// #include "../../trade_manage/TradeManager.h"
|
|
@@ -25,6 +26,8 @@
|
|
|
25
26
|
|
|
26
27
|
namespace hku {
|
|
27
28
|
|
|
29
|
+
using json = nlohmann::json;
|
|
30
|
+
|
|
28
31
|
class HKU_API Portfolio;
|
|
29
32
|
class HKU_API AllocateFundsBase;
|
|
30
33
|
class HKU_API WalkForwardSystem;
|
|
@@ -180,6 +183,11 @@ public:
|
|
|
180
183
|
*/
|
|
181
184
|
void setTO(const KData& kdata);
|
|
182
185
|
|
|
186
|
+
/**
|
|
187
|
+
* 回测完成后,返回最后一天交易记录,以及需要延迟的买入和卖出延迟请求
|
|
188
|
+
*/
|
|
189
|
+
json lastSuggestion() const;
|
|
190
|
+
|
|
183
191
|
/**
|
|
184
192
|
* @brief 不指定stock的方式下run,需要事先通过setStock设定stock
|
|
185
193
|
* @param query 查询条件
|
|
@@ -212,6 +220,9 @@ public:
|
|
|
212
220
|
*/
|
|
213
221
|
virtual TradeRecord runMoment(const Datetime& datetime);
|
|
214
222
|
|
|
223
|
+
virtual TradeRecord runMomentOnOpen(const Datetime& datetime);
|
|
224
|
+
virtual TradeRecord runMomentOnClose(const Datetime& datetime);
|
|
225
|
+
|
|
215
226
|
// 运行前准备工作, 失败将抛出异常
|
|
216
227
|
virtual void readyForRun();
|
|
217
228
|
|
|
@@ -318,7 +329,9 @@ private:
|
|
|
318
329
|
|
|
319
330
|
TradeRecord _processRequest(const KRecord& today, const KRecord& src_today);
|
|
320
331
|
|
|
321
|
-
TradeRecord _runMoment(const KRecord&
|
|
332
|
+
TradeRecord _runMoment(const KRecord& today, const KRecord& src_today);
|
|
333
|
+
TradeRecord _runMomentOnOpen(const KRecord& today, const KRecord& src_today);
|
|
334
|
+
TradeRecord _runMomentOnClose(const KRecord& today, const KRecord& src_today);
|
|
322
335
|
|
|
323
336
|
// Portfolio | AllocateFunds 指示立即进行强制卖出,以便对 buy_delay 的系统进行资金调整
|
|
324
337
|
TradeRecord _sellForce(const Datetime& date, double num, Part from, bool on_open);
|
|
@@ -34,6 +34,15 @@
|
|
|
34
34
|
#include <TargetConditionals.h>
|
|
35
35
|
#endif
|
|
36
36
|
|
|
37
|
+
#ifdef _WIN32
|
|
38
|
+
#include <shlwapi.h>
|
|
39
|
+
#pragma comment(lib, "shlwapi.lib") // Windows 链接时需要的库
|
|
40
|
+
#define GET_FILENAME(path) PathFindFileNameA(path)
|
|
41
|
+
#else
|
|
42
|
+
#include <libgen.h>
|
|
43
|
+
#define GET_FILENAME(path) basename((char *)path)
|
|
44
|
+
#endif
|
|
45
|
+
|
|
37
46
|
#ifndef HKU_CLOSE_SPEND_TIME
|
|
38
47
|
#define HKU_CLOSE_SPEND_TIME 1
|
|
39
48
|
#endif
|
|
@@ -81,7 +90,7 @@ namespace hku {
|
|
|
81
90
|
* 代码执行耗时计时器
|
|
82
91
|
* @param id 自定义耗时计时器id
|
|
83
92
|
*/
|
|
84
|
-
#define SPEND_TIME(id) hku::SpendTimer test_spend_timer_##id(#id, __FILE__, __LINE__);
|
|
93
|
+
#define SPEND_TIME(id) hku::SpendTimer test_spend_timer_##id(#id, GET_FILENAME(__FILE__), __LINE__);
|
|
85
94
|
|
|
86
95
|
/**
|
|
87
96
|
* 代码执行耗时计时器,附带输出信息
|
|
@@ -90,7 +99,7 @@ namespace hku {
|
|
|
90
99
|
*/
|
|
91
100
|
#define SPEND_TIME_MSG(id, ...) \
|
|
92
101
|
std::string msg_##id(fmt::format(__VA_ARGS__)); \
|
|
93
|
-
hku::SpendTimer test_spend_timer_##id(#id, msg_##id.c_str(), __FILE__, __LINE__);
|
|
102
|
+
hku::SpendTimer test_spend_timer_##id(#id, msg_##id.c_str(), GET_FILENAME(__FILE__), __LINE__);
|
|
94
103
|
|
|
95
104
|
/** 秒表计时 */
|
|
96
105
|
#define SPEND_TIME_KEEP(id, ...) test_spend_timer_##id.keep(fmt::format(__VA_ARGS__));
|
|
@@ -117,8 +126,8 @@ namespace hku {
|
|
|
117
126
|
* @param id 自定义耗时计时器id
|
|
118
127
|
* @param cycle 循环运行的次数(仅用于统计打印耗时输出)
|
|
119
128
|
*/
|
|
120
|
-
#define BENCHMARK_TIME(id, cycle)
|
|
121
|
-
hku::SpendTimer test_spend_timer_##id(#id, __FILE__, __LINE__); \
|
|
129
|
+
#define BENCHMARK_TIME(id, cycle) \
|
|
130
|
+
hku::SpendTimer test_spend_timer_##id(#id, GET_FILENAME(__FILE__), __LINE__); \
|
|
122
131
|
test_spend_timer_##id.setCycle(cycle);
|
|
123
132
|
|
|
124
133
|
/**
|
|
@@ -127,9 +136,10 @@ namespace hku {
|
|
|
127
136
|
* @param cycle 循环运行的次数(仅用于统计打印耗时输出)
|
|
128
137
|
* @param ... 输出信息
|
|
129
138
|
*/
|
|
130
|
-
#define BENCHMARK_TIME_MSG(id, cycle, ...)
|
|
131
|
-
std::string msg_##id(fmt::format(__VA_ARGS__));
|
|
132
|
-
hku::SpendTimer test_spend_timer_##id(#id, msg_##id.c_str(), __FILE__,
|
|
139
|
+
#define BENCHMARK_TIME_MSG(id, cycle, ...) \
|
|
140
|
+
std::string msg_##id(fmt::format(__VA_ARGS__)); \
|
|
141
|
+
hku::SpendTimer test_spend_timer_##id(#id, msg_##id.c_str(), GET_FILENAME(__FILE__), \
|
|
142
|
+
__LINE__); \
|
|
133
143
|
test_spend_timer_##id.setCycle(cycle);
|
|
134
144
|
|
|
135
145
|
#endif /* HKU_CLOSE_SPEND_TIME */
|
|
@@ -120,6 +120,11 @@ ValueT roundEx(ValueT number, int ndigits = 0) {
|
|
|
120
120
|
return static_cast<ValueT>(std::ceil(number * factor - 0.5 - epsilon) / factor);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
extern template double HKU_UTILS_API roundEx(double number, int ndigits);
|
|
124
|
+
|
|
125
|
+
template <>
|
|
126
|
+
float HKU_UTILS_API roundEx(float number, int ndigits);
|
|
127
|
+
|
|
123
128
|
/**
|
|
124
129
|
* 向上截取,如10.1截取后为11
|
|
125
130
|
* @param number 待处理数据
|
|
@@ -194,6 +199,11 @@ ValueT roundDown(ValueT number, int ndigits = 0) {
|
|
|
194
199
|
return number;
|
|
195
200
|
}
|
|
196
201
|
|
|
202
|
+
extern template double HKU_UTILS_API roundUp(double number, int ndigits);
|
|
203
|
+
extern template float HKU_UTILS_API roundUp(float number, int ndigits);
|
|
204
|
+
extern template double HKU_UTILS_API roundDown(double number, int ndigits);
|
|
205
|
+
extern template float HKU_UTILS_API roundDown(float number, int ndigits);
|
|
206
|
+
|
|
197
207
|
#if defined(_MSC_VER)
|
|
198
208
|
#pragma warning(pop)
|
|
199
209
|
#endif
|
|
@@ -405,6 +415,51 @@ inline std::string byteToHexStrForPrint(const std::string &bytes) {
|
|
|
405
415
|
return byteToHexStrForPrint(bytes.c_str(), bytes.size());
|
|
406
416
|
}
|
|
407
417
|
|
|
418
|
+
/** 判断 double 是否为整数 */
|
|
419
|
+
bool HKU_UTILS_API isInteger(double num);
|
|
420
|
+
|
|
421
|
+
/** 判断 float 是否为整数 */
|
|
422
|
+
bool HKU_UTILS_API isInteger(float num);
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* @brief 获取已排序的向量中指定分位数的值
|
|
426
|
+
* @param vec 已排序的数组
|
|
427
|
+
* @param quantile
|
|
428
|
+
* @return Indicator::value_t
|
|
429
|
+
*/
|
|
430
|
+
template <typename T>
|
|
431
|
+
T get_quantile(const std::vector<T> &vec, double quantile) {
|
|
432
|
+
if (vec.empty()) {
|
|
433
|
+
return std::numeric_limits<T>::quiet_NaN();
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
if (quantile <= 0.0) {
|
|
437
|
+
return vec.front();
|
|
438
|
+
} else if (quantile >= 1.0) {
|
|
439
|
+
return vec.back();
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
T ret;
|
|
443
|
+
double qpos = vec.size() * quantile;
|
|
444
|
+
if (qpos <= 1.0) {
|
|
445
|
+
ret = vec[0];
|
|
446
|
+
} else if (isInteger(qpos)) {
|
|
447
|
+
size_t pos = static_cast<size_t>(qpos);
|
|
448
|
+
ret = (vec[pos - 1] + vec[pos]) / 2;
|
|
449
|
+
} else {
|
|
450
|
+
size_t pos = static_cast<size_t>(qpos);
|
|
451
|
+
T x = qpos - pos;
|
|
452
|
+
ret = vec[pos - 1] + x * (vec[pos] - vec[pos - 1]);
|
|
453
|
+
}
|
|
454
|
+
return ret;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
extern template double HKU_UTILS_API get_quantile(const std::vector<double> &vec, double quantile);
|
|
458
|
+
extern template float HKU_UTILS_API get_quantile(const std::vector<float> &vec, double quantile);
|
|
459
|
+
|
|
460
|
+
HKU_UTILS_API std::ostream &operator<<(std::ostream &os, const std::vector<double> &p);
|
|
461
|
+
HKU_UTILS_API std::ostream &operator<<(std::ostream &os, const std::vector<float> &p);
|
|
462
|
+
|
|
408
463
|
/** @} */
|
|
409
464
|
} /* namespace hku */
|
|
410
465
|
|
|
@@ -25,7 +25,7 @@ namespace hku {
|
|
|
25
25
|
class HKU_UTILS_API MySQLConnect : public DBConnectBase {
|
|
26
26
|
public:
|
|
27
27
|
explicit MySQLConnect(const Parameter ¶m);
|
|
28
|
-
virtual ~MySQLConnect();
|
|
28
|
+
virtual ~MySQLConnect() override;
|
|
29
29
|
|
|
30
30
|
MySQLConnect(const MySQLConnect &) = delete;
|
|
31
31
|
MySQLConnect &operator=(const MySQLConnect &) = delete;
|
|
@@ -36,7 +36,7 @@ class HKU_UTILS_API MySQLStatement : public SQLStatementBase {
|
|
|
36
36
|
public:
|
|
37
37
|
MySQLStatement() = delete;
|
|
38
38
|
MySQLStatement(DBConnectBase *driver, const std::string &sql_statement);
|
|
39
|
-
virtual ~MySQLStatement();
|
|
39
|
+
virtual ~MySQLStatement() override;
|
|
40
40
|
|
|
41
41
|
virtual void sub_exec() override;
|
|
42
42
|
virtual bool sub_moveNext() override;
|
|
@@ -51,10 +51,13 @@ public:
|
|
|
51
51
|
|
|
52
52
|
#if HKU_OS_WINDOWS
|
|
53
53
|
m_handle = LoadLibrary(HKU_PATH(filename).c_str());
|
|
54
|
+
HKU_WARN_IF_RETURN(!m_handle, false, "load plugin({}) failed! errcode: {}", filename,
|
|
55
|
+
GetLastError());
|
|
56
|
+
|
|
54
57
|
#else
|
|
55
58
|
m_handle = dlopen(filename.c_str(), RTLD_LAZY);
|
|
59
|
+
HKU_WARN_IF_RETURN(!m_handle, false, "load plugin({}) failed! {}", filename, dlerror());
|
|
56
60
|
#endif
|
|
57
|
-
HKU_WARN_IF_RETURN(!m_handle, false, "load plugin({}) failed!", filename);
|
|
58
61
|
|
|
59
62
|
typedef PluginBase* (*CreateFunction)();
|
|
60
63
|
CreateFunction createFunction =
|
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.6.
|
|
15
|
+
#define HKU_VERSION "2.6.9"
|
|
16
16
|
#define HKU_VERSION_MAJOR 2
|
|
17
17
|
#define HKU_VERSION_MINOR 6
|
|
18
|
-
#define HKU_VERSION_ALTER
|
|
19
|
-
#define HKU_VERSION_BUILD
|
|
18
|
+
#define HKU_VERSION_ALTER 9
|
|
19
|
+
#define HKU_VERSION_BUILD 202510192244
|
|
20
20
|
#define HKU_VERSION_MODE "RELEASE"
|
|
21
|
-
#define HKU_VERSION_GIT "2.6.
|
|
21
|
+
#define HKU_VERSION_GIT "2.6.9 release.ee4977f1 (RELEASE)"
|
|
22
22
|
// clang-format on
|
|
23
23
|
|
|
24
24
|
#endif /* HKU_VERSION_H */
|
hikyuu/plugin/libbacktest.so
CHANGED
|
Binary file
|
|
Binary file
|
hikyuu/plugin/libdataserver.so
CHANGED
|
Binary file
|
hikyuu/plugin/libdevice.so
CHANGED
|
Binary file
|
hikyuu/plugin/libextind.so
CHANGED
|
Binary file
|
hikyuu/plugin/libhkuextra.so
CHANGED
|
Binary file
|
|
Binary file
|
hikyuu/plugin/libimport2hdf5.so
CHANGED
|
Binary file
|