hikyuu 2.7.3__py3-none-win_amd64.whl → 2.7.6__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hikyuu/__init__.py +3 -1
- hikyuu/__init__.pyi +11 -10
- hikyuu/analysis/__init__.pyi +1 -0
- hikyuu/analysis/analysis.pyi +2 -1
- hikyuu/core.pyi +3 -2
- hikyuu/cpp/core310.pyd +0 -0
- hikyuu/cpp/core310.pyi +80 -46
- hikyuu/cpp/core311.pyd +0 -0
- hikyuu/cpp/core311.pyi +80 -46
- hikyuu/cpp/core312.pyd +0 -0
- hikyuu/cpp/core312.pyi +80 -46
- hikyuu/cpp/core313.pyd +0 -0
- hikyuu/cpp/core313.pyi +80 -46
- hikyuu/cpp/hikyuu.dll +0 -0
- hikyuu/cpp/hikyuu.lib +0 -0
- hikyuu/cpp/mimalloc-redirect.dll +0 -0
- hikyuu/cpp/mimalloc.dll +0 -0
- hikyuu/data/clickhouse_upgrade/0002.sql +9 -0
- hikyuu/data/common_mysql.py +1 -1
- hikyuu/data/em_block_to_mysql.py +16 -4
- hikyuu/data/em_block_to_sqlite.py +16 -4
- hikyuu/data/hku_config_template.py +1 -1
- hikyuu/data/mysql_upgrade/0030.sql +3 -0
- hikyuu/data/pytdx_to_h5.py +2 -2
- hikyuu/data/pytdx_to_mysql.py +5 -5
- hikyuu/data/sqlite_upgrade/0030.sql +5 -0
- hikyuu/draw/__init__.pyi +1 -1
- hikyuu/draw/drawplot/__init__.pyi +1 -1
- hikyuu/draw/drawplot/bokeh_draw.pyi +6 -5
- hikyuu/draw/drawplot/echarts_draw.pyi +6 -5
- hikyuu/draw/drawplot/matplotlib_draw.py +19 -11
- hikyuu/draw/drawplot/matplotlib_draw.pyi +6 -5
- hikyuu/examples/notebook/001-overview.ipynb +112 -78
- hikyuu/examples/notebook/004-IndicatorOverview.ipynb +52 -65
- hikyuu/examples/notebook/006-TradeManager.ipynb +402 -291
- hikyuu/examples/notebook/008-Pickle.ipynb +25 -17
- hikyuu/examples/notebook/009-RealData.ipynb +36 -38
- hikyuu/examples/notebook/Demo/Demo2.ipynb +146 -116
- hikyuu/extend.pyi +3 -2
- hikyuu/gui/data/UseTdxImportToH5Thread.py +4 -2
- hikyuu/gui/start_qmt.py +1 -1
- hikyuu/hub.pyi +6 -6
- hikyuu/include/hikyuu/Block.h +9 -9
- hikyuu/include/hikyuu/HistoryFinanceInfo.h +3 -3
- hikyuu/include/hikyuu/KData.h +51 -28
- hikyuu/include/hikyuu/KDataImp.h +12 -7
- hikyuu/include/hikyuu/KDataPrivatedBufferImp.h +13 -7
- hikyuu/include/hikyuu/KDataSharedBufferImp.h +8 -6
- hikyuu/include/hikyuu/KQuery.h +11 -11
- hikyuu/include/hikyuu/KRecord.h +1 -1
- hikyuu/include/hikyuu/MarketInfo.h +10 -10
- hikyuu/include/hikyuu/Stock.h +30 -30
- hikyuu/include/hikyuu/StockManager.h +11 -10
- hikyuu/include/hikyuu/StockTypeInfo.h +9 -9
- hikyuu/include/hikyuu/StockWeight.h +9 -9
- hikyuu/include/hikyuu/TimeLineRecord.h +1 -1
- hikyuu/include/hikyuu/TransRecord.h +1 -1
- hikyuu/include/hikyuu/data_driver/BlockInfoDriver.h +6 -0
- hikyuu/include/hikyuu/data_driver/KDataDriver.h +4 -3
- hikyuu/include/hikyuu/indicator/IndParam.h +1 -1
- hikyuu/include/hikyuu/indicator/Indicator.h +56 -27
- hikyuu/include/hikyuu/indicator/Indicator2InImp.h +0 -4
- hikyuu/include/hikyuu/indicator/IndicatorImp.h +146 -73
- hikyuu/include/hikyuu/indicator/crt/CONTEXT.h +11 -1
- hikyuu/include/hikyuu/indicator/crt/IC.h +19 -14
- hikyuu/include/hikyuu/indicator/crt/ICIR.h +4 -7
- hikyuu/include/hikyuu/indicator/imp/IAbs.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IAcos.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IAd.h +0 -2
- hikyuu/include/hikyuu/indicator/imp/IAdvance.h +3 -0
- hikyuu/include/hikyuu/indicator/imp/IAma.h +3 -0
- hikyuu/include/hikyuu/indicator/imp/IAsin.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IAtan.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IAtr.h +2 -3
- hikyuu/include/hikyuu/indicator/imp/IBackset.h +2 -4
- hikyuu/include/hikyuu/indicator/imp/IBlockSetNum.h +3 -0
- hikyuu/include/hikyuu/indicator/imp/ICeil.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IContext.h +0 -3
- hikyuu/include/hikyuu/indicator/imp/ICorr.h +3 -0
- hikyuu/include/hikyuu/indicator/imp/ICos.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/ICost.h +0 -2
- hikyuu/include/hikyuu/indicator/imp/ICount.h +2 -1
- hikyuu/include/hikyuu/indicator/imp/ICval.h +1 -4
- hikyuu/include/hikyuu/indicator/imp/ICycle.h +0 -2
- hikyuu/include/hikyuu/indicator/imp/IDecline.h +3 -0
- hikyuu/include/hikyuu/indicator/imp/IDevsq.h +4 -1
- hikyuu/include/hikyuu/indicator/imp/IDiff.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IDma.h +2 -0
- hikyuu/include/hikyuu/indicator/imp/IDropna.h +0 -4
- hikyuu/include/hikyuu/indicator/imp/IEma.h +3 -1
- hikyuu/include/hikyuu/indicator/imp/IEvery.h +5 -1
- hikyuu/include/hikyuu/indicator/imp/IExist.h +5 -1
- hikyuu/include/hikyuu/indicator/imp/IExp.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IFilter.h +4 -5
- hikyuu/include/hikyuu/indicator/imp/IFinance.h +1 -2
- hikyuu/include/hikyuu/indicator/imp/IFloor.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IHhvbars.h +5 -1
- hikyuu/include/hikyuu/indicator/imp/IHighLine.h +5 -1
- hikyuu/include/hikyuu/indicator/imp/IHsl.h +0 -2
- hikyuu/include/hikyuu/indicator/imp/IIc.h +3 -6
- hikyuu/include/hikyuu/indicator/imp/IInBlock.h +1 -2
- hikyuu/include/hikyuu/indicator/imp/IIntpart.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IIsInf.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IIsInfa.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IIsLastBar.h +0 -1
- hikyuu/include/hikyuu/indicator/imp/IIsNa.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IJumpDown.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IJumpUp.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IKData.h +1 -2
- hikyuu/include/hikyuu/indicator/imp/ILiuTongPan.h +0 -2
- hikyuu/include/hikyuu/indicator/imp/ILn.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/ILog.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/ILowLine.h +5 -1
- hikyuu/include/hikyuu/indicator/imp/ILowLineBars.h +5 -1
- hikyuu/include/hikyuu/indicator/imp/IMa.h +6 -1
- hikyuu/include/hikyuu/indicator/imp/IMacd.h +2 -0
- hikyuu/include/hikyuu/indicator/imp/INot.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IPow.h +3 -1
- hikyuu/include/hikyuu/indicator/imp/IQuantileTrunc.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IRecover.h +3 -0
- hikyuu/include/hikyuu/indicator/imp/IRef.h +3 -1
- hikyuu/include/hikyuu/indicator/imp/IResult.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IReverse.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IRoc.h +6 -1
- hikyuu/include/hikyuu/indicator/imp/IRocp.h +5 -1
- hikyuu/include/hikyuu/indicator/imp/IRocr.h +5 -1
- hikyuu/include/hikyuu/indicator/imp/IRocr100.h +5 -1
- hikyuu/include/hikyuu/indicator/imp/IRound.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IRoundDown.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IRoundUp.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/ISaftyLoss.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/ISign.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/ISin.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/ISlope.h +5 -1
- hikyuu/include/hikyuu/indicator/imp/ISma.h +2 -0
- hikyuu/include/hikyuu/indicator/imp/ISpearman.h +3 -0
- hikyuu/include/hikyuu/indicator/imp/ISqrt.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IStdev.h +5 -1
- hikyuu/include/hikyuu/indicator/imp/IStdp.h +5 -1
- hikyuu/include/hikyuu/indicator/imp/ISum.h +6 -1
- hikyuu/include/hikyuu/indicator/imp/ITan.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/ITime.h +1 -2
- hikyuu/include/hikyuu/indicator/imp/ITimeLine.h +0 -2
- hikyuu/include/hikyuu/indicator/imp/ITr.h +1 -2
- hikyuu/include/hikyuu/indicator/imp/IVar.h +5 -1
- hikyuu/include/hikyuu/indicator/imp/IVarp.h +5 -1
- hikyuu/include/hikyuu/indicator/imp/IVigor.h +0 -2
- hikyuu/include/hikyuu/indicator/imp/IWma.h +5 -1
- hikyuu/include/hikyuu/indicator/imp/IZongGuBen.h +1 -2
- hikyuu/include/hikyuu/indicator_talib/imp/TaAdosc.h +0 -2
- hikyuu/include/hikyuu/indicator_talib/imp/TaSar.h +0 -2
- hikyuu/include/hikyuu/indicator_talib/imp/TaSarext.h +0 -4
- hikyuu/include/hikyuu/indicator_talib/imp/TaStoch.h +0 -3
- hikyuu/include/hikyuu/indicator_talib/imp/TaStochf.h +0 -2
- hikyuu/include/hikyuu/indicator_talib/imp/TaUltosc.h +0 -2
- hikyuu/include/hikyuu/indicator_talib/imp/ta_defines.h +2 -4
- hikyuu/include/hikyuu/indicator_talib/imp/ta_imp.h +70 -90
- hikyuu/include/hikyuu/plugin/hkuextra.h +2 -0
- hikyuu/include/hikyuu/plugin/interface/HkuExtraPluginInterface.h +2 -0
- hikyuu/include/hikyuu/python/pybind_utils.h +22 -5
- hikyuu/include/hikyuu/trade_manage/TradeCostBase.h +5 -3
- hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +9 -2
- hikyuu/include/hikyuu/trade_sys/allocatefunds/AllocateFundsBase.h +8 -3
- hikyuu/include/hikyuu/trade_sys/condition/ConditionBase.h +5 -2
- hikyuu/include/hikyuu/trade_sys/environment/EnvironmentBase.h +6 -2
- hikyuu/include/hikyuu/trade_sys/moneymanager/MoneyManagerBase.h +5 -2
- hikyuu/include/hikyuu/trade_sys/multifactor/MultiFactorBase.h +23 -19
- hikyuu/include/hikyuu/trade_sys/multifactor/NormalizeBase.h +6 -3
- hikyuu/include/hikyuu/trade_sys/multifactor/ScoresFilterBase.h +5 -2
- hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_EqualWeight.h +3 -3
- hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_ICIRWeight.h +4 -4
- hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_ICWeight.h +4 -4
- hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_Weight.h +4 -4
- hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +5 -2
- hikyuu/include/hikyuu/trade_sys/profitgoal/ProfitGoalBase.h +4 -2
- hikyuu/include/hikyuu/trade_sys/selector/SelectorBase.h +12 -2
- hikyuu/include/hikyuu/trade_sys/selector/crt/SE_MultiFactor.h +1 -1
- hikyuu/include/hikyuu/trade_sys/selector/crt/SE_MultiFactor2.h +1 -1
- hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector.h +1 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector2.h +1 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/OptimalSelectorBase.h +0 -2
- hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/PerformanceOptimalSelector.h +0 -4
- hikyuu/include/hikyuu/trade_sys/signal/SignalBase.h +5 -2
- hikyuu/include/hikyuu/trade_sys/slippage/SlippageBase.h +5 -2
- hikyuu/include/hikyuu/trade_sys/stoploss/StoplossBase.h +5 -2
- hikyuu/include/hikyuu/trade_sys/system/System.h +5 -2
- hikyuu/include/hikyuu/utilities/LruCache.h +299 -0
- hikyuu/include/hikyuu/utilities/arithmetic.h +2 -2
- hikyuu/include/hikyuu/utilities/omp_macro.h +25 -0
- hikyuu/include/hikyuu/utilities/plugin/PluginManager.h +5 -0
- hikyuu/include/hikyuu/utilities/thread/GlobalStealThreadPool.h +72 -19
- hikyuu/include/hikyuu/utilities/thread/GlobalThreadPool.h +0 -4
- hikyuu/include/hikyuu/utilities/thread/ThreadPool.h +0 -4
- hikyuu/include/hikyuu/utilities/thread/algorithm.h +286 -0
- hikyuu/include/hikyuu/version.h +4 -4
- hikyuu/plugin/backtest.dll +0 -0
- hikyuu/plugin/checkdata.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/import2ch.dll +0 -0
- hikyuu/plugin/import2hdf5.dll +0 -0
- hikyuu/plugin/import2mysql.dll +0 -0
- hikyuu/plugin/tmreport.dll +0 -0
- hikyuu/test/Indicator.py +1 -2
- hikyuu/trade_manage/__init__.pyi +6 -5
- hikyuu/trade_manage/trade.pyi +6 -5
- hikyuu/util/__init__.pyi +1 -1
- hikyuu/util/singleton.pyi +1 -1
- {hikyuu-2.7.3.dist-info → hikyuu-2.7.6.dist-info}/METADATA +1 -1
- {hikyuu-2.7.3.dist-info → hikyuu-2.7.6.dist-info}/RECORD +217 -210
- {hikyuu-2.7.3.dist-info → hikyuu-2.7.6.dist-info}/WHEEL +0 -0
- {hikyuu-2.7.3.dist-info → hikyuu-2.7.6.dist-info}/entry_points.txt +0 -0
- {hikyuu-2.7.3.dist-info → hikyuu-2.7.6.dist-info}/top_level.txt +0 -0
hikyuu/include/hikyuu/KQuery.h
CHANGED
|
@@ -58,20 +58,20 @@ public:
|
|
|
58
58
|
static bool isValidKType(const string& ktype);
|
|
59
59
|
|
|
60
60
|
/** 判断是否为有效 ktype */
|
|
61
|
-
static bool isBaseKType(const string& ktype);
|
|
61
|
+
static bool isBaseKType(const string& ktype) noexcept;
|
|
62
62
|
|
|
63
63
|
/** 判断是否为扩展 ktype */
|
|
64
64
|
static bool isExtraKType(const string& ktype);
|
|
65
65
|
|
|
66
66
|
/** 获取所有的 KType */
|
|
67
|
-
static vector<KType> getBaseKTypeList();
|
|
67
|
+
static vector<KType> getBaseKTypeList() noexcept;
|
|
68
68
|
|
|
69
69
|
/** 获取所有扩展 KType */
|
|
70
70
|
static vector<KType> getExtraKTypeList();
|
|
71
71
|
|
|
72
72
|
static int32_t getKTypeInMin(const KType& ktype);
|
|
73
73
|
|
|
74
|
-
static int32_t getBaseKTypeInMin(const KType& ktype);
|
|
74
|
+
static int32_t getBaseKTypeInMin(const KType& ktype) noexcept;
|
|
75
75
|
|
|
76
76
|
static int64_t getKTypeInSeconds(const KType& ktype);
|
|
77
77
|
|
|
@@ -129,14 +129,14 @@ public:
|
|
|
129
129
|
/**
|
|
130
130
|
* 按索引方式查询时,返回指定的起始索引,否则返回Null<int64_t>()
|
|
131
131
|
*/
|
|
132
|
-
int64_t start() const {
|
|
132
|
+
int64_t start() const noexcept {
|
|
133
133
|
return m_queryType != INDEX ? Null<int64_t>() : m_start;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
137
|
* 按索引方式查询时,返回指定的结束索引,否则返回Null<int64_t>()
|
|
138
138
|
*/
|
|
139
|
-
int64_t end() const {
|
|
139
|
+
int64_t end() const noexcept {
|
|
140
140
|
return m_queryType != INDEX ? Null<int64_t>() : m_end;
|
|
141
141
|
}
|
|
142
142
|
|
|
@@ -151,23 +151,23 @@ public:
|
|
|
151
151
|
Datetime endDatetime() const;
|
|
152
152
|
|
|
153
153
|
/** 获取查询条件类型 */
|
|
154
|
-
QueryType queryType() const {
|
|
154
|
+
QueryType queryType() const noexcept {
|
|
155
155
|
return m_queryType;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
/** 获取K线数据类型 */
|
|
159
159
|
// KType kType() const { return m_dataType; }
|
|
160
|
-
const string& kType() const {
|
|
160
|
+
const string& kType() const noexcept {
|
|
161
161
|
return m_dataType;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
/** 获取复权类型 */
|
|
165
|
-
RecoverType recoverType() const {
|
|
165
|
+
RecoverType recoverType() const noexcept {
|
|
166
166
|
return m_recoverType;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
/** 设置复权类型 */
|
|
170
|
-
void recoverType(RecoverType recoverType) {
|
|
170
|
+
void recoverType(RecoverType recoverType) noexcept {
|
|
171
171
|
m_recoverType = recoverType;
|
|
172
172
|
}
|
|
173
173
|
|
|
@@ -261,8 +261,8 @@ HKU_API std::ostream& operator<<(std::ostream& os, const KQuery& query);
|
|
|
261
261
|
// 关系比较函数, 不直接在类中定义是为了支持 Null<>() == d,Null可以放在左边
|
|
262
262
|
//
|
|
263
263
|
///////////////////////////////////////////////////////////////////////////////
|
|
264
|
-
bool HKU_API operator==(const KQuery&, const KQuery&);
|
|
265
|
-
bool HKU_API operator!=(const KQuery&, const KQuery&);
|
|
264
|
+
bool HKU_API operator==(const KQuery&, const KQuery&) noexcept;
|
|
265
|
+
bool HKU_API operator!=(const KQuery&, const KQuery&) noexcept;
|
|
266
266
|
|
|
267
267
|
/**
|
|
268
268
|
* 提供KQuery的Null值
|
hikyuu/include/hikyuu/KRecord.h
CHANGED
|
@@ -40,51 +40,51 @@ public:
|
|
|
40
40
|
MarketInfo(const MarketInfo&) = default;
|
|
41
41
|
MarketInfo& operator=(const MarketInfo&) = default;
|
|
42
42
|
|
|
43
|
-
MarketInfo(MarketInfo&&);
|
|
43
|
+
MarketInfo(MarketInfo&&) noexcept;
|
|
44
44
|
MarketInfo& operator=(MarketInfo&&) noexcept;
|
|
45
45
|
|
|
46
46
|
/** 获取市场简称 */
|
|
47
|
-
const string& market() const {
|
|
47
|
+
const string& market() const noexcept {
|
|
48
48
|
return m_market;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/** 获取市场名称 */
|
|
52
|
-
const string& name() const {
|
|
52
|
+
const string& name() const noexcept {
|
|
53
53
|
return m_name;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/** 获取市场描述 */
|
|
57
|
-
const string& description() const {
|
|
57
|
+
const string& description() const noexcept {
|
|
58
58
|
return m_description;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/** 获取该市场对应的指数代码 */
|
|
62
|
-
const string& code() const {
|
|
62
|
+
const string& code() const noexcept {
|
|
63
63
|
return m_code;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/** 获取市场数据的最后更新日期 */
|
|
67
|
-
Datetime lastDate() const {
|
|
67
|
+
Datetime lastDate() const noexcept {
|
|
68
68
|
return m_lastDate;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/** 开市时间1 */
|
|
72
|
-
TimeDelta openTime1() const {
|
|
72
|
+
TimeDelta openTime1() const noexcept {
|
|
73
73
|
return m_openTime1;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
/** 闭市时间1 */
|
|
77
|
-
TimeDelta closeTime1() const {
|
|
77
|
+
TimeDelta closeTime1() const noexcept {
|
|
78
78
|
return m_closeTime1;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
/** 开市时间2 */
|
|
82
|
-
TimeDelta openTime2() const {
|
|
82
|
+
TimeDelta openTime2() const noexcept {
|
|
83
83
|
return m_openTime2;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/** 闭市时间2 */
|
|
87
|
-
TimeDelta closeTime2() const {
|
|
87
|
+
TimeDelta closeTime2() const noexcept {
|
|
88
88
|
return m_closeTime2;
|
|
89
89
|
}
|
|
90
90
|
|
hikyuu/include/hikyuu/Stock.h
CHANGED
|
@@ -58,8 +58,8 @@ private:
|
|
|
58
58
|
public:
|
|
59
59
|
Stock();
|
|
60
60
|
|
|
61
|
-
Stock(const Stock&);
|
|
62
|
-
Stock(Stock&&);
|
|
61
|
+
Stock(const Stock&) noexcept;
|
|
62
|
+
Stock(Stock&&) noexcept;
|
|
63
63
|
Stock(const string& market, const string& code, const string& name);
|
|
64
64
|
|
|
65
65
|
Stock(const string& market, const string& code, const string& name, uint32_t type, bool valid,
|
|
@@ -69,7 +69,7 @@ public:
|
|
|
69
69
|
int precision, size_t minTradeNumber, size_t maxTradeNumber);
|
|
70
70
|
virtual ~Stock();
|
|
71
71
|
Stock& operator=(const Stock&);
|
|
72
|
-
Stock& operator=(Stock&&);
|
|
72
|
+
Stock& operator=(Stock&&) noexcept;
|
|
73
73
|
bool operator==(const Stock&) const;
|
|
74
74
|
bool operator!=(const Stock&) const;
|
|
75
75
|
|
|
@@ -77,52 +77,52 @@ public:
|
|
|
77
77
|
* 获取内部id,一般用于作为map的键值使用,该id实际为m_data的内存地址
|
|
78
78
|
* @note 非数据库中的stockid
|
|
79
79
|
*/
|
|
80
|
-
uint64_t id() const;
|
|
80
|
+
uint64_t id() const noexcept;
|
|
81
81
|
|
|
82
82
|
/** 获取所属市场简称,市场简称是市场的唯一标识 */
|
|
83
|
-
const string& market() const;
|
|
83
|
+
const string& market() const noexcept;
|
|
84
84
|
|
|
85
85
|
/** 获取证券代码 */
|
|
86
|
-
const string& code() const;
|
|
86
|
+
const string& code() const noexcept;
|
|
87
87
|
|
|
88
88
|
/** 市场简称+证券代码,如: sh000001 */
|
|
89
|
-
const string& market_code() const;
|
|
89
|
+
const string& market_code() const noexcept;
|
|
90
90
|
|
|
91
91
|
/** 获取证券名称 */
|
|
92
|
-
const string& name() const;
|
|
92
|
+
const string& name() const noexcept;
|
|
93
93
|
|
|
94
94
|
/** 获取证券类型 */
|
|
95
|
-
uint32_t type() const;
|
|
95
|
+
uint32_t type() const noexcept;
|
|
96
96
|
|
|
97
97
|
/** 该证券当前是否有效 */
|
|
98
|
-
bool valid() const;
|
|
98
|
+
bool valid() const noexcept;
|
|
99
99
|
|
|
100
100
|
/** 获取证券起始日期 */
|
|
101
|
-
const Datetime& startDatetime() const;
|
|
101
|
+
const Datetime& startDatetime() const noexcept;
|
|
102
102
|
|
|
103
103
|
/** 获取证券最后日期 */
|
|
104
|
-
const Datetime& lastDatetime() const;
|
|
104
|
+
const Datetime& lastDatetime() const noexcept;
|
|
105
105
|
|
|
106
106
|
/** 获取最小跳动量 */
|
|
107
|
-
price_t tick() const;
|
|
107
|
+
price_t tick() const noexcept;
|
|
108
108
|
|
|
109
109
|
/** 最小跳动量价值 */
|
|
110
|
-
price_t tickValue() const;
|
|
110
|
+
price_t tickValue() const noexcept;
|
|
111
111
|
|
|
112
112
|
/** 每单位价值 = tickValue / tick */
|
|
113
|
-
price_t unit() const;
|
|
113
|
+
price_t unit() const noexcept;
|
|
114
114
|
|
|
115
115
|
/** 获取价格精度 */
|
|
116
|
-
int precision() const;
|
|
116
|
+
int precision() const noexcept;
|
|
117
117
|
|
|
118
118
|
/** 获取最小交易数量,同minTradeNumber */
|
|
119
|
-
double atom() const;
|
|
119
|
+
double atom() const noexcept;
|
|
120
120
|
|
|
121
121
|
/** 获取最小交易数量 */
|
|
122
|
-
double minTradeNumber() const;
|
|
122
|
+
double minTradeNumber() const noexcept;
|
|
123
123
|
|
|
124
124
|
/** 获取最大交易量 */
|
|
125
|
-
double maxTradeNumber() const;
|
|
125
|
+
double maxTradeNumber() const noexcept;
|
|
126
126
|
|
|
127
127
|
void market(const string& market_);
|
|
128
128
|
void code(const string& code_);
|
|
@@ -213,9 +213,6 @@ public:
|
|
|
213
213
|
*/
|
|
214
214
|
DatetimeList getTradingCalendar(const KQuery& query) const;
|
|
215
215
|
|
|
216
|
-
/** 设置权息信息, 仅供初始化时调用 */
|
|
217
|
-
void setWeightList(const StockWeightList&);
|
|
218
|
-
|
|
219
216
|
/**
|
|
220
217
|
* 判断是否在交易时间段内,忽略日期仅判断时分秒
|
|
221
218
|
* @param time 时间
|
|
@@ -238,12 +235,12 @@ public:
|
|
|
238
235
|
void releaseKDataBuffer(KQuery::KType) const;
|
|
239
236
|
|
|
240
237
|
/** 指定类型的K线数据是否被缓存 */
|
|
241
|
-
bool isBuffer(KQuery::KType) const;
|
|
238
|
+
bool isBuffer(KQuery::KType) const noexcept;
|
|
242
239
|
|
|
243
|
-
bool isPreload(KQuery::KType ktype) const;
|
|
240
|
+
bool isPreload(KQuery::KType ktype) const noexcept;
|
|
244
241
|
|
|
245
242
|
/** 是否为Null */
|
|
246
|
-
bool isNull() const;
|
|
243
|
+
bool isNull() const noexcept;
|
|
247
244
|
|
|
248
245
|
/** (临时函数)只用于更新缓存中的K线数据 **/
|
|
249
246
|
void realtimeUpdate(KRecord, const KQuery::KType& ktype = KQuery::DAY);
|
|
@@ -265,10 +262,13 @@ private:
|
|
|
265
262
|
bool _getIndexRangeByIndex(const KQuery&, size_t& out_start, size_t& out_end) const;
|
|
266
263
|
|
|
267
264
|
// 以下函数属于基础操作添加了读锁
|
|
268
|
-
size_t _getCountFromBuffer(const KQuery::KType& ktype) const;
|
|
269
265
|
const KRecord& _getKRecordFromBuffer(size_t pos, const KQuery::KType& ktype) const;
|
|
270
266
|
KRecordList _getKRecordListFromBuffer(size_t start_ix, size_t end_ix,
|
|
271
267
|
KQuery::KType ktype) const;
|
|
268
|
+
|
|
269
|
+
bool _getIndexRangeFromBuffer(const KQuery& query, size_t& out_start, size_t& out_end) const;
|
|
270
|
+
bool _getIndexRangeByIndexFromBuffer(const KQuery& query, size_t& out_start,
|
|
271
|
+
size_t& out_end) const;
|
|
272
272
|
bool _getIndexRangeByDateFromBuffer(const KQuery&, size_t&, size_t&) const;
|
|
273
273
|
|
|
274
274
|
KRecordList _getKRecordList(const KQuery& query) const;
|
|
@@ -296,12 +296,12 @@ struct HKU_API Stock::Data {
|
|
|
296
296
|
Datetime m_lastDate; // 证券最后日期
|
|
297
297
|
|
|
298
298
|
StockWeightList m_weightList; // 权息信息列表
|
|
299
|
-
std::
|
|
299
|
+
std::shared_mutex m_weight_mutex;
|
|
300
300
|
|
|
301
301
|
mutable vector<HistoryFinanceInfo>
|
|
302
302
|
m_history_finance; // 历史财务信息 [财务报告日期, 字段1, 字段2, ...]
|
|
303
303
|
mutable std::atomic_bool m_history_finance_ready{false};
|
|
304
|
-
mutable std::
|
|
304
|
+
mutable std::shared_mutex m_history_finance_mutex;
|
|
305
305
|
|
|
306
306
|
price_t m_tick;
|
|
307
307
|
price_t m_tickValue;
|
|
@@ -347,7 +347,7 @@ inline bool operator<(const Stock& s1, const Stock& s2) {
|
|
|
347
347
|
return s1.id() < s2.id();
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
inline uint64_t Stock::id() const {
|
|
350
|
+
inline uint64_t Stock::id() const noexcept {
|
|
351
351
|
return isNull() ? 0 : (int64_t)m_data.get();
|
|
352
352
|
}
|
|
353
353
|
|
|
@@ -355,7 +355,7 @@ inline bool Stock::operator!=(const Stock& stock) const {
|
|
|
355
355
|
return !(*this == stock);
|
|
356
356
|
}
|
|
357
357
|
|
|
358
|
-
inline bool Stock::isNull() const {
|
|
358
|
+
inline bool Stock::isNull() const noexcept {
|
|
359
359
|
return !m_data || !m_kdataDriver;
|
|
360
360
|
}
|
|
361
361
|
|
|
@@ -86,7 +86,7 @@ public:
|
|
|
86
86
|
string datadir() const;
|
|
87
87
|
|
|
88
88
|
/** 获取证券数量 */
|
|
89
|
-
size_t size() const;
|
|
89
|
+
size_t size() const noexcept;
|
|
90
90
|
|
|
91
91
|
/** 是否所有数据准备完毕 */
|
|
92
92
|
bool dataReady() const;
|
|
@@ -252,7 +252,7 @@ public:
|
|
|
252
252
|
/**
|
|
253
253
|
* 获取当前执行线程id,主要用于判断 Strategy 是以独立进程还是线程方式运行
|
|
254
254
|
*/
|
|
255
|
-
std::thread::id thread_id() const {
|
|
255
|
+
std::thread::id thread_id() const noexcept {
|
|
256
256
|
return m_thread_id;
|
|
257
257
|
}
|
|
258
258
|
|
|
@@ -265,7 +265,7 @@ public:
|
|
|
265
265
|
void setPluginPath(const std::string& path);
|
|
266
266
|
|
|
267
267
|
/** 获取当前插件路径 */
|
|
268
|
-
const string& getPluginPath() const {
|
|
268
|
+
const string& getPluginPath() const noexcept {
|
|
269
269
|
return m_plugin_manager.pluginPath();
|
|
270
270
|
}
|
|
271
271
|
|
|
@@ -273,7 +273,7 @@ public:
|
|
|
273
273
|
PluginInterfaceT* getPlugin(const std::string& pluginname) noexcept;
|
|
274
274
|
|
|
275
275
|
/** 设置多语言支持路径(仅在初始化之前有效) */
|
|
276
|
-
void setLanguagePath(const std::string& path);
|
|
276
|
+
void setLanguagePath(const std::string& path) noexcept;
|
|
277
277
|
|
|
278
278
|
/** 取消加载,退出时使用 */
|
|
279
279
|
void cancelLoad() {
|
|
@@ -293,6 +293,10 @@ public:
|
|
|
293
293
|
return m_stockDict.end();
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
+
void clearPlugin() {
|
|
297
|
+
m_plugin_manager.clear();
|
|
298
|
+
}
|
|
299
|
+
|
|
296
300
|
private:
|
|
297
301
|
/* 加载全部数据 */
|
|
298
302
|
void loadData();
|
|
@@ -341,14 +345,11 @@ private:
|
|
|
341
345
|
|
|
342
346
|
typedef unordered_map<string, MarketInfo> MarketInfoMap;
|
|
343
347
|
mutable MarketInfoMap m_marketInfoDict;
|
|
344
|
-
std::shared_mutex* m_marketInfoDict_mutex;
|
|
345
348
|
|
|
346
349
|
typedef unordered_map<uint32_t, StockTypeInfo> StockTypeInfoMap;
|
|
347
350
|
mutable StockTypeInfoMap m_stockTypeInfo;
|
|
348
|
-
std::shared_mutex* m_stockTypeInfo_mutex;
|
|
349
351
|
|
|
350
352
|
std::unordered_set<Datetime> m_holidays; // 节假日
|
|
351
|
-
std::shared_mutex* m_holidays_mutex;
|
|
352
353
|
|
|
353
354
|
ZhBond10List m_zh_bond10; // 10年期中国国债收益率数据
|
|
354
355
|
|
|
@@ -368,12 +369,12 @@ private:
|
|
|
368
369
|
std::string m_i18n_path;
|
|
369
370
|
};
|
|
370
371
|
|
|
371
|
-
inline size_t StockManager::size() const {
|
|
372
|
+
inline size_t StockManager::size() const noexcept {
|
|
372
373
|
return m_stockDict.size();
|
|
373
374
|
}
|
|
374
375
|
|
|
375
376
|
inline bool StockManager::dataReady() const {
|
|
376
|
-
return m_data_ready;
|
|
377
|
+
return m_data_ready.load(std::memory_order_acquire);
|
|
377
378
|
}
|
|
378
379
|
|
|
379
380
|
inline bool StockManager::initializing() const {
|
|
@@ -434,7 +435,7 @@ inline PluginInterfaceT* StockManager::getPlugin(const std::string& pluginname)
|
|
|
434
435
|
return m_plugin_manager.getPlugin<PluginInterfaceT>(pluginname);
|
|
435
436
|
}
|
|
436
437
|
|
|
437
|
-
inline void StockManager::setLanguagePath(const std::string& path) {
|
|
438
|
+
inline void StockManager::setLanguagePath(const std::string& path) noexcept {
|
|
438
439
|
m_i18n_path = path;
|
|
439
440
|
}
|
|
440
441
|
|
|
@@ -41,46 +41,46 @@ public:
|
|
|
41
41
|
StockTypeInfo(const StockTypeInfo&) = default;
|
|
42
42
|
StockTypeInfo& operator=(const StockTypeInfo&) = default;
|
|
43
43
|
|
|
44
|
-
StockTypeInfo(StockTypeInfo&&);
|
|
44
|
+
StockTypeInfo(StockTypeInfo&&) noexcept;
|
|
45
45
|
StockTypeInfo& operator=(StockTypeInfo&&) noexcept;
|
|
46
46
|
|
|
47
47
|
/** 获取证券类型 */
|
|
48
|
-
uint32_t type() const {
|
|
48
|
+
uint32_t type() const noexcept {
|
|
49
49
|
return m_type;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/** 获取证券类型描述信息 */
|
|
53
|
-
const string& description() const {
|
|
53
|
+
const string& description() const noexcept {
|
|
54
54
|
return m_description;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
/** 获取最小跳动量 */
|
|
58
|
-
price_t tick() const {
|
|
58
|
+
price_t tick() const noexcept {
|
|
59
59
|
return m_tick;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/** 每tick价格 */
|
|
63
|
-
price_t tickValue() const {
|
|
63
|
+
price_t tickValue() const noexcept {
|
|
64
64
|
return m_tickValue;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/** 每单位价格 = tickValue / tick */
|
|
68
|
-
price_t unit() const {
|
|
68
|
+
price_t unit() const noexcept {
|
|
69
69
|
return m_unit;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
/** 获取价格精度 */
|
|
73
|
-
int precision() const {
|
|
73
|
+
int precision() const noexcept {
|
|
74
74
|
return m_precision;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/** 获取每笔最小交易数量 */
|
|
78
|
-
double minTradeNumber() const {
|
|
78
|
+
double minTradeNumber() const noexcept {
|
|
79
79
|
return m_minTradeNumber;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
/** 获取每笔最大交易数量 */
|
|
83
|
-
double maxTradeNumber() const {
|
|
83
|
+
double maxTradeNumber() const noexcept {
|
|
84
84
|
return m_maxTradeNumber;
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -29,47 +29,47 @@ public:
|
|
|
29
29
|
price_t freeCount, price_t suogu);
|
|
30
30
|
|
|
31
31
|
/** 权息日期 */
|
|
32
|
-
Datetime datetime() const {
|
|
32
|
+
Datetime datetime() const noexcept {
|
|
33
33
|
return m_datetime;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/** 每10股送X股 */
|
|
37
|
-
price_t countAsGift() const {
|
|
37
|
+
price_t countAsGift() const noexcept {
|
|
38
38
|
return m_countAsGift;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/** 每10股配X股 */
|
|
42
|
-
price_t countForSell() const {
|
|
42
|
+
price_t countForSell() const noexcept {
|
|
43
43
|
return m_countForSell;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
/** 配股价 */
|
|
47
|
-
price_t priceForSell() const {
|
|
47
|
+
price_t priceForSell() const noexcept {
|
|
48
48
|
return m_priceForSell;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/** 每10股红利 */
|
|
52
|
-
price_t bonus() const {
|
|
52
|
+
price_t bonus() const noexcept {
|
|
53
53
|
return m_bonus;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/** 每10股转增X股 */
|
|
57
|
-
price_t increasement() const {
|
|
57
|
+
price_t increasement() const noexcept {
|
|
58
58
|
return m_increasement;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/** 总股本(万股) */
|
|
62
|
-
price_t totalCount() const {
|
|
62
|
+
price_t totalCount() const noexcept {
|
|
63
63
|
return m_totalCount;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/** 流通股(万股) */
|
|
67
|
-
price_t freeCount() const {
|
|
67
|
+
price_t freeCount() const noexcept {
|
|
68
68
|
return m_freeCount;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/** 扩缩股比例 */
|
|
72
|
-
price_t suogu() const {
|
|
72
|
+
price_t suogu() const noexcept {
|
|
73
73
|
return m_suogu;
|
|
74
74
|
}
|
|
75
75
|
|
|
@@ -94,11 +94,17 @@ public:
|
|
|
94
94
|
*/
|
|
95
95
|
virtual void remove(const string& category, const string& name) = 0;
|
|
96
96
|
|
|
97
|
+
protected:
|
|
98
|
+
bool isPythonObject() const noexcept {
|
|
99
|
+
return m_is_python_object;
|
|
100
|
+
}
|
|
101
|
+
|
|
97
102
|
private:
|
|
98
103
|
bool checkType();
|
|
99
104
|
|
|
100
105
|
protected:
|
|
101
106
|
string m_name;
|
|
107
|
+
bool m_is_python_object{false};
|
|
102
108
|
};
|
|
103
109
|
|
|
104
110
|
typedef shared_ptr<BlockInfoDriver> BlockInfoDriverPtr;
|
|
@@ -134,15 +134,16 @@ public:
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
protected:
|
|
137
|
-
|
|
138
|
-
return
|
|
137
|
+
bool isPythonObject() const noexcept {
|
|
138
|
+
return m_is_python_object;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
private:
|
|
142
142
|
bool checkType();
|
|
143
143
|
|
|
144
|
-
|
|
144
|
+
protected:
|
|
145
145
|
string m_name;
|
|
146
|
+
bool m_is_python_object{false};
|
|
146
147
|
};
|
|
147
148
|
|
|
148
149
|
typedef shared_ptr<KDataDriver> KDataDriverPtr;
|