hikyuu 2.7.3__py3-none-manylinux2014_aarch64.whl → 2.7.6__py3-none-manylinux2014_aarch64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. hikyuu/__init__.py +3 -1
  2. hikyuu/__init__.pyi +9 -8
  3. hikyuu/analysis/__init__.pyi +1 -0
  4. hikyuu/analysis/analysis.pyi +2 -1
  5. hikyuu/core.pyi +3 -2
  6. hikyuu/cpp/core310.pyi +80 -46
  7. hikyuu/cpp/core310.so +0 -0
  8. hikyuu/cpp/core311.pyi +80 -46
  9. hikyuu/cpp/core311.so +0 -0
  10. hikyuu/cpp/core312.pyi +80 -46
  11. hikyuu/cpp/core312.so +0 -0
  12. hikyuu/cpp/core313.pyi +80 -46
  13. hikyuu/cpp/core313.so +0 -0
  14. hikyuu/cpp/libhikyuu.so +0 -0
  15. hikyuu/cpp/libmimalloc.so +0 -0
  16. hikyuu/cpp/libmimalloc.so.3 +0 -0
  17. hikyuu/cpp/libmimalloc.so.3.1 +0 -0
  18. hikyuu/data/clickhouse_upgrade/0002.sql +9 -0
  19. hikyuu/data/common_mysql.py +1 -1
  20. hikyuu/data/em_block_to_mysql.py +16 -4
  21. hikyuu/data/em_block_to_sqlite.py +16 -4
  22. hikyuu/data/hku_config_template.py +1 -1
  23. hikyuu/data/mysql_upgrade/0030.sql +3 -0
  24. hikyuu/data/pytdx_to_h5.py +2 -2
  25. hikyuu/data/pytdx_to_mysql.py +5 -5
  26. hikyuu/data/sqlite_upgrade/0030.sql +5 -0
  27. hikyuu/draw/__init__.pyi +1 -1
  28. hikyuu/draw/drawplot/__init__.pyi +1 -1
  29. hikyuu/draw/drawplot/bokeh_draw.pyi +7 -6
  30. hikyuu/draw/drawplot/echarts_draw.pyi +7 -6
  31. hikyuu/draw/drawplot/matplotlib_draw.py +19 -11
  32. hikyuu/draw/drawplot/matplotlib_draw.pyi +7 -6
  33. hikyuu/examples/notebook/001-overview.ipynb +112 -78
  34. hikyuu/examples/notebook/004-IndicatorOverview.ipynb +52 -65
  35. hikyuu/examples/notebook/006-TradeManager.ipynb +402 -291
  36. hikyuu/examples/notebook/008-Pickle.ipynb +25 -17
  37. hikyuu/examples/notebook/009-RealData.ipynb +36 -38
  38. hikyuu/examples/notebook/Demo/Demo2.ipynb +146 -116
  39. hikyuu/extend.pyi +2 -1
  40. hikyuu/gui/data/UseTdxImportToH5Thread.py +4 -2
  41. hikyuu/gui/start_qmt.py +1 -1
  42. hikyuu/hub.pyi +6 -6
  43. hikyuu/include/hikyuu/Block.h +9 -9
  44. hikyuu/include/hikyuu/HistoryFinanceInfo.h +3 -3
  45. hikyuu/include/hikyuu/KData.h +51 -28
  46. hikyuu/include/hikyuu/KDataImp.h +12 -7
  47. hikyuu/include/hikyuu/KDataPrivatedBufferImp.h +13 -7
  48. hikyuu/include/hikyuu/KDataSharedBufferImp.h +8 -6
  49. hikyuu/include/hikyuu/KQuery.h +11 -11
  50. hikyuu/include/hikyuu/KRecord.h +1 -1
  51. hikyuu/include/hikyuu/MarketInfo.h +10 -10
  52. hikyuu/include/hikyuu/Stock.h +30 -30
  53. hikyuu/include/hikyuu/StockManager.h +11 -10
  54. hikyuu/include/hikyuu/StockTypeInfo.h +9 -9
  55. hikyuu/include/hikyuu/StockWeight.h +9 -9
  56. hikyuu/include/hikyuu/TimeLineRecord.h +1 -1
  57. hikyuu/include/hikyuu/TransRecord.h +1 -1
  58. hikyuu/include/hikyuu/data_driver/BlockInfoDriver.h +6 -0
  59. hikyuu/include/hikyuu/data_driver/KDataDriver.h +4 -3
  60. hikyuu/include/hikyuu/indicator/IndParam.h +1 -1
  61. hikyuu/include/hikyuu/indicator/Indicator.h +56 -27
  62. hikyuu/include/hikyuu/indicator/Indicator2InImp.h +0 -4
  63. hikyuu/include/hikyuu/indicator/IndicatorImp.h +146 -73
  64. hikyuu/include/hikyuu/indicator/crt/CONTEXT.h +11 -1
  65. hikyuu/include/hikyuu/indicator/crt/IC.h +19 -14
  66. hikyuu/include/hikyuu/indicator/crt/ICIR.h +4 -7
  67. hikyuu/include/hikyuu/indicator/imp/IAbs.h +1 -0
  68. hikyuu/include/hikyuu/indicator/imp/IAcos.h +1 -0
  69. hikyuu/include/hikyuu/indicator/imp/IAd.h +0 -2
  70. hikyuu/include/hikyuu/indicator/imp/IAdvance.h +3 -0
  71. hikyuu/include/hikyuu/indicator/imp/IAma.h +3 -0
  72. hikyuu/include/hikyuu/indicator/imp/IAsin.h +1 -0
  73. hikyuu/include/hikyuu/indicator/imp/IAtan.h +1 -0
  74. hikyuu/include/hikyuu/indicator/imp/IAtr.h +2 -3
  75. hikyuu/include/hikyuu/indicator/imp/IBackset.h +2 -4
  76. hikyuu/include/hikyuu/indicator/imp/IBlockSetNum.h +3 -0
  77. hikyuu/include/hikyuu/indicator/imp/ICeil.h +1 -0
  78. hikyuu/include/hikyuu/indicator/imp/IContext.h +0 -3
  79. hikyuu/include/hikyuu/indicator/imp/ICorr.h +3 -0
  80. hikyuu/include/hikyuu/indicator/imp/ICos.h +1 -0
  81. hikyuu/include/hikyuu/indicator/imp/ICost.h +0 -2
  82. hikyuu/include/hikyuu/indicator/imp/ICount.h +2 -1
  83. hikyuu/include/hikyuu/indicator/imp/ICval.h +1 -4
  84. hikyuu/include/hikyuu/indicator/imp/ICycle.h +0 -2
  85. hikyuu/include/hikyuu/indicator/imp/IDecline.h +3 -0
  86. hikyuu/include/hikyuu/indicator/imp/IDevsq.h +4 -1
  87. hikyuu/include/hikyuu/indicator/imp/IDiff.h +1 -0
  88. hikyuu/include/hikyuu/indicator/imp/IDma.h +2 -0
  89. hikyuu/include/hikyuu/indicator/imp/IDropna.h +0 -4
  90. hikyuu/include/hikyuu/indicator/imp/IEma.h +3 -1
  91. hikyuu/include/hikyuu/indicator/imp/IEvery.h +5 -1
  92. hikyuu/include/hikyuu/indicator/imp/IExist.h +5 -1
  93. hikyuu/include/hikyuu/indicator/imp/IExp.h +1 -0
  94. hikyuu/include/hikyuu/indicator/imp/IFilter.h +4 -5
  95. hikyuu/include/hikyuu/indicator/imp/IFinance.h +1 -2
  96. hikyuu/include/hikyuu/indicator/imp/IFloor.h +1 -0
  97. hikyuu/include/hikyuu/indicator/imp/IHhvbars.h +5 -1
  98. hikyuu/include/hikyuu/indicator/imp/IHighLine.h +5 -1
  99. hikyuu/include/hikyuu/indicator/imp/IHsl.h +0 -2
  100. hikyuu/include/hikyuu/indicator/imp/IIc.h +3 -6
  101. hikyuu/include/hikyuu/indicator/imp/IInBlock.h +1 -2
  102. hikyuu/include/hikyuu/indicator/imp/IIntpart.h +1 -0
  103. hikyuu/include/hikyuu/indicator/imp/IIsInf.h +1 -0
  104. hikyuu/include/hikyuu/indicator/imp/IIsInfa.h +1 -0
  105. hikyuu/include/hikyuu/indicator/imp/IIsLastBar.h +0 -1
  106. hikyuu/include/hikyuu/indicator/imp/IIsNa.h +1 -0
  107. hikyuu/include/hikyuu/indicator/imp/IJumpDown.h +1 -0
  108. hikyuu/include/hikyuu/indicator/imp/IJumpUp.h +1 -0
  109. hikyuu/include/hikyuu/indicator/imp/IKData.h +1 -2
  110. hikyuu/include/hikyuu/indicator/imp/ILiuTongPan.h +0 -2
  111. hikyuu/include/hikyuu/indicator/imp/ILn.h +1 -0
  112. hikyuu/include/hikyuu/indicator/imp/ILog.h +1 -0
  113. hikyuu/include/hikyuu/indicator/imp/ILowLine.h +5 -1
  114. hikyuu/include/hikyuu/indicator/imp/ILowLineBars.h +5 -1
  115. hikyuu/include/hikyuu/indicator/imp/IMa.h +6 -1
  116. hikyuu/include/hikyuu/indicator/imp/IMacd.h +2 -0
  117. hikyuu/include/hikyuu/indicator/imp/INot.h +1 -0
  118. hikyuu/include/hikyuu/indicator/imp/IPow.h +3 -1
  119. hikyuu/include/hikyuu/indicator/imp/IQuantileTrunc.h +1 -0
  120. hikyuu/include/hikyuu/indicator/imp/IRecover.h +3 -0
  121. hikyuu/include/hikyuu/indicator/imp/IRef.h +3 -1
  122. hikyuu/include/hikyuu/indicator/imp/IResult.h +1 -0
  123. hikyuu/include/hikyuu/indicator/imp/IReverse.h +1 -0
  124. hikyuu/include/hikyuu/indicator/imp/IRoc.h +6 -1
  125. hikyuu/include/hikyuu/indicator/imp/IRocp.h +5 -1
  126. hikyuu/include/hikyuu/indicator/imp/IRocr.h +5 -1
  127. hikyuu/include/hikyuu/indicator/imp/IRocr100.h +5 -1
  128. hikyuu/include/hikyuu/indicator/imp/IRound.h +1 -0
  129. hikyuu/include/hikyuu/indicator/imp/IRoundDown.h +1 -0
  130. hikyuu/include/hikyuu/indicator/imp/IRoundUp.h +1 -0
  131. hikyuu/include/hikyuu/indicator/imp/ISaftyLoss.h +1 -0
  132. hikyuu/include/hikyuu/indicator/imp/ISign.h +1 -0
  133. hikyuu/include/hikyuu/indicator/imp/ISin.h +1 -0
  134. hikyuu/include/hikyuu/indicator/imp/ISlope.h +5 -1
  135. hikyuu/include/hikyuu/indicator/imp/ISma.h +2 -0
  136. hikyuu/include/hikyuu/indicator/imp/ISpearman.h +3 -0
  137. hikyuu/include/hikyuu/indicator/imp/ISqrt.h +1 -0
  138. hikyuu/include/hikyuu/indicator/imp/IStdev.h +5 -1
  139. hikyuu/include/hikyuu/indicator/imp/IStdp.h +5 -1
  140. hikyuu/include/hikyuu/indicator/imp/ISum.h +6 -1
  141. hikyuu/include/hikyuu/indicator/imp/ITan.h +1 -0
  142. hikyuu/include/hikyuu/indicator/imp/ITime.h +1 -2
  143. hikyuu/include/hikyuu/indicator/imp/ITimeLine.h +0 -2
  144. hikyuu/include/hikyuu/indicator/imp/ITr.h +1 -2
  145. hikyuu/include/hikyuu/indicator/imp/IVar.h +5 -1
  146. hikyuu/include/hikyuu/indicator/imp/IVarp.h +5 -1
  147. hikyuu/include/hikyuu/indicator/imp/IVigor.h +0 -2
  148. hikyuu/include/hikyuu/indicator/imp/IWma.h +5 -1
  149. hikyuu/include/hikyuu/indicator/imp/IZongGuBen.h +1 -2
  150. hikyuu/include/hikyuu/indicator_talib/imp/TaAdosc.h +0 -2
  151. hikyuu/include/hikyuu/indicator_talib/imp/TaSar.h +0 -2
  152. hikyuu/include/hikyuu/indicator_talib/imp/TaSarext.h +0 -4
  153. hikyuu/include/hikyuu/indicator_talib/imp/TaStoch.h +0 -3
  154. hikyuu/include/hikyuu/indicator_talib/imp/TaStochf.h +0 -2
  155. hikyuu/include/hikyuu/indicator_talib/imp/TaUltosc.h +0 -2
  156. hikyuu/include/hikyuu/indicator_talib/imp/ta_defines.h +2 -4
  157. hikyuu/include/hikyuu/indicator_talib/imp/ta_imp.h +70 -90
  158. hikyuu/include/hikyuu/plugin/hkuextra.h +2 -0
  159. hikyuu/include/hikyuu/plugin/interface/HkuExtraPluginInterface.h +2 -0
  160. hikyuu/include/hikyuu/python/pybind_utils.h +22 -5
  161. hikyuu/include/hikyuu/trade_manage/TradeCostBase.h +5 -3
  162. hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +9 -2
  163. hikyuu/include/hikyuu/trade_sys/allocatefunds/AllocateFundsBase.h +8 -3
  164. hikyuu/include/hikyuu/trade_sys/condition/ConditionBase.h +5 -2
  165. hikyuu/include/hikyuu/trade_sys/environment/EnvironmentBase.h +6 -2
  166. hikyuu/include/hikyuu/trade_sys/moneymanager/MoneyManagerBase.h +5 -2
  167. hikyuu/include/hikyuu/trade_sys/multifactor/MultiFactorBase.h +23 -19
  168. hikyuu/include/hikyuu/trade_sys/multifactor/NormalizeBase.h +6 -3
  169. hikyuu/include/hikyuu/trade_sys/multifactor/ScoresFilterBase.h +5 -2
  170. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_EqualWeight.h +3 -3
  171. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_ICIRWeight.h +4 -4
  172. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_ICWeight.h +4 -4
  173. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_Weight.h +4 -4
  174. hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +5 -2
  175. hikyuu/include/hikyuu/trade_sys/profitgoal/ProfitGoalBase.h +4 -2
  176. hikyuu/include/hikyuu/trade_sys/selector/SelectorBase.h +12 -2
  177. hikyuu/include/hikyuu/trade_sys/selector/crt/SE_MultiFactor.h +1 -1
  178. hikyuu/include/hikyuu/trade_sys/selector/crt/SE_MultiFactor2.h +1 -1
  179. hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector.h +1 -0
  180. hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector2.h +1 -0
  181. hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/OptimalSelectorBase.h +0 -2
  182. hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/PerformanceOptimalSelector.h +0 -4
  183. hikyuu/include/hikyuu/trade_sys/signal/SignalBase.h +5 -2
  184. hikyuu/include/hikyuu/trade_sys/slippage/SlippageBase.h +5 -2
  185. hikyuu/include/hikyuu/trade_sys/stoploss/StoplossBase.h +5 -2
  186. hikyuu/include/hikyuu/trade_sys/system/System.h +5 -2
  187. hikyuu/include/hikyuu/utilities/LruCache.h +299 -0
  188. hikyuu/include/hikyuu/utilities/arithmetic.h +2 -2
  189. hikyuu/include/hikyuu/utilities/omp_macro.h +25 -0
  190. hikyuu/include/hikyuu/utilities/plugin/PluginManager.h +5 -0
  191. hikyuu/include/hikyuu/utilities/thread/GlobalStealThreadPool.h +72 -19
  192. hikyuu/include/hikyuu/utilities/thread/GlobalThreadPool.h +0 -4
  193. hikyuu/include/hikyuu/utilities/thread/ThreadPool.h +0 -4
  194. hikyuu/include/hikyuu/utilities/thread/algorithm.h +286 -0
  195. hikyuu/include/hikyuu/version.h +4 -4
  196. hikyuu/plugin/libbacktest.so +0 -0
  197. hikyuu/plugin/libcheckdata.so +0 -0
  198. hikyuu/plugin/libclickhousedriver.so +0 -0
  199. hikyuu/plugin/libdataserver.so +0 -0
  200. hikyuu/plugin/libdataserver_parquet.so +0 -0
  201. hikyuu/plugin/libdevice.so +0 -0
  202. hikyuu/plugin/libextind.so +0 -0
  203. hikyuu/plugin/libhkuextra.so +0 -0
  204. hikyuu/plugin/libimport2ch.so +0 -0
  205. hikyuu/plugin/libimport2hdf5.so +0 -0
  206. hikyuu/plugin/libimport2mysql.so +0 -0
  207. hikyuu/plugin/libtmreport.so +0 -0
  208. hikyuu/test/Indicator.py +1 -2
  209. hikyuu/trade_manage/__init__.pyi +7 -6
  210. hikyuu/trade_manage/trade.pyi +7 -6
  211. hikyuu/util/singleton.pyi +1 -1
  212. {hikyuu-2.7.3.dist-info → hikyuu-2.7.6.dist-info}/METADATA +1 -1
  213. {hikyuu-2.7.3.dist-info → hikyuu-2.7.6.dist-info}/RECORD +216 -208
  214. {hikyuu-2.7.3.dist-info → hikyuu-2.7.6.dist-info}/WHEEL +0 -0
  215. {hikyuu-2.7.3.dist-info → hikyuu-2.7.6.dist-info}/entry_points.txt +0 -0
  216. {hikyuu-2.7.3.dist-info → hikyuu-2.7.6.dist-info}/top_level.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__: list[str] = ['ABS', 'ACOS', 'AD', 'ADVANCE', 'AF_EqualWeight', 'AF_FixedAmount', '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', 'AGG_VWAP', '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', 'KDataToClickHouseImporter', 'KDataToHdf5Importer', 'KDataToMySQLImporter', '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', 'check_data', '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_latest_version_info', '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']
