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
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-03
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "hikyuu/utilities/Parameter.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 时间截面数据归一化基类
|
|
16
|
+
*/
|
|
17
|
+
class HKU_API NormalizeBase {
|
|
18
|
+
PARAMETER_SUPPORT_WITH_CHECK
|
|
19
|
+
|
|
20
|
+
public:
|
|
21
|
+
NormalizeBase() = default;
|
|
22
|
+
NormalizeBase(const string& name) : m_name(name) {}
|
|
23
|
+
|
|
24
|
+
NormalizeBase(const NormalizeBase& other) : m_params(other.m_params), m_name(other.m_name) {}
|
|
25
|
+
|
|
26
|
+
virtual ~NormalizeBase() = default;
|
|
27
|
+
|
|
28
|
+
/** 获取名称 */
|
|
29
|
+
const string& name() const {
|
|
30
|
+
return m_name;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** 设置名称 */
|
|
34
|
+
void name(const string& name) {
|
|
35
|
+
m_name = name;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
typedef std::shared_ptr<NormalizeBase> NormPtr;
|
|
39
|
+
NormPtr clone();
|
|
40
|
+
|
|
41
|
+
virtual NormPtr _clone() = 0;
|
|
42
|
+
|
|
43
|
+
virtual PriceList normalize(const PriceList& data) = 0;
|
|
44
|
+
|
|
45
|
+
protected:
|
|
46
|
+
virtual bool isPythonObject() const {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
protected:
|
|
51
|
+
string m_name;
|
|
52
|
+
|
|
53
|
+
//============================================
|
|
54
|
+
// 序列化支持
|
|
55
|
+
//============================================
|
|
56
|
+
#if HKU_SUPPORT_SERIALIZATION
|
|
57
|
+
private:
|
|
58
|
+
friend class boost::serialization::access;
|
|
59
|
+
template <class Archive>
|
|
60
|
+
void save(Archive& ar, const unsigned int version) const {
|
|
61
|
+
ar& BOOST_SERIALIZATION_NVP(m_name);
|
|
62
|
+
ar& BOOST_SERIALIZATION_NVP(m_params);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
template <class Archive>
|
|
66
|
+
void load(Archive& ar, const unsigned int version) {
|
|
67
|
+
ar& BOOST_SERIALIZATION_NVP(m_name);
|
|
68
|
+
ar& BOOST_SERIALIZATION_NVP(m_params);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
BOOST_SERIALIZATION_SPLIT_MEMBER()
|
|
72
|
+
#endif /* HKU_SUPPORT_SERIALIZATION */
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
#if HKU_SUPPORT_SERIALIZATION
|
|
76
|
+
BOOST_SERIALIZATION_ASSUME_ABSTRACT(MultiFactorBase)
|
|
77
|
+
#endif
|
|
78
|
+
|
|
79
|
+
#if HKU_SUPPORT_SERIALIZATION
|
|
80
|
+
/**
|
|
81
|
+
* 对于没有私有变量的继承子类,可直接使用该宏定义序列化
|
|
82
|
+
* @code
|
|
83
|
+
* class Drived: public NormalizeBase {
|
|
84
|
+
* NORMALIZE_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
85
|
+
*
|
|
86
|
+
* public:
|
|
87
|
+
* Drived();
|
|
88
|
+
* ...
|
|
89
|
+
* };
|
|
90
|
+
* @endcode
|
|
91
|
+
* @ingroup MultiFactor
|
|
92
|
+
*/
|
|
93
|
+
#define NORMALIZE_NO_PRIVATE_MEMBER_SERIALIZATION \
|
|
94
|
+
private: \
|
|
95
|
+
friend class boost::serialization::access; \
|
|
96
|
+
template <class Archive> \
|
|
97
|
+
void serialize(Archive& ar, const unsigned int version) { \
|
|
98
|
+
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(NormalizeBase); \
|
|
99
|
+
}
|
|
100
|
+
#else
|
|
101
|
+
#define NORMALIZE_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
102
|
+
#endif
|
|
103
|
+
|
|
104
|
+
typedef std::shared_ptr<NormalizeBase> NormPtr;
|
|
105
|
+
typedef std::shared_ptr<NormalizeBase> NormalizePtr;
|
|
106
|
+
|
|
107
|
+
#define NORMALIZE_IMP(classname) \
|
|
108
|
+
public: \
|
|
109
|
+
virtual NormalizePtr _clone() override { \
|
|
110
|
+
return std::make_shared<classname>(); \
|
|
111
|
+
} \
|
|
112
|
+
PriceList normalize(const PriceList& data) override;
|
|
113
|
+
|
|
114
|
+
HKU_API std::ostream& operator<<(std::ostream&, const NormalizeBase&);
|
|
115
|
+
HKU_API std::ostream& operator<<(std::ostream&, const NormalizePtr&);
|
|
116
|
+
|
|
117
|
+
} // namespace hku
|
|
118
|
+
|
|
119
|
+
#if FMT_VERSION >= 90000
|
|
120
|
+
template <>
|
|
121
|
+
struct fmt::formatter<hku::NormalizeBase> : ostream_formatter {};
|
|
122
|
+
|
|
123
|
+
template <>
|
|
124
|
+
struct fmt::formatter<hku::NormalizePtr> : ostream_formatter {};
|
|
125
|
+
#endif
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-13
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "hikyuu/trade_manage/TradeManagerBase.h"
|
|
11
|
+
#include "ScoreRecord.h"
|
|
12
|
+
|
|
13
|
+
namespace hku {
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 评分过滤器
|
|
17
|
+
* @note 虽然直接使用 std::function 即可,但如果使用 python 函数会造成并行死锁
|
|
18
|
+
* @ingroup Selector
|
|
19
|
+
*/
|
|
20
|
+
class HKU_API ScoresFilterBase {
|
|
21
|
+
PARAMETER_SUPPORT_WITH_CHECK
|
|
22
|
+
friend HKU_API std::ostream& operator<<(std::ostream&, const ScoresFilterBase&);
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
ScoresFilterBase() = default;
|
|
26
|
+
ScoresFilterBase(const ScoresFilterBase&) = default;
|
|
27
|
+
ScoresFilterBase(const string& name) : m_name(name) {}
|
|
28
|
+
virtual ~ScoresFilterBase() = default;
|
|
29
|
+
|
|
30
|
+
const string& name() const {
|
|
31
|
+
return m_name;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
void name(const string& name) {
|
|
35
|
+
m_name = name;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
ScoreRecordList filter(const ScoreRecordList& scores, const Datetime& date,
|
|
39
|
+
const KQuery& query);
|
|
40
|
+
|
|
41
|
+
virtual ScoreRecordList _filter(const ScoreRecordList& scores, const Datetime& date,
|
|
42
|
+
const KQuery& query) = 0;
|
|
43
|
+
|
|
44
|
+
typedef std::shared_ptr<ScoresFilterBase> ScoresFilterPtr;
|
|
45
|
+
ScoresFilterPtr clone();
|
|
46
|
+
|
|
47
|
+
virtual ScoresFilterPtr _clone() = 0;
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
friend HKU_API ScoresFilterPtr operator|(const ScoresFilterPtr& a, const ScoresFilterPtr& b);
|
|
51
|
+
|
|
52
|
+
protected:
|
|
53
|
+
virtual bool isPythonObject() const {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
protected:
|
|
58
|
+
string m_name;
|
|
59
|
+
ScoresFilterPtr m_child;
|
|
60
|
+
|
|
61
|
+
//============================================
|
|
62
|
+
// 序列化支持
|
|
63
|
+
//============================================
|
|
64
|
+
#if HKU_SUPPORT_SERIALIZATION
|
|
65
|
+
private:
|
|
66
|
+
friend class boost::serialization::access;
|
|
67
|
+
template <class Archive>
|
|
68
|
+
void save(Archive& ar, const unsigned int version) const {
|
|
69
|
+
ar& BOOST_SERIALIZATION_NVP(m_name);
|
|
70
|
+
ar& BOOST_SERIALIZATION_NVP(m_params);
|
|
71
|
+
ar& BOOST_SERIALIZATION_NVP(m_child);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
template <class Archive>
|
|
75
|
+
void load(Archive& ar, const unsigned int version) {
|
|
76
|
+
ar& BOOST_SERIALIZATION_NVP(m_name);
|
|
77
|
+
ar& BOOST_SERIALIZATION_NVP(m_params);
|
|
78
|
+
ar& BOOST_SERIALIZATION_NVP(m_child);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
BOOST_SERIALIZATION_SPLIT_MEMBER()
|
|
82
|
+
#endif /* HKU_SUPPORT_SERIALIZATION */
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
#if HKU_SUPPORT_SERIALIZATION
|
|
86
|
+
BOOST_SERIALIZATION_ASSUME_ABSTRACT(ScoresFilterBase)
|
|
87
|
+
#endif
|
|
88
|
+
|
|
89
|
+
#if HKU_SUPPORT_SERIALIZATION
|
|
90
|
+
#define SCORESFILTER_NO_PRIVATE_MEMBER_SERIALIZATION \
|
|
91
|
+
private: \
|
|
92
|
+
friend class boost::serialization::access; \
|
|
93
|
+
template <class Archive> \
|
|
94
|
+
void serialize(Archive& ar, const unsigned int version) { \
|
|
95
|
+
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(ScoresFilterBase); \
|
|
96
|
+
}
|
|
97
|
+
#else
|
|
98
|
+
#define SCORESFILTER_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
99
|
+
#endif
|
|
100
|
+
|
|
101
|
+
typedef std::shared_ptr<ScoresFilterBase> ScoresFilterPtr;
|
|
102
|
+
typedef std::shared_ptr<ScoresFilterBase> SCFilterPtr;
|
|
103
|
+
|
|
104
|
+
#define SCORESFILTER_IMP(classname) \
|
|
105
|
+
public: \
|
|
106
|
+
virtual ScoresFilterPtr _clone() override { \
|
|
107
|
+
return std::make_shared<classname>(); \
|
|
108
|
+
} \
|
|
109
|
+
virtual ScoreRecordList _filter(const ScoreRecordList& scores, const Datetime& date, \
|
|
110
|
+
const KQuery& query) override;
|
|
111
|
+
|
|
112
|
+
HKU_API std::ostream& operator<<(std::ostream&, const ScoresFilterBase&);
|
|
113
|
+
HKU_API std::ostream& operator<<(std::ostream&, const ScoresFilterPtr&);
|
|
114
|
+
|
|
115
|
+
HKU_API ScoresFilterPtr operator|(const ScoresFilterPtr& a, const ScoresFilterPtr& b);
|
|
116
|
+
|
|
117
|
+
} // namespace hku
|
|
118
|
+
|
|
119
|
+
#if FMT_VERSION >= 90000
|
|
120
|
+
template <>
|
|
121
|
+
struct fmt::formatter<hku::ScoresFilterBase> : ostream_formatter {};
|
|
122
|
+
|
|
123
|
+
template <>
|
|
124
|
+
struct fmt::formatter<hku::ScoresFilterPtr> : ostream_formatter {};
|
|
125
|
+
#endif
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-03
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "NormalizeBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @ingroup MultiFactor
|
|
16
|
+
* @{
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
inline NormPtr NORM_NOTHING() {
|
|
20
|
+
return NormPtr();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** 最小-最大标准化 */
|
|
24
|
+
NormPtr HKU_API NORM_MinMax();
|
|
25
|
+
|
|
26
|
+
/** 正态标准化 */
|
|
27
|
+
NormPtr HKU_API NORM_Zscore(bool outExtreme = false, double nsigma = 3.0, bool recursive = false);
|
|
28
|
+
|
|
29
|
+
/** 分位数分布标准化 */
|
|
30
|
+
NormPtr HKU_API NORM_Quantile(double quantile_min = 0.01, double quantile_max = 0.99);
|
|
31
|
+
|
|
32
|
+
/** 分位数均匀分布标准化 */
|
|
33
|
+
NormPtr HKU_API NORM_Quantile_Uniform(double quantile_min = 0.01, double quantile_max = 0.99);
|
|
34
|
+
|
|
35
|
+
/* @} */
|
|
36
|
+
} // namespace hku
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-13
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "ScoresFilterBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @ingroup MultiFactor
|
|
16
|
+
* @{
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
ScoresFilterPtr HKU_API SCFilter_IgnoreNan();
|
|
20
|
+
|
|
21
|
+
ScoresFilterPtr HKU_API SCFilter_LessOrEqualValue(double value = 0.0);
|
|
22
|
+
|
|
23
|
+
ScoresFilterPtr HKU_API SCFilter_TopN(int topn = 10);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 过滤掉成交金额在评分列表末尾百分比范围内的截面
|
|
27
|
+
* @note
|
|
28
|
+
* 和传入的截面评分列表顺序相关,如果是降序,过滤的是成交金额较小的系统评分记录;反之,则是金额较大的系统评分记录
|
|
29
|
+
* @param min_amount_percent_limit 最小成交金额百分比限制
|
|
30
|
+
* @return ScoresFilterPtr
|
|
31
|
+
*/
|
|
32
|
+
ScoresFilterPtr HKU_API SCFilter_AmountLimit(double min_amount_percent_limit = 0.1);
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 筛选指定分组的截面
|
|
36
|
+
* @param group 分组数量
|
|
37
|
+
* @param group_index 分组索引,从0开始
|
|
38
|
+
* @return ScoresFilterPtr
|
|
39
|
+
*/
|
|
40
|
+
ScoresFilterPtr HKU_API SCFilter_Group(int group = 10, int group_index = 0);
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 筛选指定价格范围 [min_price, max_price] 内的截面
|
|
44
|
+
* @param min_price 最低价格
|
|
45
|
+
* @param max_price 最高价格
|
|
46
|
+
* @return ScoresFilterPtr
|
|
47
|
+
*/
|
|
48
|
+
ScoresFilterPtr HKU_API SCFilter_Price(double min_price = 10., double max_price = 100000.);
|
|
49
|
+
|
|
50
|
+
/* @} */
|
|
51
|
+
} // namespace hku
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-13
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../ScoresFilterBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class HKU_API GroupSCFilter : public ScoresFilterBase {
|
|
15
|
+
SCORESFILTER_IMP(GroupSCFilter)
|
|
16
|
+
SCORESFILTER_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
|
+
|
|
18
|
+
public:
|
|
19
|
+
GroupSCFilter();
|
|
20
|
+
virtual ~GroupSCFilter() override = default;
|
|
21
|
+
virtual void _checkParam(const string& name) const override;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
} // namespace hku
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-14
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../ScoresFilterBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class HKU_API IgnoreLessOrEqualValueSCFilter : public ScoresFilterBase {
|
|
15
|
+
SCORESFILTER_IMP(IgnoreLessOrEqualValueSCFilter)
|
|
16
|
+
SCORESFILTER_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
|
+
|
|
18
|
+
public:
|
|
19
|
+
IgnoreLessOrEqualValueSCFilter();
|
|
20
|
+
virtual ~IgnoreLessOrEqualValueSCFilter() override = default;
|
|
21
|
+
virtual void _checkParam(const string& name) const override;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
} // namespace hku
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-14
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../ScoresFilterBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class HKU_API IgnoreNanSCFilter : public ScoresFilterBase {
|
|
15
|
+
SCORESFILTER_IMP(IgnoreNanSCFilter)
|
|
16
|
+
SCORESFILTER_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
|
+
|
|
18
|
+
public:
|
|
19
|
+
IgnoreNanSCFilter();
|
|
20
|
+
virtual ~IgnoreNanSCFilter() override = default;
|
|
21
|
+
virtual void _checkParam(const string& name) const override;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
} // namespace hku
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-13
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../ScoresFilterBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class HKU_API MinAmountPercentSCFilter : public ScoresFilterBase {
|
|
15
|
+
SCORESFILTER_IMP(MinAmountPercentSCFilter)
|
|
16
|
+
SCORESFILTER_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
|
+
|
|
18
|
+
public:
|
|
19
|
+
MinAmountPercentSCFilter();
|
|
20
|
+
virtual ~MinAmountPercentSCFilter() override = default;
|
|
21
|
+
|
|
22
|
+
virtual void _checkParam(const string& name) const override;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
} // namespace hku
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-13
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../ScoresFilterBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class HKU_API PriceSCFilter : public ScoresFilterBase {
|
|
15
|
+
SCORESFILTER_IMP(PriceSCFilter)
|
|
16
|
+
SCORESFILTER_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
|
+
|
|
18
|
+
public:
|
|
19
|
+
PriceSCFilter();
|
|
20
|
+
virtual ~PriceSCFilter() override = default;
|
|
21
|
+
virtual void _checkParam(const string& name) const override;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
} // namespace hku
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-14
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../ScoresFilterBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class HKU_API TopNSCFilter : public ScoresFilterBase {
|
|
15
|
+
SCORESFILTER_IMP(TopNSCFilter)
|
|
16
|
+
SCORESFILTER_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
|
+
|
|
18
|
+
public:
|
|
19
|
+
TopNSCFilter();
|
|
20
|
+
virtual ~TopNSCFilter() override = default;
|
|
21
|
+
virtual void _checkParam(const string& name) const override;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
} // namespace hku
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -20,7 +20,7 @@ public:
|
|
|
20
20
|
EqualWeightMultiFactor(const vector<Indicator>& inds, const StockList& stks,
|
|
21
21
|
const KQuery& query, const Stock& ref_stk, int ic_n, bool spearman,
|
|
22
22
|
int mode, bool save_all_factors);
|
|
23
|
-
virtual ~EqualWeightMultiFactor() = default;
|
|
23
|
+
virtual ~EqualWeightMultiFactor() override = default;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
} // namespace hku
|
|
@@ -20,7 +20,7 @@ public:
|
|
|
20
20
|
ICIRMultiFactor(const IndicatorList& inds, const StockList& stks, const KQuery& query,
|
|
21
21
|
const Stock& ref_stk, int ic_n, int ic_rolling_n, bool spearman, int mode,
|
|
22
22
|
bool save_all_factors);
|
|
23
|
-
virtual ~ICIRMultiFactor() = default;
|
|
23
|
+
virtual ~ICIRMultiFactor() override = default;
|
|
24
24
|
|
|
25
25
|
virtual void _checkParam(const string& name) const override;
|
|
26
26
|
};
|
|
@@ -20,7 +20,7 @@ public:
|
|
|
20
20
|
ICMultiFactor(const IndicatorList& inds, const StockList& stks, const KQuery& query,
|
|
21
21
|
const Stock& ref_stk, int ic_n, int ic_rolling_n, bool spearman, int mode,
|
|
22
22
|
bool save_all_factors);
|
|
23
|
-
virtual ~ICMultiFactor() = default;
|
|
23
|
+
virtual ~ICMultiFactor() override = default;
|
|
24
24
|
|
|
25
25
|
virtual void _checkParam(const string& name) const override;
|
|
26
26
|
};
|
|
@@ -22,7 +22,7 @@ public:
|
|
|
22
22
|
WeightMultiFactor(const vector<Indicator>& inds, const PriceList& weights,
|
|
23
23
|
const StockList& stks, const KQuery& query, const Stock& ref_stk, int ic_n,
|
|
24
24
|
bool spearman, int mode, bool save_all_factors);
|
|
25
|
-
virtual ~WeightMultiFactor() = default;
|
|
25
|
+
virtual ~WeightMultiFactor() override = default;
|
|
26
26
|
|
|
27
27
|
private:
|
|
28
28
|
PriceList m_weights; // 每个指标权重,与输入 inds 列表等长
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-03
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../NormalizeBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class NormMinMax : public NormalizeBase {
|
|
15
|
+
NORMALIZE_IMP(NormMinMax)
|
|
16
|
+
NORMALIZE_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
|
+
|
|
18
|
+
public:
|
|
19
|
+
NormMinMax();
|
|
20
|
+
virtual ~NormMinMax() override;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
} // namespace hku
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-03
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../NormalizeBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* 分位数均匀分布标准化
|
|
16
|
+
*/
|
|
17
|
+
class NormQuantile : public NormalizeBase {
|
|
18
|
+
NORMALIZE_IMP(NormQuantile)
|
|
19
|
+
NORMALIZE_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
20
|
+
|
|
21
|
+
public:
|
|
22
|
+
NormQuantile();
|
|
23
|
+
NormQuantile(double quantile_min, double quantile_max);
|
|
24
|
+
virtual ~NormQuantile() override;
|
|
25
|
+
virtual void _checkParam(const string& name) const override;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
} // namespace hku
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-03
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../NormalizeBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* 分位数均匀分布标准化
|
|
16
|
+
*/
|
|
17
|
+
class NormQuantileUniform : public NormalizeBase {
|
|
18
|
+
NORMALIZE_IMP(NormQuantileUniform)
|
|
19
|
+
NORMALIZE_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
20
|
+
|
|
21
|
+
public:
|
|
22
|
+
NormQuantileUniform();
|
|
23
|
+
NormQuantileUniform(double quantile_min, double quantile_max);
|
|
24
|
+
virtual ~NormQuantileUniform() override;
|
|
25
|
+
virtual void _checkParam(const string& name) const override;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
} // namespace hku
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-03
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "../NormalizeBase.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
class NormZScore : public NormalizeBase {
|
|
15
|
+
NORMALIZE_IMP(NormZScore)
|
|
16
|
+
NORMALIZE_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
17
|
+
|
|
18
|
+
public:
|
|
19
|
+
NormZScore();
|
|
20
|
+
NormZScore(bool outExtreme, double nsigma, bool recursive);
|
|
21
|
+
virtual ~NormZScore() override;
|
|
22
|
+
virtual void _checkParam(const string& name) const override;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
} // namespace hku
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 hikyuu.org
|
|
3
|
+
*
|
|
4
|
+
* Created on: 2025-10-15
|
|
5
|
+
* Author: fasiondog
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "hikyuu/DataType.h"
|
|
11
|
+
|
|
12
|
+
namespace hku {
|
|
13
|
+
|
|
14
|
+
PriceList quantile_trunc(const PriceList &src, double quantile_min, double quantile_max);
|
|
15
|
+
|
|
16
|
+
}
|
|
@@ -105,6 +105,13 @@ public:
|
|
|
105
105
|
|
|
106
106
|
virtual void _readyForRun() {}
|
|
107
107
|
virtual void _runMoment(const Datetime& date, const Datetime& nextCycle, bool adjust) {}
|
|
108
|
+
virtual void _runMomentOnOpen(const Datetime& date, const Datetime& nextCycle, bool adjust) {}
|
|
109
|
+
virtual void _runMomentOnClose(const Datetime& date, const Datetime& nextCycle, bool adjust) {}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* 回测完成后,返回最后一天交易记录,以及需要延迟的买入和卖出延迟请求
|
|
113
|
+
*/
|
|
114
|
+
virtual json lastSuggestion() const;
|
|
108
115
|
|
|
109
116
|
private:
|
|
110
117
|
void initParam();
|