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/core313.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
  资产分配算法基类, 子类接口:
@@ -3357,16 +3357,6 @@ class Portfolio:
3357
3357
 
3358
3358
  运行投资组合策略。在查询条件及各组件没有变化时,PF在第二次执行时,默认不会实际进行计算。
3359
3359
  但由于各个组件的参数可能改变,此种情况无法自动判断是否需要重计算,可以手工指定进行强制计算。
3360
-
3361
- 调仓模式 adjust_mode 说明:
3362
- - "query" 模式,跟随输入参数 query 中的 ktype,此时 adjust_cycle 为以 query 中的 ktype
3363
- 决定周期间隔;
3364
- - "day" 模式,adjust_cycle 为调仓间隔天数
3365
- - "week" | "month" | "quarter" | "year" 模式时,adjust_cycle
3366
- 为对应的每周第N日、每月第n日、每季度第n日、每年第n日,在 delay_to_trading_day 为 false 时
3367
- 如果当日不是交易日将会被跳过调仓;当 delay_to_trading_day 为 true时,如果当日不是交易日
3368
- 将会顺延至当前周期内的第一个交易日,如指定每月第1日调仓,但当月1日不是交易日,则将顺延至当月
3369
- 的第一个交易日。
3370
3360
 
3371
3361
  :param Query query: 查询条件
3372
3362
  :param bool force: 强制重新计算
@@ -4694,7 +4684,8 @@ class Stock:
4694
4684
  """
4695
4685
  get_history_finance(self)
4696
4686
 
4697
- 获取所有历史财务信息历史记录
4687
+ 获取所有历史财务信息历史记录, 字段信息可参考 StockManager 中的相关方法: get_history_finance_all_fields/get_history_finance_field_index/get_history_finance_field_name 方法
4688
+ 日常建议直接使用指标 FINANCE 获取财务数据
4698
4689
  """
4699
4690
  def get_kdata(self, arg0: Query) -> KData:
4700
4691
  """
@@ -5107,6 +5098,12 @@ class StockManager:
5107
5098
 
5108
5099
  :rtype: StringList
5109
5100
  """
5101
+ def get_plugin_path(self) -> str:
5102
+ """
5103
+ get_plugin_path(self)
5104
+
5105
+ 获取插件路径
5106
+ """
5110
5107
  def get_preload_parameter(self) -> ...:
5111
5108
  """
5112
5109
  获取当前预加载参数
@@ -5211,6 +5208,12 @@ class StockManager:
5211
5208
 
5212
5209
  :param Block block: 板块实例
5213
5210
  """
5211
+ def set_plugin_path(self, arg0: str) -> None:
5212
+ """
5213
+ set_plugin_path(self, path)
5214
+
5215
+ 设置插件路径,仅在初始化之前设置有效
5216
+ """
5214
5217
  def tmpdir(self) -> str:
5215
5218
  """
5216
5219
  tmpdir(self) -> str
@@ -5575,12 +5578,13 @@ class Strategy:
5575
5578
  def __init__(self) -> None:
5576
5579
  ...
5577
5580
  @typing.overload
5578
- def __init__(self, code_list: list[str], ktype_list: list[str], name: str = 'Strategy', config: str = '') -> None:
5581
+ def __init__(self, code_list: list[str], ktype_list: list[str], preload_num: dict[str, int] = {}, name: str = 'Strategy', config: str = '') -> None:
5579
5582
  """
5580
5583
  创建策略运行时
5581
5584
 
5582
5585
  :param list code_list: 证券代码列表,如:["sz000001", "sz000002"], "all" 代表全部证券
5583
5586
  :param list ktype_list: K线类型列表, 如: ["day", "min"]
5587
+ :param dict preload_num: 预加载的K线数量,如:{"day_max": 1000, "min_max": 2000}
5584
5588
  :param str name: 策略名称
5585
5589
  :param str config: 配置文件名称(如需要使用独立的配置文件,否则为空时使用默认的hikyuu配置文件)
5586
5590
  """
@@ -5593,13 +5597,27 @@ class Strategy:
5593
5597
  :param str name: 策略名称
5594
5598
  :param str config: 配置文件名称(如需要使用独立的配置文件,否则为空时使用默认的hikyuu配置文件)
5595
5599
  """