6
+ __all__: list[str] = ['ABS', 'ACOS', 'AD', 'ADVANCE', 'AF_EqualWeight', 'AF_FixedAmount', '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', 'AGG_VWAP', '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', 'KDataToClickHouseImporter', 'KDataToHdf5Importer', 'KDataToMySQLImporter', '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', 'check_data', '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', 'enable_kdata_cache', '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_latest_version_info', '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
  资产分配算法基类, 子类接口:
@@ -1526,6 +1526,7 @@ class Indicator:
1526
1526
  """
1527
1527
  技术指标
1528
1528
  """
1529
+ enable_increment_calculate: typing.ClassVar[bool] = True
1529
1530
  @staticmethod
1530
1531
  def bar(indicator, new = True, axes = None, kref = None, legend_on = False, text_on = False, text_color = 'k', label = None, width = 0.4, color = 'r', edgecolor = 'r', zero_on = False, *args, **kwargs):
1531
1532
  """
@@ -1777,6 +1778,12 @@ class Indicator:
1777
1778
  """
1778
1779
  def equal(self, arg0: Indicator) -> bool:
1779
1780
  ...
1781
+ def extend(self) -> None:
1782
+ """
1783
+ extend(self)
1784
+
1785
+ 在有上下文时,自动将上下文扩展至当前最新数据并计算
1786
+ """
1780
1787
  def formula(self) -> str:
1781
1788
  """
1782
1789
  formula(self)
@@ -1890,7 +1897,7 @@ class Indicator:
1890
1897
  """
1891
1898
  def have_ind_param(self, arg0: str) -> bool:
1892
1899
  """
1893
- 是否存在指定的动态指标参数
1900
+ 是否存在指定的动态周期指标参数
1894
1901
  """
1895
1902
  def have_param(self, arg0: str) -> bool:
1896
1903
  """
@@ -1948,10 +1955,6 @@ class Indicator:
1948
1955
  :type value: int | bool | float | string | Query | KData | Stock | DatetimeList
1949
1956
  :raises logic_error: Unsupported type! 不支持的参数类型
1950
1957
  """
1951
- def support_ind_param(self) -> bool:
1952
- """
1953
- 是否支持动态指标参数
1954
- """
1955
1958
  def to_array(self, result_index: typing.SupportsInt = 0) -> numpy.typing.NDArray[numpy.float64]:
1956
1959
  """
1957
1960
  将指定结果集转化为numpy.array
@@ -1990,6 +1993,9 @@ class Indicator:
1990
1993
  @name.setter
1991
1994
  def name(self, arg1: str) -> None:
1992
1995
  ...
1996
+ @property
1997
+ def optype(self) -> str:
1998
+ ...
1993
1999
  class IndicatorImp:
1994
2000
  """
1995
2001
  指标实现类,定义新指标时,应从此类继承
@@ -2076,8 +2082,6 @@ class IndicatorImp:
2076
2082
  ...
2077
2083
  def set_param(self, arg0: str, arg1: any) -> None:
2078
2084
  ...
2079
- def support_ind_param(self) -> bool:
2080
- ...
2081
2085
  @property
2082
2086
  def discard(self) -> int:
2083
2087
  """
@@ -2224,14 +2228,12 @@ class KData:
2224
2228
  :rtype: KData
2225
2229
  """
2226
2230
  @typing.overload
2227
- def get_kdata(self, start: typing.SupportsInt, end: typing.SupportsInt = 9223372036854775807) -> KData:
2231
+ def get_kdata(self, arg0: Query) -> KData:
2228
2232
  """
2229
- get_kdata(self, start, end)
2230
-
2231
- 通过索引获取 KData 子集,相当于切片
2232
-
2233
- :param int start: 索引起始位置
2234
- :param int end: 索引结束位置
2233
+ get_kdata(query)
2234
+
2235
+ 通过当前 KData 获取获取另一个 KData,不一定是其子集
2236
+
2235
2237
  :rtype: KData
2236
2238
  """
2237
2239
  def get_pos(self, arg0: Datetime) -> typing.Any:
@@ -2268,6 +2270,16 @@ class KData:
2268
2270
 
2269
2271
  :rtype: Stock
2270
2272
  """
2273
+ def get_sub_kdata(self, start: typing.SupportsInt, end: typing.SupportsInt = 9223372036854775807) -> KData:
2274
+ """
2275
+ get_sub_kdata(start, end = Null<int64_t>)
2276
+
2277
+ 通过索引获取自身子集
2278
+
2279
+ :param int start: 起始索引
2280
+ :param int end: 结束索引
2281
+ :rtype: KData
2282
+ """
2271
2283
  def to_df(self, with_stock: bool = False) -> typing.Any:
2272
2284
  """
2273
2285
  to_df(self, with_stock=False) -> pandas.DataFrame
@@ -3015,7 +3027,7 @@ class MultiFactorBase:
3015
3027
  ...
3016
3028
  def __str__(self) -> str:
3017
3029
  ...
3018
- def add_special_normalize(self, name: str, norm: NormalizeBase = None, category: str = '', style_inds: collections.abc.Sequence[Indicator] = []) -> None:
3030
+ def add_special_normalize(self, name: str, norm: typing.Any = None, category: str = '', style_inds: collections.abc.Sequence[Indicator] = []) -> None:
3019
3031
  """
3020
3032
  add_special_normalize(self, name[, norm=None, category="", style_inds=[]])
3021
3033
 
@@ -4420,7 +4432,7 @@ class SelectorBase:
4420
4432
  """
4421
4433
  子类复位操作实现
4422
4434
  """
4423
- def add_scores_filter(self, arg0: ScoresFilterBase) -> None:
4435
+ def add_scores_filter(self, arg0: typing.Any) -> None:
4424
4436
  """
4425
4437
  add_scores_filter(self, filter)
4426
4438
 
@@ -4437,7 +4449,7 @@ class SelectorBase:
4437
4449
  :param Stock stock: 加入的初始标的
4438
4450
  :param System sys: 系统策略原型
4439
4451
  """
4440
- def add_stock_list(self, stk_list: collections.abc.Sequence, sys: ...) -> None:
4452
+ def add_stock_list(self, stk_list: typing.Any, sys: ...) -> None:
4441
4453
  """
4442
4454
  add_stock_list(self, stk_list, sys)
4443
4455
 
@@ -4510,7 +4522,7 @@ class SelectorBase:
4510
4522
  :param value: 参数值
4511
4523
  :raises logic_error: Unsupported type! 不支持的参数类型
4512
4524
  """
4513
- def set_scores_filter(self, arg0: ScoresFilterBase) -> None:
4525
+ def set_scores_filter(self, arg0: typing.Any) -> None:
4514
4526
  """
4515
4527
  set_scores_filter(self, filter)
4516
4528
 
@@ -4523,6 +4535,9 @@ class SelectorBase:
4523
4535
  """
4524
4536
  获取关联的 MF
4525
4537
  """
4538
+ @mf.setter
4539
+ def mf(self, arg1: typing.Any) -> None:
4540
+ ...
4526
4541
  @property
4527
4542
  def name(self) -> str:
4528
4543
  """
@@ -8209,7 +8224,7 @@ def AGG_FUNC(ind: Indicator, agg_func: typing.Any, ktype: str = 'MIN', fill_null
8209
8224
  """
8210
8225
  AGG_FUNC(ind, agg_func[, ktype=Query.MIN, fill_null=False, unit=1]
8211
8226
 
8212
- 使用自定函数聚合其他K线周期的指标。虽然支持python自定义函数, 但python函数需要GIL, 速度会慢。建议最好直接使用 C++ 自定义聚合函数。
8227
+ 使用自定函数聚合其他K线周期的指标。
8213
8228
 
8214
8229
  示例, 计算日线时聚合分钟线收盘价的和:
8215
8230
 
@@ -8594,10 +8609,10 @@ def BLOCKSETNUM(block: Block, query: Query) -> Indicator:
8594
8609
  :param Query query: 统计范围
8595
8610
  """
8596
8611
  @typing.overload
8597
- def BLOCKSETNUM(stks: collections.abc.Sequence) -> Indicator:
8612
+ def BLOCKSETNUM(stks: typing.Any) -> Indicator:
8598
8613
  ...
8599
8614
  @typing.overload
8600
- def BLOCKSETNUM(stks: collections.abc.Sequence, query: Query) -> Indicator:
8615
+ def BLOCKSETNUM(stks: typing.Any, query: Query) -> Indicator:
8601
8616
  """
8602
8617
  BLOCKSETNUM(block, query)
8603
8618
 
@@ -8664,12 +8679,26 @@ def CONTEXT(ind: Indicator, fill_null: bool = False, use_self_ktype: bool = Fals
8664
8679
  :param bool use_self_recover_type: 公式计算时使用自身独立上下文中的RECOVER_TYPE
8665
8680
  :rtype: Indicator
8666
8681
  """
8682
+ @typing.overload
8683
+ def CONTEXT(ind: Indicator, stock: Stock, fill_null: bool = False) -> Indicator:
8684
+ """
8685
+ CONTEXT(ind, stock[, fill_null=False])
8686
+
8687
+ 通过指定股票,设置指标独立上下文指标, 忽略传入ind自身上下文, 直接使用stock的作为上下文
8688
+
8689
+ :param Indicator ind: 指标对象
8690
+ :param Stock stock: 股票对象
8691
+ :param bool fill_null: 日期对齐时,缺失日期对应填充空值,否则使用前值填充。
8692
+ :rtype: Indicator
8693
+ """
8667
8694
  def CONTEXT_K(arg0: Indicator) -> KData:
8668
8695
  """
8669
8696
  CONTEXT_K(ind)
8670
8697
 
8671
8698
  获取指标上下文。Indicator::getContext()方法获取的是当前的上下文,但对于 CONTEXT 独立上下文指标无法获取其指定的独立上下文,需用此方法获取
8672
8699
 
8700
+ 该指标一旦作为公式,参与计算,其上下文可能发生变化,但其stock保持不变,仅query范围发生改变
8701
+
8673
8702
  :param Indicator ind: 指标对象
8674
8703
  :rtype: KData
8675
8704
  """
@@ -9221,7 +9250,7 @@ def GROUP_FUNC(ind: Indicator, group_func: typing.Any, ktype: str = 'DAY', unit:
9221
9250
  """
9222
9251
  GROUP_FUNC(ind, group_func[, ktype=Query.DAY, unit=1])
9223
9252
 
9224
- 自定义分组累积计算指标。虽然支持python自定义函数, 但python函数需要GIL, 速度较慢。建议最好直接使用 C++ 自定义分组累积函数。
9253
+ 自定义分组累积计算指标。
9225
9254
 
9226
9255
  示例, 计算日线时聚合分钟线收盘价的和:
9227
9256
 
@@ -9340,9 +9369,9 @@ def Hours(arg0: typing.SupportsInt) -> TimeDelta:
9340
9369
  :param int hours: 小时数
9341
9370
  :rtype: TimeDelta
9342
9371
  """
9343
- def IC(ind: Indicator, stks: typing.Any, query: Query, ref_stk: Stock, n: typing.SupportsInt = 1, spearman: bool = True, strict: bool = False) -> Indicator:
9372
+ def IC(ind: Indicator, stks: typing.Any, n: typing.SupportsInt = 1, spearman: bool = True, strict: bool = False) -> Indicator:
9344
9373
  """
9345
- IC(ind, stks, query, ref_stk[, n=1, spearman=True, strict=False]) -> Indicator
9374
+ IC(ind, stks[, n=1, spearman=True, strict=False]) -> Indicator
9346
9375
 
9347
9376
  计算指定的因子相对于参考证券的 IC (实际为 RankIC)
9348
9377
 
@@ -9353,22 +9382,18 @@ def IC(ind: Indicator, stks: typing.Any, query: Query, ref_stk: Stock, n: typing
9353
9382
 
9354
9383
  :param Indicator ind: 输入因子
9355
9384
  :param sequence(stock)|Block stks 证券组合
9356
- :param Query query: 查询条件
9357
- :param Stock ref_stk: 参照证券,通常使用 sh000300 沪深300
9358
9385
  :param int n: 时间窗口
9359
9386
  :param bool spearman: 使用 spearman 相关系数,否则为 pearson
9360
9387
  :param bool strict: 严格模式
9361
9388
  """
9362
- def ICIR(ind: Indicator, stks: typing.Any, query: Query, ref_stk: Stock, n: typing.SupportsInt = 1, rolling_n: typing.SupportsInt = 120, spearman: bool = True, strict: bool = False) -> Indicator:
9389
+ def ICIR(ind: Indicator, stks: typing.Any, n: typing.SupportsInt = 1, rolling_n: typing.SupportsInt = 120, spearman: bool = True, strict: bool = False) -> Indicator:
9363
9390
  """
9364
- ICIR(ind, stks, query, ref_stk[, n=1, rolling_n=120, spearman=True, strict=False])
9391
+ ICIR(ind, stks[, n=1, rolling_n=120, spearman=True, strict=False])
9365
9392
 
9366
9393
  计算 IC 因子 IR = IC的多周期均值/IC的标准方差
9367
9394
 
9368
9395
  :param Indicator ind: 输入因子
9369
9396
  :param sequence(stock)|Block stks 证券组合
9370
- :param Query query: 查询条件
9371
- :param Stock ref_stk: 参照证券,通常使用 sh000300 沪深300
9372
9397
  :param int n: 计算IC时对应的 n 日收益率
9373
9398
  :param int rolling_n: 滚动周期
9374
9399
  :param bool spearman: 使用 spearman 相关系数,否则为 pearson
@@ -9945,7 +9970,7 @@ def MDD(arg0: Indicator) -> Indicator:
9945
9970
  def MF_EqualWeight() -> MultiFactorBase:
9946
9971
  ...
9947
9972
  @typing.overload
9948
- def MF_EqualWeight(inds: collections.abc.Sequence, stks: collections.abc.Sequence, query: Query, ref_stk: typing.Any = None, ic_n: typing.SupportsInt = 5, spearman: bool = True, mode: typing.SupportsInt = 0, save_all_factors: bool = False) -> MultiFactorBase:
9973
+ def MF_EqualWeight(inds: collections.abc.Sequence, stks: typing.Any, query: Query, ref_stk: typing.Any = None, ic_n: typing.SupportsInt = 5, spearman: bool = True, mode: typing.SupportsInt = 0, save_all_factors: bool = False) -> MultiFactorBase:
9949
9974
  """
9950
9975
  MF_EqualWeight(inds, stks, query, ref_stk[, ic_n=5])
9951
9976
 
@@ -9954,7 +9979,7 @@ def MF_EqualWeight(inds: collections.abc.Sequence, stks: collections.abc.Sequenc
9954
9979
  :param sequense(Indicator) inds: 原始因子列表
9955
9980
  :param sequense(stock) stks: 计算证券列表
9956
9981
  :param Query query: 日期范围
9957
- :param Stock ref_stk: 参考证券 (未指定时,默认为 sh000300 沪深300)
9982
+ :param Stock ref_stk: 参考证券用于日期对齐 (未指定时,默认为 sh000001)
9958
9983
  :param int ic_n: 默认 IC 对应的 N 日收益率
9959
9984
  :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
9960
9985
  :param int mode: 获取截面数据时排序模式: 0-降序, 1-升序, 2-不排序
@@ -9965,16 +9990,16 @@ def MF_EqualWeight(inds: collections.abc.Sequence, stks: collections.abc.Sequenc
9965
9990
  def MF_ICIRWeight() -> MultiFactorBase:
9966
9991
  ...
9967
9992
  @typing.overload
9968
- def MF_ICIRWeight(inds: collections.abc.Sequence, stks: collections.abc.Sequence, query: Query, ref_stk: typing.Any = None, ic_n: typing.SupportsInt = 5, ic_rolling_n: typing.SupportsInt = 120, spearman: bool = True, mode: typing.SupportsInt = 0, save_all_factors: bool = False) -> MultiFactorBase:
9993
+ def MF_ICIRWeight(inds: collections.abc.Sequence, stks: typing.Any, query: Query, ref_stk: typing.Any = None, ic_n: typing.SupportsInt = 5, ic_rolling_n: typing.SupportsInt = 120, spearman: bool = True, mode: typing.SupportsInt = 0, save_all_factors: bool = False) -> MultiFactorBase:
9969
9994
  """
9970
- MF_EqualWeight(inds, stks, query, ref_stk[, ic_n=5, ic_rolling_n=120])
9995
+ MF_ICIRWeight(inds, stks, query, ref_stk[, ic_n=5, ic_rolling_n=120])
9971
9996
 
9972
9997
  滚动ICIR权重合成因子
9973
9998
 
9974
9999
  :param sequense(Indicator) inds: 原始因子列表
9975
10000
  :param sequense(stock) stks: 计算证券列表
9976
10001
  :param Query query: 日期范围
9977
- :param Stock ref_stk: 参考证券 (未指定时,默认为 sh000300 沪深300)
10002
+ :param Stock ref_stk: 用于日期对齐的参考证券 (未指定时,默认为 sh000001)
9978
10003
  :param int ic_n: 默认 IC 对应的 N 日收益率
9979
10004
  :param int ic_rolling_n: IC 滚动周期
9980
10005
  :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
@@ -9986,16 +10011,16 @@ def MF_ICIRWeight(inds: collections.abc.Sequence, stks: collections.abc.Sequence
9986
10011
  def MF_ICWeight() -> MultiFactorBase:
9987
10012
  ...
9988
10013
  @typing.overload
9989
- def MF_ICWeight(inds: collections.abc.Sequence, stks: collections.abc.Sequence, query: Query, ref_stk: typing.Any = None, ic_n: typing.SupportsInt = 5, ic_rolling_n: typing.SupportsInt = 120, spearman: bool = True, mode: typing.SupportsInt = 0, save_all_factors: bool = False) -> MultiFactorBase:
10014
+ def MF_ICWeight(inds: collections.abc.Sequence, stks: typing.Any, query: Query, ref_stk: typing.Any = None, ic_n: typing.SupportsInt = 5, ic_rolling_n: typing.SupportsInt = 120, spearman: bool = True, mode: typing.SupportsInt = 0, save_all_factors: bool = False) -> MultiFactorBase:
9990
10015
  """
9991
- MF_EqualWeight(inds, stks, query, ref_stk[, ic_n=5, ic_rolling_n=120])
10016
+ MF_ICWeight(inds, stks, query, ref_stk[, ic_n=5, ic_rolling_n=120])
9992
10017
 
9993
10018
  滚动IC权重合成因子
9994
10019
 
9995
10020
  :param sequense(Indicator) inds: 原始因子列表
9996
10021
  :param sequense(stock) stks: 计算证券列表
9997
10022
  :param Query query: 日期范围
9998
- :param Stock ref_stk: (未指定时,默认为 sh000300 沪深300)
10023
+ :param Stock ref_stk: 用于日期对齐的参考证券 (未指定时,默认为 sh000001)
9999
10024
  :param int ic_n: 默认 IC 对应的 N 日收益率
10000
10025
  :param int ic_rolling_n: IC 滚动周期
10001
10026
  :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
@@ -10007,7 +10032,7 @@ def MF_ICWeight(inds: collections.abc.Sequence, stks: collections.abc.Sequence,
10007
10032
  def MF_Weight() -> MultiFactorBase:
10008
10033
  ...
10009
10034
  @typing.overload
10010
- def MF_Weight(inds: collections.abc.Sequence, stks: collections.abc.Sequence, weights: collections.abc.Sequence, query: Query, ref_stk: typing.Any = None, ic_n: typing.SupportsInt = 5, spearman: bool = True, mode: typing.SupportsInt = 0, save_all_factors: bool = False) -> MultiFactorBase:
10035
+ def MF_Weight(inds: collections.abc.Sequence, stks: typing.Any, weights: collections.abc.Sequence, query: Query, ref_stk: typing.Any = None, ic_n: typing.SupportsInt = 5, spearman: bool = True, mode: typing.SupportsInt = 0, save_all_factors: bool = False) -> MultiFactorBase:
10011
10036
  """
10012
10037
  MF_Weight(inds, stks, weights, query, ref_stk[, ic_n=5, spearman=True, mode=0, save_all_factors=False])
10013
10038
 
@@ -10017,7 +10042,7 @@ def MF_Weight(inds: collections.abc.Sequence, stks: collections.abc.Sequence, we
10017
10042
  :param sequense(stock) stks: 计算证券列表
10018
10043
  :param sequense(float) weights: 权重列表(需和 inds 等长)
10019
10044
  :param Query query: 日期范围
10020
- :param Stock ref_stk: 参考证券 (未指定时,默认为 sh000300 沪深300)
10045
+ :param Stock ref_stk: 参考证券用于日期对齐 (未指定时,默认为 sh000001)
10021
10046
  :param int ic_n: 默认 IC 对应的 N 日收益率
10022
10047
  :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
10023
10048
  :param int mode: 获取截面数据时排序模式: 0-降序, 1-升序, 2-不排序
@@ -10410,7 +10435,7 @@ def QUANTILE_TRUNC(data: Indicator, n: typing.SupportsInt = 60, quantial_min: ty
10410
10435
  :rtype: Indicator
10411
10436
  """
10412
10437
  @typing.overload
10413
- def RANK(stks: collections.abc.Sequence, mode: typing.SupportsInt = 0, fill_null: bool = True, market: str = 'SH') -> Indicator:
10438
+ def RANK(stks: typing.Any, mode: typing.SupportsInt = 0, fill_null: bool = True, market: str = 'SH') -> Indicator:
10414
10439
  ...
10415
10440
  @typing.overload
10416
10441
  def RANK(stks: collections.abc.Sequence, ref_ind: Indicator, mode: typing.SupportsInt = 0, fill_null: bool = True, market: str = 'SH') -> Indicator:
@@ -10832,7 +10857,7 @@ def SE_EvaluateOptimal(arg0: typing.Any) -> SelectorBase:
10832
10857
  def SE_Fixed(weight: typing.SupportsFloat = 1.0) -> SelectorBase:
10833
10858
  ...
10834
10859
  @typing.overload
10835
- def SE_Fixed(stk_list: collections.abc.Sequence, sys: ..., weight: typing.SupportsFloat = 1.0) -> SelectorBase:
10860
+ def SE_Fixed(stk_list: typing.Any, sys: ..., weight: typing.SupportsFloat = 1.0) -> SelectorBase:
10836
10861
  """
10837
10862
  SE_Fixed([stk_list, sys])
10838
10863
 
@@ -10866,7 +10891,7 @@ def SE_MultiFactor(inds: collections.abc.Sequence, topn: typing.SupportsInt = 10
10866
10891
  :param int topn: 只选取时间截面中前 topn 个系统,小于等于0时代表不限制
10867
10892
  :param int ic_n: 默认 IC 对应的 N 日收益率
10868
10893
  :param int ic_rolling_n: IC 滚动周期
10869
- :param Stock ref_stk: 参考证券 (未指定时,默认为 sh000300 沪深300)
10894
+ :param Stock ref_stk: 参考证券,用于日期对齐,未指定时为 sh000001
10870
10895
  :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
10871
10896
  :param str mode: "MF_ICIRWeight" | "MF_ICWeight" | "MF_EqualWeight" 因子合成算法名称
10872
10897
  """
@@ -10887,7 +10912,7 @@ def SE_MultiFactor2(inds: collections.abc.Sequence, ic_n: typing.SupportsInt = 5
10887
10912
  :param sequense(Indicator) inds: 原始因子列表
10888
10913
  :param int ic_n: 默认 IC 对应的 N 日收益率
10889
10914
  :param int ic_rolling_n: IC 滚动周期
10890
- :param Stock ref_stk: 参考证券 (未指定时,默认为 sh000300 沪深300)
10915
+ :param Stock ref_stk: 参考证券,用于日期对齐,未指定时为 sh000001
10891
10916
  :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
10892
10917
  :param str mode: "MF_ICIRWeight" | "MF_ICWeight" | "MF_EqualWeight" 因子合成算法名称
10893
10918
  """
@@ -14097,7 +14122,7 @@ def bind_email(arg0: str, arg1: str) -> None:
14097
14122
  """
14098
14123
  def can_upgrade() -> bool:
14099
14124
  ...
14100
- def check_data(stock_list: collections.abc.Sequence, start_date: Datetime, end_date: Datetime, ktype: str) -> tuple:
14125
+ def check_data(stock_list: typing.Any, start_date: Datetime, end_date: Datetime, ktype: str) -> tuple:
14101
14126
  """
14102
14127
  检查数据
14103
14128
  """
@@ -14169,6 +14194,15 @@ def df_to_krecords(df: typing.Any, columns: collections.abc.Sequence[str] = ['da
14169
14194
  :param dict columns: 指定DataFrame的列名,对应KRecord的成员变量名称
14170
14195
  :return: 转换后的KRecordList
14171
14196
  """
14197
+ def enable_kdata_cache(enable: bool) -> None:
14198
+ """
14199
+ enable_kdata_cache(enable)
14200
+
14201
+ 启用或禁用K线数据缓存
14202
+
14203
+ :param bool enable: 是否启用K线数据缓存
14204
+ :return: None
14205
+ """
14172
14206
  def fetch_trial_license(arg0: str) -> str:
14173
14207
  """
14174
14208
  fetch_trial_license(email: str)
hikyuu/cpp/core313.so CHANGED
Binary file
hikyuu/cpp/libhikyuu.so CHANGED
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,9 @@
1
+ ALTER TABLE `hku_base`.`stocktypeinfo`
2
+ UPDATE `minTradeNumber` = CASE
3
+ WHEN `type` = 9 AND `description` = '科创板' THEN 200
4
+ WHEN `type` = 11 AND `description` = '北交所' THEN 100
5
+ ELSE `minTradeNumber`
6
+ END
7
+ WHERE (`type` = 9 AND `description` = '科创板')
8
+ OR (`type` = 11 AND `description` = '北交所');
9
+ ALTER TABLE `hku_base`.`version` UPDATE `version`=2 WHERE `id`=0;
@@ -502,7 +502,7 @@ def update_extern_data(connect, market, code, data_type):
502
502
  if insert_buffer:
503
503
  cur = connect.cursor()
504
504
  cur.executemany(
505
- "insert into {} (date, open, high, low, close, amount, count) \
505
+ "replace into {} (date, open, high, low, close, amount, count) \
506
506
  values (%s, %s, %s, %s, %s, %s, %s)".format(index_table), insert_buffer
507
507
  )
508
508
  connect.commit()
@@ -22,10 +22,22 @@ def em_import_block_to_mysql(connect):
22
22
 
23
23
  hku_info("更新数据库")
24
24
  cur = connect.cursor()
25
- sql = f"delete from hku_base.block where category in {tuple(blks.keys())}"
26
- cur.execute(sql)
27
- sql = f"delete from hku_base.BlockIndex where category in {tuple(blks.keys())}"
28
- cur.execute(sql)
25
+
26
+ # 构建参数化的DELETE语句以防止SQL注入
27
+ categories = tuple(blks.keys())
28
+ if len(categories) == 1:
29
+ # 处理只有一个类别的特殊情况
30
+ placeholders = '%s'
31
+ params = categories
32
+ else:
33
+ placeholders = ','.join(['%s'] * len(categories)) # 创建相应数量的占位符
34
+ params = categories
35
+
36
+ sql = f"delete from hku_base.block where category in ({placeholders})"
37
+ cur.execute(sql, params)
38
+
39
+ sql = f"delete from hku_base.BlockIndex where category in ({placeholders})"
40
+ cur.execute(sql, params)
29
41
 
30
42
  insert_records = []
31
43
 
@@ -23,10 +23,22 @@ def em_import_block_to_sqlite(connect):
23
23
 
24
24
  hku_info("更新数据库")
25
25
  cur = connect.cursor()
26
- sql = f"delete from block where category in {tuple(blks.keys())}"
27
- cur.execute(sql)
28
- sql = f"delete from BlockIndex where category in {tuple(blks.keys())}"
29
- cur.execute(sql)
26
+
27
+ # 构建参数化的DELETE语句以防止SQL注入
28
+ categories = tuple(blks.keys())
29
+ if len(categories) == 1:
30
+ # 处理只有一个类别的特殊情况
31
+ placeholders = '?'
32
+ params = categories
33
+ else:
34
+ placeholders = ','.join(['?'] * len(categories)) # 创建相应数量的占位符
35
+ params = categories
36
+
37
+ sql = f"delete from block where category in ({placeholders})"
38
+ cur.execute(sql, params)
39
+
40
+ sql = f"delete from BlockIndex where category in ({placeholders})"
41
+ cur.execute(sql, params)
30
42
 
31
43
  insert_records = []
32
44
 
@@ -330,7 +330,7 @@ def generate_default_config():
330
330
  user_dir = os.path.expanduser('~')
331
331
  data_dir = "c:\\stock" if sys.platform == 'win32' else f"{user_dir}/stock"
332
332
  hdf5_config = hdf5_template.format(dir=data_dir, reload_time="00:00", quotation_server='ipc:///tmp/hikyuu_real.ipc',
333
- day=True, week=False,
333
+ lazy_preload=False, day=True, week=False,
334
334
  month=False, quarter=False, halfyear=False, year=False,
335
335
  min1=False, min5=False, min15=False, min30=False,
336
336
  min60=False, hour2=False, timeline=False, trans=False,
@@ -0,0 +1,3 @@
1
+ update `hku_base`.`stocktypeinfo` set `minTradeNumber`=200 where `type`=9 and `description`='科创板';
2
+ update `hku_base`.`stocktypeinfo` set `minTradeNumber`=100 where `type`=11 and `description`='北交所';
3
+ UPDATE `hku_base`.`version` set `version` = 30;
@@ -327,11 +327,11 @@ def import_one_stock_data(connect, api, h5file, market, ktype, stock_record, sta
327
327
  hku_error(
328
328
  f"fetch data from tdx error! {bar_datetime} {ktype} {market}{code} last_krecord close: {last_krecord['closePrice']*0.001}, bar: {bar['close']}")
329
329
  return (0, False, Datetime(last_datetime))
330
- if ktype == 'DAY' and last_krecord['transAmount'] != 0 and (abs(float(last_krecord['transAmount']) - round(bar["amount"]*0.001))) > 10:
330
+ if ktype == 'DAY' and last_krecord['transAmount'] != 0 and (abs(float(last_krecord['transAmount']) - round(bar["amount"]*0.001))) > 10000:
331
331
  hku_error(
332
332
  f"fetch data from tdx error! {bar_datetime} {ktype} {market}{code} last_krecord amount: {float(last_krecord['transAmount'])}, bar: {round(bar['amount']*0.001)}")
333
333
  return (0, False, Datetime(last_datetime))
334
- if ktype == 'DAY' and last_krecord['transCount'] != 0 and abs(float(last_krecord['transCount']) - bar["vol"]) > 10:
334
+ if ktype == 'DAY' and last_krecord['transCount'] != 0 and abs(float(last_krecord['transCount']) - bar["vol"]) > 10000:
335
335
  hku_error(
336
336
  f"fetch data from tdx error! {bar_datetime} {ktype} {market}{code} last_krecord count: {last_krecord['transCount']}, bar: {bar['vol']}")
337
337
  return (0, False, Datetime(last_datetime))
@@ -371,11 +371,11 @@ def import_one_stock_data(
371
371
  hku_error(
372
372
  f"fetch data from tdx error! {bar_datetime} {ktype} {market}{code} last_krecord close: {last_krecord[4]}, bar: {bar['close']}")
373
373
  return (0, False, Datetime(last_datetime))
374
- if ktype == 'DAY' and last_krecord[5] != 0.0 and abs(last_krecord[5] - bar["amount"]*0.001) > 10:
374
+ if ktype == 'DAY' and last_krecord[5] != 0.0 and abs(last_krecord[5] - bar["amount"]*0.001) > 10000:
375
375
  hku_error(
376
376
  f"fetch data from tdx error! {bar_datetime} {ktype} {market}{code} last_krecord amount: {last_krecord[5]}, bar: {bar['amount']*0.001}")
377
377
  return (0, False, Datetime(last_datetime))
378
- if ktype == 'DAY' and last_krecord[6] != 0.0 and abs(last_krecord[6] - bar["vol"]) > 10:
378
+ if ktype == 'DAY' and last_krecord[6] != 0.0 and abs(last_krecord[6] - bar["vol"]) > 10000:
379
379
  hku_error(
380
380
  f"fetch data from tdx error! {bar_datetime} {ktype} {market}{code} last_krecord count: {last_krecord[6]}, bar: {bar['vol']}")
381
381
  return (0, False, Datetime(last_datetime))
@@ -523,11 +523,11 @@ def import_data(
523
523
  '5MIN': 'MIN5'
524
524
  }
525
525
  nktype = ktype_dict[ktype]
526
- h5_importer = get_mysql_importer(market, nktype)
527
- if h5_importer is not None:
526
+ importer = get_mysql_importer()
527
+ if importer is not None:
528
528
  for r in failed_list:
529
529
  hku_warn("remove {}{} {}: {}", r[0], r[1], nktype, r[2].start_of_day())
530
- h5_importer.remove(r[0], r[1], nktype, r[2].start_of_day())
530
+ importer.remove(r[0], r[1], nktype, r[2].start_of_day())
531
531
  hku_warn(f"已清理 {market} {failed_count} 个失败股票的最后记录,建议重新导入")
532
532
 
533
533
  if failed_count >= failed_limit:
@@ -0,0 +1,5 @@
1
+ BEGIN TRANSACTION;
2
+ update `stocktypeinfo` set `minTradeNumber`=200 where `type`=9 and `description`='科创板';
3
+ update `stocktypeinfo` set `minTradeNumber`=100 where `type`=11 and `description`='北交所';
4
+ UPDATE `version` set `version` = 30;
5
+ COMMIT;
hikyuu/draw/__init__.pyi CHANGED
@@ -9,8 +9,8 @@ from hikyuu.draw.drawplot import gcf
9
9
  from hikyuu.draw.drawplot import get_current_draw_engine
10
10
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWBAND
11
11
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWICON
12
- from hikyuu.draw.drawplot.matplotlib_draw import DRAWIMG
13
12
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWIMG as DRAWBMP
13
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWIMG
14
14
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWLINE
15
15
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWNUMBER
16
16
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWNUMBER_FIX
@@ -25,8 +25,8 @@ from hikyuu.draw.drawplot.echarts_draw import sys_performance as ec_sys_performa
25
25
  from hikyuu.draw.drawplot.echarts_draw import sysplot as ec_sysplot
26
26
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWBAND
27
27
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWICON
28
- from hikyuu.draw.drawplot.matplotlib_draw import DRAWIMG
29
28
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWIMG as DRAWBMP
29
+ from hikyuu.draw.drawplot.matplotlib_draw import DRAWIMG
30
30
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWLINE
31
31
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWNUMBER
32
32
  from hikyuu.draw.drawplot.matplotlib_draw import DRAWNUMBER_FIX