hikyuu 2.6.1__py3-none-win_amd64.whl → 2.6.3__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 (91) hide show
  1. hikyuu/__init__.py +1 -1
  2. hikyuu/__init__.pyi +22 -6
  3. hikyuu/analysis/__init__.pyi +16 -0
  4. hikyuu/analysis/analysis.pyi +17 -1
  5. hikyuu/core.pyi +18 -2
  6. hikyuu/cpp/core310.pyd +0 -0
  7. hikyuu/cpp/core310.pyi +391 -45
  8. hikyuu/cpp/core311.pyd +0 -0
  9. hikyuu/cpp/core311.pyi +391 -45
  10. hikyuu/cpp/core312.pyd +0 -0
  11. hikyuu/cpp/core312.pyi +391 -45
  12. hikyuu/cpp/core313.pyd +0 -0
  13. hikyuu/cpp/core313.pyi +391 -45
  14. hikyuu/cpp/core39.pyd +0 -0
  15. hikyuu/cpp/core39.pyi +391 -45
  16. hikyuu/cpp/hikyuu.dll +0 -0
  17. hikyuu/cpp/hikyuu.lib +0 -0
  18. hikyuu/cpp/sqlite3.dll +0 -0
  19. hikyuu/draw/__init__.pyi +1 -1
  20. hikyuu/draw/drawplot/__init__.pyi +1 -1
  21. hikyuu/draw/drawplot/bokeh_draw.pyi +19 -3
  22. hikyuu/draw/drawplot/echarts_draw.pyi +19 -3
  23. hikyuu/draw/drawplot/matplotlib_draw.py +22 -0
  24. hikyuu/draw/drawplot/matplotlib_draw.pyi +19 -3
  25. hikyuu/draw/kaufman.py +2 -2
  26. hikyuu/draw/kaufman.pyi +2 -2
  27. hikyuu/extend.py +0 -14
  28. hikyuu/extend.pyi +19 -6
  29. hikyuu/hub.pyi +6 -6
  30. hikyuu/include/hikyuu/Block.h +20 -0
  31. hikyuu/include/hikyuu/KQuery.h +8 -0
  32. hikyuu/include/hikyuu/Stock.h +1 -1
  33. hikyuu/include/hikyuu/StockManager.h +6 -0
  34. hikyuu/include/hikyuu/indicator/Indicator.h +5 -0
  35. hikyuu/include/hikyuu/indicator/IndicatorImp.h +8 -3
  36. hikyuu/include/hikyuu/indicator/crt/CONTEXT.h +6 -2
  37. hikyuu/include/hikyuu/indicator/crt/INSUM.h +5 -10
  38. hikyuu/include/hikyuu/indicator/crt/RSI.h +2 -18
  39. hikyuu/include/hikyuu/plugin/backtest.h +3 -2
  40. hikyuu/include/hikyuu/plugin/extind.h +150 -0
  41. hikyuu/include/hikyuu/plugin/interface/BackTestPluginInterface.h +2 -1
  42. hikyuu/include/hikyuu/plugin/interface/ExtendIndicatorsPluginInterface.h +26 -0
  43. hikyuu/include/hikyuu/plugin/interface/plugins.h +2 -0
  44. hikyuu/include/hikyuu/strategy/BrokerTradeManager.h +7 -5
  45. hikyuu/include/hikyuu/strategy/Strategy.h +22 -9
  46. hikyuu/include/hikyuu/trade_manage/OrderBrokerBase.h +11 -4
  47. hikyuu/include/hikyuu/trade_manage/TradeManager.h +8 -5
  48. hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +6 -4
  49. hikyuu/include/hikyuu/trade_manage/TradeRecord.h +9 -1
  50. hikyuu/include/hikyuu/trade_sys/multifactor/MultiFactorBase.h +8 -5
  51. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_EqualWeight.h +4 -1
  52. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_ICIRWeight.h +4 -1
  53. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_ICWeight.h +4 -1
  54. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_Weight.h +4 -1
  55. hikyuu/include/hikyuu/trade_sys/multifactor/imp/EqualWeightMultiFactor.h +2 -1
  56. hikyuu/include/hikyuu/trade_sys/multifactor/imp/ICIRMultiFactor.h +2 -1
  57. hikyuu/include/hikyuu/trade_sys/multifactor/imp/ICMultiFactor.h +2 -1
  58. hikyuu/include/hikyuu/trade_sys/multifactor/imp/WeightMultiFactor.h +1 -1
  59. hikyuu/include/hikyuu/trade_sys/system/TradeRequest.h +7 -4
  60. hikyuu/include/hikyuu/trade_sys/system/imp/WalkForwardTradeManager.h +17 -13
  61. hikyuu/include/hikyuu/utilities/thread/{MQStealThreadPool.h → GlobalMQStealThreadPool.h} +12 -12
  62. hikyuu/include/hikyuu/utilities/thread/GlobalMQThreadPool.h +271 -0
  63. hikyuu/include/hikyuu/utilities/thread/{StealThreadPool.h → GlobalStealThreadPool.h} +11 -10
  64. hikyuu/include/hikyuu/utilities/thread/GlobalThreadPool.h +224 -0
  65. hikyuu/include/hikyuu/utilities/thread/InterruptFlag.h +16 -0
  66. hikyuu/include/hikyuu/utilities/thread/MQThreadPool.h +27 -70
  67. hikyuu/include/hikyuu/utilities/thread/ThreadPool.h +18 -53
  68. hikyuu/include/hikyuu/utilities/thread/ThreadSafeQueue.h +4 -0
  69. hikyuu/include/hikyuu/utilities/thread/algorithm.h +9 -9
  70. hikyuu/include/hikyuu/utilities/thread/thread.h +4 -0
  71. hikyuu/include/hikyuu/version.h +4 -4
  72. hikyuu/plugin/backtest.dll +0 -0
  73. hikyuu/plugin/dataserver.dll +0 -0
  74. hikyuu/plugin/device.dll +0 -0
  75. hikyuu/plugin/extind.dll +0 -0
  76. hikyuu/plugin/import2hdf5.dll +0 -0
  77. hikyuu/trade_manage/__init__.pyi +19 -3
  78. hikyuu/trade_manage/broker.py +8 -8
  79. hikyuu/trade_manage/broker.pyi +4 -4
  80. hikyuu/trade_manage/broker_easytrader.py +3 -3
  81. hikyuu/trade_manage/broker_easytrader.pyi +2 -2
  82. hikyuu/trade_manage/broker_mail.py +2 -2
  83. hikyuu/trade_manage/broker_mail.pyi +2 -2
  84. hikyuu/trade_manage/trade.pyi +19 -3
  85. hikyuu/util/singleton.pyi +1 -1
  86. {hikyuu-2.6.1.dist-info → hikyuu-2.6.3.dist-info}/METADATA +1 -1
  87. {hikyuu-2.6.1.dist-info → hikyuu-2.6.3.dist-info}/RECORD +91 -86
  88. {hikyuu-2.6.1.dist-info → hikyuu-2.6.3.dist-info}/LICENSE +0 -0
  89. {hikyuu-2.6.1.dist-info → hikyuu-2.6.3.dist-info}/WHEEL +0 -0
  90. {hikyuu-2.6.1.dist-info → hikyuu-2.6.3.dist-info}/entry_points.txt +0 -0
  91. {hikyuu-2.6.1.dist-info → hikyuu-2.6.3.dist-info}/top_level.txt +0 -0