5600
+ def buy(self, stock: Stock, price: float, num: float, stoploss: float = 0.0, goal_price: float = 0.0, part: SystemPart = ...) -> TradeRecord:
5601
+ ...
5602
+ def get_kdata(self, stk: Stock, start_date: Datetime, end_date: Datetime, ktype: str, recover_type: Query.RecoverType = ...) -> KData:
5603
+ ...
5604
+ @typing.overload
5605
+ def get_last_kdata(self, stk: Stock, start_date: Datetime, ktype: str, recover_type: Query.RecoverType = ...) -> KData:
5606
+ ...
5607
+ @typing.overload
5608
+ def get_last_kdata(self, stk: Stock, lastnum: int, ktype: str, recover_type: Query.RecoverType = ...) -> KData:
5609
+ ...
5610
+ def next_datetime(self) -> Datetime:
5611
+ ...
5612
+ def now(self) -> Datetime:
5613
+ ...
5596
5614
  def on_change(self, arg0: typing.Any) -> None:
5597
5615
  """
5598
5616
  onchang(self, func)
5599
5617
 
5600
5618
  设置证券数据更新回调通知
5601
5619
 
5602
- :param func: 一个可调用的对象如普通函数,需接收 stock ktype 参数
5620
+ :param func: 一个可调用的对象如普通函数, func(stg: Strategy, stock: Stock, spot: SpotRecord
5603
5621
  """
5604
5622
  def on_received_spot(self, arg0: typing.Any) -> None:
5605
5623
  """
@@ -5607,7 +5625,7 @@ class Strategy:
5607
5625
 
5608
5626
  设置证券数据更新通知回调
5609
5627
 
5610
- :param func: 可调用对象如普通函数,没有参数
5628
+ :param func: 可调用对象如普通函数, func(stg: Strategy, revTime: Datetime)
5611
5629
  """
5612
5630
  def run_daily(self, func: typing.Any, time: TimeDelta, market: str = 'SH', ignore_market: bool = False) -> None:
5613
5631
  """
@@ -5616,7 +5634,7 @@ class Strategy:
5616
5634
  设置日内循环执行回调。如果忽略市场开闭市,则自启动时刻开始按间隔时间循环,
5617
5635
  否则第一次执行时将开盘时间对齐时间间隔,且在非开市时间停止执行。
5618
5636
 
5619
- :param func: 可调用对象如普通函数,没有参数
5637
+ :param func: 可调用对象如普通函数,func(stg: Strategy)
5620
5638
  :param TimeDelta time: 间隔时间,如间隔3秒:TimeDelta(0, 0, 0, 3) 或 Seconds(3)
5621
5639
  :param str market: 使用哪个市场的开闭市时间
5622
5640
  :param ignore_market: 忽略市场开闭市时间
@@ -5627,10 +5645,12 @@ class Strategy:
5627
5645
 
5628
5646
  设置每日定点执行回调
5629
5647
 
5630
- :param func: 可调用对象如普通函数,没有参数
5648
+ :param func: 可调用对象如普通函数,func(stg: Strategy)
5631
5649
  :param TimeDelta time: 执行时刻,如每日15点:TimeDelta(0, 15)
5632
5650
  :param ignore_holiday: 节假日不执行
5633
5651
  """
5652
+ def sell(self, stock: Stock, price: float, num: float, stoploss: float = 0.0, goal_price: float = 0.0, part: SystemPart = ...) -> TradeRecord:
5653
+ ...
5634
5654
  def start(self, auto_recieve_spot: bool = True) -> None:
5635
5655
  """
5636
5656
  start(self)
@@ -5639,12 +5659,19 @@ class Strategy:
5639
5659
 
5640
5660
  :param bool auto_recieve_spot: 是否自动接收行情数据
5641
5661
  """
5662
+ def today(self) -> Datetime:
5663
+ ...
5642
5664
  @property
5643
5665
  def context(self) -> StrategyContext:
5644
5666
  """
5645
5667
  获取策略上下文
5646
5668
  """
5647
5669
  @property
