hikyuu 2.5.6__py3-none-win_amd64.whl → 2.6.0__py3-none-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. hikyuu/__init__.py +15 -0
  2. hikyuu/__init__.pyi +16 -7
  3. hikyuu/analysis/__init__.pyi +7 -0
  4. hikyuu/analysis/analysis.pyi +8 -1
  5. hikyuu/core.pyi +9 -2
  6. hikyuu/cpp/core310.pyd +0 -0
  7. hikyuu/cpp/core310.pyi +150 -19
  8. hikyuu/cpp/core311.pyd +0 -0
  9. hikyuu/cpp/core311.pyi +150 -19
  10. hikyuu/cpp/core312.pyd +0 -0
  11. hikyuu/cpp/core312.pyi +150 -19
  12. hikyuu/cpp/core313.pyd +0 -0
  13. hikyuu/cpp/core313.pyi +149 -19
  14. hikyuu/cpp/core39.pyd +0 -0
  15. hikyuu/cpp/core39.pyi +150 -19
  16. hikyuu/cpp/hikyuu.dll +0 -0
  17. hikyuu/cpp/hikyuu.lib +0 -0
  18. hikyuu/draw/drawplot/__init__.py +2 -0
  19. hikyuu/draw/drawplot/__init__.pyi +1 -0
  20. hikyuu/draw/drawplot/bokeh_draw.pyi +12 -4
  21. hikyuu/draw/drawplot/echarts_draw.pyi +12 -4
  22. hikyuu/draw/drawplot/matplotlib_draw.py +80 -0
  23. hikyuu/draw/drawplot/matplotlib_draw.pyi +22 -4
  24. hikyuu/examples/notebook/002-HowToGetStock.ipynb +1 -1
  25. hikyuu/examples/notebook/004-IndicatorOverview.ipynb +117 -52
  26. hikyuu/extend.pyi +9 -2
  27. hikyuu/gui/HikyuuTDX.py +19 -3
  28. hikyuu/gui/data/MainWindow.py +87 -24
  29. hikyuu/gui/dataserver.py +25 -0
  30. hikyuu/gui/images/star.png +0 -0
  31. hikyuu/hub.pyi +6 -6
  32. hikyuu/include/hikyuu/StockManager.h +23 -0
  33. hikyuu/include/hikyuu/global/agent/spot_generated.h +3 -3
  34. hikyuu/include/hikyuu/plugin/__init__.py +1 -0
  35. hikyuu/include/hikyuu/plugin/backtest.h +37 -0
  36. hikyuu/include/hikyuu/plugin/dataserver.h +18 -0
  37. hikyuu/include/hikyuu/plugin/device.h +29 -0
  38. hikyuu/include/hikyuu/plugin/interface/BackTestPluginInterface.h +26 -0
  39. hikyuu/include/hikyuu/plugin/interface/DataServerPluginInterface.h +23 -0
  40. hikyuu/include/hikyuu/plugin/interface/DevicePluginInterface.h +25 -0
  41. hikyuu/include/hikyuu/plugin/interface/__init__.py +1 -0
  42. hikyuu/include/hikyuu/plugin/interface/plugins.h +20 -0
  43. hikyuu/include/hikyuu/python/pybind_utils.h +8 -0
  44. hikyuu/include/hikyuu/strategy/BrokerTradeManager.h +2 -1
  45. hikyuu/include/hikyuu/strategy/RunPortfolioInStrategy.h +1 -0
  46. hikyuu/include/hikyuu/strategy/Strategy.h +96 -16
  47. hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +4 -2
  48. hikyuu/include/hikyuu/trade_sys/system/imp/WalkForwardTradeManager.h +3 -2
  49. hikyuu/include/hikyuu/utilities/plugin/PluginClient.h +2 -2
  50. hikyuu/include/hikyuu/utilities/plugin/PluginLoader.h +66 -13
  51. hikyuu/include/hikyuu/utilities/plugin/PluginManager.h +72 -0
  52. hikyuu/include/hikyuu/version.h +5 -5
  53. hikyuu/plugin/__init__.py +1 -0
  54. hikyuu/plugin/backtest.dll +0 -0
  55. hikyuu/plugin/dataserver.dll +0 -0
  56. hikyuu/plugin/device.dll +0 -0
  57. hikyuu/strategy/strategy_demo1.py +7 -8
  58. hikyuu/strategy/strategy_demo2.py +1 -1
  59. hikyuu/trade_manage/__init__.pyi +11 -3
  60. hikyuu/trade_manage/trade.pyi +11 -3
  61. hikyuu/util/__init__.pyi +1 -1
  62. hikyuu/util/singleton.pyi +1 -1
  63. {hikyuu-2.5.6.dist-info → hikyuu-2.6.0.dist-info}/METADATA +6 -2
  64. {hikyuu-2.5.6.dist-info → hikyuu-2.6.0.dist-info}/RECORD +69 -56
  65. {hikyuu-2.5.6.dist-info → hikyuu-2.6.0.dist-info}/entry_points.txt +1 -0
  66. {hikyuu-2.5.6.dist-info → hikyuu-2.6.0.dist-info}/top_level.txt +4 -0
  67. hikyuu/cpp/core38.pyd +0 -0
  68. hikyuu/cpp/core38.pyi +0 -13173
  69. hikyuu/examples/notebook/011-PyechartsDrawplot.ipynb +0 -21821
  70. /hikyuu/gui/{hikyuu_small.png → images/hikyuu_small.png} +0 -0
  71. {hikyuu-2.5.6.dist-info → hikyuu-2.6.0.dist-info}/LICENSE +0 -0
  72. {hikyuu-2.5.6.dist-info → hikyuu-2.6.0.dist-info}/WHEEL +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', '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', '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', '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', 'roundDown', 'roundEx', 'roundUp', 'run_in_strategy', 'set_log_level', 'set_python_in_interactive', 'set_python_in_jupyter', 'start_spot_agent', 'stop_spot_agent', 'toPriceList']
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', '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']
5
5
  class AllocateFundsBase:
6
6
  """
7
7
  资产分配算法基类, 子类接口:
@@ -3372,16 +3372,6 @@ class Portfolio:
3372
3372
 
3373
3373
  运行投资组合策略。在查询条件及各组件没有变化时,PF在第二次执行时,默认不会实际进行计算。
3374
3374
  但由于各个组件的参数可能改变,此种情况无法自动判断是否需要重计算,可以手工指定进行强制计算。
3375
-
3376
- 调仓模式 adjust_mode 说明:
3377
- - "query" 模式,跟随输入参数 query 中的 ktype,此时 adjust_cycle 为以 query 中的 ktype
3378
- 决定周期间隔;
3379
- - "day" 模式,adjust_cycle 为调仓间隔天数
3380
- - "week" | "month" | "quarter" | "year" 模式时,adjust_cycle
3381
- 为对应的每周第N日、每月第n日、每季度第n日、每年第n日,在 delay_to_trading_day 为 false 时
3382
- 如果当日不是交易日将会被跳过调仓;当 delay_to_trading_day 为 true时,如果当日不是交易日
3383
- 将会顺延至当前周期内的第一个交易日,如指定每月第1日调仓,但当月1日不是交易日,则将顺延至当月
3384
- 的第一个交易日。
3385
3375
 
3386
3376
  :param Query query: 查询条件
3387
3377
  :param bool force: 强制重新计算
@@ -4711,7 +4701,8 @@ class Stock:
4711
4701
  """
4712
4702
  get_history_finance(self)
4713
4703
 
4714
- 获取所有历史财务信息历史记录
4704
+ 获取所有历史财务信息历史记录, 字段信息可参考 StockManager 中的相关方法: get_history_finance_all_fields/get_history_finance_field_index/get_history_finance_field_name 方法
4705
+ 日常建议直接使用指标 FINANCE 获取财务数据
4715
4706
  """
4716
4707
  def get_kdata(self, arg0: Query) -> KData:
4717
4708
  """
@@ -5124,6 +5115,12 @@ class StockManager:
5124
5115
 
5125
5116
  :rtype: StringList
5126
5117
  """
5118
+ def get_plugin_path(self) -> str:
5119
+ """
5120
+ get_plugin_path(self)
5121
+
5122
+ 获取插件路径
5123
+ """
5127
5124
  def get_preload_parameter(self) -> ...:
5128
5125
  """
5129
5126
  获取当前预加载参数
@@ -5228,6 +5225,12 @@ class StockManager:
5228
5225
 
5229
5226
  :param Block block: 板块实例
5230
5227
  """
5228
+ def set_plugin_path(self, arg0: str) -> None:
5229
+ """
5230
+ set_plugin_path(self, path)
5231
+
5232
+ 设置插件路径,仅在初始化之前设置有效
5233
+ """
5231
5234
  def tmpdir(self) -> str:
5232
5235
  """
5233
5236
  tmpdir(self) -> str
@@ -5592,12 +5595,13 @@ class Strategy:
5592
5595
  def __init__(self) -> None:
5593
5596
  ...
5594
5597
  @typing.overload
