hikyuu 2.6.2__py3-none-win_amd64.whl → 2.6.5__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 (136) hide show
  1. hikyuu/__init__.py +1 -1
  2. hikyuu/__init__.pyi +28 -13
  3. hikyuu/analysis/__init__.pyi +20 -0
  4. hikyuu/analysis/analysis.pyi +21 -1
  5. hikyuu/core.pyi +22 -2
  6. hikyuu/cpp/core310.pyd +0 -0
  7. hikyuu/cpp/core310.pyi +499 -50
  8. hikyuu/cpp/core311.pyd +0 -0
  9. hikyuu/cpp/core311.pyi +499 -50
  10. hikyuu/cpp/core312.pyd +0 -0
  11. hikyuu/cpp/core312.pyi +499 -50
  12. hikyuu/cpp/core313.pyd +0 -0
  13. hikyuu/cpp/core313.pyi +499 -50
  14. hikyuu/cpp/core39.pyd +0 -0
  15. hikyuu/cpp/core39.pyi +499 -50
  16. hikyuu/cpp/hikyuu.dll +0 -0
  17. hikyuu/cpp/hikyuu.lib +0 -0
  18. hikyuu/data/common.py +1 -1
  19. hikyuu/data/common_mysql.py +19 -0
  20. hikyuu/data/common_pytdx.py +2 -0
  21. hikyuu/data/common_sqlite3.py +1 -0
  22. hikyuu/data/hku_config_template.py +14 -0
  23. hikyuu/data/mysql_upgrade/0028.sql +95 -0
  24. hikyuu/data/pytdx_to_h5.py +53 -13
  25. hikyuu/data/pytdx_to_mysql.py +42 -9
  26. hikyuu/data/pytdx_to_taos.py +736 -0
  27. hikyuu/data/sqlite_upgrade/0028.sql +97 -0
  28. hikyuu/draw/__init__.pyi +1 -1
  29. hikyuu/draw/drawplot/__init__.pyi +1 -1
  30. hikyuu/draw/drawplot/bokeh_draw.pyi +24 -9
  31. hikyuu/draw/drawplot/echarts_draw.pyi +24 -9
  32. hikyuu/draw/drawplot/matplotlib_draw.py +26 -4
  33. hikyuu/draw/drawplot/matplotlib_draw.pyi +24 -9
  34. hikyuu/draw/kaufman.py +2 -2
  35. hikyuu/draw/kaufman.pyi +2 -2
  36. hikyuu/examples/notebook/001-overview.ipynb +65 -100
  37. hikyuu/examples/notebook/004-IndicatorOverview.ipynb +34 -32
  38. hikyuu/examples/notebook/007-SystemDetails.ipynb +64 -50
  39. hikyuu/examples/notebook/010-Portfolio.ipynb +120 -124
  40. hikyuu/extend.py +1 -1
  41. hikyuu/extend.pyi +24 -9
  42. hikyuu/fetcher/stock/zh_block_em.py +349 -5
  43. hikyuu/fetcher/stock/zh_stock_a_pytdx.py +2 -1
  44. hikyuu/gui/HikyuuTDX.py +47 -24
  45. hikyuu/gui/data/ImportBlockInfoTask.py +1 -1
  46. hikyuu/gui/data/ImportHistoryFinanceTask.py +48 -44
  47. hikyuu/gui/data/ImportPytdxTimeToH5Task.py +3 -1
  48. hikyuu/gui/data/ImportPytdxToH5Task.py +4 -2
  49. hikyuu/gui/data/ImportPytdxTransToH5Task.py +3 -1
  50. hikyuu/gui/data/ImportWeightToSqliteTask.py +2 -1
  51. hikyuu/gui/data/ImportZhBond10Task.py +1 -1
  52. hikyuu/gui/data/MainWindow.py +123 -106
  53. hikyuu/gui/data/UsePytdxImportToH5Thread.py +7 -3
  54. hikyuu/gui/data/UseQmtImportToH5Thread.py +1 -0
  55. hikyuu/gui/data/UseTdxImportToH5Thread.py +2 -1
  56. hikyuu/hub.pyi +6 -6
  57. hikyuu/include/hikyuu/Block.h +20 -0
  58. hikyuu/include/hikyuu/KQuery.h +8 -0
  59. hikyuu/include/hikyuu/MarketInfo.h +6 -0
  60. hikyuu/include/hikyuu/Stock.h +1 -1
  61. hikyuu/include/hikyuu/StockManager.h +6 -0
  62. hikyuu/include/hikyuu/data_driver/BaseInfoDriver.h +35 -0
  63. hikyuu/include/hikyuu/indicator/Indicator.h +5 -0
  64. hikyuu/include/hikyuu/indicator/IndicatorImp.h +8 -3
  65. hikyuu/include/hikyuu/indicator/build_in.h +1 -0
  66. hikyuu/include/hikyuu/indicator/crt/BARSLASTCOUNT.h +33 -0
  67. hikyuu/include/hikyuu/indicator/crt/INSUM.h +5 -10
  68. hikyuu/include/hikyuu/indicator/crt/RSI.h +2 -18
  69. hikyuu/include/hikyuu/indicator/imp/IBarsLastCount.h +27 -0
  70. hikyuu/include/hikyuu/plugin/backtest.h +3 -2
  71. hikyuu/include/hikyuu/plugin/device.h +6 -3
  72. hikyuu/include/hikyuu/plugin/extind.h +150 -0
  73. hikyuu/include/hikyuu/plugin/interface/BackTestPluginInterface.h +2 -1
  74. hikyuu/include/hikyuu/plugin/interface/DevicePluginInterface.h +1 -0
  75. hikyuu/include/hikyuu/plugin/interface/ExtendIndicatorsPluginInterface.h +26 -0
  76. hikyuu/include/hikyuu/plugin/interface/TMReportPluginInterface.h +80 -0
  77. hikyuu/include/hikyuu/plugin/interface/plugins.h +4 -0
  78. hikyuu/include/hikyuu/strategy/BrokerTradeManager.h +7 -5
  79. hikyuu/include/hikyuu/strategy/Strategy.h +22 -9
  80. hikyuu/include/hikyuu/trade_manage/OrderBrokerBase.h +11 -4
  81. hikyuu/include/hikyuu/trade_manage/Performance.h +17 -9
  82. hikyuu/include/hikyuu/trade_manage/PositionExtInfo.h +92 -0
  83. hikyuu/include/hikyuu/trade_manage/PositionRecord.h +7 -1
  84. hikyuu/include/hikyuu/trade_manage/TradeManager.h +8 -5
  85. hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +66 -5
  86. hikyuu/include/hikyuu/trade_manage/TradeRecord.h +9 -1
  87. hikyuu/include/hikyuu/trade_sys/multifactor/MultiFactorBase.h +8 -5
  88. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_EqualWeight.h +4 -1
  89. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_ICIRWeight.h +4 -1
  90. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_ICWeight.h +4 -1
  91. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_Weight.h +4 -1
  92. hikyuu/include/hikyuu/trade_sys/multifactor/imp/EqualWeightMultiFactor.h +2 -1
  93. hikyuu/include/hikyuu/trade_sys/multifactor/imp/ICIRMultiFactor.h +2 -1
  94. hikyuu/include/hikyuu/trade_sys/multifactor/imp/ICMultiFactor.h +2 -1
  95. hikyuu/include/hikyuu/trade_sys/multifactor/imp/WeightMultiFactor.h +1 -1
  96. hikyuu/include/hikyuu/trade_sys/selector/crt/SE_Optimal.h +8 -0
  97. hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/OptimalEvaluateSelector.h +28 -0
  98. hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/OptimalSelectorBase.h +1 -0
  99. hikyuu/include/hikyuu/trade_sys/system/TradeRequest.h +7 -4
  100. hikyuu/include/hikyuu/trade_sys/system/imp/WalkForwardTradeManager.h +17 -13
  101. hikyuu/include/hikyuu/utilities/DllLoader.h +226 -0
  102. hikyuu/include/hikyuu/utilities/datetime/Datetime.h +20 -0
  103. hikyuu/include/hikyuu/utilities/datetime/TimeDelta.h +6 -0
  104. hikyuu/include/hikyuu/utilities/plugin/PluginLoader.h +10 -10
  105. hikyuu/include/hikyuu/utilities/thread/{MQStealThreadPool.h → GlobalMQStealThreadPool.h} +12 -12
  106. hikyuu/include/hikyuu/utilities/thread/GlobalMQThreadPool.h +271 -0
  107. hikyuu/include/hikyuu/utilities/thread/{StealThreadPool.h → GlobalStealThreadPool.h} +11 -10
  108. hikyuu/include/hikyuu/utilities/thread/GlobalThreadPool.h +224 -0
  109. hikyuu/include/hikyuu/utilities/thread/InterruptFlag.h +16 -0
  110. hikyuu/include/hikyuu/utilities/thread/MQThreadPool.h +40 -77
  111. hikyuu/include/hikyuu/utilities/thread/ThreadPool.h +31 -59
  112. hikyuu/include/hikyuu/utilities/thread/ThreadSafeQueue.h +4 -0
  113. hikyuu/include/hikyuu/utilities/thread/algorithm.h +9 -9
  114. hikyuu/include/hikyuu/utilities/thread/thread.h +4 -0
  115. hikyuu/include/hikyuu/version.h +4 -4
  116. hikyuu/plugin/backtest.dll +0 -0
  117. hikyuu/plugin/dataserver.dll +0 -0
  118. hikyuu/plugin/device.dll +0 -0
  119. hikyuu/plugin/extind.dll +0 -0
  120. hikyuu/plugin/import2hdf5.dll +0 -0
  121. hikyuu/plugin/tmreport.dll +0 -0
  122. hikyuu/trade_manage/__init__.pyi +23 -8
  123. hikyuu/trade_manage/broker.py +8 -8
  124. hikyuu/trade_manage/broker.pyi +4 -4
  125. hikyuu/trade_manage/broker_easytrader.py +3 -3
  126. hikyuu/trade_manage/broker_easytrader.pyi +2 -2
  127. hikyuu/trade_manage/broker_mail.py +2 -2
  128. hikyuu/trade_manage/broker_mail.pyi +2 -2
  129. hikyuu/trade_manage/trade.pyi +23 -8
  130. hikyuu/util/singleton.pyi +1 -1
  131. {hikyuu-2.6.2.dist-info → hikyuu-2.6.5.dist-info}/METADATA +4 -3
  132. {hikyuu-2.6.2.dist-info → hikyuu-2.6.5.dist-info}/RECORD +136 -121
  133. {hikyuu-2.6.2.dist-info → hikyuu-2.6.5.dist-info}/LICENSE +0 -0
  134. {hikyuu-2.6.2.dist-info → hikyuu-2.6.5.dist-info}/WHEEL +0 -0
  135. {hikyuu-2.6.2.dist-info → hikyuu-2.6.5.dist-info}/entry_points.txt +0 -0
  136. {hikyuu-2.6.2.dist-info → hikyuu-2.6.5.dist-info}/top_level.txt +0 -0