hikyuu/cpp/core311.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', '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_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', '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', '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
  """
@@ -1804,6 +1816,15 @@ class Indicator:
1804
1816
  """
1805
1817
  克隆操作
1806
1818
  """
1819
+ def contains(self, arg0: str) -> bool:
1820
+ """
1821
+ contains(self, name)
1822
+
1823
+ 获取指标公式中是否包含指定名称的指标
1824
+
1825
+ :param str name: 指定的指标名称
1826
+ :rtype: bool
1827
+ """
1807
1828
  def empty(self) -> bool:
1808
1829
  """
1809
1830
  是否为空
@@ -2056,6 +2077,8 @@ class IndicatorImp:
2056
2077
  ...
2057
2078
  def clone(self) -> IndicatorImp:
2058
2079
  ...
2080
+ def contains(self, arg0: str) -> bool:
2081
+ ...
2059
2082
  def get_ind_param(self, arg0: str) -> ...:
2060
2083
  ...
2061
2084
  def get_param(self, arg0: str) -> any:
@@ -3136,9 +3159,9 @@ class OrderBrokerBase:
3136
3159
  ...
3137
3160
  def __str__(self) -> str:
3138
3161
  ...
3139
- def _buy(self, arg0: Datetime, arg1: str, arg2: str, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart) -> None:
3162
+ def _buy(self, arg0: Datetime, arg1: str, arg2: str, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart, arg8: str) -> None:
3140
3163
  """
3141
- _buy(self, datetime, market, code, price, num, stoploss, goal_price, part_from)
3164
+ _buy(self, datetime, market, code, price, num, stoploss, goal_price, part_from, remark)
3142
3165
 
3143
3166
  【子类接口】执行买入操作
3144
3167
 
@@ -3149,7 +3172,8 @@ class OrderBrokerBase:
3149
3172
  :param float num: 买入数量
3150
3173
  :param float stoploss: 计划止损价
3151
3174
  :param float goal_price: 计划盈利目标价
3152
- :param SystemPart part_from: 信号来源
3175
+ :param SystemPart part_from: 信号来源,
3176
+ :param str remark: 订单备注
3153
3177
  """
3154
3178
  def _get_asset_info(self) -> str:
3155
3179
  """
@@ -3171,9 +3195,9 @@ class OrderBrokerBase:
3171
3195
  :return: 以字符串(json格式)方式返回当前资产信息
3172
3196
  :rtype: str
3173
3197
  """
3174
- def _sell(self, arg0: Datetime, arg1: str, arg2: str, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart) -> None:
3198
+ def _sell(self, arg0: Datetime, arg1: str, arg2: str, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart, arg8: str) -> None:
3175
3199
  """
3176
- _sell(self, datetime, market, code, price, num, stoploss, goal_price, part_from)
3200
+ _sell(self, datetime, market, code, price, num, stoploss, goal_price, part_from, remark)
3177
3201
 
3178
3202
  【子类接口】执行卖出操作
3179
3203
 
@@ -3185,8 +3209,9 @@ class OrderBrokerBase:
3185
3209
  :param float stoploss: 计划止损价
3186
3210
  :param float goal_price: 计划盈利目标价
3187
3211
  :param SystemPart part_from: 信号来源
3212
+ :param str remark: 订单备注
3188
3213
  """