5595
- def __init__(self, code_list: list[str], ktype_list: list[str], name: str = 'Strategy', config: str = '') -> None:
5598
+ def __init__(self, code_list: list[str], ktype_list: list[str], preload_num: dict[str, int] = {}, name: str = 'Strategy', config: str = '') -> None:
5596
5599
  """
5597
5600
  创建策略运行时
5598
5601
 
5599
5602
  :param list code_list: 证券代码列表,如:["sz000001", "sz000002"], "all" 代表全部证券
5600
5603
  :param list ktype_list: K线类型列表, 如: ["day", "min"]
5604
+ :param dict preload_num: 预加载的K线数量,如:{"day_max": 1000, "min_max": 2000}
5601
5605
  :param str name: 策略名称
5602
5606
  :param str config: 配置文件名称(如需要使用独立的配置文件,否则为空时使用默认的hikyuu配置文件)
5603
5607
  """
@@ -5610,13 +5614,27 @@ class Strategy:
5610
5614
  :param str name: 策略名称
5611
5615
  :param str config: 配置文件名称(如需要使用独立的配置文件,否则为空时使用默认的hikyuu配置文件)
5612
5616
  """
5617
+ def buy(self, stock: Stock, price: float, num: float, stoploss: float = 0.0, goal_price: float = 0.0, part: SystemPart = ...) -> TradeRecord:
5618
+ ...
5619
+ def get_kdata(self, stk: Stock, start_date: Datetime, end_date: Datetime, ktype: str, recover_type: Query.RecoverType = ...) -> KData:
5620
+ ...
5621
+ @typing.overload
5622
+ def get_last_kdata(self, stk: Stock, start_date: Datetime, ktype: str, recover_type: Query.RecoverType = ...) -> KData:
5623
+ ...
5624
+ @typing.overload
5625
+ def get_last_kdata(self, stk: Stock, lastnum: int, ktype: str, recover_type: Query.RecoverType = ...) -> KData:
5626
+ ...
5627
+ def next_datetime(self) -> Datetime:
5628
+ ...
5629
+ def now(self) -> Datetime:
5630
+ ...
5613
5631
  def on_change(self, arg0: typing.Any) -> None:
5614
5632
  """
5615
5633
  onchang(self, func)
5616
5634
 
5617
5635
  设置证券数据更新回调通知
5618
5636
 