hikyuu/cpp/core310.pyi CHANGED
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
  import numpy
3
3
  import typing
4
- __all__ = ['ABS', 'ACOS', 'AD', 'ADVANCE', 'AF_EqualWeight', 'AF_FixedWeight', 'AF_FixedWeightList', 'AF_MultiFactor', 'ALIGN', 'AMA', 'ASIN', 'ATAN', 'ATR', 'AVEDEV', 'AllocateFundsBase', 'BACKSET', 'BARSCOUNT', 'BARSLAST', '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', 'DIRECT', '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', 'RECOVER_BACKWARD', 'RECOVER_EQUAL_BACKWARD', 'RECOVER_EQUAL_FORWARD', 'RECOVER_FORWARD', 'REF', 'REPLACE', 'RESULT', 'REVERSE', 'ROC', 'ROCP', 'ROCR', 'ROCR100', 'ROUND', 'ROUNDDOWN', 'ROUNDUP', 'RSI', 'SAFTYLOSS', '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', 'VAR', 'VARP', 'VIGOR', 'WARN', 'WEAVE', 'WEEK', 'WINNER', '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', 'fetch_trial_license', 'find_optimal_system', 'find_optimal_system_multi', 'get_block', 'get_business_name', 'get_data_from_buffer_server', 'get_date_range', 'get_kdata', 'get_last_version', 'get_log_level', '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', 'isinf', 'isnan', 'open_ostream_to_python', 'open_spend_time', 'remove_license', 'roundDown', 'roundEx', 'roundUp', 'run_in_strategy', 'set_log_level', 'set_python_in_interactive', 'set_python_in_jupyter', 'start_data_server', 'start_spot_agent', 'stop_data_server', 'stop_spot_agent', 'toPriceList', 'view_license']
4
+ __all__ = ['ABS', 'ACOS', 'AD', 'ADVANCE', 'AF_EqualWeight', 'AF_FixedWeight', 'AF_FixedWeightList', 'AF_MultiFactor', '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', 'DIRECT', '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', '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', 'fetch_trial_license', 'find_optimal_system', 'find_optimal_system_multi', 'get_block', 'get_business_name', 'get_data_from_buffer_server', 'get_date_range', 'get_kdata', 'get_last_version', 'get_log_level', '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', 'open_ostream_to_python', 'open_spend_time', 'remove_license', 'roundDown', 'roundEx', 'roundUp', 'run_in_strategy', 'set_log_level', 'set_python_in_interactive', 'set_python_in_jupyter', 'start_data_server', 'start_spot_agent', 'stop_data_server', 'stop_spot_agent', 'toPriceList', 'view_license']
5
5
  class AllocateFundsBase:
6
6
  """
7
7
  资产分配算法基类, 子类接口:
@@ -210,6 +210,8 @@ class Block:
210
210
  @staticmethod
211
211
  def _pybind11_conduit_v1_(*args, **kwargs):
212
212
  ...
213
+ def __eq__(self, arg0: Block) -> bool:
214
+ ...
213
215
  def __getitem__(self, arg0: str) -> Stock:
214
216
  """
215
217
  __getitem__(self, market_code)
@@ -219,6 +221,8 @@ class Block:
219
221
  """
220
222
  def __getstate__(self) -> tuple:
221
223
  ...
224
+ def __hash__(self) -> int:
225
+ ...
222
226
  @typing.overload
223
227
  def __init__(self) -> None:
224
228
  ...
@@ -234,6 +238,8 @@ class Block:
234
238
  """
235
239
  包含的证券数量
236
240
  """
241
+ def __ne__(self, arg0: Block) -> bool:
242
+ ...
237
243
  def __repr__(self) -> str:
238
244
  ...
239
245
  def __setstate__(self, arg0: tuple) -> None:
@@ -290,6 +296,12 @@ class Block:
290
296
 
291
297
  :param func filter: 输入参数为 stock, 返回 True | False 的过滤函数
292
298
  """
299
+ def is_null(self) -> bool:
300
+ """
301
+ is_null(self)
302
+
303
+ 是否为null值
304
+ """
293
305
  @typing.overload
294
306
  def remove(self, arg0: Stock) -> bool:
295
307
  """
@@ -920,6 +932,16 @@ class Datetime:
920
932
  兼容oracle用后7个字节表示的datetime
921
933
  """
922
934
  @staticmethod
935
+ def from_timestamp(arg0: int) -> Datetime:
936
+ """
937
+ 从时间戳(微秒)创建Datetime对象
938
+ """
939
+ @staticmethod
940
+ def from_timestamp_utc(arg0: int) -> Datetime:
941
+ """
942
+ 从时间戳(微秒)创建Datetime对象,并加上本地UTC时间偏差
943
+ """
944
+ @staticmethod
923
945
  def max() -> Datetime:
924
946
  """
925
947
  获取支持的最大日期, Datetime(9999, 12, 31)
@@ -1125,6 +1147,14 @@ class Datetime:
1125
1147
  """
1126
1148
  返回年度起始日期
1127
1149
  """
1150
+ def timestamp(self) -> int:
1151
+ """
1152
+ 返回时间戳(微妙级别)
1153
+ """
1154
+ def timestamp_utc(self) -> int:
1155
+ """
1156
+ 返回时间戳(微妙级别), 并扣除本地 UTC 偏差时间
1157
+ """
1128
1158
  @property
1129
1159
  def day(self) -> int:
1130
1160
  """
@@ -1804,6 +1834,15 @@ class Indicator:
1804
1834
  """
1805
1835
  克隆操作
1806
1836
  """
1837
+ def contains(self, arg0: str) -> bool:
1838
+ """
1839
+ contains(self, name)
1840
+
1841
+ 获取指标公式中是否包含指定名称的指标
1842
+
1843
+ :param str name: 指定的指标名称
1844
+ :rtype: bool
1845
+ """
1807
1846
  def empty(self) -> bool:
1808
1847
  """
1809
1848
  是否为空
@@ -2056,6 +2095,8 @@ class IndicatorImp:
2056
2095
  ...
2057
2096
  def clone(self) -> IndicatorImp:
2058
2097
  ...
2098
+ def contains(self, arg0: str) -> bool:
2099
+ ...
2059
2100
  def get_ind_param(self, arg0: str) -> ...:
2060
2101
  ...
2061
2102
  def get_param(self, arg0: str) -> any:
@@ -3136,9 +3177,9 @@ class OrderBrokerBase:
3136
3177
  ...
3137
3178
  def __str__(self) -> str:
3138
3179
  ...
3139
- def _buy(self, arg0: Datetime, arg1: str, arg2: str, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart) -> None:
3180
+ def _buy(self, arg0: Datetime, arg1: str, arg2: str, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart, arg8: str) -> None:
3140
3181
  """
3141
- _buy(self, datetime, market, code, price, num, stoploss, goal_price, part_from)
3182
+ _buy(self, datetime, market, code, price, num, stoploss, goal_price, part_from, remark)
3142
3183
 
3143
3184
  【子类接口】执行买入操作
3144
3185
 
@@ -3149,7 +3190,8 @@ class OrderBrokerBase:
3149
3190
  :param float num: 买入数量
3150
3191
  :param float stoploss: 计划止损价
3151
3192
  :param float goal_price: 计划盈利目标价
3152
- :param SystemPart part_from: 信号来源
3193
+ :param SystemPart part_from: 信号来源,
3194
+ :param str remark: 订单备注
3153
3195
  """
3154
3196
  def _get_asset_info(self) -> str:
3155
3197
  """
@@ -3171,9 +3213,9 @@ class OrderBrokerBase:
3171
3213
  :return: 以字符串(json格式)方式返回当前资产信息
3172
3214
  :rtype: str
3173
3215
  """
3174
- def _sell(self, arg0: Datetime, arg1: str, arg2: str, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart) -> None:
3216
+ def _sell(self, arg0: Datetime, arg1: str, arg2: str, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart, arg8: str) -> None:
3175
3217
  """
3176
- _sell(self, datetime, market, code, price, num, stoploss, goal_price, part_from)
3218
+ _sell(self, datetime, market, code, price, num, stoploss, goal_price, part_from, remark)
3177
3219
 
3178
3220
  【子类接口】执行卖出操作
3179
3221
 
@@ -3185,8 +3227,9 @@ class OrderBrokerBase:
3185
3227
  :param float stoploss: 计划止损价
3186
3228
  :param float goal_price: 计划盈利目标价
3187
3229
  :param SystemPart part_from: 信号来源
3230
+ :param str remark: 订单备注
3188
3231
  """
3189
- def buy(self, arg0: Datetime, arg1: str, arg2: str, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart) -> None:
3232
+ def buy(self, arg0: Datetime, arg1: str, arg2: str, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart, arg8: str) -> None:
3190
3233
  """
3191
3234
  详情见子类实现接口: _buy
3192
3235
  """
@@ -3194,7 +3237,7 @@ class OrderBrokerBase:
3194
3237
  """
3195
3238
  详情见子类实现接口: _get_asset_info
3196
3239
  """
3197
- def sell(self, arg0: Datetime, arg1: str, arg2: str, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart) -> None:
3240
+ def sell(self, arg0: Datetime, arg1: str, arg2: str, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart, arg8: str) -> None:
3198
3241
  """
3199
3242
  详情见子类实现接口: _sell
3200
3243
  """
@@ -3274,9 +3317,6 @@ class Performance:
3274
3317
  def _pybind11_conduit_v1_(*args, **kwargs):
3275
3318
  ...
3276
3319
  @staticmethod
3277
- def exist(arg0: str) -> bool:
3278
- ...
3279
- @staticmethod
3280
3320
  def to_df(per):
3281
3321
  """
3282
3322
  将 Performance 统计结果转换为 DataFrame 格式
@@ -3290,20 +3330,21 @@ class Performance:
3290
3330
  """
3291
3331
  def __init__(self) -> None:
3292
3332
  ...
3333
+ def exist(self, arg0: str) -> bool:
3334
+ ...
3293
3335
  def names(self) -> list[str]:
3294
3336
  """
3295
3337
  names(self)
3296
3338
 
3297
3339
  获取所有统计项名称
3298
3340
  """
3299
- def report(self, tm: TradeManager, datetime: Datetime = ...) -> str:
3341
+ def report(self) -> str:
3300
3342
  """
3301
- report(self, tm[, datetime=Datetime.now()])
3343
+ report(self)
3302
3344
 
3303
3345
  简单的文本统计报告,用于直接输出打印
3346
+ 只有运行 statistics 后或 Performance 本身为从 TM 获取的结果时才生效
3304
3347
 
3305
- :param TradeManager tm: 指定的交易管理实例
3306
- :param Datetime datetime: 统计截止时刻
3307
3348
  :rtype: str
3308
3349
  """
3309
3350
  def reset(self) -> None:
@@ -3321,6 +3362,8 @@ class Performance:
3321
3362
  :param TradeManager tm: 指定的交易管理实例
3322
3363
  :param Datetime datetime: 统计截止时刻
3323
3364
  """
3365
+ def to_dict(self) -> dict:
3366
+ ...
3324
3367
  def values(self) -> list[float]:
3325
3368
  """
3326
3369
  values(self)
@@ -5140,6 +5183,16 @@ class StockManager:
5140
5183
 
5141
5184
  :rtype: StringList
5142
5185
  """
5186
+ def get_market_stock(self, arg0: str) -> ...:
5187
+ """
5188
+ get_market_stock(self, market)
5189
+
5190
+ 获取指定市场的代表指数(可能为空)
5191
+
5192
+ :param string market: 指定的市场标识(市场简称)
5193
+ :return: 相应的市场代表指数,如果相应的市场信息不存在,则返回Null<Stock>()
5194
+ :rtype: Stock
5195
+ """
5143
5196
  def get_plugin_path(self) -> str:
5144
5197
  """
5145
5198
  get_plugin_path(self)
@@ -5639,20 +5692,52 @@ class Strategy:
5639
5692
  :param str name: 策略名称
5640
5693
  :param str config: 配置文件名称(如需要使用独立的配置文件,否则为空时使用默认的hikyuu配置文件)
5641
5694
  """
5642
- def buy(self, stock: Stock, price: float, num: float, stoploss: float = 0.0, goal_price: float = 0.0, part: SystemPart = ...) -> TradeRecord:
5695
+ def buy(self, stock: Stock, price: float, num: float, stoploss: float = 0.0, goal_price: float = 0.0, part: SystemPart = ..., remark: str = '') -> TradeRecord:
5643
5696
  ...
