hikyuu 2.6.8.5__py3-none-win_amd64.whl → 2.6.9__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 +5 -11
- hikyuu/__init__.pyi +37 -12
- hikyuu/analysis/__init__.pyi +26 -0
- hikyuu/analysis/analysis.pyi +27 -1
- hikyuu/core.py +2 -0
- hikyuu/core.pyi +28 -2
- hikyuu/cpp/arrow.dll +0 -0
- hikyuu/cpp/boost_date_time-mt.dll +0 -0
- hikyuu/cpp/boost_serialization-mt.dll +0 -0
- hikyuu/cpp/boost_system-mt.dll +0 -0
- hikyuu/cpp/boost_wserialization-mt.dll +0 -0
- hikyuu/cpp/core310.pyd +0 -0
- hikyuu/cpp/core310.pyi +446 -9
- hikyuu/cpp/core311.pyd +0 -0
- hikyuu/cpp/core311.pyi +446 -9
- hikyuu/cpp/core312.pyd +0 -0
- hikyuu/cpp/core312.pyi +446 -9
- hikyuu/cpp/core313.pyd +0 -0
- hikyuu/cpp/core313.pyi +446 -9
- hikyuu/cpp/core39.pyd +0 -0
- hikyuu/cpp/core39.pyi +446 -9
- hikyuu/cpp/hikyuu.dll +0 -0
- hikyuu/cpp/hikyuu.lib +0 -0
- hikyuu/cpp/i18n/zh_CN/hikyuu.mo +0 -0
- hikyuu/cpp/msvcp140-a118642f3ae8774fb9dc223e15c4a52e.dll +0 -0
- hikyuu/cpp/parquet.dll +0 -0
- hikyuu/cpp/sqlite3.dll +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/bokeh_draw.pyi +33 -8
- hikyuu/draw/drawplot/echarts_draw.pyi +33 -8
- hikyuu/draw/drawplot/matplotlib_draw.py +4 -74
- hikyuu/draw/drawplot/matplotlib_draw.pyi +33 -8
- hikyuu/examples/notebook/Demo/Demo1.ipynb +48 -33
- hikyuu/extend.py +0 -1
- hikyuu/extend.pyi +30 -5
- 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/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/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/misc.h +38 -0
- hikyuu/include/hikyuu/plugin/dataserver.h +2 -1
- hikyuu/include/hikyuu/plugin/extind.h +37 -0
- hikyuu/include/hikyuu/plugin/interface/DataServerPluginInterface.h +2 -2
- hikyuu/include/hikyuu/plugin/interface/ExtendIndicatorsPluginInterface.h +12 -0
- 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 +45 -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/backtest.dll +0 -0
- hikyuu/plugin/clickhousedriver.dll +0 -0
- hikyuu/plugin/dataserver.dll +0 -0
- hikyuu/plugin/device.dll +0 -0
- hikyuu/plugin/extind.dll +0 -0
- hikyuu/plugin/hkuextra.dll +0 -0
- hikyuu/plugin/hkuviews.dll +0 -0
- hikyuu/plugin/import2hdf5.dll +0 -0
- hikyuu/plugin/tmreport.dll +0 -0
- hikyuu/trade_manage/__init__.pyi +33 -8
- hikyuu/trade_manage/trade.pyi +33 -8
- hikyuu/util/__init__.pyi +2 -2
- hikyuu/util/singleton.pyi +1 -1
- {hikyuu-2.6.8.5.dist-info → hikyuu-2.6.9.dist-info}/METADATA +13 -14
- {hikyuu-2.6.8.5.dist-info → hikyuu-2.6.9.dist-info}/RECORD +167 -149
- {hikyuu-2.6.8.5.dist-info → hikyuu-2.6.9.dist-info}/top_level.txt +2 -1
- 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.5.dist-info → hikyuu-2.6.9.dist-info}/WHEEL +0 -0
- {hikyuu-2.6.8.5.dist-info → hikyuu-2.6.9.dist-info}/entry_points.txt +0 -0
hikyuu/cpp/core311.pyi
CHANGED
|
@@ -3,7 +3,7 @@ import collections.abc
|
|
|
3
3
|
import numpy
|
|
4
4
|
import numpy.typing
|
|
5
5
|
import typing
|
|
6
|
-
__all__ = ['ABS', 'ACOS', 'AD', 'ADVANCE', 'AF_EqualWeight', 'AF_FixedWeight', 'AF_FixedWeightList', 'AF_MultiFactor', 'AGG_COUNT', 'AGG_MAD', 'AGG_MAX', 'AGG_MEAN', 'AGG_MEDIAN', 'AGG_MIN', 'AGG_PROD', 'AGG_QUANTILE', 'AGG_STD', 'AGG_SUM', 'AGG_VAR', 'ALIGN', 'AMA', 'ASIN', 'ATAN', 'ATR', 'AVEDEV', 'AllocateFundsBase', 'BACKSET', 'BARSCOUNT', 'BARSLAST', 'BARSLASTCOUNT', 'BARSSINCE', 'BARSSINCEN', 'BETWEEN', 'BLOCKSETNUM', 'BUSINESS', 'Block', 'BlockInfoDriver', 'BorrowRecord', 'BrokerPositionRecord', 'CEILING', 'CN_Bool', 'CN_OPLine', 'CONTEXT', 'CONTEXT_K', 'CORR', 'COS', 'COST', 'COUNT', 'CROSS', 'CVAL', 'CYCLE', 'C_AMO', 'C_CLOSE', 'C_HIGH', 'C_KDATA', 'C_LOW', 'C_OPEN', 'C_VOL', 'ConditionBase', 'Constant', 'CostRecord', 'DATE', 'DAY', 'DEBUG', 'DECLINE', 'DEVSQ', 'DIFF', 'DISCARD', 'DMA', 'DOWNNDAY', 'DROPNA', 'DataDriverFactory', 'Datetime', 'DatetimeList', 'Days', 'EMA', 'ERROR', 'EVERY', 'EV_Bool', 'EV_TwoLine', 'EXIST', 'EXP', 'EnvironmentBase', 'FATAL', 'FILTER', 'FINANCE', 'FLOOR', 'FundsRecord', 'HHV', 'HHVBARS', 'HKUException', 'HOUR', 'HSL', 'Hours', 'IC', 'ICIR', 'IF', 'INBLOCK', 'INDEXA', 'INDEXADV', 'INDEXC', 'INDEXDEC', 'INDEXH', 'INDEXL', 'INDEXO', 'INDEXV', 'INFO', 'INSUM', 'INTPART', 'IR', 'ISINF', 'ISINFA', 'ISLASTBAR', 'ISNA', 'IndParam', 'Indicator', 'IndicatorImp', 'JUMPDOWN', 'JUMPUP', 'KALMAN', 'KDATA_PART', 'KData', 'KDataDriver', 'KDataToHdf5Importer', 'KRecord', 'KRecordList', 'LAST', 'LASTVALUE', 'LIUTONGPAN', 'LLV', 'LLVBARS', 'LN', 'LOG', 'LOG_LEVEL', 'LONGCROSS', 'LoanRecord', 'MA', 'MACD', 'MAX', 'MDD', 'MF_EqualWeight', 'MF_ICIRWeight', 'MF_ICWeight', 'MF_Weight', 'MIN', 'MINUTE', 'MM_FixedCapital', 'MM_FixedCapitalFunds', 'MM_FixedCount', 'MM_FixedCountTps', 'MM_FixedPercent', 'MM_FixedRisk', 'MM_FixedUnits', 'MM_Nothing', 'MM_WilliamsFixedRisk', 'MOD', 'MONTH', 'MRR', 'MarketInfo', 'Microseconds', 'Milliseconds', 'Minutes', 'MoneyManagerBase', 'MultiFactorBase', 'NDAY', 'NOT', 'OFF', 'OrderBrokerBase', 'PF_Simple', 'PF_WithoutAF', 'PG_FixedHoldDays', 'PG_FixedPercent', 'PG_NoGoal', 'POS', 'POW', 'PRICELIST', 'Parameter', 'Performance', 'Portfolio', 'PositionRecord', 'PositionRecordList', 'ProfitGoalBase', 'Query', 'RANK', 'RECOVER_BACKWARD', 'RECOVER_EQUAL_BACKWARD', 'RECOVER_EQUAL_FORWARD', 'RECOVER_FORWARD', 'REF', 'REFX', 'REPLACE', 'RESULT', 'REVERSE', 'ROC', 'ROCP', 'ROCR', 'ROCR100', 'ROUND', 'ROUNDDOWN', 'ROUNDUP', 'RSI', 'SAFTYLOSS', 'SE_EvaluateOptimal', 'SE_Fixed', 'SE_MaxFundsOptimal', 'SE_MultiFactor', 'SE_PerformanceOptimal', 'SE_Signal', 'SGN', 'SG_Add', 'SG_AllwaysBuy', 'SG_And', 'SG_Band', 'SG_Bool', 'SG_Buy', 'SG_Cross', 'SG_CrossGold', 'SG_Cycle', 'SG_Div', 'SG_Flex', 'SG_Mul', 'SG_OneSide', 'SG_Or', 'SG_Sell', 'SG_Single', 'SG_Single2', 'SG_Sub', 'SIN', 'SLICE', 'SLOPE', 'SMA', 'SPEARMAN', 'SP_FixedPercent', 'SP_FixedValue', 'SQRT', 'STDEV', 'STDP', 'ST_FixedPercent', 'ST_Indicator', 'ST_Saftyloss', 'SUM', 'SUMBARS', 'SYS_Simple', 'SYS_WalkForward', 'ScoreRecord', 'ScoreRecordList', 'Seconds', 'SelectorBase', 'SignalBase', 'SlippageBase', 'SpotRecord', 'Stock', 'StockManager', 'StockTypeInfo', 'StockWeight', 'StockWeightList', 'StoplossBase', 'Strategy', 'StrategyContext', 'System', 'SystemPart', 'SystemWeight', 'SystemWeightList', 'TAN', 'TA_ACCBANDS', 'TA_ACOS', 'TA_AD', 'TA_ADD', 'TA_ADOSC', 'TA_ADX', 'TA_ADXR', 'TA_APO', 'TA_AROON', 'TA_AROONOSC', 'TA_ASIN', 'TA_ATAN', 'TA_ATR', 'TA_AVGDEV', 'TA_AVGPRICE', 'TA_BBANDS', 'TA_BETA', 'TA_BOP', 'TA_CCI', 'TA_CDL2CROWS', 'TA_CDL3BLACKCROWS', 'TA_CDL3INSIDE', 'TA_CDL3LINESTRIKE', 'TA_CDL3OUTSIDE', 'TA_CDL3STARSINSOUTH', 'TA_CDL3WHITESOLDIERS', 'TA_CDLABANDONEDBABY', 'TA_CDLADVANCEBLOCK', 'TA_CDLBELTHOLD', 'TA_CDLBREAKAWAY', 'TA_CDLCLOSINGMARUBOZU', 'TA_CDLCONCEALBABYSWALL', 'TA_CDLCOUNTERATTACK', 'TA_CDLDARKCLOUDCOVER', 'TA_CDLDOJI', 'TA_CDLDOJISTAR', 'TA_CDLDRAGONFLYDOJI', 'TA_CDLENGULFING', 'TA_CDLEVENINGDOJISTAR', 'TA_CDLEVENINGSTAR', 'TA_CDLGAPSIDESIDEWHITE', 'TA_CDLGRAVESTONEDOJI', 'TA_CDLHAMMER', 'TA_CDLHANGINGMAN', 'TA_CDLHARAMI', 'TA_CDLHARAMICROSS', 'TA_CDLHIGHWAVE', 'TA_CDLHIKKAKE', 'TA_CDLHIKKAKEMOD', 'TA_CDLHOMINGPIGEON', 'TA_CDLIDENTICAL3CROWS', 'TA_CDLINNECK', 'TA_CDLINVERTEDHAMMER', 'TA_CDLKICKING', 'TA_CDLKICKINGBYLENGTH', 'TA_CDLLADDERBOTTOM', 'TA_CDLLONGLEGGEDDOJI', 'TA_CDLLONGLINE', 'TA_CDLMARUBOZU', 'TA_CDLMATCHINGLOW', 'TA_CDLMATHOLD', 'TA_CDLMORNINGDOJISTAR', 'TA_CDLMORNINGSTAR', 'TA_CDLONNECK', 'TA_CDLPIERCING', 'TA_CDLRICKSHAWMAN', 'TA_CDLRISEFALL3METHODS', 'TA_CDLSEPARATINGLINES', 'TA_CDLSHOOTINGSTAR', 'TA_CDLSHORTLINE', 'TA_CDLSPINNINGTOP', 'TA_CDLSTALLEDPATTERN', 'TA_CDLSTICKSANDWICH', 'TA_CDLTAKURI', 'TA_CDLTASUKIGAP', 'TA_CDLTHRUSTING', 'TA_CDLTRISTAR', 'TA_CDLUNIQUE3RIVER', 'TA_CDLUPSIDEGAP2CROWS', 'TA_CDLXSIDEGAP3METHODS', 'TA_CEIL', 'TA_CMO', 'TA_CORREL', 'TA_COS', 'TA_COSH', 'TA_DEMA', 'TA_DIV', 'TA_DX', 'TA_EMA', 'TA_EXP', 'TA_FLOOR', 'TA_HT_DCPERIOD', 'TA_HT_DCPHASE', 'TA_HT_PHASOR', 'TA_HT_SINE', 'TA_HT_TRENDLINE', 'TA_HT_TRENDMODE', 'TA_IMI', 'TA_KAMA', 'TA_LINEARREG', 'TA_LINEARREG_ANGLE', 'TA_LINEARREG_INTERCEPT', 'TA_LINEARREG_SLOPE', 'TA_LN', 'TA_LOG10', 'TA_MA', 'TA_MACD', 'TA_MACDEXT', 'TA_MACDFIX', 'TA_MAMA', 'TA_MAVP', 'TA_MAX', 'TA_MAXINDEX', 'TA_MEDPRICE', 'TA_MFI', 'TA_MIDPOINT', 'TA_MIDPRICE', 'TA_MIN', 'TA_MININDEX', 'TA_MINMAX', 'TA_MINMAXINDEX', 'TA_MINUS_DI', 'TA_MINUS_DM', 'TA_MOM', 'TA_MULT', 'TA_NATR', 'TA_OBV', 'TA_PLUS_DI', 'TA_PLUS_DM', 'TA_PPO', 'TA_ROC', 'TA_ROCP', 'TA_ROCR', 'TA_ROCR100', 'TA_RSI', 'TA_SAR', 'TA_SAREXT', 'TA_SIN', 'TA_SINH', 'TA_SMA', 'TA_SQRT', 'TA_STDDEV', 'TA_STOCH', 'TA_STOCHF', 'TA_STOCHRSI', 'TA_SUB', 'TA_SUM', 'TA_T3', 'TA_TAN', 'TA_TANH', 'TA_TEMA', 'TA_TRANGE', 'TA_TRIMA', 'TA_TRIX', 'TA_TSF', 'TA_TYPPRICE', 'TA_ULTOSC', 'TA_VAR', 'TA_WCLPRICE', 'TA_WILLR', 'TA_WMA', 'TC_FixedA', 'TC_FixedA2015', 'TC_FixedA2017', 'TC_TestStub', 'TC_Zero', 'TIME', 'TIMELINE', 'TIMELINEVOL', 'TR', 'TRACE', 'TURNOVER', 'TimeDelta', 'TimeLineList', 'TimeLineRecord', 'TradeCostBase', 'TradeManager', 'TradeRecord', 'TradeRecordList', 'TradeRequest', 'TransList', 'TransRecord', 'UPNDAY', 'UTCOffset', 'VAR', 'VARP', 'VIGOR', 'WARN', 'WEAVE', 'WEEK', 'WINNER', 'WITHDAY', 'WITHHALFYEAR', 'WITHHOUR', 'WITHHOUR2', 'WITHHOUR4', 'WITHKTYPE', 'WITHMIN', 'WITHMIN15', 'WITHMIN30', 'WITHMIN5', 'WITHMIN60', 'WITHMONTH', 'WITHQUARTER', 'WITHWEEK', 'WITHYEAR', 'WMA', 'YEAR', 'ZHBOND10', 'ZONGGUBEN', 'ZSCORE', 'active_device', 'backtest', 'batch_calculate_inds', 'can_upgrade', 'close_ostream_to_python', 'close_spend_time', 'combinate_ind', 'combinate_index', 'constant', 'crtBrokerTM', 'crtSEOptimal', 'crtTM', 'crt_pf_strategy', 'crt_sys_strategy', 'dates_to_np', 'dates_to_pa', 'df_to_krecords', 'fetch_trial_license', 'find_optimal_system', 'find_optimal_system_multi', 'get_block', 'get_business_name', 'get_data_from_buffer_server', 'get_date_range', 'get_inds_view', 'get_inds_view_pyarrow', 'get_kdata', 'get_last_version', 'get_log_level', 'get_market_view', 'get_market_view_pyarrow', 'get_spot_from_buffer_server', 'get_stock', 'get_system_part_enum', 'get_system_part_name', 'get_version', 'get_version_git', 'get_version_with_build', 'hikyuu_init', 'inner_analysis_sys_list', 'inner_combinate_ind_analysis', 'inner_combinate_ind_analysis_with_block', 'is_valid_license', 'isinf', 'isnan', 'krecords_to_df', 'krecords_to_np', 'krecords_to_pa', 'open_ostream_to_python', 'open_spend_time', 'positions_to_df', 'positions_to_np', 'positions_to_pa', 'register_extra_ktype', 'release_extra_ktype', 'remove_license', 'roundDown', 'roundEx', 'roundUp', 'run_in_strategy', 'scorerecords_to_df', 'scorerecords_to_np', 'set_log_level', 'set_python_in_interactive', 'set_python_in_jupyter', 'spot_agent_is_connected', 'spot_agent_is_running', 'start_data_server', 'start_spot_agent', 'stop_data_server', 'stop_spot_agent', 'systemweights_to_df', 'systemweights_to_np', 'timeline_to_df', 'timeline_to_np', 'timeline_to_pa', 'toPriceList', 'trades_to_df', 'trades_to_np', 'trades_to_pa', 'translist_to_df', 'translist_to_np', 'translist_to_pa', 'view_license', 'weights_to_df', 'weights_to_np', 'weights_to_pa']
|
|
6
|
+
__all__ = ['ABS', 'ACOS', 'AD', 'ADVANCE', 'AF_EqualWeight', 'AF_FixedWeight', 'AF_FixedWeightList', 'AF_MultiFactor', 'AGG_COUNT', 'AGG_FUNC', 'AGG_MAD', 'AGG_MAX', 'AGG_MEAN', 'AGG_MEDIAN', 'AGG_MIN', 'AGG_PROD', 'AGG_QUANTILE', 'AGG_STD', 'AGG_SUM', 'AGG_VAR', 'ALIGN', 'AMA', 'ASIN', 'ATAN', 'ATR', 'AVEDEV', 'AllocateFundsBase', 'BACKSET', 'BARSCOUNT', 'BARSLAST', 'BARSLASTCOUNT', 'BARSSINCE', 'BARSSINCEN', 'BETWEEN', 'BLOCKSETNUM', 'BUSINESS', 'Block', 'BlockInfoDriver', 'BorrowRecord', 'BrokerPositionRecord', 'CEILING', 'CN_Bool', 'CN_OPLine', 'CONTEXT', 'CONTEXT_K', 'CORR', 'COS', 'COST', 'COUNT', 'CROSS', 'CVAL', 'CYCLE', 'C_AMO', 'C_CLOSE', 'C_HIGH', 'C_KDATA', 'C_LOW', 'C_OPEN', 'C_VOL', 'ConditionBase', 'Constant', 'CostRecord', 'DATE', 'DAY', 'DEBUG', 'DECLINE', 'DEVSQ', 'DIFF', 'DISCARD', 'DMA', 'DOWNNDAY', 'DROPNA', 'DataDriverFactory', 'Datetime', 'DatetimeList', 'Days', 'EMA', 'ERROR', 'EVERY', 'EV_Bool', 'EV_TwoLine', 'EXIST', 'EXP', 'EnvironmentBase', 'FATAL', 'FILTER', 'FINANCE', 'FLOOR', 'FundsRecord', 'GROUP_COUNT', 'GROUP_FUNC', 'GROUP_MAX', 'GROUP_MEAN', 'GROUP_MIN', 'GROUP_PROD', 'GROUP_SUM', 'HHV', 'HHVBARS', 'HKUException', 'HOUR', 'HSL', 'Hours', 'IC', 'ICIR', 'IF', 'INBLOCK', 'INDEXA', 'INDEXADV', 'INDEXC', 'INDEXDEC', 'INDEXH', 'INDEXL', 'INDEXO', 'INDEXV', 'INFO', 'INSUM', 'INTPART', 'IR', 'ISINF', 'ISINFA', 'ISLASTBAR', 'ISNA', 'IndParam', 'Indicator', 'IndicatorImp', 'JUMPDOWN', 'JUMPUP', 'KALMAN', 'KDATA_PART', 'KData', 'KDataDriver', 'KDataToHdf5Importer', 'KRecord', 'KRecordList', 'LAST', 'LASTVALUE', 'LIUTONGPAN', 'LLV', 'LLVBARS', 'LN', 'LOG', 'LOG_LEVEL', 'LONGCROSS', 'LoanRecord', 'MA', 'MACD', 'MAX', 'MDD', 'MF_EqualWeight', 'MF_ICIRWeight', 'MF_ICWeight', 'MF_Weight', 'MIN', 'MINUTE', 'MM_FixedCapital', 'MM_FixedCapitalFunds', 'MM_FixedCount', 'MM_FixedCountTps', 'MM_FixedPercent', 'MM_FixedRisk', 'MM_FixedUnits', 'MM_Nothing', 'MM_WilliamsFixedRisk', 'MOD', 'MONTH', 'MRR', 'MarketInfo', 'Microseconds', 'Milliseconds', 'Minutes', 'MoneyManagerBase', 'MultiFactorBase', 'NDAY', 'NORM_MinMax', 'NORM_NOTHING', 'NORM_Quantile', 'NORM_Quantile_Uniform', 'NORM_Zscore', 'NOT', 'NormalizeBase', 'OFF', 'OrderBrokerBase', 'PF_Simple', 'PF_WithoutAF', 'PG_FixedHoldDays', 'PG_FixedPercent', 'PG_NoGoal', 'POS', 'POW', 'PRICELIST', 'Parameter', 'Performance', 'Portfolio', 'PositionRecord', 'PositionRecordList', 'ProfitGoalBase', 'QUANTILE_TRUNC', 'Query', 'RANK', 'RECOVER_BACKWARD', 'RECOVER_EQUAL_BACKWARD', 'RECOVER_EQUAL_FORWARD', 'RECOVER_FORWARD', 'REF', 'REFX', 'REPLACE', 'RESULT', 'REVERSE', 'ROC', 'ROCP', 'ROCR', 'ROCR100', 'ROUND', 'ROUNDDOWN', 'ROUNDUP', 'RSI', 'SAFTYLOSS', 'SCFilter_AmountLimit', 'SCFilter_Group', 'SCFilter_IgnoreNan', 'SCFilter_LessOrEqualValue', 'SCFilter_Price', 'SCFilter_TopN', 'SE_EvaluateOptimal', 'SE_Fixed', 'SE_MaxFundsOptimal', 'SE_MultiFactor', 'SE_MultiFactor2', 'SE_PerformanceOptimal', 'SE_Signal', 'SGN', 'SG_Add', 'SG_AllwaysBuy', 'SG_And', 'SG_Band', 'SG_Bool', 'SG_Buy', 'SG_Cross', 'SG_CrossGold', 'SG_Cycle', 'SG_Div', 'SG_Flex', 'SG_Mul', 'SG_OneSide', 'SG_Or', 'SG_Sell', 'SG_Single', 'SG_Single2', 'SG_Sub', 'SIN', 'SLICE', 'SLOPE', 'SMA', 'SPEARMAN', 'SP_FixedPercent', 'SP_FixedValue', 'SQRT', 'STDEV', 'STDP', 'ST_FixedPercent', 'ST_Indicator', 'ST_Saftyloss', 'SUM', 'SUMBARS', 'SYS_Simple', 'SYS_WalkForward', 'ScoreRecord', 'ScoreRecordList', 'ScoresFilterBase', 'Seconds', 'SelectorBase', 'SignalBase', 'SlippageBase', 'SpotRecord', 'Stock', 'StockManager', 'StockTypeInfo', 'StockWeight', 'StockWeightList', 'StoplossBase', 'Strategy', 'StrategyContext', 'System', 'SystemPart', 'SystemWeight', 'SystemWeightList', 'TAN', 'TA_ACCBANDS', 'TA_ACOS', 'TA_AD', 'TA_ADD', 'TA_ADOSC', 'TA_ADX', 'TA_ADXR', 'TA_APO', 'TA_AROON', 'TA_AROONOSC', 'TA_ASIN', 'TA_ATAN', 'TA_ATR', 'TA_AVGDEV', 'TA_AVGPRICE', 'TA_BBANDS', 'TA_BETA', 'TA_BOP', 'TA_CCI', 'TA_CDL2CROWS', 'TA_CDL3BLACKCROWS', 'TA_CDL3INSIDE', 'TA_CDL3LINESTRIKE', 'TA_CDL3OUTSIDE', 'TA_CDL3STARSINSOUTH', 'TA_CDL3WHITESOLDIERS', 'TA_CDLABANDONEDBABY', 'TA_CDLADVANCEBLOCK', 'TA_CDLBELTHOLD', 'TA_CDLBREAKAWAY', 'TA_CDLCLOSINGMARUBOZU', 'TA_CDLCONCEALBABYSWALL', 'TA_CDLCOUNTERATTACK', 'TA_CDLDARKCLOUDCOVER', 'TA_CDLDOJI', 'TA_CDLDOJISTAR', 'TA_CDLDRAGONFLYDOJI', 'TA_CDLENGULFING', 'TA_CDLEVENINGDOJISTAR', 'TA_CDLEVENINGSTAR', 'TA_CDLGAPSIDESIDEWHITE', 'TA_CDLGRAVESTONEDOJI', 'TA_CDLHAMMER', 'TA_CDLHANGINGMAN', 'TA_CDLHARAMI', 'TA_CDLHARAMICROSS', 'TA_CDLHIGHWAVE', 'TA_CDLHIKKAKE', 'TA_CDLHIKKAKEMOD', 'TA_CDLHOMINGPIGEON', 'TA_CDLIDENTICAL3CROWS', 'TA_CDLINNECK', 'TA_CDLINVERTEDHAMMER', 'TA_CDLKICKING', 'TA_CDLKICKINGBYLENGTH', 'TA_CDLLADDERBOTTOM', 'TA_CDLLONGLEGGEDDOJI', 'TA_CDLLONGLINE', 'TA_CDLMARUBOZU', 'TA_CDLMATCHINGLOW', 'TA_CDLMATHOLD', 'TA_CDLMORNINGDOJISTAR', 'TA_CDLMORNINGSTAR', 'TA_CDLONNECK', 'TA_CDLPIERCING', 'TA_CDLRICKSHAWMAN', 'TA_CDLRISEFALL3METHODS', 'TA_CDLSEPARATINGLINES', 'TA_CDLSHOOTINGSTAR', 'TA_CDLSHORTLINE', 'TA_CDLSPINNINGTOP', 'TA_CDLSTALLEDPATTERN', 'TA_CDLSTICKSANDWICH', 'TA_CDLTAKURI', 'TA_CDLTASUKIGAP', 'TA_CDLTHRUSTING', 'TA_CDLTRISTAR', 'TA_CDLUNIQUE3RIVER', 'TA_CDLUPSIDEGAP2CROWS', 'TA_CDLXSIDEGAP3METHODS', 'TA_CEIL', 'TA_CMO', 'TA_CORREL', 'TA_COS', 'TA_COSH', 'TA_DEMA', 'TA_DIV', 'TA_DX', 'TA_EMA', 'TA_EXP', 'TA_FLOOR', 'TA_HT_DCPERIOD', 'TA_HT_DCPHASE', 'TA_HT_PHASOR', 'TA_HT_SINE', 'TA_HT_TRENDLINE', 'TA_HT_TRENDMODE', 'TA_IMI', 'TA_KAMA', 'TA_LINEARREG', 'TA_LINEARREG_ANGLE', 'TA_LINEARREG_INTERCEPT', 'TA_LINEARREG_SLOPE', 'TA_LN', 'TA_LOG10', 'TA_MA', 'TA_MACD', 'TA_MACDEXT', 'TA_MACDFIX', 'TA_MAMA', 'TA_MAVP', 'TA_MAX', 'TA_MAXINDEX', 'TA_MEDPRICE', 'TA_MFI', 'TA_MIDPOINT', 'TA_MIDPRICE', 'TA_MIN', 'TA_MININDEX', 'TA_MINMAX', 'TA_MINMAXINDEX', 'TA_MINUS_DI', 'TA_MINUS_DM', 'TA_MOM', 'TA_MULT', 'TA_NATR', 'TA_OBV', 'TA_PLUS_DI', 'TA_PLUS_DM', 'TA_PPO', 'TA_ROC', 'TA_ROCP', 'TA_ROCR', 'TA_ROCR100', 'TA_RSI', 'TA_SAR', 'TA_SAREXT', 'TA_SIN', 'TA_SINH', 'TA_SMA', 'TA_SQRT', 'TA_STDDEV', 'TA_STOCH', 'TA_STOCHF', 'TA_STOCHRSI', 'TA_SUB', 'TA_SUM', 'TA_T3', 'TA_TAN', 'TA_TANH', 'TA_TEMA', 'TA_TRANGE', 'TA_TRIMA', 'TA_TRIX', 'TA_TSF', 'TA_TYPPRICE', 'TA_ULTOSC', 'TA_VAR', 'TA_WCLPRICE', 'TA_WILLR', 'TA_WMA', 'TC_FixedA', 'TC_FixedA2015', 'TC_FixedA2017', 'TC_TestStub', 'TC_Zero', 'TIME', 'TIMELINE', 'TIMELINEVOL', 'TR', 'TRACE', 'TURNOVER', 'TimeDelta', 'TimeLineList', 'TimeLineRecord', 'TradeCostBase', 'TradeManager', 'TradeRecord', 'TradeRecordList', 'TradeRequest', 'TransList', 'TransRecord', 'UPNDAY', 'UTCOffset', 'VAR', 'VARP', 'VIGOR', 'WARN', 'WEAVE', 'WEEK', 'WINNER', 'WITHDAY', 'WITHHALFYEAR', 'WITHHOUR', 'WITHHOUR2', 'WITHHOUR4', 'WITHKTYPE', 'WITHMIN', 'WITHMIN15', 'WITHMIN30', 'WITHMIN5', 'WITHMIN60', 'WITHMONTH', 'WITHQUARTER', 'WITHWEEK', 'WITHYEAR', 'WMA', 'YEAR', 'ZHBOND10', 'ZONGGUBEN', 'ZSCORE', 'active_device', 'backtest', 'batch_calculate_inds', 'can_upgrade', 'close_ostream_to_python', 'close_spend_time', 'combinate_ind', 'combinate_index', 'constant', 'crtBrokerTM', 'crtSEOptimal', 'crtTM', 'crt_pf_strategy', 'crt_sys_strategy', 'dates_to_np', 'dates_to_pa', 'df_to_krecords', 'fetch_trial_license', 'find_optimal_system', 'find_optimal_system_multi', 'get_block', 'get_business_name', 'get_data_from_buffer_server', 'get_date_range', 'get_funds_list', 'get_inds_view', 'get_inds_view_pyarrow', 'get_kdata', 'get_last_version', 'get_log_level', 'get_market_view', 'get_market_view_pyarrow', 'get_spot_from_buffer_server', 'get_stock', 'get_system_part_enum', 'get_system_part_name', 'get_version', 'get_version_git', 'get_version_with_build', 'hikyuu_init', 'inner_analysis_sys_list', 'inner_combinate_ind_analysis', 'inner_combinate_ind_analysis_with_block', 'is_valid_license', 'isinf', 'isnan', 'krecords_to_df', 'krecords_to_np', 'krecords_to_pa', 'open_ostream_to_python', 'open_spend_time', 'parallel_run_pf', 'parallel_run_sys', 'positions_to_df', 'positions_to_np', 'positions_to_pa', 'register_extra_ktype', 'release_extra_ktype', 'remove_license', 'roundDown', 'roundEx', 'roundUp', 'run_in_strategy', 'scorerecords_to_df', 'scorerecords_to_np', 'set_log_level', 'set_python_in_interactive', 'set_python_in_jupyter', 'spot_agent_is_connected', 'spot_agent_is_running', 'start_data_server', 'start_spot_agent', 'stop_data_server', 'stop_spot_agent', 'systemweights_to_df', 'systemweights_to_np', 'timeline_to_df', 'timeline_to_np', 'timeline_to_pa', 'toPriceList', 'trades_to_df', 'trades_to_np', 'trades_to_pa', 'translist_to_df', 'translist_to_np', 'translist_to_pa', 'view_license', 'weights_to_df', 'weights_to_np', 'weights_to_pa']
|
|
7
7
|
class AllocateFundsBase:
|
|
8
8
|
"""
|
|
9
9
|
资产分配算法基类, 子类接口:
|
|
@@ -229,7 +229,10 @@ class Block:
|
|
|
229
229
|
def __init__(self) -> None:
|
|
230
230
|
...
|
|
231
231
|
@typing.overload
|
|
232
|
-
def __init__(self,
|
|
232
|
+
def __init__(self, category: str, name: str) -> None:
|
|
233
|
+
...
|
|
234
|
+
@typing.overload
|
|
235
|
+
def __init__(self, category: str, name: str, index_code: str) -> None:
|
|
233
236
|
...
|
|
234
237
|
@typing.overload
|
|
235
238
|
def __init__(self, arg0: Block) -> None:
|
|
@@ -3081,6 +3084,17 @@ class MultiFactorBase:
|
|
|
3081
3084
|
...
|
|
3082
3085
|
def __str__(self) -> str:
|
|
3083
3086
|
...
|
|
3087
|
+
def add_special_normalize(self, name: str, norm: NormalizeBase = None, category: str = '', style_inds: collections.abc.Sequence[Indicator] = []) -> None:
|
|
3088
|
+
"""
|
|
3089
|
+
add_special_normalize(self, name[, norm=None, category="", style_inds=[]])
|
|
3090
|
+
|
|
3091
|
+
对指定名称的指标应用特定的标准化/归一化、行业中性化、风格因子中性化操作。标准化操作、行业中性化、风格因子中性化彼此无关,可同时指定也可分开指定。
|
|
3092
|
+
|
|
3093
|
+
:param str name: 特殊归一化方法名称
|
|
3094
|
+
:param Normalize norm: 特殊归一化方法
|
|
3095
|
+
:param str category: 行业中性化时,指定板块类别
|
|
3096
|
+
:param list[Indicator] style_inds: 用于中性化的风格指标列表
|
|
3097
|
+
"""
|
|
3084
3098
|
def clone(self) -> MultiFactorBase:
|
|
3085
3099
|
"""
|
|
3086
3100
|
克隆操作
|
|
@@ -3102,7 +3116,14 @@ class MultiFactorBase:
|
|
|
3102
3116
|
:return: ScoreRecordList
|
|
3103
3117
|
"""
|
|
3104
3118
|
def get_all_src_factors(self) -> list[list[Indicator]]:
|
|
3105
|
-
|
|
3119
|
+
"""
|
|
3120
|
+
get_all_src_factors(self)
|
|
3121
|
+
|
|
3122
|
+
获取所有原始因子列表(如果指定了标准化、行业中性化, 返回为已处理的因子列表)
|
|
3123
|
+
|
|
3124
|
+
:rtype: list
|
|
3125
|
+
:return: list IndicatorList stks x inds
|
|
3126
|
+
"""
|
|
3106
3127
|
def get_datetime_list(self) -> DatetimeList:
|
|
3107
3128
|
"""
|
|
3108
3129
|
获取参考日期列表(由参考证券通过查询条件获得)
|
|
@@ -3178,6 +3199,14 @@ class MultiFactorBase:
|
|
|
3178
3199
|
"""
|
|
3179
3200
|
是否存在指定参数
|
|
3180
3201
|
"""
|
|
3202
|
+
def set_normalize(self, norm: NormalizeBase) -> None:
|
|
3203
|
+
"""
|
|
3204
|
+
set_normalize(self, norm)
|
|
3205
|
+
|
|
3206
|
+
设置标准化或归一化方法(影响全部因子)
|
|
3207
|
+
|
|
3208
|
+
:param NormalizeBase norm: 标准化或归一化方法实例
|
|
3209
|
+
"""
|
|
3181
3210
|
def set_param(self, arg0: str, arg1: any) -> None:
|
|
3182
3211
|
"""
|
|
3183
3212
|
set_param(self, name, value)
|
|
@@ -3228,6 +3257,74 @@ class MultiFactorBase:
|
|
|
3228
3257
|
@query.setter
|
|
3229
3258
|
def query(self, arg1: Query) -> None:
|
|
3230
3259
|
...
|
|
3260
|
+
class NormalizeBase:
|
|
3261
|
+
"""
|
|
3262
|
+
用于 MF 的截面标准化操作
|
|
3263
|
+
"""
|
|
3264
|
+
@staticmethod
|
|
3265
|
+
def _pybind11_conduit_v1_(*args, **kwargs):
|
|
3266
|
+
...
|
|
3267
|
+
def __getstate__(self) -> tuple:
|
|
3268
|
+
...
|
|
3269
|
+
@typing.overload
|
|
3270
|
+
def __init__(self) -> None:
|
|
3271
|
+
...
|
|
3272
|
+
@typing.overload
|
|
3273
|
+
def __init__(self, arg0: NormalizeBase) -> None:
|
|
3274
|
+
...
|
|
3275
|
+
@typing.overload
|
|
3276
|
+
def __init__(self, arg0: str) -> None:
|
|
3277
|
+
"""
|
|
3278
|
+
初始化构造函数
|
|
3279
|
+
|
|
3280
|
+
:param str name: 名称
|
|
3281
|
+
"""
|
|
3282
|
+
def __repr__(self) -> str:
|
|
3283
|
+
...
|
|
3284
|
+
def __setstate__(self, arg0: tuple) -> None:
|
|
3285
|
+
...
|
|
3286
|
+
def __str__(self) -> str:
|
|
3287
|
+
...
|
|
3288
|
+
def clone(self) -> NormalizeBase:
|
|
3289
|
+
"""
|
|
3290
|
+
克隆操作
|
|
3291
|
+
"""
|
|
3292
|
+
def get_param(self, arg0: str) -> any:
|
|
3293
|
+
"""
|
|
3294
|
+
get_param(self, name)
|
|
3295
|
+
|
|
3296
|
+
获取指定的参数
|
|
3297
|
+
|
|
3298
|
+
:param str name: 参数名称
|
|
3299
|
+
:return: 参数值
|
|
3300
|
+
:raises out_of_range: 无此参数
|
|
3301
|
+
"""
|
|
3302
|
+
def have_param(self, arg0: str) -> bool:
|
|
3303
|
+
"""
|
|
3304
|
+
是否存在指定参数
|
|
3305
|
+
"""
|
|
3306
|
+
def normalize(self, arg0: collections.abc.Sequence[typing.SupportsFloat]) -> list[float]:
|
|
3307
|
+
"""
|
|
3308
|
+
【重载接口】子类计算接口
|
|
3309
|
+
"""
|
|
3310
|
+
def set_param(self, arg0: str, arg1: any) -> None:
|
|
3311
|
+
"""
|
|
3312
|
+
set_param(self, name, value)
|
|
3313
|
+
|
|
3314
|
+
设置参数
|
|
3315
|
+
|
|
3316
|
+
:param str name: 参数名称
|
|
3317
|
+
:param value: 参数值
|
|
3318
|
+
:raises logic_error: Unsupported type! 不支持的参数类型
|
|
3319
|
+
"""
|
|
3320
|
+
@property
|
|
3321
|
+
def name(self) -> str:
|
|
3322
|
+
"""
|
|
3323
|
+
名称
|
|
3324
|
+
"""
|
|
3325
|
+
@name.setter
|
|
3326
|
+
def name(self, arg1: str) -> None:
|
|
3327
|
+
...
|
|
3231
3328
|
class OrderBrokerBase:
|
|
3232
3329
|
"""
|
|
3233
3330
|
订单代理包装基类,用户可以参考自定义自己的订单代理,加入额外的处理
|
|
@@ -3503,6 +3600,10 @@ class Portfolio:
|
|
|
3503
3600
|
"""
|
|
3504
3601
|
是否存在指定参数
|
|
3505
3602
|
"""
|
|
3603
|
+
def last_suggestion(self) -> typing.Any:
|
|
3604
|
+
"""
|
|
3605
|
+
回测完成后,返回最后一天交易记录,以及需要延迟的买入和卖出延迟请求
|
|
3606
|
+
"""
|
|
3506
3607
|
def reset(self) -> None:
|
|
3507
3608
|
"""
|
|
3508
3609
|
复位操作
|
|
@@ -4280,6 +4381,87 @@ class ScoreRecordList:
|
|
|
4280
4381
|
...
|
|
4281
4382
|
def to_pandas(self):
|
|
4282
4383
|
...
|
|
4384
|
+
class ScoresFilterBase:
|
|
4385
|
+
"""
|
|
4386
|
+
用于 MF 的截面标准化操作
|
|
4387
|
+
"""
|
|
4388
|
+
@staticmethod
|
|
4389
|
+
def _pybind11_conduit_v1_(*args, **kwargs):
|
|
4390
|
+
...
|
|
4391
|
+
def __getstate__(self) -> tuple:
|
|
4392
|
+
...
|
|
4393
|
+
@typing.overload
|
|
4394
|
+
def __init__(self) -> None:
|
|
4395
|
+
...
|
|
4396
|
+
@typing.overload
|
|
4397
|
+
def __init__(self, arg0: ScoresFilterBase) -> None:
|
|
4398
|
+
...
|
|
4399
|
+
@typing.overload
|
|
4400
|
+
def __init__(self, arg0: str) -> None:
|
|
4401
|
+
"""
|
|
4402
|
+
初始化构造函数
|
|
4403
|
+
|
|
4404
|
+
:param str name: 名称
|
|
4405
|
+
"""
|
|
4406
|
+
def __or__(self, arg0: ScoresFilterBase) -> ScoresFilterBase:
|
|
4407
|
+
...
|
|
4408
|
+
def __repr__(self) -> str:
|
|
4409
|
+
...
|
|
4410
|
+
def __setstate__(self, arg0: tuple) -> None:
|
|
4411
|
+
...
|
|
4412
|
+
def __str__(self) -> str:
|
|
4413
|
+
...
|
|
4414
|
+
def _filter(self, arg0: ScoreRecordList, arg1: Datetime, arg2: Query) -> ScoreRecordList:
|
|
4415
|
+
"""
|
|
4416
|
+
【重载接口】子类计算接口
|
|
4417
|
+
"""
|
|
4418
|
+
def clone(self) -> ScoresFilterBase:
|
|
4419
|
+
"""
|
|
4420
|
+
克隆操作
|
|
4421
|
+
"""
|
|
4422
|
+
def filter(self, arg0: ScoreRecordList, arg1: Datetime, arg2: Query) -> ScoreRecordList:
|
|
4423
|
+
"""
|
|
4424
|
+
filter(self, scores, date, query)
|
|
4425
|
+
|
|
4426
|
+
截面过滤
|
|
4427
|
+
:param list scores: 截面数据
|
|
4428
|
+
:param Datetime date: 截面日期
|
|
4429
|
+
:param KQuery query: 查询参数
|
|
4430
|
+
:return: 截面数据
|
|
4431
|
+
:rtype: ScoreRecordList
|
|
4432
|
+
"""
|
|
4433
|
+
def get_param(self, arg0: str) -> any:
|
|
4434
|
+
"""
|
|
4435
|
+
get_param(self, name)
|
|
4436
|
+
|
|
4437
|
+
获取指定的参数
|
|
4438
|
+
|
|
4439
|
+
:param str name: 参数名称
|
|
4440
|
+
:return: 参数值
|
|
4441
|
+
:raises out_of_range: 无此参数
|
|
4442
|
+
"""
|
|
4443
|
+
def have_param(self, arg0: str) -> bool:
|
|
4444
|
+
"""
|
|
4445
|
+
是否存在指定参数
|
|
4446
|
+
"""
|
|
4447
|
+
def set_param(self, arg0: str, arg1: any) -> None:
|
|
4448
|
+
"""
|
|
4449
|
+
set_param(self, name, value)
|
|
4450
|
+
|
|
4451
|
+
设置参数
|
|
4452
|
+
|
|
4453
|
+
:param str name: 参数名称
|
|
4454
|
+
:param value: 参数值
|
|
4455
|
+
:raises logic_error: Unsupported type! 不支持的参数类型
|
|
4456
|
+
"""
|
|
4457
|
+
@property
|
|
4458
|
+
def name(self) -> str:
|
|
4459
|
+
"""
|
|
4460
|
+
名称
|
|
4461
|
+
"""
|
|
4462
|
+
@name.setter
|
|
4463
|
+
def name(self, arg1: str) -> None:
|
|
4464
|
+
...
|
|
4283
4465
|
class SelectorBase:
|
|
4284
4466
|
"""
|
|
4285
4467
|
选择器策略基类,实现标的、系统策略的评估和选取算法,自定义选择器策略子类接口:
|
|
@@ -4357,6 +4539,14 @@ class SelectorBase:
|
|
|
4357
4539
|
"""
|
|
4358
4540
|
子类复位操作实现
|
|
4359
4541
|
"""
|
|
4542
|
+
def add_scores_filter(self, arg0: ScoresFilterBase) -> None:
|
|
4543
|
+
"""
|
|
4544
|
+
add_scores_filter(self, filter)
|
|
4545
|
+
|
|
4546
|
+
在已有过滤基础上新增过滤, 仅适用于 SE_MultiFactor
|
|
4547
|
+
|
|
4548
|
+
:param ScoresFilter filter: 新的过滤器
|
|
4549
|
+
"""
|
|
4360
4550
|
def add_stock(self, stock: Stock, sys: ...) -> None:
|
|
4361
4551
|
"""
|
|
4362
4552
|
add_stock(self, stock, sys)
|
|
@@ -4439,6 +4629,19 @@ class SelectorBase:
|
|
|
4439
4629
|
:param value: 参数值
|
|
4440
4630
|
:raises logic_error: Unsupported type! 不支持的参数类型
|
|
4441
4631
|
"""
|
|
4632
|
+
def set_scores_filter(self, arg0: ScoresFilterBase) -> None:
|
|
4633
|
+
"""
|
|
4634
|
+
set_scores_filter(self, filter)
|
|
4635
|
+
|
|
4636
|
+
设置 ScoresFilter, 将替换现有的过滤器. 仅适用于 SE_MultiFactor
|
|
4637
|
+
|
|
4638
|
+
:param ScoresFilter filter: ScoresFilter
|
|
4639
|
+
"""
|
|
4640
|
+
@property
|
|
4641
|
+
def mf(self) -> ...:
|
|
4642
|
+
"""
|
|
4643
|
+
获取关联的 MF
|
|
4644
|
+
"""
|
|
4442
4645
|
@property
|
|
4443
4646
|
def name(self) -> str:
|
|
4444
4647
|
"""
|
|
@@ -4457,6 +4660,11 @@ class SelectorBase:
|
|
|
4457
4660
|
"""
|
|
4458
4661
|
由 PF 运行时设定的实际运行系统列表
|
|
4459
4662
|
"""
|
|
4663
|
+
@property
|
|
4664
|
+
def scfilter(self) -> ScoresFilterBase:
|
|
4665
|
+
"""
|
|
4666
|
+
获取 ScoresFilter
|
|
4667
|
+
"""
|
|
4460
4668
|
class SignalBase:
|
|
4461
4669
|
"""
|
|
4462
4670
|
信号指示器基类
|
|
@@ -5307,6 +5515,15 @@ class StockManager:
|
|
|
5307
5515
|
"""
|
|
5308
5516
|
获取当前板块信息驱动参数
|
|
5309
5517
|
"""
|
|
5518
|
+
def get_category_list(self) -> list[str]:
|
|
5519
|
+
"""
|
|
5520
|
+
get_category_list(self)
|
|
5521
|
+
|
|
5522
|
+
获取所有板块分类
|
|
5523
|
+
|
|
5524
|
+
:return: 所有板块分类
|
|
5525
|
+
:rtype: StringList
|
|
5526
|
+
"""
|
|
5310
5527
|
def get_context(self) -> StrategyContext:
|
|
5311
5528
|
"""
|
|
5312
5529
|
获取当前上下文
|
|
@@ -6263,6 +6480,10 @@ class System:
|
|
|
6263
6480
|
"""
|
|
6264
6481
|
是否存在指定参数
|
|
6265
6482
|
"""
|
|
6483
|
+
def last_suggestion(self) -> typing.Any:
|
|
6484
|
+
"""
|
|
6485
|
+
回测完成后,返回最后一天交易记录,以及需要延迟的买入和卖出延迟请求
|
|
6486
|
+
"""
|
|
6266
6487
|
def ready(self) -> None:
|
|
6267
6488
|
...
|
|
6268
6489
|
def reset(self) -> None:
|
|
@@ -8174,6 +8395,26 @@ def AGG_COUNT(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit:
|
|
|
8174
8395
|
"""
|
|
8175
8396
|
聚合函数: 非空值计数, 可参考 AGG_STD 帮助
|
|
8176
8397
|
"""
|
|
8398
|
+
def AGG_FUNC(ind: Indicator, agg_func: typing.Any, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8399
|
+
"""
|
|
8400
|
+
AGG_FUNC(ind, agg_func[, ktype=Query.MIN, fill_null=False, unit=1]
|
|
8401
|
+
|
|
8402
|
+
使用自定函数聚合其他K线周期的指标。虽然支持python自定义函数, 但python函数需要GIL, 速度会慢。建议最好直接使用 C++ 自定义聚合函数。
|
|
8403
|
+
|
|
8404
|
+
示例, 计算日线时聚合分钟线收盘价的和:
|
|
8405
|
+
|
|
8406
|
+
>>> kdata = get_kdata('sh600000', Query(Datetime(20250101), ktype=Query.DAY))
|
|
8407
|
+
>>> ind = AGG_FUNC(CLOSE(), lambda ds, x: np.sum(x))
|
|
8408
|
+
>>> ind(k)
|
|
8409
|
+
|
|
8410
|
+
:param Indicator ind: 待计算指标
|
|
8411
|
+
:param callable agg_func: 自定义聚合函数,输入参数为 arg1: datetime list, arg2: numpy array, 返回针对list的聚合结果, 注意是单个值
|
|
8412
|
+
:param KQuery.KType ktype: 聚合的K线周期
|
|
8413
|
+
:param bool fill_null: 是否填充缺失值
|
|
8414
|
+
:param int unit: 聚合周期单位 (上下文K线分组单位, 使用日线计算分钟线聚合时, unit=2代表聚合2天的分钟线)
|
|
8415
|
+
:return: 聚合结果
|
|
8416
|
+
:rtype: Indicator
|
|
8417
|
+
"""
|
|
8177
8418
|
def AGG_MAD(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8178
8419
|
"""
|
|
8179
8420
|
聚合函数: 平均绝对偏差, 可参考 AGG_STD 帮助
|
|
@@ -9149,6 +9390,48 @@ def FLOOR(arg0: typing.SupportsFloat) -> Indicator:
|
|
|
9149
9390
|
:param data: 输入数据
|
|
9150
9391
|
:rtype: Indicator
|
|
9151
9392
|
"""
|
|
9393
|
+
def GROUP_COUNT(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
|
|
9394
|
+
"""
|
|
9395
|
+
分组累积计数
|
|
9396
|
+
"""
|
|
9397
|
+
def GROUP_FUNC(ind: Indicator, group_func: typing.Any, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
|
|
9398
|
+
"""
|
|
9399
|
+
GROUP_FUNC(ind, group_func[, ktype=Query.DAY, unit=1])
|
|
9400
|
+
|
|
9401
|
+
自定义分组累积计算指标。虽然支持python自定义函数, 但python函数需要GIL, 速度较慢。建议最好直接使用 C++ 自定义分组累积函数。
|
|
9402
|
+
|
|
9403
|
+
示例, 计算日线时聚合分钟线收盘价的和:
|
|
9404
|
+
|
|
9405
|
+
>>> kdata = get_kdata('sh600000', Query(Datetime(20250101), ktype=Query.DAY))
|
|
9406
|
+
>>> ind = GROUP_FUNC(CLOSE(), lambda dates, data: data/2.0)
|
|
9407
|
+
>>> ind(k)
|
|
9408
|
+
|
|
9409
|
+
:param Indicator ind: 待计算指标
|
|
9410
|
+
:param callable group_func: 自定义分组累积函数,输入参数为 arg1: datetime list, arg2: numpy array, 返回和输入等长的累积计算结果, 类型同样须为 np.array
|
|
9411
|
+
:param KQuery.KType ktype: 分组的K线周期
|
|
9412
|
+
:param int unit: 分组周期单位 (分组的K线周期单位, 使用日线计算分钟线, unit=2代表按2天累积计算的分钟线)
|
|
9413
|
+
:rtype: Indicator
|
|
9414
|
+
"""
|
|
9415
|
+
def GROUP_MAX(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
|
|
9416
|
+
"""
|
|
9417
|
+
分组累积最大值
|
|
9418
|
+
"""
|
|
9419
|
+
def GROUP_MEAN(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
|
|
9420
|
+
"""
|
|
9421
|
+
分组累积平均
|
|
9422
|
+
"""
|
|
9423
|
+
def GROUP_MIN(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
|
|
9424
|
+
"""
|
|
9425
|
+
分组累积最小值
|
|
9426
|
+
"""
|
|
9427
|
+
def GROUP_PROD(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
|
|
9428
|
+
"""
|
|
9429
|
+
分组累积乘积
|
|
9430
|
+
"""
|
|
9431
|
+
def GROUP_SUM(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
|
|
9432
|
+
"""
|
|
9433
|
+
分组累积和
|
|
9434
|
+
"""
|
|
9152
9435
|
@typing.overload
|
|
9153
9436
|
def HHV(n: typing.SupportsInt = 20) -> Indicator:
|
|
9154
9437
|
...
|
|
@@ -10120,6 +10403,36 @@ def NDAY(x: Indicator, y: Indicator, n: IndParam) -> Indicator:
|
|
|
10120
10403
|
:param int|Indicator|IndParam n: 时间窗口
|
|
10121
10404
|
:rtype: Indicator
|
|
10122
10405
|
"""
|
|
10406
|
+
def NORM_MinMax() -> NormalizeBase:
|
|
10407
|
+
"""
|
|
10408
|
+
最小-最大标准化操作
|
|
10409
|
+
"""
|
|
10410
|
+
def NORM_NOTHING() -> NormalizeBase:
|
|
10411
|
+
"""
|
|
10412
|
+
无截面标准化操作
|
|
10413
|
+
"""
|
|
10414
|
+
def NORM_Quantile(quantile_min: typing.SupportsFloat = 0.01, quantile_max: typing.SupportsFloat = 0.99) -> NormalizeBase:
|
|
10415
|
+
"""
|
|
10416
|
+
分位数截面标准化操作
|
|
10417
|
+
|
|
10418
|
+
:param quantile_min: 最小分位数
|
|
10419
|
+
:param quantile_max: 最大分位数
|
|
10420
|
+
"""
|
|
10421
|
+
def NORM_Quantile_Uniform(quantile_min: typing.SupportsFloat = 0.01, quantile_max: typing.SupportsFloat = 0.99) -> NormalizeBase:
|
|
10422
|
+
"""
|
|
10423
|
+
分位数截面均匀分布标准化操作
|
|
10424
|
+
|
|
10425
|
+
:param quantile_min: 最小分位数
|
|
10426
|
+
:param quantile_max: 最大分位数
|
|
10427
|
+
"""
|
|
10428
|
+
def NORM_Zscore(out_extreme: bool = False, nsigma: typing.SupportsFloat = 3.0, recursive: bool = False) -> NormalizeBase:
|
|
10429
|
+
"""
|
|
10430
|
+
Z-score 标准化操作
|
|
10431
|
+
|
|
10432
|
+
:param out_extreme: 是否剔除异常值
|
|
10433
|
+
:param nsigma: 异常值判断倍数±3.0
|
|
10434
|
+
:param recursive: 是否递归处理异常值
|
|
10435
|
+
"""
|
|
10123
10436
|
@typing.overload
|
|
10124
10437
|
def NOT() -> Indicator:
|
|
10125
10438
|
...
|
|
@@ -10258,6 +10571,22 @@ def PRICELIST(data: typing.Any = None, discard: typing.SupportsInt = 0, align_da
|
|
|
10258
10571
|
:rtype: Indicator
|
|
10259
10572
|
"""
|
|
10260
10573
|
@typing.overload
|
|
10574
|
+
def QUANTILE_TRUNC(n: typing.SupportsInt = 60, quantial_min: typing.SupportsFloat = 0.01, quantial_max: typing.SupportsFloat = 0.99) -> Indicator:
|
|
10575
|
+
...
|
|
10576
|
+
@typing.overload
|
|
10577
|
+
def QUANTILE_TRUNC(data: Indicator, n: typing.SupportsInt = 60, quantial_min: typing.SupportsFloat = 0.01, quantial_max: typing.SupportsFloat = 0.99) -> Indicator:
|
|
10578
|
+
"""
|
|
10579
|
+
QUANTILE_TRUNC(data[, n=60, quantial_min=0.01, quantial_max=0.99])
|
|
10580
|
+
|
|
10581
|
+
对数据进行分位数截断处理。非窗口滚动。
|
|
10582
|
+
|
|
10583
|
+
:param Indicator data: 待剔除异常值数据
|
|
10584
|
+
:param int n: 时间窗口
|
|
10585
|
+
:param float quantial_min: 剔除极值时使用的百分位数下限,默认 0.01
|
|
10586
|
+
:param float quantial_max: 剔除极值时使用的百分位数上限,默认 0.99
|
|
10587
|
+
:rtype: Indicator
|
|
10588
|
+
"""
|
|
10589
|
+
@typing.overload
|
|
10261
10590
|
def RANK(stks: collections.abc.Sequence, mode: typing.SupportsInt = 0, fill_null: bool = True, market: str = 'SH') -> Indicator:
|
|
10262
10591
|
...
|
|
10263
10592
|
@typing.overload
|
|
@@ -10615,6 +10944,59 @@ def SAFTYLOSS(data: Indicator, n1: Indicator, n2: Indicator, p: Indicator) -> In
|
|
|
10615
10944
|
:param float|Indicator|IndParam p: 噪音系数
|
|
10616
10945
|
:rtype: Indicator
|
|
10617
10946
|
"""
|
|
10947
|
+
def SCFilter_AmountLimit(min_amount_percent_limit: typing.SupportsFloat = 0.1) -> ScoresFilterBase:
|
|
10948
|
+
"""
|
|
10949
|
+
SCFilter_AmountLimit([min_amount_percent_limit: float = 0.1])
|
|
10950
|
+
|
|
10951
|
+
过滤掉成交金额在评分列表末尾百分比范围内的截面
|
|
10952
|
+
|
|
10953
|
+
注意:和传入的截面评分列表顺序相关,如果是降序,过滤的是成交金额较小的系统评分记录;反之,则是金额较大的系统评分记录
|
|
10954
|
+
|
|
10955
|
+
:param double min_amount_percent_limit: 最小金额百分比限制
|
|
10956
|
+
:return: 截面过滤器
|
|
10957
|
+
:rtype: ScoresFilterPtr
|
|
10958
|
+
"""
|
|
10959
|
+
def SCFilter_Group(group: typing.SupportsInt = 10, group_index: typing.SupportsInt = 0) -> ScoresFilterBase:
|
|
10960
|
+
"""
|
|
10961
|
+
SCFilter_Group([group: int=10, group_index: int=0])
|
|
10962
|
+
|
|
10963
|
+
按截面进行分组过滤
|
|
10964
|
+
:param int group: 分组数量
|
|
10965
|
+
:param int group_index: 分组索引
|
|
10966
|
+
:return: 截面过滤器
|
|
10967
|
+
:rtype: ScoresFilterPtr
|
|
10968
|
+
"""
|
|
10969
|
+
def SCFilter_IgnoreNan() -> ScoresFilterBase:
|
|
10970
|
+
"""
|
|
10971
|
+
SCFilter_IgnoreNan() -> ScoresFilterPtr
|
|
10972
|
+
|
|
10973
|
+
忽略截面中的NAN值
|
|
10974
|
+
"""
|
|
10975
|
+
def SCFilter_LessOrEqualValue(value: typing.SupportsFloat = 0.0) -> ScoresFilterBase:
|
|
10976
|
+
"""
|
|
10977
|
+
SCFilter_LessOrEqualValue([value = 0.0])
|
|
10978
|
+
|
|
10979
|
+
过滤掉评分小于等于指定值的截面
|
|
10980
|
+
"""
|
|
10981
|
+
def SCFilter_Price(min_price: typing.SupportsFloat = 10.0, max_price: typing.SupportsFloat = 100000.0) -> ScoresFilterBase:
|
|
10982
|
+
"""
|
|
10983
|
+
SCFilter_Price([min_price = 10., max_price = 100000.])
|
|
10984
|
+
|
|
10985
|
+
仅保留价格在 [min_price, max_price] 之间的标的
|
|
10986
|
+
|
|
10987
|
+
注意:和传入的截面评分列表顺序相关,如果是降序,过滤的是价格较小的系统评分记录;反之,则是价格较大的系统评分记录
|
|
10988
|
+
|
|
10989
|
+
:param double min_price: 最小价格限制
|
|
10990
|
+
:param double max_price: 最大价格限制
|
|
10991
|
+
"""
|
|
10992
|
+
def SCFilter_TopN(topn: typing.SupportsInt = 10) -> ScoresFilterBase:
|
|
10993
|
+
"""
|
|
10994
|
+
SCFilter_TopN([topn: int=10])
|
|
10995
|
+
|
|
10996
|
+
获取评分列表中的前 topn 个
|
|
10997
|
+
|
|
10998
|
+
:param int topn: 前 topn 个
|
|
10999
|
+
"""
|
|
10618
11000
|
def SE_EvaluateOptimal(arg0: typing.Any) -> SelectorBase:
|
|
10619
11001
|
"""
|
|
10620
11002
|
SE_EvaluateOptimal(evalulate_func)
|
|
@@ -10665,6 +11047,27 @@ def SE_MultiFactor(inds: collections.abc.Sequence, topn: typing.SupportsInt = 10
|
|
|
10665
11047
|
:param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
|
|
10666
11048
|
:param str mode: "MF_ICIRWeight" | "MF_ICWeight" | "MF_EqualWeight" 因子合成算法名称
|
|
10667
11049
|
"""
|
|
11050
|
+
@typing.overload
|
|
11051
|
+
def SE_MultiFactor2(mf: ..., filter: ScoresFilterBase = ...) -> SelectorBase:
|
|
11052
|
+
...
|
|
11053
|
+
@typing.overload
|
|
11054
|
+
def SE_MultiFactor2(inds: collections.abc.Sequence, ic_n: typing.SupportsInt = 5, ic_rolling_n: typing.SupportsInt = 120, ref_stk: typing.Any = None, spearman: bool = True, mode: str = 'MF_ICIRWeight', filter: ScoresFilterBase = ...) -> SelectorBase:
|
|
11055
|
+
"""
|
|
11056
|
+
SE_MultiFactor2([inds, ic_n, ic_rolling_n, ref_stk, spearman, mode, filter])
|
|
11057
|
+
|
|
11058
|
+
创建基于多因子评分的选择器,两种创建方式
|
|
11059
|
+
|
|
11060
|
+
- 直接指定 MF:
|
|
11061
|
+
:param MultiFactorBase mf: 直接指定的多因子合成算法
|
|
11062
|
+
|
|
11063
|
+
- 参数直接创建:
|
|
11064
|
+
:param sequense(Indicator) inds: 原始因子列表
|
|
11065
|
+
:param int ic_n: 默认 IC 对应的 N 日收益率
|
|
11066
|
+
:param int ic_rolling_n: IC 滚动周期
|
|
11067
|
+
:param Stock ref_stk: 参考证券 (未指定时,默认为 sh000300 沪深300)
|
|
11068
|
+
:param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
|
|
11069
|
+
:param str mode: "MF_ICIRWeight" | "MF_ICWeight" | "MF_EqualWeight" 因子合成算法名称
|
|
11070
|
+
"""
|
|
10668
11071
|
def SE_PerformanceOptimal(key: str = '帐户平均年收益率%', mode: typing.SupportsInt = 0) -> SelectorBase:
|
|
10669
11072
|
"""
|
|
10670
11073
|
SE_PerformanceOptimal(key="帐户平均年收益率%", mode=0)
|
|
@@ -13764,7 +14167,7 @@ def ZSCORE(data: Indicator, out_extreme: bool = False, nsigma: typing.SupportsFl
|
|
|
13764
14167
|
"""
|
|
13765
14168
|
ZSCORE(data[, out_extreme, nsigma, recursive])
|
|
13766
14169
|
|
|
13767
|
-
|
|
14170
|
+
对数据进行标准化(归一),可选进行极值处理
|
|
13768
14171
|
|
|
13769
14172
|
注:非窗口滚动,如需窗口滚动的标准化,直接 (x - MA(x, n)) / STDEV(x, n) 即可。
|
|
13770
14173
|
|
|
@@ -13943,6 +14346,16 @@ def get_date_range(start: Datetime, end: Datetime) -> DatetimeList:
|
|
|
13943
14346
|
:param Datetime end: 结束日期
|
|
13944
14347
|
:rtype: DatetimeList
|
|
13945
14348
|
"""
|
|
14349
|
+
def get_funds_list(arg0: collections.abc.Sequence[TradeManager], arg1: DatetimeList) -> list[list[FundsRecord]]:
|
|
14350
|
+
"""
|
|
14351
|
+
get_funds_list(tm_list: list, ref_dates: DatetimeList) -> list[Funds])
|
|
14352
|
+
|
|
14353
|
+
一次性从多个账户中获取多个指定时刻的账户资金信息
|
|
14354
|
+
|
|
14355
|
+
:param list tm_list: 账户列表
|
|
14356
|
+
:param DatetimeList ref_dates: 获取时刻列表
|
|
14357
|
+
:return: 账户资金列表
|
|
14358
|
+
"""
|
|
13946
14359
|
@typing.overload
|
|
13947
14360
|
def get_inds_view(stks: collections.abc.Sequence, inds: collections.abc.Sequence[Indicator], query: Query, market: str = 'SH') -> typing.Any:
|
|
13948
14361
|
...
|
|
@@ -14118,6 +14531,27 @@ def open_spend_time() -> None:
|
|
|
14118
14531
|
"""
|
|
14119
14532
|
全局开启 c++ 部分耗时打印
|
|
14120
14533
|
"""
|
|
14534
|
+
def parallel_run_pf(pf_list: collections.abc.Sequence[...], query: Query, force: bool = False) -> list[list[...]]:
|
|
14535
|
+
"""
|
|
14536
|
+
parallel_run_pf(pf_list, query[, force=False])
|
|
14537
|
+
|
|
14538
|
+
并行执行多个投资组合策略, 并返回 list FundsList, 各账户对应资产(按query时间段)
|
|
14539
|
+
|
|
14540
|
+
:param list pf_list: 投资组合列表
|
|
14541
|
+
:param Query query: 查询条件
|
|
14542
|
+
:param bool force: 强制重新计算
|
|
14543
|
+
"""
|
|
14544
|
+
def parallel_run_sys(sys_list: collections.abc.Sequence[...], query: Query, reset: bool = False, reset_all: bool = False) -> list[list[...]]:
|
|
14545
|
+
"""
|
|
14546
|
+
parallel_run_sys(sys_list, query[, reset=False, reset_all=False])
|
|
14547
|
+
|
|
14548
|
+
并行运行多个系系统, 并返回 list FundsList, 各账户对应资产(按query时间段)
|
|
14549
|
+
|
|
14550
|
+
:param sys_list: 系统列表
|
|
14551
|
+
:param query: 查询条件
|
|
14552
|
+
:param bool reset: 执行前是否依据系统部件共享属性复位
|
|
14553
|
+
:param bool reset_all: 强制复位所有部件
|
|
14554
|
+
"""
|
|
14121
14555
|
def positions_to_df(arg0: PositionRecordList) -> typing.Any:
|
|
14122
14556
|
"""
|
|
14123
14557
|
positions_to_df(positions)
|
|
@@ -14277,16 +14711,19 @@ def spot_agent_is_running() -> bool:
|
|
|
14277
14711
|
"""
|
|
14278
14712
|
判断行情数据接收代理是否在运行
|
|
14279
14713
|
"""
|
|
14280
|
-
def start_data_server(addr: str = 'tcp://0.0.0.0:9201', work_num: typing.SupportsInt =
|
|
14714
|
+
def start_data_server(addr: str = 'tcp://0.0.0.0:9201', work_num: typing.SupportsInt = 3, save_tick: bool = False, buf_tick: bool = False, parquet_path: str = '') -> None:
|
|
14281
14715
|
"""
|
|
14282
|
-
start_data_server(addr: str[, work_num: int=
|
|
14716
|
+
start_data_server(addr: str[, work_num: int=3, save_tick: bool=False, buf_tick: bool=False, parquet_path: str=''])
|
|
14283
14717
|
|
|
14284
|
-
|
|
14285
|
-
|
|
14718
|
+
启动数据缓存服务。其中save_tick 参数和 parquet_path 有关联:
|
|
14719
|
+
- 如果 save_tick=True, parquet_path 不为空时, 使用 parquet_path 保存数据;
|
|
14720
|
+
- 如果 save_tick=True, parquet_path 为空时, 则使用 clickhouse K线存储引擎保存数据(需配置使用 clickhouse K线存储引擎)
|
|
14721
|
+
|
|
14286
14722
|
:param str addr: 服务器地址
|
|
14287
14723
|
:param int work_num: 工作线程数
|
|
14288
|
-
:param bool save_tick: 是否保存tick数据至数据库(
|
|
14724
|
+
:param bool save_tick: 是否保存tick数据至数据库(如果 parquet_path 不为空时, 使用 parquet 文件进行保存;否则,需使用 clickhouse K线存储引擎)
|
|
14289
14725
|
:param bool buf_tick: 是否缓存tick数据
|
|
14726
|
+
:param str parquet_path: 保存tick数据至parquet文件路径, 仅在 save_tick=True 时有效
|
|
14290
14727
|
:return: None
|
|
14291
14728
|
"""
|
|
14292
14729
|
def start_spot_agent(print: bool = False, worker_num: typing.SupportsInt = 1, addr: str = '') -> None:
|
hikyuu/cpp/core312.pyd
CHANGED
|
Binary file
|