3189
- def buy(self, arg0: Datetime, arg1: str, arg2: str, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart) -> None:
3214
+ def buy(self, arg0: Datetime, arg1: str, arg2: str, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart, arg8: str) -> None:
3190
3215
  """
3191
3216
  详情见子类实现接口: _buy
3192
3217
  """
@@ -3194,7 +3219,7 @@ class OrderBrokerBase:
3194
3219
  """
3195
3220
  详情见子类实现接口: _get_asset_info
3196
3221
  """
3197
- def sell(self, arg0: Datetime, arg1: str, arg2: str, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart) -> None:
3222
+ def sell(self, arg0: Datetime, arg1: str, arg2: str, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart, arg8: str) -> None:
3198
3223
  """
3199
3224
  详情见子类实现接口: _sell
3200
3225
  """
@@ -5140,6 +5165,16 @@ class StockManager:
5140
5165
 
5141
5166
  :rtype: StringList
5142
5167
  """
5168
+ def get_market_stock(self, arg0: str) -> ...:
5169
+ """
5170
+ get_market_stock(self, market)
5171
+
5172
+ 获取指定市场的代表指数(可能为空)
5173
+
5174
+ :param string market: 指定的市场标识(市场简称)
5175
+ :return: 相应的市场代表指数,如果相应的市场信息不存在,则返回Null<Stock>()
5176
+ :rtype: Stock
5177
+ """
5143
5178
  def get_plugin_path(self) -> str:
5144
5179
  """
5145
5180
  get_plugin_path(self)
@@ -5639,20 +5674,52 @@ class Strategy:
5639
5674
  :param str name: 策略名称
5640
5675
  :param str config: 配置文件名称(如需要使用独立的配置文件,否则为空时使用默认的hikyuu配置文件)
5641
5676
  """
5642
- def buy(self, stock: Stock, price: float, num: float, stoploss: float = 0.0, goal_price: float = 0.0, part: SystemPart = ...) -> TradeRecord:
5677
+ def buy(self, stock: Stock, price: float, num: float, stoploss: float = 0.0, goal_price: float = 0.0, part: SystemPart = ..., remark: str = '') -> TradeRecord:
5643
5678
  ...
5644
5679
  def get_kdata(self, stk: Stock, start_date: Datetime, end_date: Datetime, ktype: str, recover_type: Query.RecoverType = ...) -> KData:
5645
- ...
5680
+ """
5681
+ get_kdata(self, stk, start_date, end_date, ktype, recover_type)
5682
+
5683
+ 获取指定证券指定日期范围内的K线数据(为保证实盘和回测一致,请使用本方法获取K线数据)
5684
+ :param Stock stk: 指定的证券
5685
+ :param Datetime start_date: 开始日期
5686
+ :param Datetime end_date: 结束日期
5687
+ :param KQuery.KType ktype: K线类型
5688
+ :param KQuery.RecoverType recover_type: 恢复方式
5689
+ :return: K线数据
5690
+ :rtype: KData
5691
+ """
5646
5692
  @typing.overload
5647
5693
  def get_last_kdata(self, stk: Stock, start_date: Datetime, ktype: str, recover_type: Query.RecoverType = ...) -> KData:
5648
5694
  ...
5649
5695
  @typing.overload
5650
5696
  def get_last_kdata(self, stk: Stock, lastnum: int, ktype: str, recover_type: Query.RecoverType = ...) -> KData:
5651
- ...
5697
+ """
5698
+ get_last_kdata(self, stk, start_date, ktype, recover_type)
5699
+
5700
+ 获取指定证券从指定日期开始到当前时间的对应K线数据(为保证实盘和回测一致,请使用本方法获取K线数据)
5701
+
5702
+ 或 指定当前能获取到的最后 last_num 条 K线数据(为保证实盘和回测一致,请使用本方法获取K线数据)
5703
+
5704
+ :param Stock stk: 指定的证券
5705
+ :param Datetime start_date: 开始日期 (或为 int 类型,表示从当前日期往前推多少个交易日)
5706
+ :param KQuery.KType ktype: K线类型
5707
+ :param KQuery.RecoverType recover_type: 恢复方式
5708
+ :return: K线数据
5709
+ :rtype: KData
5710
+ """
5652
5711
  def next_datetime(self) -> Datetime:
5653
- ...
5712
+ """
5713
+ next_datetime(self)
5714
+
5715
+ 下一交易时间点(回测使用)
5716
+ """
5654
5717
  def now(self) -> Datetime:
5655
- ...
5718
+ """
5719
+ now(self)
5720
+
5721
+ 获取当前时间(使用该方法而不是 Datatime.now(), 以便回测和实盘一直)
5722
+ """
5656
5723
  def on_change(self, arg0: typing.Any) -> None:
5657
5724
  """
5658
5725
  onchang(self, func)
@@ -5669,6 +5736,24 @@ class Strategy:
5669
5736
 
5670
5737
  :param func: 可调用对象如普通函数, func(stg: Strategy, revTime: Datetime)
5671
5738
  """
5739
+ def order(self, stock: Stock, num: float, remark: str = '') -> TradeRecord:
5740
+ """
5741
+ order(self, stk, num, remark='')
5742
+
5743
+ 按数量下单(正数为买入,负数为卖出)
5744
+ :param Stock stk: 指定的证券
5745
+ :param int num: 下单数量
5746
+ :param str remark: 下单备注
5747
+ """
5748
+ def order_value(self, stock: Stock, price: float, remark: str = '') -> TradeRecord:
5749
+ """
5750
+ order_value(self, stk, value, remark='')
5751
+
5752
+ 按预期的证劵市值下单,即希望买入多少钱的证券(正数为买入,负数为卖出)
5753
+ :param Stock stk: 指定的证券
5754
+ :param float value: 投入买入资金
5755
+ :param str remark: 下单备注
5756
+ """
5672
5757
  def run_daily(self, func: typing.Any, time: TimeDelta, market: str = 'SH', ignore_market: bool = False) -> None:
5673
5758
  """