5644
5697
  def get_kdata(self, stk: Stock, start_date: Datetime, end_date: Datetime, ktype: str, recover_type: Query.RecoverType = ...) -> KData:
5645
- ...
5698
+ """
5699
+ get_kdata(self, stk, start_date, end_date, ktype, recover_type)
5700
+
5701
+ 获取指定证券指定日期范围内的K线数据(为保证实盘和回测一致,请使用本方法获取K线数据)
5702
+ :param Stock stk: 指定的证券
5703
+ :param Datetime start_date: 开始日期
5704
+ :param Datetime end_date: 结束日期
5705
+ :param KQuery.KType ktype: K线类型
5706
+ :param KQuery.RecoverType recover_type: 恢复方式
5707
+ :return: K线数据
5708
+ :rtype: KData
5709
+ """
5646
5710
  @typing.overload
5647
5711
  def get_last_kdata(self, stk: Stock, start_date: Datetime, ktype: str, recover_type: Query.RecoverType = ...) -> KData:
5648
5712
  ...
5649
5713
  @typing.overload
5650
5714
  def get_last_kdata(self, stk: Stock, lastnum: int, ktype: str, recover_type: Query.RecoverType = ...) -> KData:
5651
- ...
5715
+ """
5716
+ get_last_kdata(self, stk, start_date, ktype, recover_type)
5717
+
5718
+ 获取指定证券从指定日期开始到当前时间的对应K线数据(为保证实盘和回测一致,请使用本方法获取K线数据)
5719
+
5720
+ 或 指定当前能获取到的最后 last_num 条 K线数据(为保证实盘和回测一致,请使用本方法获取K线数据)
5721
+
5722
+ :param Stock stk: 指定的证券
5723
+ :param Datetime start_date: 开始日期 (或为 int 类型,表示从当前日期往前推多少个交易日)
5724
+ :param KQuery.KType ktype: K线类型
5725
+ :param KQuery.RecoverType recover_type: 恢复方式
5726
+ :return: K线数据
5727
+ :rtype: KData
5728
+ """
5652
5729
  def next_datetime(self) -> Datetime:
5653
- ...
5730
+ """
5731
+ next_datetime(self)
5732
+
5733
+ 下一交易时间点(回测使用)
5734
+ """
5654
5735
  def now(self) -> Datetime:
5655
- ...
5736
+ """
5737
+ now(self)
5738
+
5739
+ 获取当前时间(使用该方法而不是 Datatime.now(), 以便回测和实盘一直)
5740
+ """
5656
5741
  def on_change(self, arg0: typing.Any) -> None:
5657
5742
  """
5658
5743
  onchang(self, func)
@@ -5669,6 +5754,24 @@ class Strategy:
5669
5754
 
5670
5755
  :param func: 可调用对象如普通函数, func(stg: Strategy, revTime: Datetime)
5671
5756
  """
5757
+ def order(self, stock: Stock, num: float, remark: str = '') -> TradeRecord:
5758
+ """
5759
+ order(self, stk, num, remark='')
5760
+
5761
+ 按数量下单(正数为买入,负数为卖出)
5762
+ :param Stock stk: 指定的证券
5763
+ :param int num: 下单数量
5764
+ :param str remark: 下单备注
5765
+ """
5766
+ def order_value(self, stock: Stock, price: float, remark: str = '') -> TradeRecord:
5767
+ """
5768
+ order_value(self, stk, value, remark='')
5769
+
5770
+ 按预期的证劵市值下单,即希望买入多少钱的证券(正数为买入,负数为卖出)
5771
+ :param Stock stk: 指定的证券
5772
+ :param float value: 投入买入资金
5773
+ :param str remark: 下单备注
5774
+ """
5672
5775
  def run_daily(self, func: typing.Any, time: TimeDelta, market: str = 'SH', ignore_market: bool = False) -> None:
5673
5776
  """
5674
5777
  run_daily(self, func)
@@ -5691,7 +5794,7 @@ class Strategy:
5691
5794
  :param TimeDelta time: 执行时刻,如每日15点:TimeDelta(0, 15)
5692
5795
  :param ignore_holiday: 节假日不执行
5693
5796
  """
5694
- def sell(self, stock: Stock, price: float, num: float, stoploss: float = 0.0, goal_price: float = 0.0, part: SystemPart = ...) -> TradeRecord:
5797
+ def sell(self, stock: Stock, price: float, num: float, stoploss: float = 0.0, goal_price: float = 0.0, part: SystemPart = ..., remark: str = '') -> TradeRecord:
5695
5798
  ...
5696
5799
  def start(self, auto_recieve_spot: bool = True) -> None:
5697
5800
  """
@@ -5702,7 +5805,11 @@ class Strategy:
5702
5805
  :param bool auto_recieve_spot: 是否自动接收行情数据
5703
5806
  """
5704
5807
  def today(self) -> Datetime:
5705
- ...
5808
+ """
5809
+ today(self)
5810
+
5811
+ 获取当前交易日日期(使用该方法而不是 Datatime.today(), 以便回测和实盘一直)
5812
+ """
5706
5813
  @property
5707
5814
  def context(self) -> StrategyContext:
5708
5815
  """
@@ -6844,9 +6951,9 @@ class TradeManager:
6844
6951
  ...
6845
6952
  def borrow_stock(self, arg0: Datetime, arg1: Stock, arg2: float, arg3: float) -> bool:
6846
6953
  ...
6847
- def buy(self, datetime: Datetime, stock: Stock, real_price: float, num: float, stoploss: float = 0.0, goal_price: float = 0.0, plan_price: float = 0.0, part: SystemPart = ...) -> TradeRecord:
6954
+ def buy(self, datetime: Datetime, stock: Stock, real_price: float, num: float, stoploss: float = 0.0, goal_price: float = 0.0, plan_price: float = 0.0, part: SystemPart = ..., remark: str = '') -> TradeRecord:
6848
6955
  """
6849
- buy(self, datetime, stock, real_price, number[, stoploss=0.0, goal_price=0.0, plan_price=0.0, part=System.INVALID])
6956
+ buy(self, datetime, stock, real_price, number[, stoploss=0.0, goal_price=0.0, plan_price=0.0, part=System.INVALID, remark=""])
6850
6957
 
6851
6958
  买入操作
6852
6959
 
@@ -6858,9 +6965,10 @@ class TradeManager:
6858
6965
  :param float goal_price: 目标价格
6859
6966
  :param float plan_price: 计划买入价格
6860
6967
  :param SystemPart part: 交易指示来源
6968
+ :param string remark: 备注信息
6861
6969
  :rtype: TradeRecord
6862
6970
  """
6863
- def buy_short(self, arg0: Datetime, arg1: Stock, arg2: float, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart) -> TradeRecord:
6971
+ def buy_short(self, arg0: Datetime, arg1: Stock, arg2: float, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart, arg8: str) -> TradeRecord:
6864
6972
  ...
6865
6973
  def cash(self, datetime: Datetime, ktype: str = 'DAY') -> float:
6866
6974
  """
@@ -6906,8 +7014,15 @@ class TradeManager:
6906
7014
  """
6907
7015
  克隆(深复制)实例
6908
7016
  """
6909
- def fetch_asset_info_from_broker(self, arg0: OrderBrokerBase, arg1: Datetime) -> None:
6910
- ...
7017
+ def fetch_asset_info_from_broker(self, broker: OrderBrokerBase, date: Datetime = ...) -> None:
7018
+ """
7019
+ fetch_asset_info_from_broker(self, date)
7020
+
7021
+ 从Broker同步当前时刻的资产信息,必须按时间顺序被调用
7022
+
7023
+ :param broker 订单代理实例
7024
+ :param datetime 同步时,通常为当前时间(Null),也可以强制为指定的时间点
7025
+ """
6911
7026
  def getParam(self, arg0: str) -> any:
6912
7027
  """
6913
7028
  get_param(self, name)
@@ -6978,6 +7093,16 @@ class TradeManager:
6978
7093
  :param Query.KType ktype: K线类型
6979
7094
  :rtype: FundsList
6980
7095
  """
7096
+ def get_history_position_ext_info_list(self, ktype: str = 'DAY', trade_mode: int = 0) -> list[...]:
7097
+ """
7098
+ get_history_position_ext_info_list(self, ktype=Query.DAY, trade_mode=0) -> list[PositionExtInfo])
7099
+
7100
+ 获取账户历史持仓扩展详情(已平仓记录)
7101
+
7102
+ :param Query.KType ktype: k线类型
7103
+ :param int trade_mode: 交易模式,影响部分统计项: 0-收盘时交易, 1-下一开盘时交易
7104
+ :return: 持仓扩展详情列表
7105
+ """
6981
7106
  def get_history_position_list(self) -> PositionRecordList:
6982
7107
  """
6983
7108
  get_history_position_list(self)
@@ -6998,6 +7123,26 @@ class TradeManager:
6998
7123
  """
6999
7124
  def get_margin_rate(self, arg0: Datetime, arg1: Stock) -> float:
7000
7125
  ...
7126
+ def get_max_pull_back(self, date: Datetime = ..., ktype: str = 'DAY') -> float:
7127
+ """
7128
+ get_max_pull_back(self, date, ktype=Query.DAY) -> float
7129
+
7130
+ 获取指定时刻时账户的最大回撤百分比(负数)
7131
+
7132
+ :param Datetime date: 指定日期(包含该时刻)
7133
+ :param Query.KType ktype: k线类型
7134
+ :return: 最大回撤百分比
7135
+ """
7136
+ def get_performance(self, datetime: Datetime = ..., ktype: str = 'DAY') -> ...:
7137
+ """
7138
+ get_performance(self[, datetime=Datetime.now(), ktype=Query.DAY]) -> Performance)
7139
+
7140
+ 获取账户指定时刻的账户表现
7141
+
7142
+ :param Datetime datetime: 指定时刻
7143
+ :param Query.KType ktype: K线类型
7144
+ :return: 账户表现
7145
+ """
7001
7146
  def get_position(self, arg0: Datetime, arg1: Stock) -> PositionRecord:
7002
7147
  """
7003
7148
  get_position(self, date, stock)
@@ -7008,6 +7153,17 @@ class TradeManager:
7008
7153
  :param Stock stock: 指定的证券
7009
7154
  :rtype: PositionRecord
7010
7155
  """
7156
+ def get_position_ext_info_list(self, current_time: Datetime, ktype: str = 'DAY', trade_mode: int = 0) -> list[...]:
7157
+ """
7158
+ get_position_ext_info_list(self, current_time, ktype=Query.DAY, trade_mode=0) -> list[PositionExtInfo])
7159
+
7160
+ 获取账户最后交易时刻之后指定时间的持仓详情(未平常记录)
7161
+
7162
+ :param Datetime current_time: 当前时刻(需大于等于最后交易时刻)
7163
+ :param Query.KType ktype: k线类型
7164
+ :param int trade_mode: 交易模式,影响部分统计项: 0-收盘时交易, 1-下一开盘时交易
7165
+ :return: 持仓扩展详情列表
7166
+ """
7011
7167
  def get_position_list(self) -> PositionRecordList:
7012
7168
  """
7013
7169
  get_position_list(self)
@@ -7037,6 +7193,24 @@ class TradeManager:
7037
7193
  :return: 收益曲线
7038
7194
  :rtype: PriceList
7039
7195
  """
7196
+ def get_profit_percent_monthly(self, datetime: Datetime = ...) -> list[tuple[Datetime, float]]:
7197
+ """
7198
+ get_profit_percent_monthly(self, datetime=Datetime.now()) -> list[tuple[Datetime, double]])
7199
+
7200
+ 获取账户指定截止时刻的账户收益百分比(月度)
7201
+
7202
+ :param Datetime datetime: 指定截止时刻
7203
+ :return: 账户收益百分比(月度)
7204
+ """
7205
+ def get_profit_percent_yearly(self, datetime: Datetime = ...) -> list[tuple[Datetime, float]]:
7206
+ """
7207
+ get_profit_percent_yearly(self, datetime=Datetime.now()) -> list[tuple[Datetime, double]])
7208
+
7209
+ 获取账户指定截止时刻的账户收益百分比(年度)
7210
+
7211
+ :param Datetime datetime: 指定截止时刻
7212
+ :return: 账户收益百分比(年度)
7213
+ """
7040
7214
  def get_return_cash_cost(self, arg0: Datetime, arg1: Datetime, arg2: float) -> CostRecord:
7041
7215
  ...
7042
7216
  def get_return_stock_cost(self, arg0: Datetime, arg1: Datetime, arg2: Stock, arg3: float, arg4: float) -> CostRecord:
@@ -7108,9 +7282,9 @@ class TradeManager:
7108
7282
  ...
7109
7283
  def return_stock(self, arg0: Datetime, arg1: Stock, arg2: float, arg3: float) -> bool:
7110
7284
  ...
7111
- def sell(self, datetime: Datetime, stock: Stock, real_price: float, num: float = 1.7976931348623157e+308, stoploss: float = 0.0, goal_price: float = 0.0, plan_price: float = 0.0, part: SystemPart = ...) -> TradeRecord:
7285
+ def sell(self, datetime: Datetime, stock: Stock, real_price: float, num: float = 1.7976931348623157e+308, stoploss: float = 0.0, goal_price: float = 0.0, plan_price: float = 0.0, part: SystemPart = ..., remark: str = '') -> TradeRecord:
7112
7286
  """
7113
- sell(self, datetime, stock, realPrice[, number=constant.max_double, stoploss=0.0, goal_price=0.0, plan_price=0.0, part=System.INVALID])
7287
+ sell(self, datetime, stock, realPrice[, number=constant.max_double, stoploss=0.0, goal_price=0.0, plan_price=0.0, part=System.INVALID, remark=""])
7114
7288
 
7115
7289
  卖出操作
7116
7290
 
@@ -7122,9 +7296,10 @@ class TradeManager:
7122
7296
  :param float goal_price: 新的目标价格
7123
7297
  :param float plan_price: 原计划卖出价格
7124
7298
  :param SystemPart part: 交易指示来源
7299
+ :param string remark: 交易备注
7125
7300
  :rtype: TradeRecord
7126
7301
  """
7127
- def sell_short(self, arg0: Datetime, arg1: Stock, arg2: float, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart) -> TradeRecord:
7302
+ def sell_short(self, arg0: Datetime, arg1: Stock, arg2: float, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart, arg8: str) -> TradeRecord:
7128
7303
  ...
7129
7304
  def set_param(self, arg0: str, arg1: any) -> None:
7130
7305
  """
@@ -7305,6 +7480,14 @@ class TradeRecord:
7305
7480
  def real_price(self, arg0: float) -> None:
7306
7481
  ...
7307
7482
  @property
7483
+ def remark(self) -> str:
7484
+ """
7485
+ 备注
7486
+ """
7487
+ @remark.setter
7488
+ def remark(self, arg0: str) -> None:
7489
+ ...
7490
+ @property
7308
7491
  def stock(self) -> Stock:
7309
7492
  """
7310
7493
  股票(Stock)
@@ -7929,6 +8112,20 @@ def BARSLAST(arg0: float) -> Indicator:
7929
8112
  :rtype: Indicator
