hikyuu 2.6.8.5__py3-none-win_amd64.whl → 2.7.0__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.
Files changed (201) hide show
  1. hikyuu/__init__.py +31 -16
  2. hikyuu/__init__.pyi +610 -590
  3. hikyuu/analysis/__init__.pyi +584 -563
  4. hikyuu/analysis/analysis.pyi +585 -564
  5. hikyuu/core.py +2 -0
  6. hikyuu/core.pyi +586 -565
  7. hikyuu/cpp/__init__.pyi +2 -2
  8. hikyuu/cpp/boost_date_time-mt.dll +0 -0
  9. hikyuu/cpp/boost_serialization-mt.dll +0 -0
  10. hikyuu/cpp/boost_system-mt.dll +0 -0
  11. hikyuu/cpp/boost_wserialization-mt.dll +0 -0
  12. hikyuu/cpp/core310.pyd +0 -0
  13. hikyuu/cpp/core310.pyi +501 -104
  14. hikyuu/cpp/core311.pyd +0 -0
  15. hikyuu/cpp/core311.pyi +501 -104
  16. hikyuu/cpp/core312.pyd +0 -0
  17. hikyuu/cpp/core312.pyi +501 -104
  18. hikyuu/cpp/core313.pyd +0 -0
  19. hikyuu/cpp/core313.pyi +501 -104
  20. hikyuu/cpp/hikyuu.dll +0 -0
  21. hikyuu/cpp/hikyuu.lib +0 -0
  22. hikyuu/cpp/i18n/zh_CN/hikyuu.mo +0 -0
  23. hikyuu/data/clickhouse_upgrade/createdb.sql +105 -105
  24. hikyuu/data/common.py +3 -3
  25. hikyuu/data/common_clickhouse.py +1 -1
  26. hikyuu/data/download_block.py +351 -0
  27. hikyuu/data/em_block_to_clickhouse.py +26 -74
  28. hikyuu/data/em_block_to_mysql.py +25 -75
  29. hikyuu/data/em_block_to_sqlite.py +26 -78
  30. hikyuu/data/hku_config_template.py +3 -3
  31. hikyuu/data/pytdx_to_clickhouse.py +15 -11
  32. hikyuu/data/pytdx_to_h5.py +6 -2
  33. hikyuu/data/pytdx_to_mysql.py +5 -1
  34. hikyuu/data/pytdx_weight_to_clickhouse.py +1 -1
  35. hikyuu/data/pytdx_weight_to_mysql.py +1 -1
  36. hikyuu/data/pytdx_weight_to_sqlite.py +1 -1
  37. hikyuu/data/zh_bond10_to_clickhouse.py +1 -1
  38. hikyuu/draw/drawplot/__init__.pyi +8 -8
  39. hikyuu/draw/drawplot/bokeh_draw.pyi +600 -580
  40. hikyuu/draw/drawplot/common.pyi +1 -1
  41. hikyuu/draw/drawplot/echarts_draw.pyi +602 -582
  42. hikyuu/draw/drawplot/matplotlib_draw.py +4 -74
  43. hikyuu/draw/drawplot/matplotlib_draw.pyi +612 -592
  44. hikyuu/draw/elder.pyi +11 -11
  45. hikyuu/draw/kaufman.pyi +18 -18
  46. hikyuu/draw/volume.pyi +10 -10
  47. hikyuu/examples/notebook/Demo/Demo1.ipynb +48 -33
  48. hikyuu/extend.py +0 -8
  49. hikyuu/extend.pyi +594 -574
  50. hikyuu/fetcher/stock/zh_block_em.py +12 -40
  51. hikyuu/gui/HikyuuTDX.py +99 -31
  52. hikyuu/gui/data/CollectSpotThread.py +1 -1
  53. hikyuu/gui/data/EscapetimeThread.py +8 -14
  54. hikyuu/gui/data/ImportBlockInfoTask.py +3 -10
  55. hikyuu/gui/data/MainWindow.py +1196 -717
  56. hikyuu/gui/data/SchedImportThread.py +2 -2
  57. hikyuu/gui/data/UsePytdxImportToH5Thread.py +3 -3
  58. hikyuu/gui/data/UseQmtImportToH5Thread.py +2 -2
  59. hikyuu/gui/data/UseTdxImportToH5Thread.py +3 -3
  60. hikyuu/gui/data/tool.py +32 -25
  61. hikyuu/gui/dataserver.py +5 -3
  62. hikyuu/gui/images/liandongxiaopu.png +0 -0
  63. hikyuu/hub.pyi +6 -6
  64. hikyuu/include/hikyuu/DataType.h +4 -16
  65. hikyuu/include/hikyuu/KData.h +6 -3
  66. hikyuu/include/hikyuu/KDataPrivatedBufferImp.h +1 -1
  67. hikyuu/include/hikyuu/KDataSharedBufferImp.h +1 -1
  68. hikyuu/include/hikyuu/KQuery.h +2 -2
  69. hikyuu/include/hikyuu/Stock.h +4 -1
  70. hikyuu/include/hikyuu/StockManager.h +13 -3
  71. hikyuu/include/hikyuu/config.h +0 -3
  72. hikyuu/include/hikyuu/data_driver/BaseInfoDriver.h +8 -0
  73. hikyuu/include/hikyuu/data_driver/BlockInfoDriver.h +6 -0
  74. hikyuu/include/hikyuu/data_driver/KDataDriver.h +26 -1
  75. hikyuu/include/hikyuu/data_driver/base_info/mysql/MySQLBaseInfoDriver.h +1 -1
  76. hikyuu/include/hikyuu/data_driver/base_info/sqlite/SQLiteBaseInfoDriver.h +1 -1
  77. hikyuu/include/hikyuu/data_driver/block_info/mysql/MySQLBlockInfoDriver.h +2 -1
  78. hikyuu/include/hikyuu/data_driver/block_info/qianlong/QLBlockInfoDriver.h +2 -1
  79. hikyuu/include/hikyuu/data_driver/block_info/sqlite/SQLiteBlockInfoDriver.h +2 -1
  80. hikyuu/include/hikyuu/data_driver/kdata/DoNothingKDataDriver.h +1 -1
  81. hikyuu/include/hikyuu/data_driver/kdata/cvs/KDataTempCsvDriver.h +1 -1
  82. hikyuu/include/hikyuu/data_driver/kdata/hdf5/H5KDataDriver.h +1 -1
  83. hikyuu/include/hikyuu/data_driver/kdata/mysql/MySQLKDataDriver.h +1 -1
  84. hikyuu/include/hikyuu/data_driver/kdata/sqlite/SQLiteKDataDriver.h +1 -1
  85. hikyuu/include/hikyuu/data_driver/kdata/tdx/TdxKDataDriver.h +1 -1
  86. hikyuu/include/hikyuu/hikyuu.h +1 -1
  87. hikyuu/include/hikyuu/indicator/build_in.h +1 -0
  88. hikyuu/include/hikyuu/indicator/crt/CYCLE.h +4 -4
  89. hikyuu/include/hikyuu/indicator/crt/HSL.h +2 -2
  90. hikyuu/include/hikyuu/indicator/crt/QUANTILE_TRUNC.h +30 -0
  91. hikyuu/include/hikyuu/indicator/crt/TURNOVER.h +1 -0
  92. hikyuu/include/hikyuu/indicator/crt/ZSCORE.h +2 -2
  93. hikyuu/include/hikyuu/indicator/imp/IQuantileTrunc.h +25 -0
  94. hikyuu/include/hikyuu/misc.h +38 -0
  95. hikyuu/include/hikyuu/plugin/dataserver.h +2 -1
  96. hikyuu/include/hikyuu/plugin/device.h +10 -0
  97. hikyuu/include/hikyuu/plugin/extind.h +37 -0
  98. hikyuu/include/hikyuu/plugin/interface/DataServerPluginInterface.h +2 -2
  99. hikyuu/include/hikyuu/plugin/interface/DevicePluginInterface.h +2 -0
  100. hikyuu/include/hikyuu/plugin/interface/ExtendIndicatorsPluginInterface.h +12 -0
  101. hikyuu/include/hikyuu/plugin/interface/plugins.h +0 -5
  102. hikyuu/include/hikyuu/python/pybind_utils.h +0 -12
  103. hikyuu/include/hikyuu/strategy/RunSystemInStrategy.h +3 -0
  104. hikyuu/include/hikyuu/trade_manage/Performance.h +4 -4
  105. hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +10 -1
  106. hikyuu/include/hikyuu/trade_sys/moneymanager/imp/FixedCapitalFundsMM.h +0 -4
  107. hikyuu/include/hikyuu/trade_sys/multifactor/MultiFactorBase.h +36 -3
  108. hikyuu/include/hikyuu/trade_sys/multifactor/NormalizeBase.h +125 -0
  109. hikyuu/include/hikyuu/trade_sys/multifactor/ScoresFilterBase.h +125 -0
  110. hikyuu/include/hikyuu/trade_sys/multifactor/build_in.h +3 -0
  111. hikyuu/include/hikyuu/trade_sys/multifactor/buildin_norm.h +36 -0
  112. hikyuu/include/hikyuu/trade_sys/multifactor/buildin_scfilter.h +51 -0
  113. hikyuu/include/hikyuu/trade_sys/multifactor/filter/GroupSCFilter.h +24 -0
  114. hikyuu/include/hikyuu/trade_sys/multifactor/filter/IgnoreLessOrEqualValueSCFilter.h +24 -0
  115. hikyuu/include/hikyuu/trade_sys/multifactor/filter/IgnoreNanSCFilter.h +24 -0
  116. hikyuu/include/hikyuu/trade_sys/multifactor/filter/MinAmountPercentSCFilter.h +25 -0
  117. hikyuu/include/hikyuu/trade_sys/multifactor/filter/PriceSCFilter.h +24 -0
  118. hikyuu/include/hikyuu/trade_sys/multifactor/filter/TopNSCFilter.h +24 -0
  119. hikyuu/include/hikyuu/trade_sys/multifactor/imp/EqualWeightMultiFactor.h +1 -1
  120. hikyuu/include/hikyuu/trade_sys/multifactor/imp/ICIRMultiFactor.h +1 -1
  121. hikyuu/include/hikyuu/trade_sys/multifactor/imp/ICMultiFactor.h +1 -1
  122. hikyuu/include/hikyuu/trade_sys/multifactor/imp/WeightMultiFactor.h +1 -1
  123. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormMinMax.h +23 -0
  124. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormQuantile.h +28 -0
  125. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormQuantileUniform.h +28 -0
  126. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormZScore.h +25 -0
  127. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/__init__.py +1 -0
  128. hikyuu/include/hikyuu/trade_sys/multifactor/normalize/quantile_trunc.h +16 -0
  129. hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +7 -0
  130. hikyuu/include/hikyuu/trade_sys/portfolio/imp/SimplePortfolio.h +7 -0
  131. hikyuu/include/hikyuu/trade_sys/portfolio/imp/WithoutAFPortfolio.h +7 -0
  132. hikyuu/include/hikyuu/trade_sys/selector/SelectorBase.h +49 -0
  133. hikyuu/include/hikyuu/trade_sys/selector/build_in.h +1 -0
  134. hikyuu/include/hikyuu/trade_sys/selector/crt/SE_MultiFactor2.h +40 -0
  135. hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector.h +0 -3
  136. hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector2.h +49 -0
  137. hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorSelector.h +1 -1
  138. hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorValueSelector.h +1 -1
  139. hikyuu/include/hikyuu/trade_sys/signal/imp/BandSignal2.h +0 -4
  140. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/AddValueSignal.h +2 -2
  141. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/DivValueSignal.h +2 -2
  142. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/MulValueSignal.h +2 -2
  143. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorSignal.h +1 -1
  144. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorValueSignal.h +4 -4
  145. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/SubValueSignal.h +2 -2
  146. hikyuu/include/hikyuu/trade_sys/slippage/build_in.h +5 -1
  147. hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_LogNormal.h +22 -0
  148. hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_Normal.h +22 -0
  149. hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_TruncNormal.h +25 -0
  150. hikyuu/include/hikyuu/trade_sys/slippage/crt/SP_Uniform.h +23 -0
  151. hikyuu/include/hikyuu/trade_sys/slippage/imp/LogNormalSlippage.h +28 -0
  152. hikyuu/include/hikyuu/trade_sys/slippage/imp/NormalSlippage.h +28 -0
  153. hikyuu/include/hikyuu/trade_sys/slippage/imp/TruncNormalSlippage.h +28 -0
  154. hikyuu/include/hikyuu/trade_sys/slippage/imp/UniformSlippage.h +24 -0
  155. hikyuu/include/hikyuu/trade_sys/system/System.h +14 -1
  156. hikyuu/include/hikyuu/utilities/SpendTimer.h +17 -7
  157. hikyuu/include/hikyuu/utilities/arithmetic.h +45 -0
  158. hikyuu/include/hikyuu/utilities/db_connect/mysql/MySQLConnect.h +1 -1
  159. hikyuu/include/hikyuu/utilities/db_connect/mysql/MySQLStatement.h +1 -1
  160. hikyuu/include/hikyuu/utilities/db_connect/sqlite/SQLiteConnect.h +1 -1
  161. hikyuu/include/hikyuu/utilities/db_connect/sqlite/SQLiteStatement.h +1 -1
  162. hikyuu/include/hikyuu/utilities/plugin/PluginLoader.h +4 -1
  163. hikyuu/include/hikyuu/version.h +5 -5
  164. hikyuu/plugin/backtest.dll +0 -0
  165. hikyuu/plugin/clickhousedriver.dll +0 -0
  166. hikyuu/plugin/dataserver.dll +0 -0
  167. hikyuu/plugin/dataserver_parquet.dll +0 -0
  168. hikyuu/plugin/device.dll +0 -0
  169. hikyuu/plugin/extind.dll +0 -0
  170. hikyuu/plugin/hkuextra.dll +0 -0
  171. hikyuu/plugin/import2hdf5.dll +0 -0
  172. hikyuu/plugin/tmreport.dll +0 -0
  173. hikyuu/trade_manage/__init__.pyi +600 -580
  174. hikyuu/trade_manage/broker.pyi +3 -3
  175. hikyuu/trade_manage/broker_easytrader.pyi +1 -1
  176. hikyuu/trade_manage/trade.py +0 -2
  177. hikyuu/trade_manage/trade.pyi +600 -580
  178. hikyuu/util/__init__.pyi +2 -2
  179. hikyuu/util/singleton.pyi +1 -1
  180. {hikyuu-2.6.8.5.dist-info → hikyuu-2.7.0.dist-info}/METADATA +36 -33
  181. {hikyuu-2.6.8.5.dist-info → hikyuu-2.7.0.dist-info}/RECORD +185 -168
  182. {hikyuu-2.6.8.5.dist-info → hikyuu-2.7.0.dist-info}/top_level.txt +2 -2
  183. hikyuu/cpp/core39.pyd +0 -0
  184. hikyuu/cpp/core39.pyi +0 -14381
  185. hikyuu/data_driver/__init__.py +0 -49
  186. hikyuu/data_driver/jqdata_data_driver.py +0 -277
  187. hikyuu/data_driver/pytdx_data_driver.py +0 -292
  188. hikyuu/fetcher/stock/zh_stock_a_huatai.py +0 -51
  189. hikyuu/fetcher/stock/zh_stock_a_pytdx.py +0 -129
  190. hikyuu/gui/data/CollectToMemThread.py +0 -123
  191. hikyuu/gui/data/CollectToMySQLThread.py +0 -178
  192. hikyuu/gui/start_huatai_insight.py +0 -510
  193. hikyuu/include/hikyuu/plugin/hkuviews.h +0 -36
  194. hikyuu/include/hikyuu/plugin/interface/HkuViewsPluginInterface.h +0 -34
  195. hikyuu/include/hikyuu/views/arrow_common.h +0 -38
  196. hikyuu/include/hikyuu/views/arrow_views.h +0 -117
  197. hikyuu/plugin/hkuviews.dll +0 -0
  198. hikyuu/tools/update_block_info.py +0 -168
  199. /hikyuu/include/hikyuu/{views → trade_sys/multifactor/filter}/__init__.py +0 -0
  200. {hikyuu-2.6.8.5.dist-info → hikyuu-2.7.0.dist-info}/WHEEL +0 -0
  201. {hikyuu-2.6.8.5.dist-info → hikyuu-2.7.0.dist-info}/entry_points.txt +0 -0