5674
5759
  run_daily(self, func)
@@ -5691,7 +5776,7 @@ class Strategy:
5691
5776
  :param TimeDelta time: 执行时刻,如每日15点:TimeDelta(0, 15)
5692
5777
  :param ignore_holiday: 节假日不执行
5693
5778
  """
5694
- def sell(self, stock: Stock, price: float, num: float, stoploss: float = 0.0, goal_price: float = 0.0, part: SystemPart = ...) -> TradeRecord:
5779
+ def sell(self, stock: Stock, price: float, num: float, stoploss: float = 0.0, goal_price: float = 0.0, part: SystemPart = ..., remark: str = '') -> TradeRecord:
5695
5780
  ...
5696
5781
  def start(self, auto_recieve_spot: bool = True) -> None:
5697
5782
  """
@@ -5702,7 +5787,11 @@ class Strategy:
5702
5787
  :param bool auto_recieve_spot: 是否自动接收行情数据
5703
5788
  """
5704
5789
  def today(self) -> Datetime:
5705
- ...
5790
+ """
5791
+ today(self)
5792
+
5793
+ 获取当前交易日日期(使用该方法而不是 Datatime.today(), 以便回测和实盘一直)
5794
+ """
5706
5795
  @property
5707
5796
  def context(self) -> StrategyContext:
5708
5797
  """
@@ -5749,8 +5838,24 @@ class StrategyContext:
5749
5838
  @staticmethod
5750
5839
  def _pybind11_conduit_v1_(*args, **kwargs):
5751
5840
  ...
5752
- def __init__(self, stock_code_list = None):
5841
+ @typing.overload
5842
+ def __init__(self) -> None:
5753
5843
  ...
5844
+ @typing.overload
5845
+ def __init__(self, arg0: list[str]) -> None:
5846
+ ...
5847
+ @typing.overload
5848
+ def __init__(self, stock_list: list[str], ktype_list: list[str], preload_num: dict[str, int] = {}) -> None:
5849
+ """
5850
+ __init__(self, stock_list, ktype_list, [preload_num={}])
5851
+
5852
+ 创建策略上下文
5853
+
5854
+ :param stock_list: 需要加载的证券代码列表,如:["sz000001", "sz000002"], 如包含 'ALL', 表示加载全部
5855
+ :param ktype_list: 需要加载的K线类型列表, 如:["day", "min"], 未指定时取全局配置文件中配置的默认值
5856
+ :param preload_num: 预加载数量,默认为空,如:{"min_max": 100, "day_max": 200}. 未指定时取全局配置文件中配置的默认值
5857
+ :return: 策略上下文对象
5858
+ """
5754
5859
  def __repr__(self) -> str:
5755
5860
  ...
5756
5861
  def __str__(self) -> str:
@@ -6828,9 +6933,9 @@ class TradeManager:
6828
6933
  ...
6829
6934
  def borrow_stock(self, arg0: Datetime, arg1: Stock, arg2: float, arg3: float) -> bool:
6830
6935
  ...
6831
- 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:
6936
+ 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:
6832
6937
  """
6833
- buy(self, datetime, stock, real_price, number[, stoploss=0.0, goal_price=0.0, plan_price=0.0, part=System.INVALID])
6938
+ buy(self, datetime, stock, real_price, number[, stoploss=0.0, goal_price=0.0, plan_price=0.0, part=System.INVALID, remark=""])
6834
6939
 
6835
6940
  买入操作
6836
6941
 
@@ -6842,9 +6947,10 @@ class TradeManager:
6842
6947
  :param float goal_price: 目标价格
6843
6948
  :param float plan_price: 计划买入价格
6844
6949
  :param SystemPart part: 交易指示来源
6950
+ :param string remark: 备注信息
6845
6951
  :rtype: TradeRecord
6846
6952
  """
6847
- def buy_short(self, arg0: Datetime, arg1: Stock, arg2: float, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart) -> TradeRecord:
6953
+ def buy_short(self, arg0: Datetime, arg1: Stock, arg2: float, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart, arg8: str) -> TradeRecord:
6848
6954
  ...
6849
6955
  def cash(self, datetime: Datetime, ktype: str = 'DAY') -> float:
6850
6956
  """
@@ -7092,9 +7198,9 @@ class TradeManager:
7092
7198
  ...
7093
7199
  def return_stock(self, arg0: Datetime, arg1: Stock, arg2: float, arg3: float) -> bool:
7094
7200
  ...
7095
- 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:
7201
+ 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:
7096
7202
  """
7097
- sell(self, datetime, stock, realPrice[, number=constant.max_double, stoploss=0.0, goal_price=0.0, plan_price=0.0, part=System.INVALID])
7203
+ sell(self, datetime, stock, realPrice[, number=constant.max_double, stoploss=0.0, goal_price=0.0, plan_price=0.0, part=System.INVALID, remark=""])
7098
7204
 
7099
7205
  卖出操作
7100
7206
 