7930
8113
  """
7931
8114
  @typing.overload
8115
+ def BARSLASTCOUNT() -> Indicator:
8116
+ ...
8117
+ @typing.overload
8118
+ def BARSLASTCOUNT(data: Indicator) -> Indicator:
8119
+ """
8120
+ BARSLASTCOUNT([data])
8121
+
8122
+ 用于统计连续满足条件的周期数
8123
+ BARSLASTCOUNT(X), 其中X为条件表达式。例如, BARSLASTCOUNT(CLOSE>OPEN)表示统计连续收阳的周期数
8124
+
8125
+ :param Indicator data: 条件指标
8126
+ :rtype: Indicator
8127
+ """
8128
+ @typing.overload
7932
8129
  def BARSSINCE() -> Indicator:
7933
8130
  ...
7934
8131
  @typing.overload
@@ -8872,18 +9069,7 @@ def INSUM(block: Block, ind: Indicator, mode: int, fill_null: bool = True) -> In
8872
9069
  ...
8873
9070
  @typing.overload
8874
9071
  def INSUM(block: Block, query: Query, ind: Indicator, mode: int, fill_null: bool = True) -> Indicator:
8875
- """
8876
- INSUM(block, query, ind, mode[, fill_null=True])
8877
-
8878
- 返回板块各成分该指标相应输出按计算类型得到的计算值.计算类型:0-累加,1-平均数,2-最大值,3-最小值.
8879
-
8880
- :param Block block: 指定板块
8881
- :param Query query: 指定范围
8882
- :param Indicator ind: 指定指标
8883
- :param int mode: 计算类型:0-累加,1-平均数,2-最大值,3-最小值.
8884
- :param bool fill_null: 日期对齐时缺失数据填充 nan 值。
8885
- :rtype: Indicator
8886
- """
9072
+ ...
8887
9073
  @typing.overload
8888
9074
  def INSUM(stks: typing.Sequence, ind: Indicator, mode: int, fill_null: bool = True) -> Indicator:
8889
9075
  ...
@@ -8892,12 +9078,14 @@ def INSUM(stks: typing.Sequence, query: Query, ind: Indicator, mode: int, fill_n
8892
9078
  """
8893
9079
  INSUM(stks, query, ind, mode[, fill_null=True])
8894
9080
 
8895
- 返回板块各成分该指标相应输出按计算类型得到的计算值.计算类型:0-累加,1-平均数,2-最大值,3-最小值.
9081
+ 返回板块各成分该指标相应输出按计算类型得到的计算值.计算类型:0-累加,1-平均数,2-最大值,3-最小值,4-降序排名,5-升序排名.
9082
+
9083
+ 注意: INSUM使用模式4/5时相当于RANK功能, 但不适合在MF中使用, 在 MF 中使用时计算量为 N x N 级别, 计算缓慢。如果希望在 MF 中使用,建议直接使用 RANK[VIP] 指标。
8896
9084
 
8897
9085
  :param Sequence stks: stock list
8898
9086
  :param Query query: 指定范围
8899
9087
  :param Indicator ind: 指定指标
8900
- :param int mode: 计算类型:0-累加,1-平均数,2-最大值,3-最小值.
9088
+ :param int mode: 计算类型:0-累加,1-平均数,2-最大值,3-最小值,4-降序排名(指标值最高的排名为1), 5-升序排名(指标值越高排名值越高)
8901
9089
  :param bool fill_null: 日期对齐时缺失数据填充 nan 值。
8902
9090
  :rtype: Indicator
8903
9091
  """
@@ -9321,7 +9509,7 @@ def MDD(arg0: Indicator) -> Indicator:
9321
9509
  def MF_EqualWeight() -> MultiFactorBase:
9322
9510
  ...
9323
9511
  @typing.overload
9324
- def MF_EqualWeight(inds: typing.Sequence, stks: typing.Sequence, query: Query, ref_stk: typing.Any = None, ic_n: int = 5, spearman: bool = True) -> MultiFactorBase:
9512
+ def MF_EqualWeight(inds: typing.Sequence, stks: typing.Sequence, query: Query, ref_stk: typing.Any = None, ic_n: int = 5, spearman: bool = True, mode: int = 0, save_all_factors: bool = False) -> MultiFactorBase:
9325
9513
  """
9326
9514
  MF_EqualWeight(inds, stks, query, ref_stk[, ic_n=5])
9327
9515
 