hikyuu/cpp/core313.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', 'SP_LogNormal', 'SP_Normal', 'SP_TruncNormal', 'SP_Uniform', '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', 'bind_email', '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', '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_expire_date', 'get_funds_list', 'get_kdata', 'get_last_version', 'get_log_level', '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', 'open_ostream_to_python', 'open_spend_time', 'parallel_run_pf', 'parallel_run_sys', 'positions_to_df', 'positions_to_np', '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', 'toPriceList', 'trades_to_df', 'trades_to_np', 'translist_to_df', 'translist_to_np', 'view_license', 'weights_to_df', 'weights_to_np']
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, arg0: str, arg1: str) -> None:
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:
@@ -1207,9 +1210,6 @@ class DatetimeList:
1207
1210
  @staticmethod
1208
1211
  def to_pandas(data: DatetimeList):
1209
1212
  ...
1210
- @staticmethod
1211
- def to_pyarrow(data):
1212
- ...
1213
1213
  def __bool__(self) -> bool:
1214
1214
  """
1215
1215
  Check whether the list is nonempty
@@ -2332,8 +2332,6 @@ class KData:
2332
2332
  """
2333
2333
  将 KData 转换为 NumPy 数组
2334
2334
  """
2335
- def to_pyarrow(self) -> typing.Any:
2336
- ...
2337
2335
  def tocsv(self, arg0: str) -> None:
2338
2336
  """