@@ -7106,9 +7212,10 @@ class TradeManager:
7106
7212
  :param float goal_price: 新的目标价格
7107
7213
  :param float plan_price: 原计划卖出价格
7108
7214
  :param SystemPart part: 交易指示来源
7215
+ :param string remark: 交易备注
7109
7216
  :rtype: TradeRecord
7110
7217
  """
7111
- def sell_short(self, arg0: Datetime, arg1: Stock, arg2: float, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart) -> TradeRecord:
7218
+ def sell_short(self, arg0: Datetime, arg1: Stock, arg2: float, arg3: float, arg4: float, arg5: float, arg6: float, arg7: SystemPart, arg8: str) -> TradeRecord:
7112
7219
  ...
7113
7220
  def set_param(self, arg0: str, arg1: any) -> None:
7114
7221
  """
@@ -7289,6 +7396,14 @@ class TradeRecord:
7289
7396
  def real_price(self, arg0: float) -> None:
7290
7397
  ...
7291
7398
  @property
7399
+ def remark(self) -> str:
7400
+ """
7401
+ 备注
7402
+ """
7403
+ @remark.setter
7404
+ def remark(self, arg0: str) -> None:
7405
+ ...
7406
+ @property
7292
7407
  def stock(self) -> Stock:
7293
7408
  """
7294
7409
  股票(Stock)
@@ -8053,10 +8168,10 @@ def CN_OPLine(arg0: Indicator) -> ConditionBase:
8053
8168
  :rtype: ConditionBase
8054
8169
  """
8055
8170
  @typing.overload
8056
- def CONTEXT(fill_null: bool = True) -> Indicator:
8171
+ def CONTEXT(fill_null: bool = False, use_self_ktype: bool = False, use_self_recover_type: bool = False) -> Indicator:
8057
8172
  ...
8058
8173
  @typing.overload
8059
- def CONTEXT(ind: Indicator, fill_null: bool = True) -> Indicator:
8174
+ def CONTEXT(ind: Indicator, fill_null: bool = False, use_self_ktype: bool = False, use_self_recover_type: bool = False) -> Indicator:
8060
8175
  """
8061
8176
  CONTEXT(ind)
8062
8177
 
@@ -8065,7 +8180,9 @@ def CONTEXT(ind: Indicator, fill_null: bool = True) -> Indicator:
8065
8180
  则需使用 ind = CONTEXT(CLOSE(k1)), 此时 ind(k2) 将仍旧使用 k1 的收盘价。
8066
8181
 
8067
8182
  :param Indicator ind: 指标对象
8068
- :param bool fill_null: 日期对齐时,缺失日期对应填充空值
8183
+ :param bool fill_null: 日期对齐时,缺失日期对应填充空值,否则使用前值填充。
8184
+ :param bool use_self_ktype: 公式计算时使用自身独立上下文中的KTYPE
8185
+ :param bool use_self_recover_type: 公式计算时使用自身独立上下文中的RECOVER_TYPE
8069
8186
  :rtype: Indicator
8070
8187
  """
8071
8188
  def CONTEXT_K(arg0: Indicator) -> KData:
@@ -8854,18 +8971,7 @@ def INSUM(block: Block, ind: Indicator, mode: int, fill_null: bool = True) -> In
8854
8971
  ...
8855
8972
  @typing.overload
8856
8973
  def INSUM(block: Block, query: Query, ind: Indicator, mode: int, fill_null: bool = True) -> Indicator:
8857
- """
8858
- INSUM(block, query, ind, mode[, fill_null=True])
8859
-
8860
- 返回板块各成分该指标相应输出按计算类型得到的计算值.计算类型:0-累加,1-平均数,2-最大值,3-最小值.
8861
-
8862
- :param Block block: 指定板块
8863
- :param Query query: 指定范围
8864
- :param Indicator ind: 指定指标
8865
- :param int mode: 计算类型:0-累加,1-平均数,2-最大值,3-最小值.
8866
- :param bool fill_null: 日期对齐时缺失数据填充 nan 值。
8867
- :rtype: Indicator
8868
- """
8974
+ ...
8869
8975
  @typing.overload
8870
8976
  def INSUM(stks: typing.Sequence, ind: Indicator, mode: int, fill_null: bool = True) -> Indicator:
8871
8977
  ...
