hikyuu 2.7.0__py3-none-manylinux2014_aarch64.whl → 2.7.5__py3-none-manylinux2014_aarch64.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 +28 -8
- hikyuu/__init__.pyi +26 -14
- hikyuu/analysis/__init__.pyi +7 -1
- hikyuu/analysis/analysis.pyi +8 -2
- hikyuu/core.pyi +9 -3
- hikyuu/cpp/core310.pyi +172 -68
- hikyuu/cpp/core310.so +0 -0
- hikyuu/cpp/core311.pyi +172 -68
- hikyuu/cpp/core311.so +0 -0
- hikyuu/cpp/core312.pyi +172 -68
- hikyuu/cpp/core312.so +0 -0
- hikyuu/cpp/core313.pyi +172 -68
- hikyuu/cpp/core313.so +0 -0
- hikyuu/cpp/i18n/zh_CN/hikyuu.mo +0 -0
- hikyuu/cpp/i18n/zh_CN/hikyuu_plugin.mo +0 -0
- hikyuu/cpp/libboost_atomic.so +0 -0
- hikyuu/cpp/libboost_atomic.so.1.90.0 +0 -0
- hikyuu/cpp/{libboost_charconv-mt.so → libboost_charconv.so} +0 -0
- hikyuu/cpp/{libboost_charconv-mt.so.1.88.0 → libboost_charconv.so.1.90.0} +0 -0
- hikyuu/cpp/libboost_chrono.so +0 -0
- hikyuu/cpp/libboost_chrono.so.1.90.0 +0 -0
- hikyuu/cpp/libboost_container.so +0 -0
- hikyuu/cpp/libboost_container.so.1.90.0 +0 -0
- hikyuu/cpp/libboost_date_time.so +0 -0
- hikyuu/cpp/libboost_date_time.so.1.90.0 +0 -0
- hikyuu/cpp/libboost_locale.so +0 -0
- hikyuu/cpp/libboost_locale.so.1.90.0 +0 -0
- hikyuu/cpp/libboost_random.so +0 -0
- hikyuu/cpp/libboost_random.so.1.90.0 +0 -0
- hikyuu/cpp/libboost_serialization.so +0 -0
- hikyuu/cpp/libboost_serialization.so.1.90.0 +0 -0
- hikyuu/cpp/libboost_thread.so +0 -0
- hikyuu/cpp/libboost_thread.so.1.90.0 +0 -0
- hikyuu/cpp/libboost_wserialization.so +0 -0
- hikyuu/cpp/libboost_wserialization.so.1.90.0 +0 -0
- hikyuu/cpp/libhikyuu.so +0 -0
- hikyuu/cpp/libmimalloc.so +0 -0
- hikyuu/cpp/libmimalloc.so.3 +0 -0
- hikyuu/cpp/libmimalloc.so.3.1 +0 -0
- hikyuu/cpp/libsqlite3.so +0 -0
- hikyuu/data/clickhouse_upgrade/0001.sql +2 -0
- hikyuu/data/clickhouse_upgrade/0002.sql +9 -0
- hikyuu/data/common_clickhouse.py +1 -3
- hikyuu/data/common_mysql.py +1 -1
- hikyuu/data/download_block.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 +31 -4
- hikyuu/data/mysql_upgrade/0029.sql +2 -0
- hikyuu/data/mysql_upgrade/0030.sql +3 -0
- hikyuu/data/pytdx_to_clickhouse.py +86 -32
- hikyuu/data/pytdx_to_h5.py +73 -28
- hikyuu/data/pytdx_to_mysql.py +65 -21
- hikyuu/data/pytdx_weight_to_clickhouse.py +2 -0
- hikyuu/data/pytdx_weight_to_mysql.py +2 -0
- hikyuu/data/pytdx_weight_to_sqlite.py +2 -0
- hikyuu/data/sqlite_upgrade/0029.sql +4 -0
- hikyuu/data/sqlite_upgrade/0030.sql +5 -0
- hikyuu/data/tdx_to_clickhouse.py +2 -2
- hikyuu/data/tdx_to_h5.py +11 -11
- hikyuu/data/tdx_to_mysql.py +2 -2
- hikyuu/draw/__init__.pyi +1 -1
- hikyuu/draw/drawplot/__init__.pyi +1 -1
- hikyuu/draw/drawplot/bokeh_draw.pyi +17 -9
- hikyuu/draw/drawplot/echarts_draw.pyi +17 -9
- hikyuu/draw/drawplot/matplotlib_draw.py +23 -9
- hikyuu/draw/drawplot/matplotlib_draw.pyi +17 -9
- 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 +10 -4
- hikyuu/gui/HikyuuTDX.py +42 -3
- hikyuu/gui/data/MainWindow.py +189 -129
- 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 +28 -12
- hikyuu/include/hikyuu/StockTypeInfo.h +9 -9
- hikyuu/include/hikyuu/StockWeight.h +9 -9
- hikyuu/include/hikyuu/StrategyContext.h +4 -4
- hikyuu/include/hikyuu/TimeLineRecord.h +1 -1
- hikyuu/include/hikyuu/TransRecord.h +1 -1
- hikyuu/include/hikyuu/data_driver/BaseInfoDriver.h +2 -1
- hikyuu/include/hikyuu/data_driver/BlockInfoDriver.h +6 -0
- hikyuu/include/hikyuu/data_driver/KDataDriver.h +6 -7
- hikyuu/include/hikyuu/data_driver/kdata/mysql/MySQLKDataDriver.h +5 -1
- hikyuu/include/hikyuu/data_driver/kdata/sqlite/SQLiteKDataDriver.h +1 -1
- hikyuu/include/hikyuu/global/sysinfo.h +24 -5
- 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 +147 -74
- 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/KDataToClickHouseImporter.h +40 -0
- hikyuu/include/hikyuu/plugin/KDataToMySQLImporter.h +40 -0
- hikyuu/include/hikyuu/plugin/checkdata.h +20 -0
- hikyuu/include/hikyuu/plugin/extind.h +3 -0
- hikyuu/include/hikyuu/plugin/hkuextra.h +4 -0
- hikyuu/include/hikyuu/plugin/interface/CheckDataPluginInterface.h +25 -0
- hikyuu/include/hikyuu/plugin/interface/HkuExtraPluginInterface.h +4 -0
- hikyuu/include/hikyuu/plugin/interface/ImportKDataToClickHousePluginInterface.h +44 -0
- hikyuu/include/hikyuu/plugin/interface/ImportKDataToMySQLPluginInterface.h +42 -0
- hikyuu/include/hikyuu/plugin/interface/plugins.h +6 -0
- hikyuu/include/hikyuu/python/convert_any.h +9 -6
- hikyuu/include/hikyuu/python/pybind_utils.h +22 -5
- hikyuu/include/hikyuu/strategy/Strategy.h +1 -1
- hikyuu/include/hikyuu/trade_manage/TradeCostBase.h +5 -3
- hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +9 -3
- hikyuu/include/hikyuu/trade_manage/TradeRecord.h +2 -1
- hikyuu/include/hikyuu/trade_sys/allocatefunds/AllocateFundsBase.h +8 -4
- hikyuu/include/hikyuu/trade_sys/allocatefunds/build_in.h +1 -0
- hikyuu/include/hikyuu/trade_sys/allocatefunds/crt/AF_FixedAmount.h +26 -0
- hikyuu/include/hikyuu/trade_sys/allocatefunds/imp/FixAmountFunds.h +18 -0
- hikyuu/include/hikyuu/trade_sys/condition/ConditionBase.h +5 -3
- hikyuu/include/hikyuu/trade_sys/environment/EnvironmentBase.h +6 -3
- hikyuu/include/hikyuu/trade_sys/moneymanager/MoneyManagerBase.h +5 -3
- hikyuu/include/hikyuu/trade_sys/multifactor/MultiFactorBase.h +23 -20
- hikyuu/include/hikyuu/trade_sys/multifactor/NormalizeBase.h +6 -4
- hikyuu/include/hikyuu/trade_sys/multifactor/ScoresFilterBase.h +5 -3
- 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 +16 -13
- hikyuu/include/hikyuu/trade_sys/profitgoal/ProfitGoalBase.h +13 -13
- hikyuu/include/hikyuu/trade_sys/selector/SelectorBase.h +12 -3
- 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 -3
- hikyuu/include/hikyuu/trade_sys/slippage/SlippageBase.h +5 -3
- hikyuu/include/hikyuu/trade_sys/stoploss/StoplossBase.h +5 -3
- hikyuu/include/hikyuu/trade_sys/system/System.h +6 -4
- hikyuu/include/hikyuu/utilities/Log.h +6 -7
- hikyuu/include/hikyuu/utilities/LruCache.h +299 -0
- hikyuu/include/hikyuu/utilities/Parameter.h +17 -0
- hikyuu/include/hikyuu/utilities/arithmetic.h +2 -2
- hikyuu/include/hikyuu/utilities/config.h +28 -0
- hikyuu/include/hikyuu/utilities/omp_macro.h +25 -0
- hikyuu/include/hikyuu/utilities/plugin/PluginBase.h +17 -2
- hikyuu/include/hikyuu/utilities/plugin/PluginManager.h +46 -22
- hikyuu/include/hikyuu/utilities/thread/GlobalStealThreadPool.h +71 -19
- hikyuu/include/hikyuu/utilities/thread/GlobalThreadPool.h +1 -5
- hikyuu/include/hikyuu/utilities/thread/MQStealThreadPool.h +286 -0
- hikyuu/include/hikyuu/utilities/thread/MQThreadPool.h +1 -0
- hikyuu/include/hikyuu/utilities/thread/StealThreadPool.h +297 -0
- hikyuu/include/hikyuu/utilities/thread/ThreadPool.h +1 -4
- hikyuu/include/hikyuu/utilities/thread/WorkStealQueue.h +9 -8
- hikyuu/include/hikyuu/utilities/thread/algorithm.h +350 -14
- hikyuu/include/hikyuu/version.h +4 -4
- hikyuu/plugin/libbacktest.so +0 -0
- hikyuu/plugin/libcheckdata.so +0 -0
- hikyuu/plugin/libclickhousedriver.so +0 -0
- hikyuu/plugin/libdataserver.so +0 -0
- hikyuu/plugin/libdataserver_parquet.so +0 -0
- hikyuu/plugin/libdevice.so +0 -0
- hikyuu/plugin/libextind.so +0 -0
- hikyuu/plugin/libhkuextra.so +0 -0
- hikyuu/plugin/libimport2ch.so +0 -0
- hikyuu/plugin/libimport2hdf5.so +0 -0
- hikyuu/plugin/libimport2mysql.so +0 -0
- hikyuu/plugin/libtmreport.so +0 -0
- hikyuu/test/Indicator.py +1 -2
- hikyuu/trade_manage/__init__.pyi +14 -8
- hikyuu/trade_manage/trade.pyi +14 -8
- hikyuu/trade_sys/trade_sys.py +54 -5
- hikyuu/util/__init__.pyi +2 -2
- hikyuu/util/singleton.pyi +1 -1
- {hikyuu-2.7.0.dist-info → hikyuu-2.7.5.dist-info}/METADATA +10 -4
- {hikyuu-2.7.0.dist-info → hikyuu-2.7.5.dist-info}/RECORD +282 -252
- 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/data/pytdx_to_taos.py +0 -736
- {hikyuu-2.7.0.dist-info → hikyuu-2.7.5.dist-info}/WHEEL +0 -0
- {hikyuu-2.7.0.dist-info → hikyuu-2.7.5.dist-info}/entry_points.txt +0 -0
- {hikyuu-2.7.0.dist-info → hikyuu-2.7.5.dist-info}/top_level.txt +0 -0
|
@@ -88,7 +88,7 @@ public:
|
|
|
88
88
|
|
|
89
89
|
/** 克隆操作 */
|
|
90
90
|
typedef shared_ptr<Portfolio> PortfolioPtr;
|
|
91
|
-
PortfolioPtr clone()
|
|
91
|
+
PortfolioPtr clone();
|
|
92
92
|
|
|
93
93
|
/** 运行前准备 */
|
|
94
94
|
void readyForRun();
|
|
@@ -99,7 +99,7 @@ public:
|
|
|
99
99
|
virtual string str() const;
|
|
100
100
|
|
|
101
101
|
virtual void _reset() {}
|
|
102
|
-
virtual PortfolioPtr _clone()
|
|
102
|
+
virtual PortfolioPtr _clone() {
|
|
103
103
|
return std::make_shared<Portfolio>();
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -113,6 +113,10 @@ public:
|
|
|
113
113
|
*/
|
|
114
114
|
virtual json lastSuggestion() const;
|
|
115
115
|
|
|
116
|
+
bool isPythonObject() const noexcept {
|
|
117
|
+
return m_is_python_object;
|
|
118
|
+
}
|
|
119
|
+
|
|
116
120
|
private:
|
|
117
121
|
void initParam();
|
|
118
122
|
|
|
@@ -122,10 +126,6 @@ private:
|
|
|
122
126
|
const string& mode);
|
|
123
127
|
|
|
124
128
|
protected:
|
|
125
|
-
virtual bool isPythonObject() const {
|
|
126
|
-
return false;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
129
|
// 跟踪打印当前TM持仓情况
|
|
130
130
|
void traceMomentTMAfterRunAtOpen(const Datetime& date);
|
|
131
131
|
void traceMomentTMAfterRunAtClose(const Datetime& date);
|
|
@@ -139,6 +139,7 @@ protected:
|
|
|
139
139
|
|
|
140
140
|
KQuery m_query; // 关联的查询条件
|
|
141
141
|
bool m_need_calculate; // 是否需要计算标志
|
|
142
|
+
bool m_is_python_object{false};
|
|
142
143
|
|
|
143
144
|
SystemList m_real_sys_list; // 所有实际运行的子系统列表
|
|
144
145
|
|
|
@@ -160,6 +161,7 @@ private:
|
|
|
160
161
|
ar& BOOST_SERIALIZATION_NVP(m_se);
|
|
161
162
|
ar& BOOST_SERIALIZATION_NVP(m_af);
|
|
162
163
|
ar& BOOST_SERIALIZATION_NVP(m_query);
|
|
164
|
+
ar& BOOST_SERIALIZATION_NVP(m_is_python_object);
|
|
163
165
|
}
|
|
164
166
|
|
|
165
167
|
template <class Archive>
|
|
@@ -171,19 +173,20 @@ private:
|
|
|
171
173
|
ar& BOOST_SERIALIZATION_NVP(m_se);
|
|
172
174
|
ar& BOOST_SERIALIZATION_NVP(m_af);
|
|
173
175
|
ar& BOOST_SERIALIZATION_NVP(m_query);
|
|
176
|
+
ar& BOOST_SERIALIZATION_NVP(m_is_python_object);
|
|
174
177
|
}
|
|
175
178
|
|
|
176
179
|
BOOST_SERIALIZATION_SPLIT_MEMBER()
|
|
177
180
|
#endif /* HKU_SUPPORT_SERIALIZATION */
|
|
178
181
|
};
|
|
179
182
|
|
|
180
|
-
#define PORTFOLIO_IMP(classname)
|
|
181
|
-
public:
|
|
182
|
-
virtual PortfolioPtr _clone()
|
|
183
|
-
return std::make_shared<classname>();
|
|
184
|
-
}
|
|
185
|
-
virtual void _reset() override;
|
|
186
|
-
virtual void _readyForRun() override;
|
|
183
|
+
#define PORTFOLIO_IMP(classname) \
|
|
184
|
+
public: \
|
|
185
|
+
virtual PortfolioPtr _clone() override { \
|
|
186
|
+
return std::make_shared<classname>(); \
|
|
187
|
+
} \
|
|
188
|
+
virtual void _reset() override; \
|
|
189
|
+
virtual void _readyForRun() override; \
|
|
187
190
|
virtual void _runMoment(const Datetime& date, const Datetime& nextCycle, bool adjust) override;
|
|
188
191
|
|
|
189
192
|
/**
|
|
@@ -62,8 +62,8 @@ public:
|
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
* 买入时计算目标价格
|
|
65
|
-
* @param datetime
|
|
66
|
-
* @param price
|
|
65
|
+
* @param datetime 当前时间
|
|
66
|
+
* @param price 当前价格
|
|
67
67
|
* @return 返回Null<price_t>时,表示未限定目标; 返回0,意味着需要卖出
|
|
68
68
|
*/
|
|
69
69
|
virtual price_t getGoal(const Datetime& datetime, price_t price) = 0;
|
|
@@ -80,13 +80,14 @@ public:
|
|
|
80
80
|
virtual ProfitGoalPtr _clone() = 0;
|
|
81
81
|
|
|
82
82
|
/** 子类计算接口,由setTO调用 */
|
|
83
|
-
virtual void _calculate()
|
|
83
|
+
virtual void _calculate() {}
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return false;
|
|
85
|
+
bool isPythonObject() const noexcept {
|
|
86
|
+
return m_is_python_object;
|
|
88
87
|
}
|
|
89
88
|
|
|
89
|
+
bool m_is_python_object{false};
|
|
90
|
+
|
|
90
91
|
protected:
|
|
91
92
|
string m_name;
|
|
92
93
|
KData m_kdata;
|
|
@@ -143,13 +144,12 @@ private: \
|
|
|
143
144
|
#define PROFIT_GOAL_NO_PRIVATE_MEMBER_SERIALIZATION
|
|
144
145
|
#endif
|
|
145
146
|
|
|
146
|
-
#define PROFITGOAL_IMP(classname)
|
|
147
|
-
public:
|
|
148
|
-
virtual ProfitGoalPtr _clone() override {
|
|
149
|
-
return std::make_shared<classname>();
|
|
150
|
-
}
|
|
151
|
-
virtual price_t getGoal(const Datetime&, price_t) override;
|
|
152
|
-
virtual void _calculate() override;
|
|
147
|
+
#define PROFITGOAL_IMP(classname) \
|
|
148
|
+
public: \
|
|
149
|
+
virtual ProfitGoalPtr _clone() override { \
|
|
150
|
+
return std::make_shared<classname>(); \
|
|
151
|
+
} \
|
|
152
|
+
virtual price_t getGoal(const Datetime&, price_t) override;
|
|
153
153
|
|
|
154
154
|
/**
|
|
155
155
|
* 客户程序都应使用该指针类型
|
|
@@ -153,6 +153,11 @@ public:
|
|
|
153
153
|
return m_mf;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
void setMF(const MFPtr& mf) {
|
|
157
|
+
m_mf = mf;
|
|
158
|
+
m_calculated = false;
|
|
159
|
+
}
|
|
160
|
+
|
|
156
161
|
ScoresFilterPtr getScoresFilter() const {
|
|
157
162
|
return m_sc_filter;
|
|
158
163
|
}
|
|
@@ -163,9 +168,8 @@ public:
|
|
|
163
168
|
/** 在已有过滤基础上追加过滤,仅用于 MF 相关的 Selector,从 MF 获取 Score 列表时进行过滤 */
|
|
164
169
|
void addScoresFilter(const ScoresFilterPtr& filter);
|
|
165
170
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return false;
|
|
171
|
+
bool isPythonObject() const noexcept {
|
|
172
|
+
return m_is_python_object;
|
|
169
173
|
}
|
|
170
174
|
|
|
171
175
|
private:
|
|
@@ -177,6 +181,7 @@ protected:
|
|
|
177
181
|
|
|
178
182
|
protected:
|
|
179
183
|
string m_name;
|
|
184
|
+
bool m_is_python_object{false};
|
|
180
185
|
bool m_calculated{false}; // 是否已计算过
|
|
181
186
|
bool m_proto_calculated{false};
|
|
182
187
|
KQuery m_query;
|
|
@@ -196,6 +201,7 @@ private:
|
|
|
196
201
|
template <class Archive>
|
|
197
202
|
void save(Archive& ar, const unsigned int version) const {
|
|
198
203
|
ar& BOOST_SERIALIZATION_NVP(m_name);
|
|
204
|
+
ar& BOOST_SERIALIZATION_NVP(m_is_python_object);
|
|
199
205
|
ar& BOOST_SERIALIZATION_NVP(m_params);
|
|
200
206
|
ar& BOOST_SERIALIZATION_NVP(m_pro_sys_list);
|
|
201
207
|
ar& BOOST_SERIALIZATION_NVP(m_sc_filter);
|
|
@@ -205,6 +211,7 @@ private:
|
|
|
205
211
|
template <class Archive>
|
|
206
212
|
void load(Archive& ar, const unsigned int version) {
|
|
207
213
|
ar& BOOST_SERIALIZATION_NVP(m_name);
|
|
214
|
+
ar& BOOST_SERIALIZATION_NVP(m_is_python_object);
|
|
208
215
|
ar& BOOST_SERIALIZATION_NVP(m_params);
|
|
209
216
|
ar& BOOST_SERIALIZATION_NVP(m_pro_sys_list);
|
|
210
217
|
ar& BOOST_SERIALIZATION_NVP(m_sc_filter);
|
|
@@ -281,10 +288,12 @@ inline const SystemList& SelectorBase::getProtoSystemList() const {
|
|
|
281
288
|
|
|
282
289
|
inline void SelectorBase::setScoresFilter(const ScoresFilterPtr& filter) {
|
|
283
290
|
m_sc_filter = filter;
|
|
291
|
+
m_calculated = false;
|
|
284
292
|
}
|
|
285
293
|
|
|
286
294
|
inline void SelectorBase::addScoresFilter(const ScoresFilterPtr& filter) {
|
|
287
295
|
m_sc_filter = m_sc_filter | filter;
|
|
296
|
+
m_calculated = false;
|
|
288
297
|
}
|
|
289
298
|
|
|
290
299
|
} /* namespace hku */
|
|
@@ -27,7 +27,7 @@ SelectorPtr HKU_API SE_MultiFactor(const MFPtr& mf, int topn = 10);
|
|
|
27
27
|
* @param topn 只选取时间截面中前 topn 个系统,小于等于0时代表不限制
|
|
28
28
|
* @param ic_n ic 对应的 ic_n 日收益率
|
|
29
29
|
* @param ic_rolling_n 计算滚动 IC (即 IC 的 n 日移动平均)周期
|
|
30
|
-
* @param ref_stk
|
|
30
|
+
* @param ref_stk 参考证券,用于日期对齐,未指定时为 sh000001
|
|
31
31
|
* @param spearman 默认使用 spearman 计算相关系数,否则为 pearson
|
|
32
32
|
* @param mode "MF_ICIRWeight" | "MF_ICWeight" | "MF_EqualWeight" 因子合成算法名称
|
|
33
33
|
* @return SelectorPtr
|
|
@@ -26,7 +26,7 @@ SelectorPtr HKU_API SE_MultiFactor2(const MFPtr& mf,
|
|
|
26
26
|
* @param src_inds 原始因子公式
|
|
27
27
|
* @param ic_n ic 对应的 ic_n 日收益率
|
|
28
28
|
* @param ic_rolling_n 计算滚动 IC (即 IC 的 n 日移动平均)周期
|
|
29
|
-
* @param ref_stk
|
|
29
|
+
* @param ref_stk 参考证券,用于日期对齐,未指定时为 sh000001
|
|
30
30
|
* @param spearman 默认使用 spearman 计算相关系数,否则为 pearson
|
|
31
31
|
* @param mode "MF_ICIRWeight" | "MF_ICWeight" | "MF_EqualWeight" 因子合成算法名称
|
|
32
32
|
* @return SelectorPtr
|
|
@@ -54,8 +54,6 @@ public:
|
|
|
54
54
|
|
|
55
55
|
private:
|
|
56
56
|
void _initParams();
|
|
57
|
-
void _calculate_single(const vector<std::pair<size_t, size_t>>& train_ranges,
|
|
58
|
-
const DatetimeList& dates, size_t test_len, bool trace);
|
|
59
57
|
|
|
60
58
|
void _calculate_parallel(const vector<std::pair<size_t, size_t>>& train_ranges,
|
|
61
59
|
const DatetimeList& dates, size_t test_len, bool trace);
|
|
@@ -27,10 +27,6 @@ public:
|
|
|
27
27
|
virtual void _reset() override;
|
|
28
28
|
|
|
29
29
|
private:
|
|
30
|
-
void _calculate_single(const vector<std::pair<size_t, size_t>>& train_ranges,
|
|
31
|
-
const DatetimeList& dates, const string& key, int mode, size_t test_len,
|
|
32
|
-
bool trace);
|
|
33
|
-
|
|
34
30
|
void _calculate_parallel(const vector<std::pair<size_t, size_t>>& train_ranges,
|
|
35
31
|
const DatetimeList& dates, const string& key, int mode,
|
|
36
32
|
size_t test_len, bool trace);
|
|
@@ -130,9 +130,8 @@ public:
|
|
|
130
130
|
/** 子类计算接口,在setTO中调用 */
|
|
131
131
|
virtual void _calculate(const KData&) = 0;
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return false;
|
|
133
|
+
bool isPythonObject() const noexcept {
|
|
134
|
+
return m_is_python_object;
|
|
136
135
|
}
|
|
137
136
|
|
|
138
137
|
private:
|
|
@@ -141,6 +140,7 @@ private:
|
|
|
141
140
|
protected:
|
|
142
141
|
string m_name;
|
|
143
142
|
KData m_kdata;
|
|
143
|
+
bool m_is_python_object{false};
|
|
144
144
|
bool m_calculated{false}; // 仅针对 setTO 时的计算
|
|
145
145
|
|
|
146
146
|
/* 多头持仓 */
|
|
@@ -165,6 +165,7 @@ private:
|
|
|
165
165
|
void save(Archive& ar, const unsigned int version) const {
|
|
166
166
|
ar& BOOST_SERIALIZATION_NVP(m_name);
|
|
167
167
|
ar& BOOST_SERIALIZATION_NVP(m_params);
|
|
168
|
+
ar& BOOST_SERIALIZATION_NVP(m_is_python_object);
|
|
168
169
|
ar& BOOST_SERIALIZATION_NVP(m_hold_long);
|
|
169
170
|
ar& BOOST_SERIALIZATION_NVP(m_hold_short);
|
|
170
171
|
ar& BOOST_SERIALIZATION_NVP(m_buySig);
|
|
@@ -178,6 +179,7 @@ private:
|
|
|
178
179
|
void load(Archive& ar, const unsigned int version) {
|
|
179
180
|
ar& BOOST_SERIALIZATION_NVP(m_name);
|
|
180
181
|
ar& BOOST_SERIALIZATION_NVP(m_params);
|
|
182
|
+
ar& BOOST_SERIALIZATION_NVP(m_is_python_object);
|
|
181
183
|
ar& BOOST_SERIALIZATION_NVP(m_hold_long);
|
|
182
184
|
ar& BOOST_SERIALIZATION_NVP(m_hold_short);
|
|
183
185
|
ar& BOOST_SERIALIZATION_NVP(m_buySig);
|
|
@@ -71,14 +71,14 @@ public:
|
|
|
71
71
|
/** 子类计算接口,由setTO调用 */
|
|
72
72
|
virtual void _calculate() = 0;
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return false;
|
|
74
|
+
bool isPythonObject() const noexcept {
|
|
75
|
+
return m_is_python_object;
|
|
77
76
|
}
|
|
78
77
|
|
|
79
78
|
protected:
|
|
80
79
|
string m_name;
|
|
81
80
|
KData m_kdata;
|
|
81
|
+
bool m_is_python_object{false};
|
|
82
82
|
|
|
83
83
|
//============================================
|
|
84
84
|
// 序列化支持
|
|
@@ -89,12 +89,14 @@ private:
|
|
|
89
89
|
template <class Archive>
|
|
90
90
|
void save(Archive& ar, const unsigned int version) const {
|
|
91
91
|
ar& BOOST_SERIALIZATION_NVP(m_name);
|
|
92
|
+
ar& BOOST_SERIALIZATION_NVP(m_is_python_object);
|
|
92
93
|
ar& BOOST_SERIALIZATION_NVP(m_params);
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
template <class Archive>
|
|
96
97
|
void load(Archive& ar, const unsigned int version) {
|
|
97
98
|
ar& BOOST_SERIALIZATION_NVP(m_name);
|
|
99
|
+
ar& BOOST_SERIALIZATION_NVP(m_is_python_object);
|
|
98
100
|
ar& BOOST_SERIALIZATION_NVP(m_params);
|
|
99
101
|
}
|
|
100
102
|
|
|
@@ -86,12 +86,12 @@ public:
|
|
|
86
86
|
/** 子类计算接口,由setTO调用 */
|
|
87
87
|
virtual void _calculate() = 0;
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return false;
|
|
89
|
+
bool isPythonObject() const noexcept {
|
|
90
|
+
return m_is_python_object;
|
|
92
91
|
}
|
|
93
92
|
|
|
94
93
|
protected:
|
|
94
|
+
bool m_is_python_object{false};
|
|
95
95
|
string m_name;
|
|
96
96
|
TradeManagerPtr m_tm;
|
|
97
97
|
KData m_kdata;
|
|
@@ -104,6 +104,7 @@ private:
|
|
|
104
104
|
friend class boost::serialization::access;
|
|
105
105
|
template <class Archive>
|
|
106
106
|
void save(Archive& ar, const unsigned int version) const {
|
|
107
|
+
ar& BOOST_SERIALIZATION_NVP(m_is_python_object);
|
|
107
108
|
ar& BOOST_SERIALIZATION_NVP(m_name);
|
|
108
109
|
ar& BOOST_SERIALIZATION_NVP(m_params);
|
|
109
110
|
// m_kdata都是系统运行时临时设置,不需要序列化
|
|
@@ -112,6 +113,7 @@ private:
|
|
|
112
113
|
|
|
113
114
|
template <class Archive>
|
|
114
115
|
void load(Archive& ar, const unsigned int version) {
|
|
116
|
+
ar& BOOST_SERIALIZATION_NVP(m_is_python_object);
|
|
115
117
|
ar& BOOST_SERIALIZATION_NVP(m_name);
|
|
116
118
|
ar& BOOST_SERIALIZATION_NVP(m_params);
|
|
117
119
|
// m_kdata都是系统运行时临时设置,不需要序列化
|
|
@@ -36,7 +36,7 @@ class HKU_API WalkForwardSystem;
|
|
|
36
36
|
* 交易系统基类
|
|
37
37
|
* @ingroup System
|
|
38
38
|
*/
|
|
39
|
-
class HKU_API System {
|
|
39
|
+
class HKU_API System : public enable_shared_from_this<System> {
|
|
40
40
|
PARAMETER_SUPPORT_WITH_CHECK
|
|
41
41
|
friend class HKU_API Portfolio;
|
|
42
42
|
friend class HKU_API AllocateFundsBase;
|
|
@@ -276,9 +276,8 @@ public:
|
|
|
276
276
|
// 处理延迟买入请求,仅供 PF 调用
|
|
277
277
|
virtual TradeRecord pfProcessDelayBuyRequest(const Datetime& date);
|
|
278
278
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
return false;
|
|
279
|
+
bool isPythonObject() const noexcept {
|
|
280
|
+
return m_is_python_object;
|
|
282
281
|
}
|
|
283
282
|
|
|
284
283
|
private:
|
|
@@ -352,6 +351,7 @@ protected:
|
|
|
352
351
|
KData m_kdata;
|
|
353
352
|
KData m_src_kdata; // 未复权的原始 K 线数据
|
|
354
353
|
|
|
354
|
+
bool m_is_python_object{false};
|
|
355
355
|
bool m_calculated; // 控制是否需要重新计算
|
|
356
356
|
bool m_pre_ev_valid;
|
|
357
357
|
bool m_pre_cn_valid;
|
|
@@ -394,6 +394,7 @@ private:
|
|
|
394
394
|
ar& BOOST_SERIALIZATION_NVP(m_kdata);
|
|
395
395
|
ar& BOOST_SERIALIZATION_NVP(m_stock);
|
|
396
396
|
|
|
397
|
+
ar& BOOST_SERIALIZATION_NVP(m_is_python_object);
|
|
397
398
|
ar& BOOST_SERIALIZATION_NVP(m_calculated);
|
|
398
399
|
ar& BOOST_SERIALIZATION_NVP(m_pre_ev_valid);
|
|
399
400
|
ar& BOOST_SERIALIZATION_NVP(m_pre_cn_valid);
|
|
@@ -428,6 +429,7 @@ private:
|
|
|
428
429
|
ar& BOOST_SERIALIZATION_NVP(m_kdata);
|
|
429
430
|
ar& BOOST_SERIALIZATION_NVP(m_stock);
|
|
430
431
|
|
|
432
|
+
ar& BOOST_SERIALIZATION_NVP(m_is_python_object);
|
|
431
433
|
ar& BOOST_SERIALIZATION_NVP(m_calculated);
|
|
432
434
|
ar& BOOST_SERIALIZATION_NVP(m_pre_ev_valid);
|
|
433
435
|
ar& BOOST_SERIALIZATION_NVP(m_pre_cn_valid);
|
|
@@ -343,13 +343,12 @@ std::shared_ptr<spdlog::logger> HKU_UTILS_API getHikyuuLogger();
|
|
|
343
343
|
}
|
|
344
344
|
|
|
345
345
|
/** 用于 catch (...) 中打印,减少编译后代码大小 */
|
|
346
|
-
|
|
347
|
-
#define
|
|
348
|
-
#define
|
|
349
|
-
#define
|
|
350
|
-
#define
|
|
351
|
-
#define
|
|
352
|
-
#define HKU_FATAL_UNKNOWN HKU_FATAL("{}", g_unknown_error_msg)
|
|
346
|
+
#define HKU_THROW_UNKNOWN HKU_THROW("Unknown error!")
|
|
347
|
+
#define HKU_TRACE_UNKNOWN HKU_TRACE("Unknown error!")
|
|
348
|
+
#define HKU_DEBUG_UNKNOWN HKU_DEBUG("Unknown error!")
|
|
349
|
+
#define HKU_INFO_UNKNOWN HKU_INFO("Unknown error!");
|
|
350
|
+
#define HKU_ERROR_UNKNOWN HKU_ERROR("Unknown error!");
|
|
351
|
+
#define HKU_FATAL_UNKNOWN HKU_FATAL("Unknown error!");
|
|
353
352
|
|
|
354
353
|
#if CPP_STANDARD >= CPP_STANDARD_20
|
|
355
354
|
#define CLASS_LOGGER_IMP(cls) \
|