2339
2337
  tocsv(self, filename)
@@ -2593,9 +2591,6 @@ class KRecordList:
2593
2591
  @staticmethod
2594
2592
  def to_pandas(data):
2595
2593
  ...
2596
- @staticmethod
2597
- def to_pyarrow(data):
2598
- ...
2599
2594
  def __bool__(self) -> bool:
2600
2595
  """
2601
2596
  Check whether the list is nonempty
@@ -3070,6 +3065,17 @@ class MultiFactorBase:
3070
3065
  ...
3071
3066
  def __str__(self) -> str:
3072
3067
  ...
3068
+ def add_special_normalize(self, name: str, norm: NormalizeBase = None, category: str = '', style_inds: collections.abc.Sequence[Indicator] = []) -> None:
3069
+ """
3070
+ add_special_normalize(self, name[, norm=None, category="", style_inds=[]])
3071
+
3072
+ 对指定名称的指标应用特定的标准化/归一化、行业中性化、风格因子中性化操作。标准化操作、行业中性化、风格因子中性化彼此无关,可同时指定也可分开指定。
3073
+
3074
+ :param str name: 特殊归一化方法名称
3075
+ :param Normalize norm: 特殊归一化方法
3076
+ :param str category: 行业中性化时,指定板块类别
3077
+ :param list[Indicator] style_inds: 用于中性化的风格指标列表
3078
+ """
3073
3079
  def clone(self) -> MultiFactorBase:
3074
3080
  """
3075
3081
  克隆操作
@@ -3091,7 +3097,14 @@ class MultiFactorBase:
3091
3097
  :return: ScoreRecordList
3092
3098
  """
3093
3099
  def get_all_src_factors(self) -> list[list[Indicator]]:
3094
- ...
3100
+ """
3101
+ get_all_src_factors(self)
3102
+
3103
+ 获取所有原始因子列表(如果指定了标准化、行业中性化, 返回为已处理的因子列表)
3104
+
3105
+ :rtype: list
3106
+ :return: list IndicatorList stks x inds
3107
+ """
3095
3108
  def get_datetime_list(self) -> DatetimeList:
3096
3109
  """
3097
3110
  获取参考日期列表(由参考证券通过查询条件获得)
@@ -3167,6 +3180,14 @@ class MultiFactorBase:
3167
3180
  """
3168
3181
  是否存在指定参数
3169
3182
  """
3183
+ def set_normalize(self, norm: NormalizeBase) -> None:
3184
+ """
3185
+ set_normalize(self, norm)
3186
+
3187
+ 设置标准化或归一化方法(影响全部因子)
3188
+
3189
+ :param NormalizeBase norm: 标准化或归一化方法实例
3190
+ """
3170
3191
  def set_param(self, arg0: str, arg1: any) -> None:
3171
3192
  """
3172
3193
  set_param(self, name, value)
@@ -3217,6 +3238,74 @@ class MultiFactorBase:
3217
3238
  @query.setter
3218
3239
  def query(self, arg1: Query) -> None:
3219
3240
  ...
3241
+ class NormalizeBase:
3242
+ """
3243
+ 用于 MF 的截面标准化操作
3244
+ """
3245
+ @staticmethod
3246
+ def _pybind11_conduit_v1_(*args, **kwargs):
3247
+ ...
3248
+ def __getstate__(self) -> tuple:
3249
+ ...
3250
+ @typing.overload
3251
+ def __init__(self) -> None:
3252
+ ...
3253
+ @typing.overload
3254
+ def __init__(self, arg0: NormalizeBase) -> None:
3255
+ ...
3256
+ @typing.overload
3257
+ def __init__(self, arg0: str) -> None:
3258
+ """
3259
+ 初始化构造函数
3260
+
3261
+ :param str name: 名称
3262
+ """
3263
+ def __repr__(self) -> str:
3264
+ ...
3265
+ def __setstate__(self, arg0: tuple) -> None:
3266
+ ...
3267
+ def __str__(self) -> str:
3268
+ ...
3269
+ def clone(self) -> NormalizeBase:
3270
+ """
3271
+ 克隆操作
3272
+ """
3273
+ def get_param(self, arg0: str) -> any:
3274
+ """
3275
+ get_param(self, name)
3276
+
3277
+ 获取指定的参数
3278
+
3279
+ :param str name: 参数名称
3280
+ :return: 参数值
3281
+ :raises out_of_range: 无此参数
3282
+ """
3283
+ def have_param(self, arg0: str) -> bool:
3284
+ """
3285
+ 是否存在指定参数
3286
+ """
3287
+ def normalize(self, arg0: collections.abc.Sequence[typing.SupportsFloat]) -> list[float]:
3288
+ """
3289
+ 【重载接口】子类计算接口
3290
+ """
3291
+ def set_param(self, arg0: str, arg1: any) -> None:
3292
+ """
3293
+ set_param(self, name, value)
3294
+
3295
+ 设置参数
3296
+
3297
+ :param str name: 参数名称
3298
+ :param value: 参数值
3299
+ :raises logic_error: Unsupported type! 不支持的参数类型
3300
+ """
3301
+ @property
3302
+ def name(self) -> str:
3303
+ """
3304
+ 名称
3305
+ """
3306
+ @name.setter
3307
+ def name(self, arg1: str) -> None:
3308
+ ...
3220
3309
  class OrderBrokerBase:
3221
3310
  """