@@ -8874,12 +8980,14 @@ def INSUM(stks: typing.Sequence, query: Query, ind: Indicator, mode: int, fill_n
8874
8980
  """
8875
8981
  INSUM(stks, query, ind, mode[, fill_null=True])
8876
8982
 
8877
- 返回板块各成分该指标相应输出按计算类型得到的计算值.计算类型:0-累加,1-平均数,2-最大值,3-最小值.
8983
+ 返回板块各成分该指标相应输出按计算类型得到的计算值.计算类型:0-累加,1-平均数,2-最大值,3-最小值,4-降序排名,5-升序排名.
8984
+
8985
+ 注意: INSUM使用模式4/5时相当于RANK功能, 但不适合在MF中使用, 在 MF 中使用时计算量为 N x N 级别, 计算缓慢。如果希望在 MF 中使用,建议直接使用 RANK[VIP] 指标。
8878
8986
 
8879
8987
  :param Sequence stks: stock list
8880
8988
  :param Query query: 指定范围
8881
8989
  :param Indicator ind: 指定指标
8882
- :param int mode: 计算类型:0-累加,1-平均数,2-最大值,3-最小值.
8990
+ :param int mode: 计算类型:0-累加,1-平均数,2-最大值,3-最小值,4-降序排名(指标值最高的排名为1), 5-升序排名(指标值越高排名值越高)
8883
8991
  :param bool fill_null: 日期对齐时缺失数据填充 nan 值。
8884
8992
  :rtype: Indicator
8885
8993
  """
@@ -9303,7 +9411,7 @@ def MDD(arg0: Indicator) -> Indicator:
9303
9411
  def MF_EqualWeight() -> MultiFactorBase:
9304
9412
  ...
9305
9413
  @typing.overload
9306
- def MF_EqualWeight(inds: typing.Sequence, stks: typing.Sequence, query: Query, ref_stk: typing.Any = None, ic_n: int = 5, spearman: bool = True) -> MultiFactorBase:
9414
+ 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:
9307
9415
  """
9308
9416
  MF_EqualWeight(inds, stks, query, ref_stk[, ic_n=5])
9309
9417
 
@@ -9315,13 +9423,15 @@ def MF_EqualWeight(inds: typing.Sequence, stks: typing.Sequence, query: Query, r
9315
9423
  :param Stock ref_stk: 参考证券 (未指定时,默认为 sh000300 沪深300)
9316
9424
  :param int ic_n: 默认 IC 对应的 N 日收益率
9317
9425
  :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
9426
+ :param int mode: 获取截面数据时排序模式: 0-降序, 1-升序, 2-不排序
9427
+ :param bool save_all_factors: 是否保存所有因子值,影响 get_actor/get_all_factors 方法
9318
9428
  :rtype: MultiFactorBase
9319
9429
  """
9320
9430
  @typing.overload
9321
9431
  def MF_ICIRWeight() -> MultiFactorBase:
9322
9432
  ...
9323
9433
  @typing.overload
9324
- 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:
9434
+ 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:
9325
9435
  """
9326
9436
  MF_EqualWeight(inds, stks, query, ref_stk[, ic_n=5, ic_rolling_n=120])
9327
9437
 
@@ -9334,13 +9444,15 @@ def MF_ICIRWeight(inds: typing.Sequence, stks: typing.Sequence, query: Query, re
9334
9444
  :param int ic_n: 默认 IC 对应的 N 日收益率
9335
9445
  :param int ic_rolling_n: IC 滚动周期
9336
9446
  :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
9447
+ :param int mode: 获取截面数据时排序模式: 0-降序, 1-升序, 2-不排序
9448
+ :param bool save_all_factors: 是否保存所有因子值,影响 get_actor/get_all_factors 方法
9337
9449
  :rtype: MultiFactorBase
9338
9450
  """
9339
9451
  @typing.overload
9340
9452
  def MF_ICWeight() -> MultiFactorBase:
9341
9453
  ...
9342
9454
  @typing.overload
9343
- 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:
9455
+ 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:
9344
9456
  """
9345
9457
  MF_EqualWeight(inds, stks, query, ref_stk[, ic_n=5, ic_rolling_n=120])
9346
9458
 
@@ -9353,13 +9465,15 @@ def MF_ICWeight(inds: typing.Sequence, stks: typing.Sequence, query: Query, ref_
9353
9465
  :param int ic_n: 默认 IC 对应的 N 日收益率
9354
9466
  :param int ic_rolling_n: IC 滚动周期
9355
9467
  :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
9468
+ :param int mode: 获取截面数据时排序模式: 0-降序, 1-升序, 2-不排序
9469
+ :param bool save_all_factors: 是否保存所有因子值,影响 get_actor/get_all_factors 方法
9356
9470
  :rtype: MultiFactorBase
9357
9471
  """
9358
9472
  @typing.overload
9359
9473
  def MF_Weight() -> MultiFactorBase:
9360
9474
  ...
9361
9475
  @typing.overload
9362
- 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:
9476
+ 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:
9363
9477
  """
9364
9478
  MF_EqualWeight(inds, stks, query, ref_stk[, ic_n=5])
9365
9479
 
@@ -9372,6 +9486,8 @@ def MF_Weight(inds: typing.Sequence, stks: typing.Sequence, weights: typing.Sequ
9372
9486
  :param Stock ref_stk: 参考证券 (未指定时,默认为 sh000300 沪深300)
9373
9487
  :param int ic_n: 默认 IC 对应的 N 日收益率
9374
9488
  :param bool spearman: 默认使用 spearman 计算相关系数,否则为 pearson
9489
+ :param int mode: 获取截面数据时排序模式: 0-降序, 1-升序, 2-不排序
9490
+ :param bool save_all_factors: 是否保存所有因子值,影响 get_actor/get_all_factors 方法
9375
9491
  :rtype: MultiFactorBase
9376
9492
  """
9377
9493
  @typing.overload
@@ -9707,6 +9823,24 @@ def PRICELIST(data: typing.Any = None, discard: int = 0, align_dates: typing.Any
9707
9823
  :rtype: Indicator
9708
9824
  """
9709
9825
  @typing.overload
9826
+ def RANK(block: Block, ref_ind: Indicator, mode: int = 0, fill_null: bool = True, market: str = 'SH') -> Indicator:
9827
+ ...
9828
+ @typing.overload
9829
+ def RANK(stks: typing.Sequence, ref_ind: Indicator, mode: int = 0, fill_null: bool = True, market: str = 'SH') -> Indicator:
9830
+ """
9831
+ RANK(stks, ref_ind, mode = 0, fill_null = true, market = 'SH')
9832
+
9833
+ 计算指标值在指定板块中的排名
9834
+
9835
+ :param stks: 指定证券列表 或 Block
9836
+ :param ref_ind: 参考指标
9837
+ :param mode: 排序方式: 0-降序排名(指标值最高值排名为1), 1-升序排名(指标值越大排名值越大), 2-降序排名百分比, 3-升序排名百分比
9838
+ :param fill_null: 是否填充缺失值
9839
+ :param market: 板块所属市场
9840
+ :return: 指标值在指定板块中的排名
9841
+ :rtype: Indicator
9842
+ """
9843
+ @typing.overload
9710
9844
  def RECOVER_BACKWARD() -> Indicator:
9711
9845
  ...
9712
9846
  @typing.overload
@@ -12880,6 +13014,217 @@ def WINNER(arg0: float) -> Indicator:
12880
13014
  该函数仅对日线分析周期有效,且仅对存在流通盘权息数据的证券有效,对指数、基金等无效。
12881
13015
  """
12882
13016
  @typing.overload
13017
+ def WITHDAY(fill_null: bool = False) -> Indicator:
13018
+ ...
13019
+ @typing.overload
13020
+ def WITHDAY(ind: Indicator, fill_null: bool = False) -> Indicator:
13021
+ """
13022
+ WITHDAY([ind, fill_null])
13023
+
13024
+ 将指标数据转换到日线
13025
+
13026
+ :param Indicator ind: 指标数据
13027
+ :param bool fill_null: 是否填充空值
13028
+ :rtype: Indicator
13029
+ """
13030
+ @typing.overload
13031
+ def WITHHALFYEAR(fill_null: bool = False) -> Indicator:
13032
+ ...
13033
+ @typing.overload
13034
+ def WITHHALFYEAR(ind: Indicator, fill_null: bool = False) -> Indicator:
13035
+ """
13036
+ WITHHALFYEAR([ind, fill_null])
13037
+
13038
+ 将指标数据转换到半年线
13039
+
13040
+ :param Indicator ind: 指标数据
13041
+ :param bool fill_null: 是否填充空值
13042
+ :rtype: Indicator
13043
+ """
13044
+ @typing.overload
13045
+ def WITHHOUR(fill_null: bool = False) -> Indicator:
13046
+ ...
13047
+ @typing.overload
13048
+ def WITHHOUR(ind: Indicator, fill_null: bool = False) -> Indicator:
13049
+ """
13050
+ WITHHOUR([ind, fill_null])
13051
+
13052
+ 将指标数据转换到60分钟线
13053
+
13054
+ :param Indicator ind: 指标数据
13055
+ :param bool fill_null: 是否填充空值
13056
+ :rtype: Indicator
13057
+ """
13058
+ @typing.overload
13059
+ def WITHHOUR2(fill_null: bool = False) -> Indicator:
13060
+ ...
13061
+ @typing.overload
13062
+ def WITHHOUR2(ind: Indicator, fill_null: bool = False) -> Indicator:
13063
+ """
13064
+ WITHHOUR2([ind, fill_null])
13065
+
13066
+ 将指标数据转换到2小时线
13067
+
13068
+ :param Indicator ind: 指标数据
13069
+ :param bool fill_null: 是否填充空值
13070
+ :rtype: Indicator
13071
+ """
13072
+ @typing.overload
13073
+ def WITHHOUR4(fill_null: bool = False) -> Indicator:
13074
+ ...
13075
+ @typing.overload
13076
+ def WITHHOUR4(ind: Indicator, fill_null: bool = False) -> Indicator:
13077
+ """
13078
+ WITHHOUR4([ind, fill_null])
13079
+
13080
+ 将指标数据转换到4小时线
13081
+
13082
+ :param Indicator ind: 指标数据
13083
+ :param bool fill_null: 是否填充空值
13084
+ :rtype: Indicator
13085
+ """
13086
+ @typing.overload
13087
+ def WITHKTYPE(ktype: str, fill_null: bool = False) -> Indicator:
13088
+ ...
13089
+ @typing.overload
13090
+ def WITHKTYPE(ind: Indicator, ktype: str, fill_null: bool = False) -> Indicator:
13091
+ """
13092
+ WITHKTYPE([ind, ktype, fill_null])
13093
+
13094
+ 将指标数据转换到指定周期
13095
+
13096
+ :param Indicator ind: 指标数据
13097
+ :param KQuery.KType ktype: 指标周期
13098
+ :param bool fill_null: 是否填充空值
13099
+ :rtype: Indicator
13100
+ """
13101
+ @typing.overload
13102
+ def WITHMIN(fill_null: bool = False) -> Indicator:
13103
+ ...
13104
+ @typing.overload
13105
+ def WITHMIN(ind: Indicator, fill_null: bool = False) -> Indicator:
13106
+ """
13107
+ WITHMIN([ind, fill_null])
13108
+
13109
+ 将指标数据转换到分钟线
13110
+
13111
+ :param Indicator ind: 指标数据
13112
+ :param bool fill_null: 是否填充空值
13113
+ :rtype: Indicator
13114
+ """
13115
+ @typing.overload
13116
+ def WITHMIN15(fill_null: bool = False) -> Indicator:
13117
+ ...
13118
+ @typing.overload
13119
+ def WITHMIN15(ind: Indicator, fill_null: bool = False) -> Indicator:
13120
+ """
13121
+ WITHMIN15([ind, fill_null])
13122
+
13123
+ 将指标数据转换到15分钟线
13124
+
13125
+ :param Indicator ind: 指标数据
13126
+ :param bool fill_null: 是否填充空值
13127
+ :rtype: Indicator
13128
+ """
13129
+ @typing.overload
13130
+ def WITHMIN30(fill_null: bool = False) -> Indicator:
13131
+ ...
13132
+ @typing.overload
13133
+ def WITHMIN30(ind: Indicator, fill_null: bool = False) -> Indicator:
13134
+ """
13135
+ WITHMIN30([ind, fill_null])
13136
+
13137
+ 将指标数据转换到30分钟线
13138
+
13139
+ :param Indicator ind: 指标数据
13140
+ :param bool fill_null: 是否填充空值
13141
+ :rtype: Indicator
13142
+ """
13143
+ @typing.overload
13144
+ def WITHMIN5(fill_null: bool = False) -> Indicator:
13145
+ ...
13146
+ @typing.overload
13147
+ def WITHMIN5(ind: Indicator, fill_null: bool = False) -> Indicator:
13148
+ """
13149
+ WITHMIN5([ind, fill_null])
13150
+
13151
+ 将指标数据转换到5分钟线
13152
+
13153
+ :param Indicator ind: 指标数据
13154
+ :param bool fill_null: 是否填充空值
13155
+ :rtype: Indicator
13156
+ """
13157
+ @typing.overload
13158
+ def WITHMIN60(fill_null: bool = False) -> Indicator:
13159
+ ...
13160
+ @typing.overload
13161
+ def WITHMIN60(ind: Indicator, fill_null: bool = False) -> Indicator:
13162
+ """
13163
+ WITHMIN60([ind, fill_null])
13164
+
13165
+ 将指标数据转换到60分钟线
13166
+
13167
+ :param Indicator ind: 指标数据
13168
+ :param bool fill_null: 是否填充空值
13169
+ :rtype: Indicator
13170
+ """
13171
+ @typing.overload
13172
+ def WITHMONTH(fill_null: bool = False) -> Indicator:
13173
+ ...
13174
+ @typing.overload
13175
+ def WITHMONTH(ind: Indicator, fill_null: bool = False) -> Indicator:
13176
+ """
13177
+ WITHMONTH([ind, fill_null])
13178
+
13179
+ 将指标数据转换到月线
13180
+
13181
+ :param Indicator ind: 指标数据
13182
+ :param bool fill_null: 是否填充空值
13183
+ :rtype: Indicator
13184
+ """
13185
+ @typing.overload
13186
+ def WITHQUARTER(fill_null: bool = False) -> Indicator:
13187
+ ...
13188
+ @typing.overload
13189
+ def WITHQUARTER(ind: Indicator, fill_null: bool = False) -> Indicator:
13190
+ """
13191
+ WITHQUARTER([ind, fill_null])
13192
+
13193
+ 将指标数据转换到季线
13194
+
13195
+ :param Indicator ind: 指标数据
13196
+ :param bool fill_null: 是否填充空值
13197
+ :rtype: Indicator
13198
+ """
13199
+ @typing.overload
13200
+ def WITHWEEK(fill_null: bool = False) -> Indicator:
13201
+ ...
13202
+ @typing.overload
13203
+ def WITHWEEK(ind: Indicator, fill_null: bool = False) -> Indicator:
13204
+ """
13205
+ WITHWEEK([ind, fill_null])
13206
+
13207
+ 将指标数据转换到周线
13208
+
13209
+ :param Indicator ind: 指标数据
13210
+ :param bool fill_null: 是否填充空值
13211
+ :rtype: Indicator
13212
+ """
13213
+ @typing.overload
13214
+ def WITHYEAR(fill_null: bool = False) -> Indicator:
13215
+ ...
13216
+ @typing.overload
13217
+ def WITHYEAR(ind: Indicator, fill_null: bool = False) -> Indicator:
13218
+ """
13219
+ WITHYEAR([ind, fill_null])
13220
+
13221
+ 将指标数据转换到年线
13222
+
13223
+ :param Indicator ind: 指标数据
13224
+ :param bool fill_null: 是否填充空值
13225
+ :rtype: Indicator
13226
+ """
13227
+ @typing.overload
12883
13228
  def WMA(n: int = 22) -> Indicator:
12884
13229
  ...
12885
13230
  @typing.overload
@@ -12974,10 +13319,10 @@ def active_device(arg0: str) -> None:
12974
13319
  :param str active_code: 授权码
12975
13320
  """
12976
13321
  @typing.overload
12977
- 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:
13322
+ 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) -> None:
12978
13323
  ...
12979
13324
  @typing.overload
12980
- 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:
13325
+ 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) -> None:
12981
13326
  """
12982
13327
  backtest([context], on_bar, tm, start_date, end_date, ktype, ref_market, mode)
12983
13328
 
@@ -12994,6 +13339,7 @@ def backtest(on_bar: typing.Any, tm: TradeManager, start_date: Datetime, end_dat
12994
13339
  :param Query.KType ktype: K线类型(按该类型逐 Bar 执行测试)
12995
13340
  :param str ref_market: 所属市场
12996
13341
  :param mode 模式 0: 当前bar收盘价执行买卖操作; 1: 下一bar开盘价执行买卖操作
13342
+ :param support_short: 是否支持卖空
12997
13343
  """
12998
13344
  def batch_calculate_inds(arg0: typing.Sequence, arg1: KData) -> list:
12999
13345
  """