5670
+ def is_backtesting(self) -> bool:
5671
+ """
5672
+ 回测状态
5673
+ """
5674
+ @property
5648
5675
  def name(self) -> str:
5649
5676
  """
5650
5677
  策略名称
@@ -5652,6 +5679,27 @@ class Strategy:
5652
5679
  @name.setter
5653
5680
  def name(self, arg1: str) -> None:
5654
5681
  ...
5682
+ @property
5683
+ def running(self) -> bool:
5684
+ """
5685
+ 获取当前运行状态
5686
+ """
5687
+ @property
5688
+ def sp(self) -> SlippageBase:
5689
+ """
5690
+ 移滑价差算法
5691
+ """
5692
+ @sp.setter
5693
+ def sp(self, arg1: SlippageBase) -> None:
5694
+ ...
5695
+ @property
5696
+ def tm(self) -> TradeManager:
5697
+ """
5698
+ 关联的交易管理实例
5699
+ """
5700
+ @tm.setter
5701
+ def tm(self, arg1: TradeManager) -> None:
5702
+ ...
5655
5703
  class StrategyContext:
5656
5704
  """
5657
5705
  策略上下文
@@ -6685,6 +6733,16 @@ class TradeManager:
6685
6733
  :param axes: 绘制的轴对象,默认为None,表示创建新的轴对象
6686
6734
  :return: None
6687
6735
  """
6736
+ @staticmethod
6737
+ def performance(tm: TradeManager, query: Query, ref_stk: Stock = None):
6738
+ """
6739
+
6740
+ 绘制系统绩效,即账户累积收益率曲线
6741
+
6742
+ :param SystemBase | PortfolioBase sys: SYS或PF实例
6743
+ :param Stock ref_stk: 参考股票, 默认为沪深300: sh000300, 绘制参考标的的收益曲线
6744
+ :return: None
6745
+ """
6688
6746
  def __getstate__(self) -> tuple:
6689
6747
  ...
6690
6748
  @typing.overload
@@ -6784,7 +6842,7 @@ class TradeManager:
6784
6842
  """
6785
6843
  克隆(深复制)实例
6786
6844
  """
6787
- def fetch_asset_info_from_broker(self, arg0: OrderBrokerBase) -> None:
6845
+ def fetch_asset_info_from_broker(self, arg0: OrderBrokerBase, arg1: Datetime) -> None:
6788
6846
  ...
6789
6847
  def getParam(self, arg0: str) -> any:
6790
6848
  """
@@ -12850,6 +12908,36 @@ def ZSCORE(data: Indicator, out_extreme: bool = False, nsigma: float = 3.0, recu
12850
12908
  :param bool recursive: 是否进行递归剔除极值,默认 False
12851
12909
  :rtype: Indicator
12852
12910
  """
12911
+ def active_device(arg0: str) -> None:
12912
+ """
12913
+ active_device(active_code: str)
12914
+
12915
+ VIP功能授权码激活设备
12916
+
12917
+ :param str active_code: 授权码
12918
+ """
12919
+ @typing.overload
12920
+ 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:
12921
+ ...
12922
+ @typing.overload
12923
+ 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:
12924
+ """
12925
+ backtest([context], on_bar, tm, start_date, end_date, ktype, ref_market, mode)
12926
+
12927
+ 事件驱动式回测, 通常直接测试 Strategy 中的主体函数
12928
+
12929
+ 如果 hikyuu 已经加载数据,可以忽略 context 参数。否则通 Strategy 类似,需要主动传入 context 参数,
12930
+ context 中包含需要加载的股票代码、K线类型、K线数量、K线起始日期等信息。
12931
+
12932
+ :param StrategyContext context: 策略上下文 ()
12933
+ :param func on_bar: 策略主体执行函数, 如: on_bar(stg: Strategy)
12934
+ :param TradeManager tm: 策略测试账户
12935
+ :param Datetime start_date: 起始日期
12936
+ :param Datetime end_date: 结束日期(不包含其本身)
12937
+ :param Query.KType ktype: K线类型(按该类型逐 Bar 执行测试)
12938
+ :param str ref_market: 所属市场
12939
+ :param mode 模式 0: 当前bar收盘价执行买卖操作; 1: 下一bar开盘价执行买卖操作
12940
+ """
12853
12941
  def batch_calculate_inds(arg0: typing.Sequence, arg1: KData) -> list:
12854
12942
  """
12855
12943
  batch_calculate_inds(inds, kdata) -> list)