3222
3311
  订单代理包装基类,用户可以参考自定义自己的订单代理,加入额外的处理
@@ -3490,6 +3579,10 @@ class Portfolio:
3490
3579
  """
3491
3580
  是否存在指定参数
3492
3581
  """
3582
+ def last_suggestion(self) -> typing.Any:
3583
+ """
3584
+ 回测完成后,返回最后一天交易记录,以及需要延迟的买入和卖出延迟请求
3585
+ """
3493
3586
  def reset(self) -> None:
3494
3587
  """
3495
3588
  复位操作
@@ -3786,8 +3879,6 @@ class PositionRecordList:
3786
3879
  ...
3787
3880
  def to_pandas(self):
3788
3881
  ...
3789
- def to_pyarrow(self):
3790
- ...
3791
3882
  class ProfitGoalBase:
3792
3883
  """
3793
3884
  盈利目标策略基类
@@ -4266,6 +4357,87 @@ class ScoreRecordList:
4266
4357
  ...
4267
4358
  def to_pandas(self):
4268
4359
  ...
4360
+ class ScoresFilterBase:
4361
+ """
4362
+ 用于 MF 的截面标准化操作
4363
+ """
4364
+ @staticmethod
4365
+ def _pybind11_conduit_v1_(*args, **kwargs):
4366
+ ...
4367
+ def __getstate__(self) -> tuple:
4368
+ ...
4369
+ @typing.overload
4370
+ def __init__(self) -> None:
4371
+ ...
4372
+ @typing.overload
4373
+ def __init__(self, arg0: ScoresFilterBase) -> None:
4374
+ ...
4375
+ @typing.overload
4376
+ def __init__(self, arg0: str) -> None:
4377
+ """
4378
+ 初始化构造函数
4379
+
4380
+ :param str name: 名称
4381
+ """
4382
+ def __or__(self, arg0: ScoresFilterBase) -> ScoresFilterBase:
4383
+ ...
4384
+ def __repr__(self) -> str:
4385
+ ...
4386
+ def __setstate__(self, arg0: tuple) -> None:
4387
+ ...
4388
+ def __str__(self) -> str:
4389
+ ...
4390
+ def _filter(self, arg0: ScoreRecordList, arg1: Datetime, arg2: Query) -> ScoreRecordList:
4391
+ """
4392
+ 【重载接口】子类计算接口
4393
+ """
4394
+ def clone(self) -> ScoresFilterBase:
4395
+ """
4396
+ 克隆操作
4397
+ """
4398
+ def filter(self, arg0: ScoreRecordList, arg1: Datetime, arg2: Query) -> ScoreRecordList:
4399
+ """
4400
+ filter(self, scores, date, query)
4401
+
4402
+ 截面过滤
4403
+ :param list scores: 截面数据
4404
+ :param Datetime date: 截面日期
4405
+ :param KQuery query: 查询参数
4406
+ :return: 截面数据
4407
+ :rtype: ScoreRecordList
4408
+ """
4409
+ def get_param(self, arg0: str) -> any:
4410
+ """
4411
+ get_param(self, name)
4412
+
4413
+ 获取指定的参数
4414
+
4415
+ :param str name: 参数名称
4416
+ :return: 参数值
4417
+ :raises out_of_range: 无此参数
4418
+ """
4419
+ def have_param(self, arg0: str) -> bool:
4420
+ """
4421
+ 是否存在指定参数
4422
+ """
4423
+ def set_param(self, arg0: str, arg1: any) -> None:
4424
+ """
4425
+ set_param(self, name, value)
4426
+
4427
+ 设置参数
4428
+
4429
+ :param str name: 参数名称
4430
+ :param value: 参数值
4431
+ :raises logic_error: Unsupported type! 不支持的参数类型
4432
+ """
4433
+ @property
4434
+ def name(self) -> str:
4435
+ """
4436
+ 名称
4437
+ """
4438
+ @name.setter
4439
+ def name(self, arg1: str) -> None:
4440
+ ...
4269
4441
  class SelectorBase:
4270
4442
  """
4271
4443
  选择器策略基类,实现标的、系统策略的评估和选取算法,自定义选择器策略子类接口:
@@ -4343,6 +4515,14 @@ class SelectorBase:
4343
4515
  """
4344
4516
  子类复位操作实现
4345
4517
  """
4518
+ def add_scores_filter(self, arg0: ScoresFilterBase) -> None:
4519
+ """
4520
+ add_scores_filter(self, filter)
4521
+
4522
+ 在已有过滤基础上新增过滤, 仅适用于 SE_MultiFactor
4523
+
4524
+ :param ScoresFilter filter: 新的过滤器
4525
+ """
4346
4526
  def add_stock(self, stock: Stock, sys: ...) -> None:
4347
4527
  """
4348
4528
  add_stock(self, stock, sys)
@@ -4425,6 +4605,19 @@ class SelectorBase:
4425
4605
  :param value: 参数值
4426
4606
  :raises logic_error: Unsupported type! 不支持的参数类型
4427
4607
  """
4608
+ def set_scores_filter(self, arg0: ScoresFilterBase) -> None:
4609
+ """
4610
+ set_scores_filter(self, filter)
4611
+
4612
+ 设置 ScoresFilter, 将替换现有的过滤器. 仅适用于 SE_MultiFactor
4613
+
4614
+ :param ScoresFilter filter: ScoresFilter
4615
+ """
4616
+ @property
4617
+ def mf(self) -> ...:
4618
+ """
4619
+ 获取关联的 MF
4620
+ """
4428
4621
  @property
4429
4622
  def name(self) -> str:
4430
4623
  """
@@ -4443,6 +4636,11 @@ class SelectorBase:
4443
4636
  """
4444
4637
  由 PF 运行时设定的实际运行系统列表
4445
4638
  """
4639
+ @property
4640
+ def scfilter(self) -> ScoresFilterBase:
4641
+ """
4642
+ 获取 ScoresFilter
4643
+ """
4446
4644
  class SignalBase:
4447
4645
  """
4448
4646
  信号指示器基类
@@ -5292,6 +5490,15 @@ class StockManager:
5292
5490
  """
5293
5491
  获取当前板块信息驱动参数
5294
5492
  """
5493
+ def get_category_list(self) -> list[str]:
5494
+ """
5495
+ get_category_list(self)
5496
+
5497
+ 获取所有板块分类
5498
+
5499
+ :return: 所有板块分类
5500
+ :rtype: StringList
5501
+ """
5295
5502
  def get_context(self) -> StrategyContext:
5296
5503
  """
5297
5504
  获取当前上下文
@@ -5649,9 +5856,6 @@ class StockWeightList:
5649
5856
  @staticmethod
5650
5857
  def to_pandas(data):
5651
5858
  ...
5652
- @staticmethod
5653
- def to_pyarrow(data):
5654
- ...
5655
5859
  def __bool__(self) -> bool:
5656
5860
  """
5657
5861
  Check whether the list is nonempty
@@ -6245,6 +6449,10 @@ class System:
6245
6449
  """
6246
6450
  是否存在指定参数
6247
6451
  """
6452
+ def last_suggestion(self) -> typing.Any:
6453
+ """
6454
+ 回测完成后,返回最后一天交易记录,以及需要延迟的买入和卖出延迟请求
6455
+ """
6248
6456
  def ready(self) -> None:
6249
6457
  ...
6250
6458
  def reset(self) -> None:
@@ -6859,9 +7067,6 @@ class TimeLineList:
6859
7067
  @staticmethod
6860
7068
  def to_pandas(data):
6861
7069
  ...
6862
- @staticmethod
6863
- def to_pyarrow(data):
6864
- ...
6865
7070
  def __bool__(self) -> bool:
6866
7071
  """
