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
|
@@ -18,32 +18,37 @@ namespace hku {
|
|
|
18
18
|
天的收益”(比如过去 5 天的收益),并称之为 “当前 IC”。(否则当前值都会是缺失NA)
|
|
19
19
|
如需严格“t 时刻因子值→t+1 时刻收益“计算,请设置 strict=True (注意此模式下, 后n位为 NA)
|
|
20
20
|
* @param stks 证券组合
|
|
21
|
-
* @param query 查询条件
|
|
22
|
-
* @param ref_stk 参照证券,默认 sh000300 沪深300
|
|
23
21
|
* @param n 时间窗口 (对应 n 日收益率)
|
|
24
22
|
* @param spearman 使用 spearman 相关系数,否则为 pearson
|
|
25
23
|
* @param strict 严格模式, 遵循IC定义“t 时刻因子值→t+1 时刻收益”
|
|
26
24
|
* @return Indicator
|
|
27
25
|
* @ingroup Indicator
|
|
28
26
|
*/
|
|
29
|
-
Indicator HKU_API IC(const StockList& stks,
|
|
30
|
-
const Stock& ref_stk = getStock("sh000300"), int n = 1, bool spearman = true,
|
|
31
|
-
bool strict = false);
|
|
27
|
+
Indicator HKU_API IC(const StockList& stks, int n = 1, bool spearman = true, bool strict = false);
|
|
32
28
|
|
|
33
|
-
Indicator HKU_API IC(const Block& blk,
|
|
34
|
-
const Stock& ref_stk = getStock("sh000300"), int n = 1, bool spearman = true,
|
|
35
|
-
bool strict = false);
|
|
29
|
+
Indicator HKU_API IC(const Block& blk, int n = 1, bool spearman = true, bool strict = false);
|
|
36
30
|
|
|
37
|
-
inline Indicator IC(const Indicator& ind, const StockList& stks,
|
|
38
|
-
const Stock& ref_stk = getStock("sh000300"), int n = 1, bool spearman = true,
|
|
31
|
+
inline Indicator IC(const Indicator& ind, const StockList& stks, int n = 1, bool spearman = true,
|
|
39
32
|
bool strict = false) {
|
|
40
|
-
return IC(stks,
|
|
33
|
+
return IC(stks, n, spearman, strict)(ind);
|
|
41
34
|
}
|
|
42
35
|
|
|
43
|
-
inline Indicator IC(const Indicator& ind, const Block& blk,
|
|
44
|
-
const Stock& ref_stk = getStock("sh000300"), int n = 1, bool spearman = true,
|
|
36
|
+
inline Indicator IC(const Indicator& ind, const Block& blk, int n = 1, bool spearman = true,
|
|
45
37
|
bool strict = false) {
|
|
46
|
-
return IC(blk,
|
|
38
|
+
return IC(blk, n, spearman, strict)(ind);
|
|
47
39
|
}
|
|
48
40
|
|
|
41
|
+
/**
|
|
42
|
+
* @brief 计算指定的因子列表相对于指定的收益列表的
|
|
43
|
+
* IC,其中,inds和returns均为已经计算好并按日期对齐后的结果。inds不需要按n右移。
|
|
44
|
+
* @note 仅为数值计算,返回结果无对齐日期
|
|
45
|
+
* @param inds 因子列表,inds不需要按n右移。
|
|
46
|
+
* @param returns 收益列表
|
|
47
|
+
* @param n 时间窗口 (对应 n 日收益率)
|
|
48
|
+
* @param use_spearman 使用 spearman 相关系数,否则为 pearson
|
|
49
|
+
* @param strict 严格模式, 遵循IC定义“t 时刻因子值→t+1 时刻收益”
|
|
50
|
+
*/
|
|
51
|
+
Indicator HKU_API IC(IndicatorList inds, IndicatorList returns, int n = 1, bool use_spearman = true,
|
|
52
|
+
bool strict = false);
|
|
53
|
+
|
|
49
54
|
} // namespace hku
|
|
@@ -22,7 +22,6 @@ namespace hku {
|
|
|
22
22
|
* @param ind 因子公式
|
|
23
23
|
* @param stks 证券组合
|
|
24
24
|
* @param query 查询条件
|
|
25
|
-
* @param ref_stk 参照证券,默认 sh000300 沪深300
|
|
26
25
|
* @param n IC对应的N日收益率
|
|
27
26
|
* @param rolling_n 滚动时间窗口
|
|
28
27
|
* @param spearman 使用 spearman 相关系数,否则为 pearson
|
|
@@ -30,10 +29,9 @@ namespace hku {
|
|
|
30
29
|
* @return Indicator
|
|
31
30
|
* @ingroup Indicator
|
|
32
31
|
*/
|
|
33
|
-
inline Indicator ICIR(const Indicator& ind, const StockList& stks,
|
|
34
|
-
const Stock& ref_stk = getStock("sh000300"), int n = 1, int rolling_n = 120,
|
|
32
|
+
inline Indicator ICIR(const Indicator& ind, const StockList& stks, int n = 1, int rolling_n = 120,
|
|
35
33
|
bool spearman = true, bool strict = false) {
|
|
36
|
-
Indicator ic = IC(ind, stks,
|
|
34
|
+
Indicator ic = IC(ind, stks, n, spearman, strict);
|
|
37
35
|
Indicator x = MA(ic, rolling_n) / STDEV(ic, rolling_n);
|
|
38
36
|
x.name("ICIR");
|
|
39
37
|
x.setParam<int>("n", n);
|
|
@@ -41,10 +39,9 @@ inline Indicator ICIR(const Indicator& ind, const StockList& stks, const KQuery&
|
|
|
41
39
|
return x;
|
|
42
40
|
}
|
|
43
41
|
|
|
44
|
-
inline Indicator ICIR(const Indicator& ind, const Block& blk,
|
|
45
|
-
const Stock& ref_stk = getStock("sh000300"), int n = 1, int rolling_n = 120,
|
|
42
|
+
inline Indicator ICIR(const Indicator& ind, const Block& blk, int n = 1, int rolling_n = 120,
|
|
46
43
|
bool spearman = true, bool strict = false) {
|
|
47
|
-
Indicator ic = IC(ind, blk,
|
|
44
|
+
Indicator ic = IC(ind, blk, n, spearman, strict);
|
|
48
45
|
Indicator x = MA(ic, rolling_n) / STDEV(ic, rolling_n);
|
|
49
46
|
x.name("ICIR");
|
|
50
47
|
x.setParam<int>("n", n);
|
|
@@ -23,6 +23,9 @@ public:
|
|
|
23
23
|
IAdvance();
|
|
24
24
|
virtual ~IAdvance();
|
|
25
25
|
virtual void _checkParam(const string& name) const override;
|
|
26
|
+
|
|
27
|
+
virtual bool supportIncrementCalculate() const override;
|
|
28
|
+
virtual void _increment_calculate(const Indicator& ind, size_t start_pos) override;
|
|
26
29
|
};
|
|
27
30
|
|
|
28
31
|
} /* namespace hku */
|
|
@@ -21,6 +21,7 @@ namespace hku {
|
|
|
21
21
|
*/
|
|
22
22
|
class IAma : public IndicatorImp {
|
|
23
23
|
INDICATOR_IMP(IAma)
|
|
24
|
+
INDICATOR_IMP_SUPPORT_INCREMENT
|
|
24
25
|
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
25
26
|
|
|
26
27
|
public:
|
|
@@ -30,6 +31,8 @@ public:
|
|
|
30
31
|
virtual void _checkParam(const string& name) const override;
|
|
31
32
|
virtual void _dyn_calculate(const Indicator&) override;
|
|
32
33
|
|
|
34
|
+
virtual size_t min_increment_start() const override;
|
|
35
|
+
|
|
33
36
|
private:
|
|
34
37
|
void _dyn_one_circle(const Indicator& ind, size_t curPos, int n, int fast_n, int slow_n);
|
|
35
38
|
};
|
|
@@ -15,16 +15,15 @@ namespace hku {
|
|
|
15
15
|
|
|
16
16
|
class IAtr : public IndicatorImp {
|
|
17
17
|
INDICATOR_IMP(IAtr)
|
|
18
|
-
|
|
18
|
+
INDICATOR_IMP_SUPPORT_INCREMENT
|
|
19
19
|
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
20
20
|
|
|
21
21
|
public:
|
|
22
22
|
IAtr();
|
|
23
|
-
explicit IAtr(const KData&, int n);
|
|
24
23
|
virtual ~IAtr();
|
|
25
24
|
virtual void _checkParam(const string& name) const override;
|
|
26
25
|
};
|
|
27
26
|
|
|
28
27
|
} /* namespace hku */
|
|
29
28
|
|
|
30
|
-
#endif /* INDICATOR_IMP_ATR_H_ */
|
|
29
|
+
#endif /* INDICATOR_IMP_ATR_H_ */
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
namespace hku {
|
|
17
17
|
|
|
18
18
|
class IBackset : public IndicatorImp {
|
|
19
|
-
|
|
19
|
+
INDICATOR_IMP(IBackset)
|
|
20
|
+
INDICATOR_IMP_SUPPORT_DYNAMIC_CYCLE
|
|
20
21
|
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
21
22
|
|
|
22
23
|
public:
|
|
@@ -24,9 +25,6 @@ public:
|
|
|
24
25
|
virtual ~IBackset();
|
|
25
26
|
|
|
26
27
|
virtual void _checkParam(const string& name) const override;
|
|
27
|
-
virtual bool isSerial() const override {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
28
|
};
|
|
31
29
|
|
|
32
30
|
} /* namespace hku */
|
|
@@ -21,6 +21,9 @@ public:
|
|
|
21
21
|
IBlockSetNum();
|
|
22
22
|
virtual ~IBlockSetNum();
|
|
23
23
|
virtual void _checkParam(const string& name) const override;
|
|
24
|
+
|
|
25
|
+
virtual bool supportIncrementCalculate() const override;
|
|
26
|
+
virtual void _increment_calculate(const Indicator& ind, size_t start_pos) override;
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
} // namespace hku
|
|
@@ -21,9 +21,6 @@ public:
|
|
|
21
21
|
virtual string formula() const override;
|
|
22
22
|
virtual void _calculate(const Indicator& data) override;
|
|
23
23
|
virtual IndicatorImpPtr _clone() override;
|
|
24
|
-
virtual bool needSelfAlikeCompare() const noexcept override {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
24
|
|
|
28
25
|
virtual bool selfAlike(const IndicatorImp& other) const noexcept override;
|
|
29
26
|
|
|
@@ -21,6 +21,9 @@ public:
|
|
|
21
21
|
virtual ~ICorr();
|
|
22
22
|
|
|
23
23
|
virtual void _checkParam(const string& name) const override;
|
|
24
|
+
virtual bool supportIncrementCalculate() const override;
|
|
25
|
+
virtual size_t min_increment_start() const override;
|
|
26
|
+
virtual void _increment_calculate(const Indicator& ind, size_t start_pos) override;
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
} // namespace hku
|
|
@@ -16,12 +16,10 @@ namespace hku {
|
|
|
16
16
|
/* COST(k, X) 表示X%获利盘的价格是多少 */
|
|
17
17
|
class ICost : public IndicatorImp {
|
|
18
18
|
INDICATOR_IMP(ICost)
|
|
19
|
-
INDICATOR_NEED_CONTEXT
|
|
20
19
|
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
21
20
|
|
|
22
21
|
public:
|
|
23
22
|
ICost();
|
|
24
|
-
ICost(const KData&, double percent);
|
|
25
23
|
virtual ~ICost();
|
|
26
24
|
virtual void _checkParam(const string& name) const override;
|
|
27
25
|
};
|
|
@@ -19,7 +19,8 @@ namespace hku {
|
|
|
19
19
|
* COUNT(CLOSE>OPEN,20)表示统计20周期内收阳的周期数
|
|
20
20
|
*/
|
|
21
21
|
class ICount : public IndicatorImp {
|
|
22
|
-
|
|
22
|
+
INDICATOR_IMP(ICount)
|
|
23
|
+
INDICATOR_IMP_SUPPORT_DYNAMIC_CYCLE
|
|
23
24
|
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
24
25
|
|
|
25
26
|
public:
|
|
@@ -15,6 +15,7 @@ namespace hku {
|
|
|
15
15
|
|
|
16
16
|
class ICval : public IndicatorImp {
|
|
17
17
|
INDICATOR_IMP(ICval)
|
|
18
|
+
INDICATOR_IMP_SUPPORT_INCREMENT
|
|
18
19
|
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
19
20
|
|
|
20
21
|
public:
|
|
@@ -23,10 +24,6 @@ public:
|
|
|
23
24
|
virtual ~ICval();
|
|
24
25
|
virtual void _checkParam(const string& name) const override;
|
|
25
26
|
|
|
26
|
-
virtual bool needSelfAlikeCompare() const noexcept override {
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
27
|
virtual bool selfAlike(const IndicatorImp& other) const noexcept override;
|
|
31
28
|
};
|
|
32
29
|
|
|
@@ -14,12 +14,10 @@ namespace hku {
|
|
|
14
14
|
/* 获取换手率,等于 VOL(k) / CAPITAL(k) */
|
|
15
15
|
class ICycle : public IndicatorImp {
|
|
16
16
|
INDICATOR_IMP(ICycle)
|
|
17
|
-
INDICATOR_NEED_CONTEXT
|
|
18
17
|
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
19
18
|
|
|
20
19
|
public:
|
|
21
20
|
ICycle();
|
|
22
|
-
explicit ICycle(const KData&);
|
|
23
21
|
virtual ~ICycle();
|
|
24
22
|
virtual void _checkParam(const string& name) const override;
|
|
25
23
|
|
|
@@ -23,6 +23,9 @@ public:
|
|
|
23
23
|
IDecline();
|
|
24
24
|
virtual ~IDecline();
|
|
25
25
|
virtual void _checkParam(const string& name) const override;
|
|
26
|
+
|
|
27
|
+
virtual bool supportIncrementCalculate() const override;
|
|
28
|
+
virtual void _increment_calculate(const Indicator& ind, size_t start_pos) override;
|
|
26
29
|
};
|
|
27
30
|
|
|
28
31
|
} /* namespace hku */
|
|
@@ -16,13 +16,16 @@
|
|
|
16
16
|
namespace hku {
|
|
17
17
|
|
|
18
18
|
class IDevsq : public hku::IndicatorImp {
|
|
19
|
-
|
|
19
|
+
INDICATOR_IMP(IDevsq)
|
|
20
|
+
INDICATOR_IMP_SUPPORT_INCREMENT
|
|
21
|
+
INDICATOR_IMP_SUPPORT_DYNAMIC_CYCLE
|
|
20
22
|
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
21
23
|
|
|
22
24
|
public:
|
|
23
25
|
IDevsq();
|
|
24
26
|
virtual ~IDevsq();
|
|
25
27
|
virtual void _checkParam(const string& name) const override;
|
|
28
|
+
virtual size_t min_increment_start() const override;
|
|
26
29
|
};
|
|
27
30
|
|
|
28
31
|
} /* namespace hku */
|
|
@@ -19,12 +19,14 @@ namespace hku {
|
|
|
19
19
|
*/
|
|
20
20
|
class IDma : public Indicator2InImp {
|
|
21
21
|
INDICATOR2IN_IMP(IDma)
|
|
22
|
+
INDICATOR_IMP_SUPPORT_INCREMENT
|
|
22
23
|
INDICATOR2IN_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
23
24
|
|
|
24
25
|
public:
|
|
25
26
|
IDma();
|
|
26
27
|
explicit IDma(const Indicator& ref_a, bool fill_null);
|
|
27
28
|
virtual ~IDma();
|
|
29
|
+
virtual size_t min_increment_start() const override;
|
|
28
30
|
};
|
|
29
31
|
|
|
30
32
|
} // namespace hku
|
|
@@ -23,10 +23,6 @@ public:
|
|
|
23
23
|
IDropna();
|
|
24
24
|
virtual ~IDropna();
|
|
25
25
|
|
|
26
|
-
virtual bool needSelfAlikeCompare() const noexcept override {
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
26
|
// 禁止子节点合并, 上级默认已为 false
|
|
31
27
|
// virtual bool selfAlike(const IndicatorImp& other) const noexcept override {
|
|
32
28
|
// return false;
|
|
@@ -17,7 +17,9 @@ namespace hku {
|
|
|
17
17
|
* 抛弃数 = 0
|
|
18
18
|
*/
|
|
19
19
|
class IEma : public IndicatorImp {
|
|
20
|
-
|
|
20
|
+
INDICATOR_IMP(IEma)
|
|
21
|
+
INDICATOR_IMP_SUPPORT_INCREMENT
|
|
22
|
+
INDICATOR_IMP_SUPPORT_DYNAMIC_CYCLE
|
|
21
23
|
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
22
24
|
|
|
23
25
|
public:
|
|
@@ -19,13 +19,17 @@ namespace hku {
|
|
|
19
19
|
* 一直存在, EVERY (X,N) 表示条件X在N周期一直存在
|
|
20
20
|
*/
|
|
21
21
|
class IEvery : public IndicatorImp {
|
|
22
|
-
|
|
22
|
+
INDICATOR_IMP(IEvery)
|
|
23
|
+
INDICATOR_IMP_SUPPORT_DYNAMIC_CYCLE
|
|
23
24
|
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
24
25
|
|
|
25
26
|
public:
|
|
26
27
|
IEvery();
|
|
27
28
|
virtual ~IEvery();
|
|
28
29
|
virtual void _checkParam(const string& name) const override;
|
|
30
|
+
virtual bool supportIncrementCalculate() const override;
|
|
31
|
+
virtual size_t min_increment_start() const override;
|
|
32
|
+
virtual void _increment_calculate(const Indicator& ind, size_t start_pos) override;
|
|
29
33
|
};
|
|
30
34
|
|
|
31
35
|
} /* namespace hku */
|
|
@@ -19,13 +19,17 @@ namespace hku {
|
|
|
19
19
|
* 存在, EXIST(X,N) 表示条件X在N周期有存在
|
|
20
20
|
*/
|
|
21
21
|
class IExist : public IndicatorImp {
|
|
22
|
-
|
|
22
|
+
INDICATOR_IMP(IExist)
|
|
23
|
+
INDICATOR_IMP_SUPPORT_DYNAMIC_CYCLE
|
|
23
24
|
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
24
25
|
|
|
25
26
|
public:
|
|
26
27
|
IExist();
|
|
27
28
|
virtual ~IExist();
|
|
28
29
|
virtual void _checkParam(const string& name) const override;
|
|
30
|
+
virtual bool supportIncrementCalculate() const override;
|
|
31
|
+
virtual size_t min_increment_start() const override;
|
|
32
|
+
virtual void _increment_calculate(const Indicator& ind, size_t start_pos) override;
|
|
29
33
|
};
|
|
30
34
|
|
|
31
35
|
} /* namespace hku */
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
namespace hku {
|
|
17
17
|
|
|
18
18
|
class IFilter : public IndicatorImp {
|
|
19
|
-
|
|
19
|
+
INDICATOR_IMP(IFilter)
|
|
20
|
+
INDICATOR_IMP_SUPPORT_DYNAMIC_CYCLE
|
|
20
21
|
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
21
22
|
|
|
22
23
|
public:
|
|
@@ -24,10 +25,8 @@ public:
|
|
|
24
25
|
virtual ~IFilter();
|
|
25
26
|
|
|
26
27
|
virtual void _checkParam(const string& name) const override;
|
|
27
|
-
|
|
28
|
-
virtual
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
28
|
+
virtual bool supportIncrementCalculate() const override;
|
|
29
|
+
virtual void _increment_calculate(const Indicator& ind, size_t start_pos) override;
|
|
31
30
|
};
|
|
32
31
|
|
|
33
32
|
} /* namespace hku */
|
|
@@ -13,12 +13,11 @@ namespace hku {
|
|
|
13
13
|
|
|
14
14
|
class IFinance : public IndicatorImp {
|
|
15
15
|
INDICATOR_IMP(IFinance)
|
|
16
|
-
|
|
16
|
+
INDICATOR_IMP_SUPPORT_INCREMENT
|
|
17
17
|
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
18
18
|
|
|
19
19
|
public:
|
|
20
20
|
IFinance();
|
|
21
|
-
explicit IFinance(const KData&);
|
|
22
21
|
virtual ~IFinance() = default;
|
|
23
22
|
};
|
|
24
23
|
|
|
@@ -16,13 +16,17 @@
|
|
|
16
16
|
namespace hku {
|
|
17
17
|
|
|
18
18
|
class IHhvbars : public IndicatorImp {
|
|
19
|
-
|
|
19
|
+
INDICATOR_IMP(IHhvbars)
|
|
20
|
+
INDICATOR_IMP_SUPPORT_DYNAMIC_CYCLE
|
|
20
21
|
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
21
22
|
|
|
22
23
|
public:
|
|
23
24
|
IHhvbars();
|
|
24
25
|
virtual ~IHhvbars();
|
|
25
26
|
virtual void _checkParam(const string& name) const override;
|
|
27
|
+
virtual bool supportIncrementCalculate() const override;
|
|
28
|
+
virtual size_t min_increment_start() const override;
|
|
29
|
+
virtual void _increment_calculate(const Indicator& ind, size_t start_pos) override;
|
|
26
30
|
};
|
|
27
31
|
|
|
28
32
|
} /* namespace hku */
|
|
@@ -20,13 +20,17 @@ namespace hku {
|
|
|
20
20
|
* 参数: n: N日时间窗口
|
|
21
21
|
*/
|
|
22
22
|
class IHighLine : public IndicatorImp {
|
|
23
|
-
|
|
23
|
+
INDICATOR_IMP(IHighLine)
|
|
24
|
+
INDICATOR_IMP_SUPPORT_DYNAMIC_CYCLE
|
|
24
25
|
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
25
26
|
|
|
26
27
|
public:
|
|
27
28
|
IHighLine();
|
|
28
29
|
virtual ~IHighLine();
|
|
29
30
|
virtual void _checkParam(const string& name) const override;
|
|
31
|
+
virtual bool supportIncrementCalculate() const override;
|
|
32
|
+
virtual size_t min_increment_start() const override;
|
|
33
|
+
virtual void _increment_calculate(const Indicator& ind, size_t start_pos) override;
|
|
30
34
|
};
|
|
31
35
|
|
|
32
36
|
} /* namespace hku */
|
|
@@ -16,12 +16,10 @@ namespace hku {
|
|
|
16
16
|
/* 获取换手率,等于 VOL(k) / CAPITAL(k) */
|
|
17
17
|
class IHsl : public IndicatorImp {
|
|
18
18
|
INDICATOR_IMP(IHsl)
|
|
19
|
-
INDICATOR_NEED_CONTEXT
|
|
20
19
|
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
21
20
|
|
|
22
21
|
public:
|
|
23
22
|
IHsl();
|
|
24
|
-
explicit IHsl(const KData&);
|
|
25
23
|
virtual ~IHsl();
|
|
26
24
|
};
|
|
27
25
|
|
|
@@ -14,17 +14,16 @@ namespace hku {
|
|
|
14
14
|
class IIc : public IndicatorImp {
|
|
15
15
|
public:
|
|
16
16
|
IIc();
|
|
17
|
-
IIc(const StockList& stks,
|
|
18
|
-
bool strict);
|
|
17
|
+
IIc(const StockList& stks, int n, bool spearman, bool strict);
|
|
19
18
|
virtual ~IIc();
|
|
20
19
|
|
|
21
20
|
virtual void _checkParam(const string& name) const override;
|
|
22
21
|
virtual void _calculate(const Indicator& data) override;
|
|
23
22
|
virtual IndicatorImpPtr _clone() override;
|
|
24
23
|
|
|
24
|
+
virtual bool selfAlike(const IndicatorImp& other) const noexcept override;
|
|
25
|
+
|
|
25
26
|
private:
|
|
26
|
-
KQuery m_query;
|
|
27
|
-
Stock m_ref_stk;
|
|
28
27
|
StockList m_stks;
|
|
29
28
|
|
|
30
29
|
//============================================
|
|
@@ -36,8 +35,6 @@ private:
|
|
|
36
35
|
template <class Archive>
|
|
37
36
|
void serialize(Archive& ar, const unsigned int version) {
|
|
38
37
|
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(IndicatorImp);
|
|
39
|
-
ar& BOOST_SERIALIZATION_NVP(m_query);
|
|
40
|
-
ar& BOOST_SERIALIZATION_NVP(m_ref_stk);
|
|
41
38
|
ar& BOOST_SERIALIZATION_NVP(m_stks);
|
|
42
39
|
}
|
|
43
40
|
#endif
|
|
@@ -16,12 +16,11 @@ namespace hku {
|
|
|
16
16
|
/* 已指标形式返回是否在指定板块中 */
|
|
17
17
|
class IInBlock : public IndicatorImp {
|
|
18
18
|
INDICATOR_IMP(IInBlock)
|
|
19
|
-
|
|
19
|
+
INDICATOR_IMP_SUPPORT_INCREMENT
|
|
20
20
|
INDICATOR_IMP_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
21
21
|
|
|
22
22
|
public:
|
|
23
23
|
IInBlock();
|
|
24
|
-
explicit IInBlock(const KData& kdata, const string& category, const string& name);
|
|
25
24
|
virtual ~IInBlock();
|
|
26
25
|
};
|
|
27
26
|
|