@@ -12917,6 +13005,14 @@ def crt_pf_strategy(pf: Portfolio, query: Query, broker: OrderBrokerBase, cost_f
12917
13005
  ...
12918
13006
  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:
12919
13007
  ...
13008
+ def fetch_trial_license(arg0: str) -> str:
13009
+ """
13010
+ fetch_trial_license(email: str)
13011
+
13012
+ 获取试用授权码
13013
+
13014
+ :param str email: 邮箱地址
13015
+ """
12920
13016
  def find_optimal_system(sys_list: list[System], stock: Stock, query: Query, sort_key: str = '', sort_mode: int = 0) -> tuple[float, System]:
12921
13017
  ...
12922
13018
  def find_optimal_system_multi(sys_list: list[System], stock: Stock, query: Query, sort_key: str = '', sort_mode: int = 0) -> tuple[float, System]:
@@ -12940,7 +13036,13 @@ def get_business_name(arg0: BUSINESS) -> str:
12940
13036
  :rtype: string
12941
13037
  """
12942
13038
  def get_data_from_buffer_server(arg0: str, arg1: list[Stock], arg2: str) -> None:
12943
- ...
13039
+ """
13040
+ get_data_from_buffer_server(addr: str, stklist: list, ktype: Query.KType)
13041
+
13042
+ :param str addr: 数据服务器地址
13043
+ :param list stklist: 需要获取数据的股票列表
13044
+ :param Query.KType ktype: 数据类型
13045
+ """
12944
13046
  def get_date_range(start: Datetime, end: Datetime) -> DatetimeList:
12945
13047
  """
12946
13048
  get_date_range(start, end)
@@ -13054,6 +13156,12 @@ def open_spend_time() -> None:
13054
13156
  """
13055
13157
  全局开启 c++ 部分耗时打印
13056
13158
  """
13159
+ def remove_license() -> None:
13160
+ """
13161
+ remove_license()
13162
+
13163
+ 移除当前授权
13164
+ """
13057
13165
  @typing.overload
13058
13166
  def roundDown(number: float, ndigits: int = 0) -> float:
13059
13167
  ...
@@ -13133,14 +13241,36 @@ def set_python_in_interactive(arg0: bool) -> None:
13133
13241
  ...
13134
13242
  def set_python_in_jupyter(arg0: bool) -> None:
13135
13243
  ...
13244
+ def start_data_server(addr: str = 'tcp://0.0.0.0:9201', work_num: int = 2) -> None:
13245
+ """
13246
+ start_data_server(addr: str[, work_num: int=2])
13247
+
13248
+ 启动数据缓存服务
13249
+
13250
+ :param str addr: 服务器地址
13251
+ :param int work_num: 工作线程数
13252
+ :return: None
13253
+ """
13136
13254
  def start_spot_agent(print: bool = False, worker_num: int = 1, addr: str = '') -> None:
13137
13255
  ...
13256
+ def stop_data_server() -> None:
13257
+ """
13258
+ stop_data_server()
13259
+
13260
+ 停止数据缓存服务
13261
+ """
13138
13262
  def stop_spot_agent() -> None:
13139
13263
  ...
13140
13264
  def toPriceList(arg0: typing.Sequence) -> list[float]:
13141
13265
  """
13142
13266
  将 python list/tuple/np.arry 对象转化为 PriceList 对象
13143
13267
  """
13268
+ def view_license() -> str:
13269
+ """
13270
+ view_license()
13271
+
13272
+ 查看设备授权信息
13273
+ """
13144
13274
  DEBUG: LOG_LEVEL # value = <LOG_LEVEL.DEBUG: 1>
13145
13275
  ERROR: LOG_LEVEL # value = <LOG_LEVEL.ERROR: 4>
13146
13276
  FATAL: LOG_LEVEL # value = <LOG_LEVEL.FATAL: 5>
hikyuu/cpp/core39.pyd CHANGED
Binary file