6867
7072
  Check whether the list is nonempty
@@ -7822,8 +8027,6 @@ class TradeRecordList:
7822
8027
  ...
7823
8028
  def to_pandas(self):
7824
8029
  ...
7825
- def to_pyarrow(self):
7826
- ...
7827
8030
  class TradeRequest:
7828
8031
  """
7829
8032
  交易请求记录。系统内部在实现延迟操作时登记的交易请求信息。暴露该结构的主要目的是用于
@@ -7910,9 +8113,6 @@ class TransList:
7910
8113
  @staticmethod
7911
8114
  def to_pandas(data):
7912
8115
  ...
7913
- @staticmethod
7914
- def to_pyarrow(data):
7915
- ...
7916
8116
  def __bool__(self) -> bool:
7917
8117
  """
7918
8118
  Check whether the list is nonempty
@@ -8153,6 +8353,26 @@ def AGG_COUNT(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit:
8153
8353
  """
8154
8354
  聚合函数: 非空值计数, 可参考 AGG_STD 帮助
8155
8355
  """
8356
+ def AGG_FUNC(ind: Indicator, agg_func: typing.Any, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
8357
+ """
8358
+ AGG_FUNC(ind, agg_func[, ktype=Query.MIN, fill_null=False, unit=1]
8359
+
8360
+ 使用自定函数聚合其他K线周期的指标。虽然支持python自定义函数, 但python函数需要GIL, 速度会慢。建议最好直接使用 C++ 自定义聚合函数。
8361
+
8362
+ 示例, 计算日线时聚合分钟线收盘价的和:
8363
+
8364
+ >>> kdata = get_kdata('sh600000', Query(Datetime(20250101), ktype=Query.DAY))
8365
+ >>> ind = AGG_FUNC(CLOSE(), lambda ds, x: np.sum(x))
8366
+ >>> ind(k)
8367
+
8368
+ :param Indicator ind: 待计算指标
8369
+ :param callable agg_func: 自定义聚合函数,输入参数为 arg1: datetime list, arg2: numpy array, 返回针对list的聚合结果, 注意是单个值
8370
+ :param KQuery.KType ktype: 聚合的K线周期
8371
+ :param bool fill_null: 是否填充缺失值
8372
+ :param int unit: 聚合周期单位 (上下文K线分组单位, 使用日线计算分钟线聚合时, unit=2代表聚合2天的分钟线)
8373
+ :return: 聚合结果
8374
+ :rtype: Indicator
8375
+ """
8156
8376
  def AGG_MAD(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
8157
8377
  """
8158
8378
  聚合函数: 平均绝对偏差, 可参考 AGG_STD 帮助
@@ -9128,6 +9348,48 @@ def FLOOR(arg0: typing.SupportsFloat) -> Indicator:
9128
9348
  :param data: 输入数据
9129
9349
  :rtype: Indicator
9130
9350
  """
9351
+ def GROUP_COUNT(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
9352
+ """
9353
+ 分组累积计数
9354
+ """
9355
+ def GROUP_FUNC(ind: Indicator, group_func: typing.Any, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
9356
+ """
9357
+ GROUP_FUNC(ind, group_func[, ktype=Query.DAY, unit=1])
9358
+
9359
+ 自定义分组累积计算指标。虽然支持python自定义函数, 但python函数需要GIL, 速度较慢。建议最好直接使用 C++ 自定义分组累积函数。
9360
+
9361
+ 示例, 计算日线时聚合分钟线收盘价的和:
9362
+
9363
+ >>> kdata = get_kdata('sh600000', Query(Datetime(20250101), ktype=Query.DAY))
9364
+ >>> ind = GROUP_FUNC(CLOSE(), lambda dates, data: data/2.0)
9365
+ >>> ind(k)
9366
+
9367
+ :param Indicator ind: 待计算指标
9368
+ :param callable group_func: 自定义分组累积函数,输入参数为 arg1: datetime list, arg2: numpy array, 返回和输入等长的累积计算结果, 类型同样须为 np.array
9369
+ :param KQuery.KType ktype: 分组的K线周期
9370
+ :param int unit: 分组周期单位 (分组的K线周期单位, 使用日线计算分钟线, unit=2代表按2天累积计算的分钟线)
9371
+ :rtype: Indicator
9372
+ """
9373
+ def GROUP_MAX(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
9374
+ """
9375
+ 分组累积最大值
9376
+ """
9377
+ def GROUP_MEAN(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
9378
+ """
9379
+ 分组累积平均
9380
+ """
9381
+ def GROUP_MIN(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
9382
+ """
9383
+ 分组累积最小值
9384
+ """
9385
+ def GROUP_PROD(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
9386
+ """
9387
+ 分组累积乘积
9388
+ """
9389
+ def GROUP_SUM(ind: Indicator, ktype: str = 'DAY', unit: typing.SupportsInt = 1) -> Indicator:
9390
+ """
9391
+ 分组累积和
9392
+ """
9131
9393
  @typing.overload
9132
9394
  def HHV(n: typing.SupportsInt = 20) -> Indicator:
9133
9395
  ...
@@ -10099,6 +10361,36 @@ def NDAY(x: Indicator, y: Indicator, n: IndParam) -> Indicator:
10099
10361
  :param int|Indicator|IndParam n: 时间窗口
10100
10362
  :rtype: Indicator
10101
10363
  """
10364
+ def NORM_MinMax() -> NormalizeBase:
10365
+ """
10366
+ 最小-最大标准化操作
10367
+ """
10368
+ def NORM_NOTHING() -> NormalizeBase:
10369
+ """
10370
+ 无截面标准化操作
10371
+ """
10372
+ def NORM_Quantile(quantile_min: typing.SupportsFloat = 0.01, quantile_max: typing.SupportsFloat = 0.99) -> NormalizeBase:
10373
+ """
10374
+ 分位数截面标准化操作
10375
+
10376
+ :param quantile_min: 最小分位数
10377
+ :param quantile_max: 最大分位数
10378
+ """
10379
+ def NORM_Quantile_Uniform(quantile_min: typing.SupportsFloat = 0.01, quantile_max: typing.SupportsFloat = 0.99) -> NormalizeBase:
10380
+ """
10381
+ 分位数截面均匀分布标准化操作
10382
+
10383
+ :param quantile_min: 最小分位数
10384
+ :param quantile_max: 最大分位数
10385
+ """
10386
+ def NORM_Zscore(out_extreme: bool = False, nsigma: typing.SupportsFloat = 3.0, recursive: bool = False) -> NormalizeBase:
10387
+ """
10388
+ Z-score 标准化操作
10389
+
10390
+ :param out_extreme: 是否剔除异常值
10391
+ :param nsigma: 异常值判断倍数±3.0
10392
+ :param recursive: 是否递归处理异常值
10393
+ """
10102
10394
  @typing.overload
10103
10395
  def NOT() -> Indicator:
10104
10396
  ...
@@ -10237,6 +10529,22 @@ def PRICELIST(data: typing.Any = None, discard: typing.SupportsInt = 0, align_da
10237
10529
  :rtype: Indicator
10238
10530
  """
10239
10531
  @typing.overload
10532
+ def QUANTILE_TRUNC(n: typing.SupportsInt = 60, quantial_min: typing.SupportsFloat = 0.01, quantial_max: typing.SupportsFloat = 0.99) -> Indicator:
10533
+ ...
10534
+ @typing.overload
10535
+ def QUANTILE_TRUNC(data: Indicator, n: typing.SupportsInt = 60, quantial_min: typing.SupportsFloat = 0.01, quantial_max: typing.SupportsFloat = 0.99) -> Indicator:
10536
+ """
10537
+ QUANTILE_TRUNC(data[, n=60, quantial_min=0.01, quantial_max=0.99])
10538
+
10539
+ 对数据进行分位数截断处理。非窗口滚动。
10540
+
10541
+ :param Indicator data: 待剔除异常值数据
10542
+ :param int n: 时间窗口
10543
+ :param float quantial_min: 剔除极值时使用的百分位数下限,默认 0.01
10544
+ :param float quantial_max: 剔除极值时使用的百分位数上限,默认 0.99
10545
+ :rtype: Indicator
10546
+ """
10547
+ @typing.overload
10240
10548
  def RANK(stks: collections.abc.Sequence, mode: typing.SupportsInt = 0, fill_null: bool = True, market: str = 'SH') -> Indicator:
10241
10549
  ...
10242
10550
  @typing.overload
@@ -10594,6 +10902,59 @@ def SAFTYLOSS(data: Indicator, n1: Indicator, n2: Indicator, p: Indicator) -> In
10594
10902
  :param float|Indicator|IndParam p: 噪音系数
10595
10903
  :rtype: Indicator
10596
10904
  """
10905
+ def SCFilter_AmountLimit(min_amount_percent_limit: typing.SupportsFloat = 0.1) -> ScoresFilterBase:
10906
+ """
10907
+ SCFilter_AmountLimit([min_amount_percent_limit: float = 0.1])
10908
+
10909
+ 过滤掉成交金额在评分列表末尾百分比范围内的截面
10910
+
10911
+ 注意:和传入的截面评分列表顺序相关,如果是降序,过滤的是成交金额较小的系统评分记录;反之,则是金额较大的系统评分记录
10912
+
10913
+ :param double min_amount_percent_limit: 最小金额百分比限制
10914
+ :return: 截面过滤器
10915
+ :rtype: ScoresFilterPtr
10916
+ """
10917
+ def SCFilter_Group(group: typing.SupportsInt = 10, group_index: typing.SupportsInt = 0) -> ScoresFilterBase:
10918
+ """
10919
+ SCFilter_Group([group: int=10, group_index: int=0])
10920
+
10921
+ 按截面进行分组过滤
10922
+ :param int group: 分组数量
10923
+ :param int group_index: 分组索引
10924
+ :return: 截面过滤器
10925
+ :rtype: ScoresFilterPtr
10926
+ """
10927
+ def SCFilter_IgnoreNan() -> ScoresFilterBase:
10928
+ """
10929
+ SCFilter_IgnoreNan() -> ScoresFilterPtr
10930
+
10931
+ 忽略截面中的NAN值
10932
+ """
10933
+ def SCFilter_LessOrEqualValue(value: typing.SupportsFloat = 0.0) -> ScoresFilterBase:
10934
+ """
10935
+ SCFilter_LessOrEqualValue([value = 0.0])
10936
+
10937
+ 过滤掉评分小于等于指定值的截面
10938
+ """
10939
+ def SCFilter_Price(min_price: typing.SupportsFloat = 10.0, max_price: typing.SupportsFloat = 100000.0) -> ScoresFilterBase:
10940
+ """
10941
+ SCFilter_Price([min_price = 10., max_price = 100000.])
10942
+
10943
+ 仅保留价格在 [min_price, max_price] 之间的标的
10944
+
10945
+ 注意:和传入的截面评分列表顺序相关,如果是降序,过滤的是价格较小的系统评分记录;反之,则是价格较大的系统评分记录
10946
+
10947
+ :param double min_price: 最小价格限制
10948
+ :param double max_price: 最大价格限制
10949
+ """
10950
+ def SCFilter_TopN(topn: typing.SupportsInt = 10) -> ScoresFilterBase:
10951
+ """
10952
+ SCFilter_TopN([topn: int=10])
10953
+
10954
+ 获取评分列表中的前 topn 个
10955
+
10956
+ :param int topn: 前 topn 个
10957
+ """
10597
10958
  def SE_EvaluateOptimal(arg0: typing.Any) -> SelectorBase:
10598
10959
  """
10599
10960
  SE_EvaluateOptimal(evalulate_func)
@@ -10644,6 +11005,27 @@ def SE_MultiFactor(inds: collections.abc.Sequence, topn: typing.SupportsInt = 10
10644
11005
  :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
10645
11006
  :param str mode: "MF_ICIRWeight" | "MF_ICWeight" | "MF_EqualWeight" 因子合成算法名称
10646
11007
  """
11008
+ @typing.overload
11009
+ def SE_MultiFactor2(mf: ..., filter: ScoresFilterBase = ...) -> SelectorBase:
11010
+ ...
11011
+ @typing.overload
11012
+ 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:
11013
+ """
11014
+ SE_MultiFactor2([inds, ic_n, ic_rolling_n, ref_stk, spearman, mode, filter])
11015
+
11016
+ 创建基于多因子评分的选择器,两种创建方式
11017
+
11018
+ - 直接指定 MF:
11019
+ :param MultiFactorBase mf: 直接指定的多因子合成算法
11020
+
11021
+ - 参数直接创建:
11022
+ :param sequense(Indicator) inds: 原始因子列表
11023
+ :param int ic_n: 默认 IC 对应的 N 日收益率
11024
+ :param int ic_rolling_n: IC 滚动周期
11025
+ :param Stock ref_stk: 参考证券 (未指定时,默认为 sh000300 沪深300)
11026
+ :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
11027
+ :param str mode: "MF_ICIRWeight" | "MF_ICWeight" | "MF_EqualWeight" 因子合成算法名称
11028
+ """
10647
11029
  def SE_PerformanceOptimal(key: str = '帐户平均年收益率%', mode: typing.SupportsInt = 0) -> SelectorBase:
10648
11030
  """
10649
11031
  SE_PerformanceOptimal(key="帐户平均年收益率%", mode=0)
@@ -11054,6 +11436,48 @@ def SP_FixedValue(value: typing.SupportsFloat = 0.01) -> SlippageBase:
11054
11436
  :param float p: 偏移价格
11055
11437
  :return: 移滑价差算法实例
11056
11438
  """
11439
+ def SP_LogNormal(mean: typing.SupportsFloat = 0.0, stddev: typing.SupportsFloat = 0.05) -> SlippageBase:
11440
+ """
11441
+ SP_LogNormal([mean=0.0, stddev=0.05])
11442
+
11443
+ 对数正态分布随机价格移滑价差算法, 买入和卖出操作是价格在对数正态分布[mean, stddev]范围内的随机偏移
11444
+
11445
+ :param float mean: 对数正态分布的均值
11446
+ :param float stddev: 对数正态分布的标准差
11447
+ :return: 移滑价差算法实例
11448
+ """
11449
+ def SP_Normal(mean: typing.SupportsFloat = 0.0, stddev: typing.SupportsFloat = 0.05) -> SlippageBase:
11450
+ """
11451
+ SP_Normal([mean=0.0, stddev=0.05])
11452
+
11453
+ 正态分布随机价格移滑价差算法, 买入和卖出操作是价格在正态分布[mean, stddev]范围内的随机偏移
11454
+
11455
+ :param float mean: 正态分布的均值
11456
+ :param float stddev: 正态分布的标准差
11457
+ :return: 移滑价差算法实例
11458
+ """
11459
+ def SP_TruncNormal(mean: typing.SupportsFloat = 0.0, stddev: typing.SupportsFloat = 0.05, min_value: typing.SupportsFloat = -0.11, max_value: typing.SupportsFloat = 0.1) -> SlippageBase:
11460
+ """
11461
+ SP_TruncNormal([mean=0.0, stddev=0.05, min_value=-0.1, max_value=0.1])
11462
+
11463
+ 截断正态分布随机价格移滑价差算法, 买入和卖出操作是价格在截断正态分布[mean, stddev, min_value, max_value]范围内的随机偏移
11464
+
11465
+ :param float mean: 截断正态分布的均值
11466
+ :param float stddev: 截断正态分布的标准差
11467
+ :param float min_value: 最小截断值
11468
+ :param float max_value: 最大截断值
11469
+ :return: 移滑价差算法实例
11470
+ """
11471
+ def SP_Uniform(min_value: typing.SupportsFloat = -0.05, max_value: typing.SupportsFloat = 0.05) -> SlippageBase:
11472
+ """
11473
+ SP_Uniform([min_value=-0.05, max_value=0.05])
11474
+
11475
+ 均匀分布随机价格移滑价差算法, 买入和卖出操作是价格在[min_value, max_value]范围内的均匀分布随机偏移
11476
+
11477
+ :param float min_value: 最小偏移价格
11478
+ :param float max_value: 最大偏移价格
11479
+ :return: 移滑价差算法实例
11480
+ """
11057
11481
  @typing.overload
11058
11482
  def SQRT() -> Indicator:
11059
11483
  ...
@@ -13743,7 +14167,7 @@ def ZSCORE(data: Indicator, out_extreme: bool = False, nsigma: typing.SupportsFl
13743
14167
  """
13744
14168
  ZSCORE(data[, out_extreme, nsigma, recursive])
13745
14169
 
13746
- 对数据进行标准化(归一),可选进行极值排除
14170
+ 对数据进行标准化(归一),可选进行极值处理
13747
14171
 
13748
14172
  注:非窗口滚动,如需窗口滚动的标准化,直接 (x - MA(x, n)) / STDEV(x, n) 即可。
13749
14173
 
@@ -13797,6 +14221,15 @@ def batch_calculate_inds(arg0: collections.abc.Sequence, arg1: KData) -> list:
13797
14221
  :return: 指标计算结果列表
13798
14222
  :rtype: list
13799
14223
  """
14224
+ def bind_email(arg0: str, arg1: str) -> None:
14225
+ """
14226
+ bind_email(email: str, code: str)
14227
+
14228
+ 绑定邮箱和授权码
14229
+
14230
+ :param str email: 邮箱地址
14231
+ :param str code: 授权码
14232
+ """
13800
14233
  def can_upgrade() -> bool:
13801
14234
  ...
13802
14235
  def close_ostream_to_python() -> None:
@@ -13857,10 +14290,6 @@ def dates_to_np(arg0: DatetimeList) -> numpy.ndarray:
13857
14290
  """
13858
14291
  将 DatetimeList 转换为 NumPy 元组
13859
14292
  """
13860
- def dates_to_pa(arg0: DatetimeList) -> typing.Any:
13861
- """
13862
- 将日期列表转换为 pyarrow.Table 对象
13863
- """
13864
14293
  def df_to_krecords(df: typing.Any, columns: collections.abc.Sequence[str] = ['datetime', 'open', 'high', 'low', 'close', 'amount', 'volume']) -> KRecordList:
13865
14294
  """
13866
14295
  df_to_krecords(df: pd.DataFrame[, columns: dict]) -> KRecordList
@@ -13874,7 +14303,7 @@ def df_to_krecords(df: typing.Any, columns: collections.abc.Sequence[str] = ['da
13874
14303
  def fetch_trial_license(arg0: str) -> str:
13875
14304
  """
13876
14305
  fetch_trial_license(email: str)
13877
-
14306
+
13878
14307
  获取试用授权码
13879
14308
 
13880
14309
  :param str email: 邮箱地址
@@ -13922,38 +14351,23 @@ def get_date_range(start: Datetime, end: Datetime) -> DatetimeList:
13922
14351
  :param Datetime end: 结束日期
13923
14352
  :rtype: DatetimeList
13924
14353
  """
13925
- @typing.overload
13926
- def get_inds_view(stks: collections.abc.Sequence, inds: collections.abc.Sequence[Indicator], query: Query, market: str = 'SH') -> typing.Any:
13927
- ...
13928
- @typing.overload
13929
- def get_inds_view(stks: collections.abc.Sequence, inds: collections.abc.Sequence[Indicator], date: Datetime, cal_len: typing.SupportsInt = 100, ktype: str = 'DAY', market: str = 'SH') -> typing.Any:
14354
+ def get_expire_date() -> Datetime:
14355
+ """
14356
+ get_expire_date() -> Datetime
14357
+
14358
+ 查看授权到期时间
13930
14359
  """
13931
- get_inds_view(stks, inds, date[, cal_len=100, ktype=Query.DAY, market='SH']) -> pandas.DataFrame)
14360
+ def get_funds_list(arg0: collections.abc.Sequence[TradeManager], arg1: DatetimeList) -> list[list[FundsRecord]]:
14361
+ """
14362
+ get_funds_list(tm_list: list, ref_dates: DatetimeList) -> list[Funds])
13932
14363
 
13933
- 方式1: 获取指定日期的各证券的各指标结果
13934
-
13935
- :param stks: 证券列表
13936
- :param list[Indicator] inds: 指标列表
13937
- :param Datetime date: 指定日期
13938
- :param int cal_len: 计算需要的数据长度
13939
- :param str ktype: k线类型
13940
- :param str market: 指定行情市场(用于日期对齐)
13941
-
13942
- 方式2: 获取按指定Query查询计算的各证券的各指标结果, 结果中将包含指定 Query 包含的所有指定市场交易日日期
13943
- get_inds_view(stks, inds, query, market='SH'])
14364
+ 一次性从多个账户中获取多个指定时刻的账户资金信息
13944
14365
 
13945
- :param stks: 指定证券列表
13946
- :param list[Indicator] inds: 指定指标列表
13947
- :param Query query: 查询条件
13948
- :param str market: 指定行情市场(用于日期对齐)
14366
+ :param list tm_list: 账户列表
14367
+ :param DatetimeList ref_dates: 获取时刻列表
14368
+ :return: 账户资金列表
13949
14369
  """
13950
14370
  @typing.overload
13951
- def get_inds_view_pyarrow(stks: collections.abc.Sequence, inds: collections.abc.Sequence[Indicator], query: Query, market: str = 'SH') -> typing.Any:
13952
- ...
13953
- @typing.overload
13954
- def get_inds_view_pyarrow(stks: collections.abc.Sequence, inds: collections.abc.Sequence[Indicator], date: Datetime, cal_len: typing.SupportsInt = 100, ktype: str = 'DAY', market: str = 'SH') -> typing.Any:
13955
- ...
13956
- @typing.overload
13957
14371
  def get_kdata(arg0: str, arg1: Query) -> KData:
13958
14372
  ...
13959
14373
  @typing.overload
@@ -13984,23 +14398,6 @@ def get_log_level() -> LOG_LEVEL:
13984
14398
  """
13985
14399
  获取当前日志级别
13986
14400
  """
13987
- def get_market_view(stks: collections.abc.Sequence, date: Datetime = ..., market: str = 'SH') -> typing.Any:
13988
- """
13989
- get_market_view(stks[, date=Datetime(), market='SH']) -> pandas.DataFrame
13990
-
13991
- 获取指定股票集合在指定交易日的行情数据,不包含当日停牌无数据的股票。如未指定日期,则返回最后交易日行情数据,
13992
- 如同时接收了行情数据,则为实时行情。
13993
-
13994
- 注: 此函数依赖于日线数据
13995
-
13996
- :param list[Stock] stks: 股票列表
13997
- :param Datetime date: 获取指定日期的行情数据
13998
- :param str market: 市场代码
13999
- :return: 指定股票列表最后行情数据
14000
- :rtype: pandas.DataFrame
14001
- """
14002
- def get_market_view_pyarrow(stks: collections.abc.Sequence, date: Datetime = ..., market: str = 'SH') -> typing.Any:
14003
- ...
14004
14401
  def get_spot_from_buffer_server(arg0: str, arg1: str, arg2: str, arg3: Datetime) -> list[SpotRecord]:
14005
14402
  """
14006
14403
  get_spot_from_buffer_server(addr: str, market: str, code: str, datetime: str)
@@ -14087,16 +14484,33 @@ def krecords_to_df(arg0: KRecordList) -> typing.Any:
14087
14484
  ...
14088
14485
  def krecords_to_np(arg0: KRecordList) -> numpy.ndarray:
14089
14486
  ...
14090
- def krecords_to_pa(arg0: KRecordList) -> typing.Any:
14091
- """
14092
- 将KRecordList转换为parraw.Table
14093
- """
14094
14487
  def open_ostream_to_python() -> None:
14095
14488
  ...
14096
14489
  def open_spend_time() -> None:
14097
14490
  """
14098
14491
  全局开启 c++ 部分耗时打印
14099
14492
  """
14493
+ def parallel_run_pf(pf_list: collections.abc.Sequence[...], query: Query, force: bool = False) -> list[list[...]]:
14494
+ """
14495
+ parallel_run_pf(pf_list, query[, force=False])
14496
+
14497
+ 并行执行多个投资组合策略, 并返回 list FundsList, 各账户对应资产(按query时间段)
14498
+
14499
+ :param list pf_list: 投资组合列表
14500
+ :param Query query: 查询条件
14501
+ :param bool force: 强制重新计算
14502
+ """
14503
+ def parallel_run_sys(sys_list: collections.abc.Sequence[...], query: Query, reset: bool = False, reset_all: bool = False) -> list[list[...]]:
14504
+ """
14505
+ parallel_run_sys(sys_list, query[, reset=False, reset_all=False])
14506
+
14507
+ 并行运行多个系系统, 并返回 list FundsList, 各账户对应资产(按query时间段)
14508
+
14509
+ :param sys_list: 系统列表
14510
+ :param query: 查询条件
14511
+ :param bool reset: 执行前是否依据系统部件共享属性复位
14512
+ :param bool reset_all: 强制复位所有部件
14513
+ """
14100
14514
  def positions_to_df(arg0: PositionRecordList) -> typing.Any:
14101
14515
  """
14102
14516
  positions_to_df(positions)
@@ -14115,10 +14529,6 @@ def positions_to_np(arg0: PositionRecordList) -> numpy.ndarray:
14115
14529
 
14116
14530
  注意: 其中的当前市值、利润、盈亏等计算值均以日线计算, 如使用日线一下级别回测时, 对未清仓的持仓记录需要自行重新计算!
14117
14531
  """
14118
- def positions_to_pa(arg0: PositionRecordList) -> typing.Any:
14119
- """
14120
- 将交易记录列表转换为 pyarrow.Table 对象
14121
- """
14122
14532
  @typing.overload
14123
14533
  def register_extra_ktype(ktype: str, basetype: str, minutes: typing.SupportsInt, get_phase_end: collections.abc.Callable[[Datetime], Datetime]) -> None:
14124
14534
  ...
@@ -14162,7 +14572,7 @@ def release_extra_ktype() -> None:
14162
14572
  def remove_license() -> None:
14163
14573
  """
14164
14574
  remove_license()
14165
-
14575
+
14166
14576
  移除当前授权
14167
14577
  """
14168
14578
  @typing.overload
@@ -14256,16 +14666,19 @@ def spot_agent_is_running() -> bool:
14256
14666
  """
14257
14667
  判断行情数据接收代理是否在运行
14258
14668
  """
14259
- def start_data_server(addr: str = 'tcp://0.0.0.0:9201', work_num: typing.SupportsInt = 2, save_tick: bool = False, buf_tick: bool = False) -> None:
14669
+ 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:
14260
14670
  """
14261
- start_data_server(addr: str[, work_num: int=2])
14671
+ start_data_server(addr: str[, work_num: int=3, save_tick: bool=False, buf_tick: bool=False, parquet_path: str=''])
14262
14672
 
14263
- 启动数据缓存服务
14264
-
14673
+ 启动数据缓存服务。其中save_tick 参数和 parquet_path 有关联:
14674
+ - 如果 save_tick=True, parquet_path 不为空时, 使用 parquet_path 保存数据;
14675
+ - 如果 save_tick=True, parquet_path 为空时, 则使用 clickhouse K线存储引擎保存数据(需配置使用 clickhouse K线存储引擎)
14676
+
14265
14677
  :param str addr: 服务器地址
14266
14678
  :param int work_num: 工作线程数
14267
- :param bool save_tick: 是否保存tick数据至数据库(仅支持使用 clickhouse K线存储引擎)
14679
+ :param bool save_tick: 是否保存tick数据至数据库(如果 parquet_path 不为空时, 使用 parquet 文件进行保存;否则,需使用 clickhouse K线存储引擎)
14268
14680
  :param bool buf_tick: 是否缓存tick数据
14681
+ :param str parquet_path: 保存tick数据至parquet文件路径, 仅在 save_tick=True 时有效
14269
14682
  :return: None
14270
14683
  """
14271
14684
  def start_spot_agent(print: bool = False, worker_num: typing.SupportsInt = 1, addr: str = '') -> None:
@@ -14300,10 +14713,6 @@ def timeline_to_np(arg0: TimeLineList) -> numpy.ndarray:
14300
14713
  """
14301
14714
  将分时线记录转换为NumPy元组
14302
14715
  """
14303
- def timeline_to_pa(arg0: TimeLineList) -> typing.Any:
14304
- """
14305
- 将分时线记录转换为 pyarrow.Table 对象
14306
- """
14307
14716
  def toPriceList(arg0: collections.abc.Sequence) -> list[float]:
14308
14717
  """
14309
14718
  将 python list/tuple/np.arry 对象转化为 PriceList 对象
@@ -14320,10 +14729,6 @@ def trades_to_df(arg0: TradeRecordList) -> typing.Any:
14320
14729
  """
14321
14730
  def trades_to_np(arg0: TradeRecordList) -> numpy.ndarray:
14322
14731
  ...
14323
- def trades_to_pa(arg0: TradeRecordList) -> typing.Any:
14324
- """
14325
- 将交易记录列表转换为 pyarrow.Table 对象
14326
- """
14327
14732
  def translist_to_df(arg0: TransList) -> typing.Any:
14328
14733
  """
14329
14734
  将分笔记录转换为 DataFrame
@@ -14332,10 +14737,6 @@ def translist_to_np(arg0: TransList) -> numpy.ndarray:
14332
14737
  """
14333
14738
  将分笔记录转换为NumPy元组
14334
14739
  """
14335
- def translist_to_pa(arg0: TransList) -> typing.Any:
14336
- """
14337
- 将分笔记录转换为 pyarrow.Table 对象
14338
- """
14339
14740
  def view_license() -> str:
14340
14741
  """
14341
14742
  view_license()
@@ -14346,10 +14747,6 @@ def weights_to_df(arg0: StockWeightList) -> typing.Any:
14346
14747
  ...
14347
14748
  def weights_to_np(arg0: StockWeightList) -> numpy.ndarray:
14348
14749
  ...
14349
- def weights_to_pa(arg0: StockWeightList) -> typing.Any:
14350
- """
14351
- 将权息记录列表转换为 pyarrow.Table 对象
14352
- """
14353
14750
  DEBUG: LOG_LEVEL # value = <LOG_LEVEL.DEBUG: 1>
14354
14751
  ERROR: LOG_LEVEL # value = <LOG_LEVEL.ERROR: 4>
14355
14752
  FATAL: LOG_LEVEL # value = <LOG_LEVEL.FATAL: 5>