5619
- :param func: 一个可调用的对象如普通函数,需接收 stock ktype 参数
5637
+ :param func: 一个可调用的对象如普通函数, func(stg: Strategy, stock: Stock, spot: SpotRecord
5620
5638
  """
5621
5639
  def on_received_spot(self, arg0: typing.Any) -> None:
5622
5640
  """
@@ -5624,7 +5642,7 @@ class Strategy:
5624
5642
 
5625
5643
  设置证券数据更新通知回调
5626
5644
 
5627
- :param func: 可调用对象如普通函数,没有参数
5645
+ :param func: 可调用对象如普通函数, func(stg: Strategy, revTime: Datetime)
5628
5646
  """
5629
5647
  def run_daily(self, func: typing.Any, time: TimeDelta, market: str = 'SH', ignore_market: bool = False) -> None:
5630
5648
  """
@@ -5633,7 +5651,7 @@ class Strategy:
5633
5651
  设置日内循环执行回调。如果忽略市场开闭市,则自启动时刻开始按间隔时间循环,
5634
5652
  否则第一次执行时将开盘时间对齐时间间隔,且在非开市时间停止执行。
5635
5653
 
5636
- :param func: 可调用对象如普通函数,没有参数
5654
+ :param func: 可调用对象如普通函数,func(stg: Strategy)
5637
5655
  :param TimeDelta time: 间隔时间,如间隔3秒:TimeDelta(0, 0, 0, 3) 或 Seconds(3)
5638
5656
  :param str market: 使用哪个市场的开闭市时间
5639
5657
  :param ignore_market: 忽略市场开闭市时间
@@ -5644,10 +5662,12 @@ class Strategy:
5644
5662
 
5645
5663
  设置每日定点执行回调
5646
5664
 
5647
- :param func: 可调用对象如普通函数,没有参数
5665
+ :param func: 可调用对象如普通函数,func(stg: Strategy)
5648
5666
  :param TimeDelta time: 执行时刻,如每日15点:TimeDelta(0, 15)
5649
5667
  :param ignore_holiday: 节假日不执行
5650
5668
  """
5669
+ def sell(self, stock: Stock, price: float, num: float, stoploss: float = 0.0, goal_price: float = 0.0, part: SystemPart = ...) -> TradeRecord:
5670
+ ...
5651
5671
  def start(self, auto_recieve_spot: bool = True) -> None:
5652
5672
  """
5653
5673
  start(self)
@@ -5656,12 +5676,19 @@ class Strategy:
5656
5676
 
5657
5677
  :param bool auto_recieve_spot: 是否自动接收行情数据
5658
5678
  """
5679
+ def today(self) -> Datetime:
5680
+ ...
5659
5681
  @property
5660
5682
  def context(self) -> StrategyContext:
5661
5683
  """
5662
5684
  获取策略上下文
5663
5685
  """
5664
5686
  @property
5687
+ def is_backtesting(self) -> bool:
5688
+ """
5689
+ 回测状态
5690
+ """
5691
+ @property
5665
5692
  def name(self) -> str:
5666
5693
  """
5667
5694
  策略名称
@@ -5669,6 +5696,27 @@ class Strategy:
5669
5696
  @name.setter
5670
5697
  def name(self, arg1: str) -> None:
5671
5698
  ...
5699
+ @property
5700
+ def running(self) -> bool:
5701
+ """
5702
+ 获取当前运行状态
5703
+ """
5704
+ @property
5705
+ def sp(self) -> SlippageBase:
5706
+ """
5707
+ 移滑价差算法
5708
+ """
5709
+ @sp.setter
5710
+ def sp(self, arg1: SlippageBase) -> None:
5711
+ ...
5712
+ @property
5713
+ def tm(self) -> TradeManager:
5714
+ """
5715
+ 关联的交易管理实例
5716
+ """
5717
+ @tm.setter
5718
+ def tm(self, arg1: TradeManager) -> None:
5719
+ ...
5672
5720
  class StrategyContext:
5673
5721
  """
5674
5722
  策略上下文
@@ -6706,6 +6754,17 @@ class TradeManager:
6706
6754
  :param axes: 绘制的轴对象,默认为None,表示创建新的轴对象
6707
6755
  :return: None
6708
6756
 
6757
+ """
6758
+ @staticmethod
6759
+ def performance(tm: TradeManager, query: Query, ref_stk: Stock = None):
6760
+ """
6761
+
6762
+ 绘制系统绩效,即账户累积收益率曲线
6763
+
6764
+ :param SystemBase | PortfolioBase sys: SYS或PF实例
6765
+ :param Stock ref_stk: 参考股票, 默认为沪深300: sh000300, 绘制参考标的的收益曲线
6766
+ :return: None
6767
+
6709
6768
  """
6710
6769
  def __getstate__(self) -> tuple:
6711
6770
  ...
@@ -6806,7 +6865,7 @@ class TradeManager:
6806
6865
  """
6807
6866
  克隆(深复制)实例
6808
6867
  """
6809
- def fetch_asset_info_from_broker(self, arg0: OrderBrokerBase) -> None:
6868
+ def fetch_asset_info_from_broker(self, arg0: OrderBrokerBase, arg1: Datetime) -> None:
6810
6869
  ...
6811
6870
  def getParam(self, arg0: str) -> any:
6812
6871
  """
@@ -12872,6 +12931,36 @@ def ZSCORE(data: Indicator, out_extreme: bool = False, nsigma: float = 3.0, recu
12872
12931
  :param bool recursive: 是否进行递归剔除极值,默认 False
12873
12932
  :rtype: Indicator
12874
12933
  """
12934
+ def active_device(arg0: str) -> None:
12935
+ """
12936
+ active_device(active_code: str)
12937
+
12938
+ VIP功能授权码激活设备
12939
+
12940
+ :param str active_code: 授权码
12941
+ """
12942
+ @typing.overload
12943
+ 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:
12944
+ ...
12945
+ @typing.overload
12946
+ 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:
12947
+ """
12948
+ backtest([context], on_bar, tm, start_date, end_date, ktype, ref_market, mode)
12949
+
12950
+ 事件驱动式回测, 通常直接测试 Strategy 中的主体函数
12951
+
12952
+ 如果 hikyuu 已经加载数据,可以忽略 context 参数。否则通 Strategy 类似,需要主动传入 context 参数,
12953
+ context 中包含需要加载的股票代码、K线类型、K线数量、K线起始日期等信息。
12954
+
12955
+ :param StrategyContext context: 策略上下文 ()
12956
+ :param func on_bar: 策略主体执行函数, 如: on_bar(stg: Strategy)
12957
+ :param TradeManager tm: 策略测试账户
12958
+ :param Datetime start_date: 起始日期
12959
+ :param Datetime end_date: 结束日期(不包含其本身)
12960
+ :param Query.KType ktype: K线类型(按该类型逐 Bar 执行测试)
12961
+ :param str ref_market: 所属市场
12962
+ :param mode 模式 0: 当前bar收盘价执行买卖操作; 1: 下一bar开盘价执行买卖操作
12963
+ """
12875
12964
  def batch_calculate_inds(arg0: typing.Sequence, arg1: KData) -> list:
12876
12965
  """
12877
12966
  batch_calculate_inds(inds, kdata) -> list)
@@ -12939,6 +13028,14 @@ def crt_pf_strategy(pf: Portfolio, query: Query, broker: OrderBrokerBase, cost_f
12939
13028
  ...
12940
13029
  def crt_sys_strategy(sys: System, stk_market_code: str, query: Query, broker: OrderBrokerBase, cost_func: TradeCostBase, other_brokers: str = [], name: list[OrderBrokerBase] = 'SYSStrategy', config: str = '') -> Strategy:
12941
13030
  ...
13031
+ def fetch_trial_license(arg0: str) -> str:
13032
+ """
13033
+ fetch_trial_license(email: str)
13034
+
13035
+ 获取试用授权码
13036
+
13037
+ :param str email: 邮箱地址
13038
+ """
12942
13039
  def find_optimal_system(sys_list: list[System], stock: Stock, query: Query, sort_key: str = '', sort_mode: int = 0) -> tuple[float, System]:
12943
13040
  ...
12944
13041
  def find_optimal_system_multi(sys_list: list[System], stock: Stock, query: Query, sort_key: str = '', sort_mode: int = 0) -> tuple[float, System]:
@@ -12962,7 +13059,13 @@ def get_business_name(arg0: BUSINESS) -> str:
12962
13059
  :rtype: string
12963
13060
  """
12964
13061
  def get_data_from_buffer_server(arg0: str, arg1: list[Stock], arg2: str) -> None:
12965
- ...
13062
+ """
13063
+ get_data_from_buffer_server(addr: str, stklist: list, ktype: Query.KType)
13064
+
13065
+ :param str addr: 数据服务器地址
13066
+ :param list stklist: 需要获取数据的股票列表
13067
+ :param Query.KType ktype: 数据类型
13068
+ """
12966
13069
  def get_date_range(start: Datetime, end: Datetime) -> DatetimeList:
12967
13070
  """
12968
13071
  get_date_range(start, end)
@@ -13076,6 +13179,12 @@ def open_spend_time() -> None:
13076
13179
  """
13077
13180
  全局开启 c++ 部分耗时打印
13078
13181
  """
13182
+ def remove_license() -> None:
13183
+ """
13184
+ remove_license()
13185
+
13186
+ 移除当前授权
13187
+ """
13079
13188
  @typing.overload
13080
13189
  def roundDown(number: float, ndigits: int = 0) -> float:
13081
13190
  ...
@@ -13155,14 +13264,36 @@ def set_python_in_interactive(arg0: bool) -> None:
13155
13264
  ...
13156
13265
  def set_python_in_jupyter(arg0: bool) -> None:
13157
13266
  ...
13267
+ def start_data_server(addr: str = 'tcp://0.0.0.0:9201', work_num: int = 2) -> None:
13268
+ """
13269
+ start_data_server(addr: str[, work_num: int=2])
13270
+
13271
+ 启动数据缓存服务
13272
+
13273
+ :param str addr: 服务器地址
13274
+ :param int work_num: 工作线程数
13275
+ :return: None
13276
+ """
13158
13277
  def start_spot_agent(print: bool = False, worker_num: int = 1, addr: str = '') -> None:
13159
13278
  ...
13279
+ def stop_data_server() -> None:
13280
+ """
13281
+ stop_data_server()
13282
+
13283
+ 停止数据缓存服务
13284
+ """
13160
13285
  def stop_spot_agent() -> None:
13161
13286
  ...
13162
13287
  def toPriceList(arg0: typing.Sequence) -> list[float]:
13163
13288
  """
13164
13289
  将 python list/tuple/np.arry 对象转化为 PriceList 对象
13165
13290
  """
13291
+ def view_license() -> str:
13292
+ """
13293
+ view_license()
13294
+
13295
+ 查看设备授权信息
13296
+ """
13166
13297
  DEBUG: LOG_LEVEL # value = <LOG_LEVEL.DEBUG: 1>
13167
13298
  ERROR: LOG_LEVEL # value = <LOG_LEVEL.ERROR: 4>
13168
13299
  FATAL: LOG_LEVEL # value = <LOG_LEVEL.FATAL: 5>
hikyuu/cpp/core312.pyd CHANGED
Binary file