@@ -9333,13 +9521,15 @@ def MF_EqualWeight(inds: typing.Sequence, stks: typing.Sequence, query: Query, r
9333
9521
  :param Stock ref_stk: 参考证券 (未指定时,默认为 sh000300 沪深300)
9334
9522
  :param int ic_n: 默认 IC 对应的 N 日收益率
9335
9523
  :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
9524
+ :param int mode: 获取截面数据时排序模式: 0-降序, 1-升序, 2-不排序
9525
+ :param bool save_all_factors: 是否保存所有因子值,影响 get_actor/get_all_factors 方法
9336
9526
  :rtype: MultiFactorBase
9337
9527
  """
9338
9528
  @typing.overload
9339
9529
  def MF_ICIRWeight() -> MultiFactorBase:
9340
9530
  ...
9341
9531
  @typing.overload
9342
- def MF_ICIRWeight(inds: typing.Sequence, stks: typing.Sequence, query: Query, ref_stk: typing.Any = None, ic_n: int = 5, ic_rolling_n: int = 120, spearman: bool = True) -> MultiFactorBase:
9532
+ def MF_ICIRWeight(inds: typing.Sequence, stks: typing.Sequence, query: Query, ref_stk: typing.Any = None, ic_n: int = 5, ic_rolling_n: int = 120, spearman: bool = True, mode: int = 0, save_all_factors: bool = False) -> MultiFactorBase:
9343
9533
  """
9344
9534
  MF_EqualWeight(inds, stks, query, ref_stk[, ic_n=5, ic_rolling_n=120])
9345
9535
 
@@ -9352,13 +9542,15 @@ def MF_ICIRWeight(inds: typing.Sequence, stks: typing.Sequence, query: Query, re
9352
9542
  :param int ic_n: 默认 IC 对应的 N 日收益率
9353
9543
  :param int ic_rolling_n: IC 滚动周期
9354
9544
  :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
9545
+ :param int mode: 获取截面数据时排序模式: 0-降序, 1-升序, 2-不排序
9546
+ :param bool save_all_factors: 是否保存所有因子值,影响 get_actor/get_all_factors 方法
9355
9547
  :rtype: MultiFactorBase
9356
9548
  """
9357
9549
  @typing.overload
9358
9550
  def MF_ICWeight() -> MultiFactorBase:
9359
9551
  ...
9360
9552
  @typing.overload
9361
- def MF_ICWeight(inds: typing.Sequence, stks: typing.Sequence, query: Query, ref_stk: typing.Any = None, ic_n: int = 5, ic_rolling_n: int = 120, spearman: bool = True) -> MultiFactorBase:
9553
+ def MF_ICWeight(inds: typing.Sequence, stks: typing.Sequence, query: Query, ref_stk: typing.Any = None, ic_n: int = 5, ic_rolling_n: int = 120, spearman: bool = True, mode: int = 0, save_all_factors: bool = False) -> MultiFactorBase:
9362
9554
  """
9363
9555
  MF_EqualWeight(inds, stks, query, ref_stk[, ic_n=5, ic_rolling_n=120])
9364
9556
 
@@ -9371,13 +9563,15 @@ def MF_ICWeight(inds: typing.Sequence, stks: typing.Sequence, query: Query, ref_
9371
9563
  :param int ic_n: 默认 IC 对应的 N 日收益率
9372
9564
  :param int ic_rolling_n: IC 滚动周期
9373
9565
  :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
9566
+ :param int mode: 获取截面数据时排序模式: 0-降序, 1-升序, 2-不排序
9567
+ :param bool save_all_factors: 是否保存所有因子值,影响 get_actor/get_all_factors 方法
9374
9568
  :rtype: MultiFactorBase
9375
9569
  """
9376
9570
  @typing.overload
9377
9571
  def MF_Weight() -> MultiFactorBase:
9378
9572
  ...
9379
9573
  @typing.overload
9380
- def MF_Weight(inds: typing.Sequence, stks: typing.Sequence, weights: typing.Sequence, query: Query, ref_stk: typing.Any = None, ic_n: int = 5, spearman: bool = True) -> MultiFactorBase:
9574
+ def MF_Weight(inds: typing.Sequence, stks: typing.Sequence, weights: typing.Sequence, query: Query, ref_stk: typing.Any = None, ic_n: int = 5, spearman: bool = True, mode: int = 0, save_all_factors: bool = False) -> MultiFactorBase:
9381
9575
  """
9382
9576
  MF_EqualWeight(inds, stks, query, ref_stk[, ic_n=5])
9383
9577
 
@@ -9390,6 +9584,8 @@ def MF_Weight(inds: typing.Sequence, stks: typing.Sequence, weights: typing.Sequ
9390
9584
  :param Stock ref_stk: 参考证券 (未指定时,默认为 sh000300 沪深300)
9391
9585
  :param int ic_n: 默认 IC 对应的 N 日收益率
9392
9586
  :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
9587
+ :param int mode: 获取截面数据时排序模式: 0-降序, 1-升序, 2-不排序
9588
+ :param bool save_all_factors: 是否保存所有因子值,影响 get_actor/get_all_factors 方法
9393
9589
  :rtype: MultiFactorBase
9394
9590
  """
9395
9591
  @typing.overload
@@ -9725,6 +9921,24 @@ def PRICELIST(data: typing.Any = None, discard: int = 0, align_dates: typing.Any
9725
9921
  :rtype: Indicator
9726
9922
  """
9727
9923
  @typing.overload
9924
+ def RANK(block: Block, ref_ind: Indicator, mode: int = 0, fill_null: bool = True, market: str = 'SH') -> Indicator:
9925
+ ...
9926
+ @typing.overload
9927
+ def RANK(stks: typing.Sequence, ref_ind: Indicator, mode: int = 0, fill_null: bool = True, market: str = 'SH') -> Indicator:
9928
+ """
9929
+ RANK(stks, ref_ind, mode = 0, fill_null = true, market = 'SH')
9930
+
9931
+ 计算指标值在指定板块中的排名
9932
+
9933
+ :param stks: 指定证券列表 或 Block
9934
+ :param ref_ind: 参考指标
9935
+ :param mode: 排序方式: 0-降序排名(指标值最高值排名为1), 1-升序排名(指标值越大排名值越大), 2-降序排名百分比, 3-升序排名百分比
9936
+ :param fill_null: 是否填充缺失值
9937
+ :param market: 板块所属市场
9938
+ :return: 指标值在指定板块中的排名
9939
+ :rtype: Indicator
9940
+ """
9941
+ @typing.overload
9728
9942
  def RECOVER_BACKWARD() -> Indicator:
9729
9943
  ...
9730
9944
  @typing.overload
@@ -10051,6 +10265,14 @@ def SAFTYLOSS(data: Indicator, n1: Indicator, n2: Indicator, p: Indicator) -> In
10051
10265
  :param float|Indicator|IndParam p: 噪音系数
10052
10266
  :rtype: Indicator
10053
10267
  """
10268
+ def SE_EvaluateOptimal(arg0: typing.Any) -> SelectorBase:
10269
+ """
10270
+ SE_EvaluateOptimal(evalulate_func)
10271
+
10272
+ 使用自定义函数进行寻优的选择器
10273
+
10274
+ :param func: 一个可调用对象,接收参数为 (sys, lastdate),返回一个 float 数值
10275
+ """
10054
10276
  @typing.overload
10055
10277
  def SE_Fixed(weight: float = 1.0) -> SelectorBase:
10056
10278
  ...
@@ -12776,6 +12998,14 @@ def UPNDAY(data: Indicator, n: Indicator) -> Indicator:
12776
12998
  :param int|Indicator|IndParam n: 时间窗口
12777
12999
  :rtype: Indicator
12778
13000
  """
13001
+ def UTCOffset() -> TimeDelta:
13002
+ """
13003
+ UTCOffset()
13004
+
13005
+ 获取当前系统 UTC 偏移量
13006
+
13007
+ :rtype: TimeDelta
13008
+ """
12779
13009
  @typing.overload
12780
13010
  def VAR(n: int = 10) -> Indicator:
12781
13011
  ...
@@ -12898,6 +13128,217 @@ def WINNER(arg0: float) -> Indicator:
12898
13128
  该函数仅对日线分析周期有效,且仅对存在流通盘权息数据的证券有效,对指数、基金等无效。
12899
13129
  """
12900
13130
  @typing.overload
13131
+ def WITHDAY(fill_null: bool = False) -> Indicator:
13132
+ ...
13133
+ @typing.overload
13134
+ def WITHDAY(ind: Indicator, fill_null: bool = False) -> Indicator:
13135
+ """
13136
+ WITHDAY([ind, fill_null])
13137
+
13138
+ 将指标数据转换到日线
13139
+
13140
+ :param Indicator ind: 指标数据
13141
+ :param bool fill_null: 是否填充空值
13142
+ :rtype: Indicator
13143
+ """
13144
+ @typing.overload
13145
+ def WITHHALFYEAR(fill_null: bool = False) -> Indicator:
13146
+ ...
13147
+ @typing.overload
13148
+ def WITHHALFYEAR(ind: Indicator, fill_null: bool = False) -> Indicator:
13149
+ """
13150
+ WITHHALFYEAR([ind, fill_null])
13151
+
13152
+ 将指标数据转换到半年线
13153
+
13154
+ :param Indicator ind: 指标数据
13155
+ :param bool fill_null: 是否填充空值
13156
+ :rtype: Indicator
13157
+ """
13158
+ @typing.overload
13159
+ def WITHHOUR(fill_null: bool = False) -> Indicator:
13160
+ ...
13161
+ @typing.overload
13162
+ def WITHHOUR(ind: Indicator, fill_null: bool = False) -> Indicator:
13163
+ """
13164
+ WITHHOUR([ind, fill_null])
13165
+
13166
+ 将指标数据转换到60分钟线
13167
+
13168
+ :param Indicator ind: 指标数据
13169
+ :param bool fill_null: 是否填充空值
13170
+ :rtype: Indicator
13171
+ """
13172
+ @typing.overload
13173
+ def WITHHOUR2(fill_null: bool = False) -> Indicator:
13174
+ ...
13175
+ @typing.overload
13176
+ def WITHHOUR2(ind: Indicator, fill_null: bool = False) -> Indicator:
13177
+ """
13178
+ WITHHOUR2([ind, fill_null])
13179
+
13180
+ 将指标数据转换到2小时线
13181
+
13182
+ :param Indicator ind: 指标数据
13183
+ :param bool fill_null: 是否填充空值
13184
+ :rtype: Indicator
13185
+ """
13186
+ @typing.overload
13187
+ def WITHHOUR4(fill_null: bool = False) -> Indicator:
13188
+ ...
13189
+ @typing.overload
13190
+ def WITHHOUR4(ind: Indicator, fill_null: bool = False) -> Indicator:
13191
+ """
13192
+ WITHHOUR4([ind, fill_null])
13193
+
13194
+ 将指标数据转换到4小时线
13195
+
13196
+ :param Indicator ind: 指标数据
13197
+ :param bool fill_null: 是否填充空值
13198
+ :rtype: Indicator
13199
+ """
13200
+ @typing.overload
13201
+ def WITHKTYPE(ktype: str, fill_null: bool = False) -> Indicator:
13202
+ ...
13203
+ @typing.overload
13204
+ def WITHKTYPE(ind: Indicator, ktype: str, fill_null: bool = False) -> Indicator:
13205
+ """
13206
+ WITHKTYPE([ind, ktype, fill_null])
13207
+
13208
+ 将指标数据转换到指定周期
13209
+
13210
+ :param Indicator ind: 指标数据
13211
+ :param KQuery.KType ktype: 指标周期
13212
+ :param bool fill_null: 是否填充空值
13213
+ :rtype: Indicator
13214
+ """
13215
+ @typing.overload
13216
+ def WITHMIN(fill_null: bool = False) -> Indicator:
13217
+ ...
13218
+ @typing.overload
13219
+ def WITHMIN(ind: Indicator, fill_null: bool = False) -> Indicator:
13220
+ """
13221
+ WITHMIN([ind, fill_null])
13222
+
13223
+ 将指标数据转换到分钟线
13224
+
13225
+ :param Indicator ind: 指标数据
13226
+ :param bool fill_null: 是否填充空值
13227
+ :rtype: Indicator
13228
+ """
13229
+ @typing.overload
13230
+ def WITHMIN15(fill_null: bool = False) -> Indicator:
13231
+ ...
13232
+ @typing.overload
13233
+ def WITHMIN15(ind: Indicator, fill_null: bool = False) -> Indicator:
13234
+ """
13235
+ WITHMIN15([ind, fill_null])
13236
+
13237
+ 将指标数据转换到15分钟线
13238
+
13239
+ :param Indicator ind: 指标数据
13240
+ :param bool fill_null: 是否填充空值
13241
+ :rtype: Indicator
13242
+ """
13243
+ @typing.overload
13244
+ def WITHMIN30(fill_null: bool = False) -> Indicator:
13245
+ ...
13246
+ @typing.overload
13247
+ def WITHMIN30(ind: Indicator, fill_null: bool = False) -> Indicator:
13248
+ """
13249
+ WITHMIN30([ind, fill_null])
13250
+
13251
+ 将指标数据转换到30分钟线
13252
+
13253
+ :param Indicator ind: 指标数据
13254
+ :param bool fill_null: 是否填充空值
13255
+ :rtype: Indicator
13256
+ """
13257
+ @typing.overload
13258
+ def WITHMIN5(fill_null: bool = False) -> Indicator:
13259
+ ...
13260
+ @typing.overload
13261
+ def WITHMIN5(ind: Indicator, fill_null: bool = False) -> Indicator:
13262
+ """
13263
+ WITHMIN5([ind, fill_null])
13264
+
13265
+ 将指标数据转换到5分钟线
13266
+
13267
+ :param Indicator ind: 指标数据
13268
+ :param bool fill_null: 是否填充空值
13269
+ :rtype: Indicator
13270
+ """
13271
+ @typing.overload
13272
+ def WITHMIN60(fill_null: bool = False) -> Indicator:
13273
+ ...
13274
+ @typing.overload
13275
+ def WITHMIN60(ind: Indicator, fill_null: bool = False) -> Indicator:
13276
+ """
13277
+ WITHMIN60([ind, fill_null])
13278
+
13279
+ 将指标数据转换到60分钟线
13280
+
13281
+ :param Indicator ind: 指标数据
13282
+ :param bool fill_null: 是否填充空值
13283
+ :rtype: Indicator
13284
+ """
13285
+ @typing.overload
13286
+ def WITHMONTH(fill_null: bool = False) -> Indicator:
13287
+ ...
13288
+ @typing.overload
13289
+ def WITHMONTH(ind: Indicator, fill_null: bool = False) -> Indicator:
13290
+ """
13291
+ WITHMONTH([ind, fill_null])
13292
+
13293
+ 将指标数据转换到月线
13294
+
13295
+ :param Indicator ind: 指标数据
13296
+ :param bool fill_null: 是否填充空值
13297
+ :rtype: Indicator
13298
+ """
13299
+ @typing.overload
13300
+ def WITHQUARTER(fill_null: bool = False) -> Indicator:
13301
+ ...
13302
+ @typing.overload
13303
+ def WITHQUARTER(ind: Indicator, fill_null: bool = False) -> Indicator:
13304
+ """
13305
+ WITHQUARTER([ind, fill_null])
13306
+
13307
+ 将指标数据转换到季线
13308
+
13309
+ :param Indicator ind: 指标数据
13310
+ :param bool fill_null: 是否填充空值
13311
+ :rtype: Indicator
13312
+ """
13313
+ @typing.overload
13314
+ def WITHWEEK(fill_null: bool = False) -> Indicator:
13315
+ ...
13316
+ @typing.overload
13317
+ def WITHWEEK(ind: Indicator, fill_null: bool = False) -> Indicator:
13318
+ """
13319
+ WITHWEEK([ind, fill_null])
13320
+
13321
+ 将指标数据转换到周线
13322
+
13323
+ :param Indicator ind: 指标数据
13324
+ :param bool fill_null: 是否填充空值
13325
+ :rtype: Indicator
13326
+ """
13327
+ @typing.overload
13328
+ def WITHYEAR(fill_null: bool = False) -> Indicator:
13329
+ ...
13330
+ @typing.overload
13331
+ def WITHYEAR(ind: Indicator, fill_null: bool = False) -> Indicator:
13332
+ """
13333
+ WITHYEAR([ind, fill_null])
13334
+
13335
+ 将指标数据转换到年线
13336
+
13337
+ :param Indicator ind: 指标数据
13338
+ :param bool fill_null: 是否填充空值
13339
+ :rtype: Indicator
13340
+ """
13341
+ @typing.overload
12901
13342
  def WMA(n: int = 22) -> Indicator:
12902
13343
  ...
12903
13344
  @typing.overload
@@ -12992,10 +13433,10 @@ def active_device(arg0: str) -> None:
12992
13433
  :param str active_code: 授权码
12993
13434
  """
12994
13435
  @typing.overload
12995
- def backtest(context: StrategyContext, on_bar: typing.Any, tm: TradeManager, start_date: Datetime, end_date: Datetime = ..., ktype: str = 'DAY', ref_market: str = 'SH', mode: int = 0) -> None:
13436
+ def backtest(context: StrategyContext, on_bar: typing.Any, tm: TradeManager, start_date: Datetime, end_date: Datetime = ..., ktype: str = 'DAY', ref_market: str = 'SH', mode: int = 0, support_short: bool = False, sp: SlippageBase = None) -> None:
12996
13437
  ...
12997
13438
  @typing.overload
12998
- def backtest(on_bar: typing.Any, tm: TradeManager, start_date: Datetime, end_date: Datetime = ..., ktype: str = 'DAY', ref_market: str = 'SH', mode: int = 0) -> None:
13439
+ def backtest(on_bar: typing.Any, tm: TradeManager, start_date: Datetime, end_date: Datetime = ..., ktype: str = 'DAY', ref_market: str = 'SH', mode: int = 0, support_short: bool = False, sp: SlippageBase = None) -> None:
12999
13440
  """
13000
13441
  backtest([context], on_bar, tm, start_date, end_date, ktype, ref_market, mode)
13001
13442
 
@@ -13012,6 +13453,8 @@ def backtest(on_bar: typing.Any, tm: TradeManager, start_date: Datetime, end_dat
13012
13453
  :param Query.KType ktype: K线类型(按该类型逐 Bar 执行测试)
13013
13454
  :param str ref_market: 所属市场
13014
13455
  :param mode 模式 0: 当前bar收盘价执行买卖操作; 1: 下一bar开盘价执行买卖操作
13456
+ :param support_short: 是否支持卖空
13457
+ :param Slippage sp: 滑点算法
13015
13458
  """
13016
13459
  def batch_calculate_inds(arg0: typing.Sequence, arg1: KData) -> list:
13017
13460
  """
@@ -13217,6 +13660,12 @@ def inner_combinate_ind_analysis(arg0: Stock, arg1: Query, arg2: TradeManager, a
13217
13660
  ...
13218
13661
  def inner_combinate_ind_analysis_with_block(arg0: Block, arg1: Query, arg2: TradeManager, arg3: System, arg4: typing.Sequence, arg5: typing.Sequence, arg6: int) -> dict:
13219
13662
  ...
13663
+ def is_valid_license() -> bool:
13664
+ """
13665
+ is_valid_license()
13666
+
13667
+ 查看当前设备是否授权
13668
+ """
13220
13669
  def isinf(arg0: float) -> bool:
13221
13670
  """
13222
13671
  是否是无穷大或无穷小