hikyuu 2.5.2__py3-none-win_amd64.whl → 2.5.5__py3-none-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. hikyuu/__init__.py +5 -1
  2. hikyuu/__init__.pyi +522 -511
  3. hikyuu/analysis/__init__.pyi +490 -485
  4. hikyuu/analysis/analysis.pyi +491 -486
  5. hikyuu/core.pyi +492 -487
  6. hikyuu/cpp/__init__.pyi +2 -2
  7. hikyuu/cpp/core310.pyd +0 -0
  8. hikyuu/cpp/core310.pyi +249 -26
  9. hikyuu/cpp/core311.pyd +0 -0
  10. hikyuu/cpp/core311.pyi +249 -26
  11. hikyuu/cpp/core312.pyd +0 -0
  12. hikyuu/cpp/core312.pyi +249 -26
  13. hikyuu/cpp/core313.pyd +0 -0
  14. hikyuu/cpp/core313.pyi +243 -26
  15. hikyuu/cpp/core38.pyd +0 -0
  16. hikyuu/cpp/core38.pyi +249 -26
  17. hikyuu/cpp/core39.pyd +0 -0
  18. hikyuu/cpp/core39.pyi +249 -26
  19. hikyuu/cpp/hikyuu.dll +0 -0
  20. hikyuu/cpp/hikyuu.lib +0 -0
  21. hikyuu/data/mysql_upgrade/0027.sql +6 -0
  22. hikyuu/data/pytdx_to_h5.py +7 -4
  23. hikyuu/data/pytdx_to_mysql.py +7 -4
  24. hikyuu/data/sqlite_upgrade/0027.sql +8 -0
  25. hikyuu/draw/drawplot/__init__.py +8 -1
  26. hikyuu/draw/drawplot/__init__.pyi +11 -7
  27. hikyuu/draw/drawplot/bokeh_draw.pyi +509 -500
  28. hikyuu/draw/drawplot/common.pyi +1 -1
  29. hikyuu/draw/drawplot/echarts_draw.pyi +511 -502
  30. hikyuu/draw/drawplot/matplotlib_draw.py +129 -8
  31. hikyuu/draw/drawplot/matplotlib_draw.pyi +571 -515
  32. hikyuu/draw/elder.pyi +11 -11
  33. hikyuu/draw/kaufman.pyi +18 -18
  34. hikyuu/draw/volume.pyi +10 -10
  35. hikyuu/extend.pyi +501 -495
  36. hikyuu/fetcher/stock/zh_block_em.py +18 -7
  37. hikyuu/hub.py +112 -6
  38. hikyuu/hub.pyi +39 -13
  39. hikyuu/include/hikyuu/DataType.h +1 -2
  40. hikyuu/include/hikyuu/StockManager.h +2 -1
  41. hikyuu/include/hikyuu/StrategyContext.h +12 -3
  42. hikyuu/include/hikyuu/indicator/Indicator.h +24 -0
  43. hikyuu/include/hikyuu/indicator/Indicator2InImp.h +1 -0
  44. hikyuu/include/hikyuu/indicator/build_in.h +2 -0
  45. hikyuu/include/hikyuu/indicator/crt/ATR.h +2 -13
  46. hikyuu/include/hikyuu/indicator/crt/BARSSINCE.h +14 -2
  47. hikyuu/include/hikyuu/indicator/crt/KALMAN.h +30 -0
  48. hikyuu/include/hikyuu/indicator/crt/TR.h +32 -0
  49. hikyuu/include/hikyuu/indicator/imp/IAtr.h +3 -1
  50. hikyuu/include/hikyuu/indicator/imp/IBarsSince.h +6 -0
  51. hikyuu/include/hikyuu/indicator/imp/IKalman.h +27 -0
  52. hikyuu/include/hikyuu/indicator/imp/ITr.h +35 -0
  53. hikyuu/include/hikyuu/python/convert_any.h +299 -0
  54. hikyuu/include/hikyuu/trade_manage/PositionRecord.h +5 -4
  55. hikyuu/include/hikyuu/trade_sys/allocatefunds/crt/AF_MultiFactor.h +1 -1
  56. hikyuu/include/hikyuu/trade_sys/allocatefunds/imp/MultiFactorAllocaterFunds.h +3 -0
  57. hikyuu/include/hikyuu/trade_sys/condition/ConditionBase.h +4 -1
  58. hikyuu/include/hikyuu/trade_sys/condition/imp/{SubCondition.h → logic/SubCondition.h} +1 -1
  59. hikyuu/include/hikyuu/trade_sys/environment/EnvironmentBase.h +20 -6
  60. hikyuu/include/hikyuu/trade_sys/environment/build_in.h +1 -0
  61. hikyuu/include/hikyuu/trade_sys/environment/crt/EV_Logic.h +35 -0
  62. hikyuu/include/hikyuu/trade_sys/environment/imp/logic/AddEnvironment.h +42 -0
  63. hikyuu/include/hikyuu/trade_sys/environment/imp/logic/AndEnvironment.h +42 -0
  64. hikyuu/include/hikyuu/trade_sys/environment/imp/logic/DivEnvironment.h +42 -0
  65. hikyuu/include/hikyuu/trade_sys/environment/imp/logic/MultiEnvironment.h +42 -0
  66. hikyuu/include/hikyuu/trade_sys/environment/imp/logic/OrEnvironment.h +42 -0
  67. hikyuu/include/hikyuu/trade_sys/environment/imp/logic/SubEnvironment.h +42 -0
  68. hikyuu/include/hikyuu/trade_sys/environment/imp/logic/__init__.py +1 -0
  69. hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +0 -4
  70. hikyuu/include/hikyuu/trade_sys/signal/crt/SG_Logic.h +68 -7
  71. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/AndSignal.h +19 -0
  72. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorSignal.h +1 -0
  73. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorValueSignal.h +1 -0
  74. hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OrSignal.h +19 -0
  75. hikyuu/include/hikyuu/utilities/datetime/Datetime.h +2 -1
  76. hikyuu/include/hikyuu/version.h +4 -4
  77. hikyuu/indicator/indicator.py +1 -0
  78. hikyuu/trade_manage/__init__.pyi +506 -499
  79. hikyuu/trade_manage/broker.pyi +3 -3
  80. hikyuu/trade_manage/broker_easytrader.pyi +1 -1
  81. hikyuu/trade_manage/trade.pyi +506 -499
  82. hikyuu/trade_sys/trade_sys.py +4 -3
  83. hikyuu/util/__init__.pyi +1 -1
  84. hikyuu/util/singleton.pyi +1 -1
  85. {hikyuu-2.5.2.dist-info → hikyuu-2.5.5.dist-info}/METADATA +3 -2
  86. {hikyuu-2.5.2.dist-info → hikyuu-2.5.5.dist-info}/RECORD +90 -73
  87. {hikyuu-2.5.2.dist-info → hikyuu-2.5.5.dist-info}/top_level.txt +1 -0
  88. {hikyuu-2.5.2.dist-info → hikyuu-2.5.5.dist-info}/LICENSE +0 -0
  89. {hikyuu-2.5.2.dist-info → hikyuu-2.5.5.dist-info}/WHEEL +0 -0
  90. {hikyuu-2.5.2.dist-info → hikyuu-2.5.5.dist-info}/entry_points.txt +0 -0
hikyuu/cpp/core313.pyi CHANGED
@@ -1,11 +1,36 @@
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', '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', '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_Band', 'SG_Bool', 'SG_Buy', 'SG_Cross', 'SG_CrossGold', 'SG_Cycle', 'SG_Div', 'SG_Flex', 'SG_Mul', 'SG_OneSide', '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', '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', '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']
5
5
  class AllocateFundsBase:
6
6
  """
7
7
  资产分配算法基类, 子类接口:
8
8
 
9
+ 公共参数:
10
+
11
+ - adjust_running_sys (bool|True): 是否调整之前已经持仓策略的持仓。不调整时,仅使用总账户当前剩余资金进行分配,否则将使用总市值进行分配
12
+ 注意: 无论是否调整已持仓策略,权重比例都是相对于总资产,不是针对剩余现金余额
13
+ 仅针对剩余现金比例调整没有意义,即使分配由于交易成本原因可能也无法完成实际交易
14
+ adjust_running_sys: True - 主动根据资产分配对已持仓策略进行增减仓
15
+ adjust_running_sys: False - 不会根据当前分配权重对已持仓策略进行强制加减仓
16
+
17
+ - auto_adjust_weight (bool|True): 自动调整权重,此时认为传入的权重为各证券的相互比例(详见ignore_zero_weight说明)。否则,以传入的权重为指定权重不做调整(此时传入的各个权重需要小于1)。
18
+
19
+ - ignore_zero_weight (bool|False): 该参数在 auto_adjust_weight 时生效。是否过滤子类返回的比例权重列表中的 0 值(包含小于0)和 nan 值。
20
+
21
+ 如:子类返回权重比例列表 [6, 2, 0, 0, 0], 则
22
+ - 过滤 0 值,则实际调整后的权重为 Xi / sum(Xi):[6/8, 2/8]
23
+ - 不过滤,m 设为非零元素个数,n为总元素个数,(Xi / Sum(Xi)) * (m / n):
24
+ [(6/8)*(2/5), (2/8)*(2/5), 0, 0, 0]
25
+ 即,保留分为5份后,仅在2份中保持相对比例
26
+
27
+ - ignore_se_score_is_null (bool|False): 忽略选中系统列表中的系统得分为 null 的系统. 注意:某些SE(如SE_MultiFactor)本身可能也存在类似控制
28
+ - ignore_se_score_lt_zero (bool|False): 忽略选中系统列表中的系统得分小于等于 0 的系统
29
+ - reserve_percent (float|0.0): 保留不参与重分配的资产比例
30
+ - trace (bool|False): 打印跟踪信息
31
+
32
+ 子类接口:
33
+
9
34
  - _allocateWeight : 【必须】子类资产分配调整实现
10
35
  - _clone : 【必须】克隆接口
11
36
  - _reset : 【可选】重载私有变量
@@ -457,7 +482,7 @@ class ConditionBase:
457
482
  def _pybind11_conduit_v1_(*args, **kwargs):
458
483
  ...
459
484
  @staticmethod
460
- def plot(cn, new = True, axes = None, kdata = None):
485
+ def plot(cn, new = True, axes = None, kdata = None, upcolor = 'red', downcolor = 'blue', alpha = 0.2):
461
486
  """
462
487
  绘制系统有效条件
463
488
 
@@ -466,6 +491,9 @@ class ConditionBase:
466
491
  :param axes: 指定在那个轴对象中进行绘制
467
492
  :param KData kdata: 指定的KData,如该值为None,则认为该系统有效条件已经
468
493
  指定了交易对象,否则,使用该参数作为交易对象
494
+ :param upcolor: 有效数时的颜色
495
+ :param downcolor: 无效时的颜色
496
+ :param alpha: 透明度
469
497
  """
470
498
  def __add__(self, arg0: ConditionBase) -> ConditionBase:
471
499
  ...
@@ -1299,7 +1327,7 @@ class EnvironmentBase:
1299
1327
  def _pybind11_conduit_v1_(*args, **kwargs):
1300
1328
  ...
1301
1329
  @staticmethod
1302
- def plot(ev, ref_kdata, new = True, axes = None):
1330
+ def plot(ev, ref_kdata, new = True, axes = None, upcolor = 'red', downcolor = 'blue', alpha = 0.2):
1303
1331
  """
1304
1332
  绘制市场有效判断
1305
1333
 
@@ -1307,7 +1335,14 @@ class EnvironmentBase:
1307
1335
  :param KData ref_kdata: 用于日期参考
1308
1336
  :param new: 仅在未指定axes的情况下生效,当为True时,创建新的窗口对象并在其中进行绘制
1309
1337
  :param axes: 指定在那个轴对象中进行绘制
1338
+ :param upcolor: 有效时的颜色
1339
+ :param downcolor: 无效时的颜色
1340
+ :param alpha: 透明度
1310
1341
  """
1342
+ def __add__(self, arg0: EnvironmentBase) -> EnvironmentBase:
1343
+ ...
1344
+ def __and__(self, arg0: EnvironmentBase) -> EnvironmentBase:
1345
+ ...
1311
1346
  def __getstate__(self) -> tuple:
1312
1347
  ...
1313
1348
  @typing.overload
@@ -1319,13 +1354,21 @@ class EnvironmentBase:
1319
1354
  @typing.overload
1320
1355
  def __init__(self, arg0: str) -> None:
1321
1356
  ...
1357
+ def __mul__(self, arg0: EnvironmentBase) -> EnvironmentBase:
1358
+ ...
1359
+ def __or__(self, arg0: EnvironmentBase) -> EnvironmentBase:
1360
+ ...
1322
1361
  def __repr__(self) -> str:
1323
1362
  ...
1324
1363
  def __setstate__(self, arg0: tuple) -> None:
1325
1364
  ...
1326
1365
  def __str__(self) -> str:
1327
1366
  ...
1328
- def _add_valid(self, arg0: Datetime) -> None:
1367
+ def __sub__(self, arg0: EnvironmentBase) -> EnvironmentBase:
1368
+ ...
1369
+ def __truediv__(self, arg0: EnvironmentBase) -> EnvironmentBase:
1370
+ ...
1371
+ def _add_valid(self, arg0: Datetime, arg1: float) -> None:
1329
1372
  """
1330
1373
  _add_valid(self, datetime)
1331
1374
 
@@ -1530,7 +1573,6 @@ class Indicator:
1530
1573
  """
1531
1574
  技术指标
1532
1575
  """
1533
- __hash__: typing.ClassVar[None] = None
1534
1576
  @staticmethod
1535
1577
  def __getitem__(data, i):
1536
1578
  """
@@ -1574,6 +1616,20 @@ class Indicator:
1574
1616
  :rtype: bool
1575
1617
  """
1576
1618
  @staticmethod
1619
+ def heatmap(ind, axes = None):
1620
+ """
1621
+
1622
+ 绘制指标收益年-月收益热力图
1623
+
1624
+ 指标收益率 = (当前月末值 - 上月末值) / 上月末值 * 100
1625
+
1626
+ 指标应已计算(即有值),且为时间序列
1627
+
1628
+ :param ind: 指定指标
1629
+ :param axes: 绘制的轴对象,默认为None,表示创建新的轴对象
1630
+ :return: None
1631
+ """
1632
+ @staticmethod
1577
1633
  def plot(indicator, new = True, axes = None, kref = None, legend_on = False, text_on = False, text_color = 'k', zero_on = False, label = None, linestyle = '-', *args, **kwargs):
1578
1634
  """
1579
1635
  绘制indicator曲线
@@ -1647,6 +1703,8 @@ class Indicator:
1647
1703
  @typing.overload
1648
1704
  def __gt__(self, arg0: float) -> Indicator:
1649
1705
  ...
1706
+ def __hash__(self) -> int:
1707
+ ...
1650
1708
  @typing.overload
1651
1709
  def __init__(self) -> None:
1652
1710
  ...
@@ -3238,8 +3296,21 @@ class Portfolio:
3238
3296
  def _pybind11_conduit_v1_(*args, **kwargs):
3239
3297
  ...
3240
3298
  @staticmethod
3299
+ def heatmap(sys, axes = None):
3300
+ """
3301
+
3302
+ 绘制系统收益年-月收益热力图
3303
+ """
3304
+ @staticmethod
3241
3305
  def performance(sys, ref_stk = None):
3242
- ...
3306
+ """
3307
+
3308
+ 绘制系统绩效,即账户累积收益率曲线
3309
+
3310
+ :param SystemBase | PortfolioBase sys: SYS或PF实例
3311
+ :param Stock ref_stk: 参考股票, 默认为沪深300: sh000300, 绘制参考标的的收益曲线
3312
+ :return: None
3313
+ """
3243
3314
  def __getstate__(self) -> tuple:
3244
3315
  ...
3245
3316
  @typing.overload
@@ -3458,7 +3529,10 @@ class PositionRecord:
3458
3529
  @property
3459
3530
  def total_profit(self) -> float:
3460
3531
  """
3461
- 累计盈利 = 累计卖出资金 - 累计买入资金 - 累计交易成本
3532
+ total_profit(self):
3533
+
3534
+ 累计盈利 = 累计卖出资金 - 累计买入资金 - 累计交易成本
3535
+ 注意: 只对已清仓的记录有效, 未清仓的记录返回0
3462
3536
  """
3463
3537
  @property
3464
3538
  def total_risk(self) -> float:
@@ -5603,6 +5677,14 @@ class StrategyContext:
5603
5677
  def ktype_list(self, arg1: list[str]) -> None:
5604
5678
  ...
5605
5679
  @property
5680
+ def preload_num(self) -> dict[str, int]:
5681
+ """
5682
+ 预加载数量
5683
+ """
5684
+ @preload_num.setter
5685
+ def preload_num(self, arg1: dict[str, int]) -> None:
5686
+ ...
5687
+ @property
5606
5688
  def start_datetime(self) -> Datetime:
5607
5689
  """
5608
5690
  起始日期
@@ -5646,8 +5728,21 @@ class System:
5646
5728
  def _pybind11_conduit_v1_(*args, **kwargs):
5647
5729
  ...
5648
5730
  @staticmethod
5731
+ def heatmap(sys, axes = None):
5732
+ """
5733
+
5734
+ 绘制系统收益年-月收益热力图
5735
+ """
5736
+ @staticmethod
5649
5737
  def performance(sys, ref_stk = None):
5650
- ...
5738
+ """
5739
+
5740
+ 绘制系统绩效,即账户累积收益率曲线
5741
+
5742
+ :param SystemBase | PortfolioBase sys: SYS或PF实例
5743
+ :param Stock ref_stk: 参考股票, 默认为沪深300: sh000300, 绘制参考标的的收益曲线
5744
+ :return: None
5745
+ """
5651
5746
  @staticmethod
5652
5747
  def plot(sys, new = True, axes = None, style = 1, only_draw_close = False):
5653
5748
  """
@@ -6577,6 +6672,18 @@ class TradeManager:
6577
6672
  @staticmethod
6578
6673
  def _pybind11_conduit_v1_(*args, **kwargs):
6579
6674
  ...
6675
+ @staticmethod
6676
+ def heatmap(tm, start_date, end_date = None, axes = None):
6677
+ """
6678
+
6679
+ 绘制账户收益年-月收益热力图
6680
+
6681
+ :param tm: 交易账户
6682
+ :param start_date: 开始日期
6683
+ :param end_date: 结束日期,默认为今天
6684
+ :param axes: 绘制的轴对象,默认为None,表示创建新的轴对象
6685
+ :return: None
6686
+ """
6580
6687
  def __getstate__(self) -> tuple:
6581
6688
  ...
6582
6689
  @typing.overload
@@ -7512,7 +7619,7 @@ def AF_FixedWeightList(weights: list[float]) -> AllocateFundsBase:
7512
7619
  """
7513
7620
  AF_FixedWeightList(weights)
7514
7621
 
7515
- 固定比例资产分配列表
7622
+ 固定比例资产分配列表.
7516
7623
 
7517
7624
  :param float weights: 指定的资产比例列表
7518
7625
  """
@@ -7520,7 +7627,7 @@ def AF_MultiFactor() -> AllocateFundsBase:
7520
7627
  """
7521
7628
  AF_MultiFactor()
7522
7629
 
7523
- 创建 MultiFactor 评分权重的资产分配算法实例
7630
+ 创建 MultiFactor 评分权重的资产分配算法实例, 即直接以SE返回的评分作为权重。
7524
7631
  """
7525
7632
  @typing.overload
7526
7633
  def ALIGN(ref: DatetimeList, fill_null: bool = True) -> Indicator:
@@ -7607,23 +7714,14 @@ def ATAN(arg0: float) -> Indicator:
7607
7714
  def ATR(n: int = 14) -> Indicator:
7608
7715
  ...
7609
7716
  @typing.overload
7610
- def ATR(n: IndParam) -> Indicator:
7611
- ...
7612
- @typing.overload
7613
- def ATR(data: Indicator, n: IndParam) -> Indicator:
7614
- ...
7615
- @typing.overload
7616
- def ATR(data: Indicator, n: Indicator) -> Indicator:
7617
- ...
7618
- @typing.overload
7619
- def ATR(data: Indicator, n: int = 14) -> Indicator:
7717
+ def ATR(kdata: KData, n: int = 14) -> Indicator:
7620
7718
  """
7621
- ATR([data, n=14])
7719
+ ATR([kdata, n=14])
7622
7720
 
7623
- 平均真实波幅(Average True Range)
7721
+ 平均真实波幅(Average True Range), 真实波动幅度 TR 的简单移动均值
7624
7722
 
7625
- :param Indicator data 待计算的源数据
7626
- :param int|Indicator|IndParam n: 计算均值的周期窗口,必须为大于1的整数
7723
+ :param KData kdata 待计算的源数据
7724
+ :param int n: 计算均值的周期窗口,必须为大于1的整数
7627
7725
  :rtype: Indicator
7628
7726
  """
7629
7727
  @typing.overload
@@ -7728,6 +7826,23 @@ def BARSSINCE(arg0: float) -> Indicator:
7728
7826
  :rtype: Indicator
7729
7827
  """
7730
7828
  @typing.overload
7829
+ def BARSSINCEN(n: int) -> Indicator:
7830
+ ...
7831
+ @typing.overload
7832
+ def BARSSINCEN(cond: Indicator, n: int) -> Indicator:
7833
+ """
7834
+ BARSSINCEN(cond, n)
7835
+
7836
+ N周期内第一个条件成立到当前的周期数
7837
+
7838
+ 用法:BARSSINCEN(X,N):N周期内第一次X不为0到现在的周期数,N为常量BARSSINCEN(X,N)
7839
+ 例如:BARSSINCEN(HIGH>10,10)表示10个周期内股价超过10元时到当前的周期数
7840
+
7841
+ :param Indicator cond: 条件
7842
+ :param int|Indicator n: 时间窗口
7843
+ :rtype: Indicator
7844
+ """
7845
+ @typing.overload
7731
7846
  def BETWEEN(arg0: Indicator, arg1: Indicator, arg2: Indicator) -> Indicator:
7732
7847
  ...
7733
7848
  @typing.overload
@@ -8778,6 +8893,21 @@ def JUMPUP(arg0: Indicator) -> Indicator:
8778
8893
  :rtype: Indicator
8779
8894
  """
8780
8895
  @typing.overload
8896
+ def KALMAN(q: float = 0.01, r: float = 0.1) -> Indicator:
8897
+ ...
8898
+ @typing.overload
8899
+ def KALMAN(ind: Indicator, q: float = 0.01, r: float = 0.1) -> Indicator:
8900
+ """
8901
+ KALMAN(ind, [q=0.01], [r=0.1])
8902
+
8903
+ Kalman滤波器, 用于平滑指标, 可设置平滑系数q和r, 默认q=0.01, r=0.1
8904
+
8905
+ :param Indicator ind: 指标
8906
+ :param float q: 平滑系数
8907
+ :param float r: 噪声系数
8908
+ :rtype: Indicator
8909
+ """
8910
+ @typing.overload
8781
8911
  def KDATA_PART(data: KData, kpart: str) -> Indicator:
8782
8912
  ...
8783
8913
  @typing.overload
@@ -9868,6 +9998,10 @@ def SGN(arg0: Indicator) -> Indicator:
9868
9998
  :param Indicator data: 输入数据
9869
9999
  :rtype: Indicator
9870
10000
  """
10001
+ @typing.overload
10002
+ def SG_Add(sg_list: typing.Sequence, alternate: bool) -> SignalBase:
10003
+ ...
10004
+ @typing.overload
9871
10005
  def SG_Add(sg1: SignalBase, sg2: SignalBase, alternate: bool) -> SignalBase:
9872
10006
  """
9873
10007
  SG_Add(sg1, sg2, alternate)
@@ -9889,6 +10023,23 @@ def SG_AllwaysBuy() -> SignalBase:
9889
10023
  一个特殊的SG,持续每天发出买入信号,通常配合 PF 使用
9890
10024
  """
9891
10025
  @typing.overload
10026
+ def SG_And(sg_list: typing.Sequence, alternate: bool) -> SignalBase:
10027
+ ...
10028
+ @typing.overload
10029
+ def SG_And(sg1: SignalBase, sg2: SignalBase, alternate: bool) -> SignalBase:
10030
+ """
10031
+ SG_And(sg1, sg2, alternate)
10032
+
10033
+ 生成两个指标与的信号
10034
+
10035
+ 由于 SG 的 alternate 默认为 True, 在使用如 "sg1 + sg2 + sg3" 的形式时,容易忽略 sg1 + sg2 的 alternate 属性
10036
+ 建议使用: SG_Add(sg1, sg2, False) + sg3 来避免 alternate 的问题
10037
+
10038
+ :param SignalBase sg1: 输入信号1
10039
+ :param SignalBase sg2: 输入信号2
10040
+ :param bool alternate: 是否交替买入卖出,默认为True
10041
+ """
10042
+ @typing.overload
9892
10043
  def SG_Band(ind: Indicator, lower: Indicator, upper: Indicator) -> SignalBase:
9893
10044
  ...
9894
10045
  @typing.overload
@@ -9953,6 +10104,10 @@ def SG_Cycle() -> SignalBase:
9953
10104
 
9954
10105
  一个特殊的SG,配合PF使用,以 PF 调仓周期为买入信号
9955
10106
  """
10107
+ @typing.overload
10108
+ def SG_Div(sg_list: typing.Sequence, alternate: bool) -> SignalBase:
10109
+ ...
10110
+ @typing.overload
9956
10111
  def SG_Div(sg1: SignalBase, sg2: SignalBase, alternate: bool) -> SignalBase:
9957
10112
  """
9958
10113
  SG_Div(sg1, sg2, alternate)
@@ -9976,6 +10131,10 @@ def SG_Flex(op: Indicator, slow_n: int) -> SignalBase:
9976
10131
  :param int slow_n: 慢线EMA周期
9977
10132
  :return: 信号指示器
9978
10133
  """
10134
+ @typing.overload
10135
+ def SG_Mul(sg_list: typing.Sequence, alternate: bool) -> SignalBase:
10136
+ ...
10137
+ @typing.overload
9979
10138
  def SG_Mul(sg1: SignalBase, sg2: SignalBase, alternate: bool) -> SignalBase:
9980
10139
  """
9981
10140
  SG_Mul(sg1, sg2, alternate)
@@ -9999,6 +10158,23 @@ def SG_OneSide(ind: Indicator, is_buy: bool) -> SignalBase:
9999
10158
  :param bool is_buy: 构建的是买入信号,否则为卖出信号
10000
10159
  :return: 信号指示器
10001
10160
  """
10161
+ @typing.overload
10162
+ def SG_Or(sg_list: typing.Sequence, alternate: bool) -> SignalBase:
10163
+ ...
10164
+ @typing.overload
10165
+ def SG_Or(sg1: SignalBase, sg2: SignalBase, alternate: bool) -> SignalBase:
10166
+ """
10167
+ SG_Or(sg1, sg2, alternate)
10168
+
10169
+ 生成两个指标与的信号
10170
+
10171
+ 由于 SG 的 alternate 默认为 True, 在使用如 "sg1 + sg2 + sg3" 的形式时,容易忽略 sg1 + sg2 的 alternate 属性
10172
+ 建议使用: SG_Add(sg1, sg2, False) + sg3 来避免 alternate 的问题
10173
+
10174
+ :param SignalBase sg1: 输入信号1
10175
+ :param SignalBase sg2: 输入信号2
10176
+ :param bool alternate: 是否交替买入卖出,默认为True
10177
+ """
10002
10178
  def SG_Sell(ind: Indicator) -> SignalBase:
10003
10179
  """
10004
10180
  SG_Sell(ind)
@@ -10041,6 +10217,10 @@ def SG_Single2(ind: Indicator, filter_n: int = 10, filter_p: float = 0.1) -> Sig
10041
10217
  :param float filter_p: 过滤器百分比
10042
10218
  :return: 信号指示器
10043
10219
  """
10220
+ @typing.overload
10221
+ def SG_Sub(sg_list: typing.Sequence, alternate: bool) -> SignalBase:
10222
+ ...
10223
+ @typing.overload
10044
10224
  def SG_Sub(sg1: SignalBase, sg2: SignalBase, alternate: bool) -> SignalBase:
10045
10225
  """
10046
10226
  SG_Sub(sg1, sg2, alternate)
@@ -12419,6 +12599,22 @@ def TIMELINEVOL(arg0: KData) -> Indicator:
12419
12599
  :rtype: Indicator
12420
12600
  """
12421
12601
  @typing.overload
12602
+ def TR() -> Indicator:
12603
+ ...
12604
+ @typing.overload
12605
+ def TR(kdata: KData) -> Indicator:
12606
+ """
12607
+ TR([kdata])
12608
+
12609
+ 真实波动幅度(TR)是以下三个值中的最大值:
12610
+ 1. 当前周期最高价与最低价之差
12611
+ 2. 当前周期最高价与前一周期收盘价之差的绝对值
12612
+ 3. 当前周期最低价与前一周期收盘价之差的绝对值
12613
+
12614
+ :param KData kdata: K线数据
12615
+ :rtype: Indicator
12616
+ """
12617
+ @typing.overload
12422
12618
  def TURNOVER(n: int = 1) -> Indicator:
12423
12619
  ...
12424
12620
  @typing.overload
@@ -12508,14 +12704,34 @@ def VIGOR(n: int = 2) -> Indicator:
12508
12704
  :param int n: EMA平滑窗口
12509
12705
  :rtype: Indicator
12510
12706
  """
12707
+ @typing.overload
12708
+ def WEAVE(arg0: typing.Sequence) -> Indicator:
12709
+ ...
12710
+ @typing.overload
12511
12711
  def WEAVE(arg0: Indicator, arg1: Indicator) -> Indicator:
12712
+ ...
12713
+ @typing.overload
12714
+ def WEAVE(arg0: Indicator, arg1: Indicator, arg2: Indicator) -> Indicator:
12715
+ ...
12716
+ @typing.overload
12717
+ def WEAVE(arg0: Indicator, arg1: Indicator, arg2: Indicator, arg3: Indicator) -> Indicator:
12718
+ ...
12719
+ @typing.overload
12720
+ def WEAVE(arg0: Indicator, arg1: Indicator, arg2: Indicator, arg3: Indicator, arg4: Indicator) -> Indicator:
12721
+ ...
12722
+ @typing.overload
12723
+ def WEAVE(arg0: Indicator, arg1: Indicator, arg2: Indicator, arg3: Indicator, arg4: Indicator, arg5: Indicator) -> Indicator:
12512
12724
  """
12513
- WEAVE(ind1, ind2)
12725
+ WEAVE(ind1, ind2[, ind3, ind4, ind5, ind6])
12514
12726
 
12515
- 将ind1和ind2的结果组合在一起放在一个Indicator中。如ind = WEAVE(ind1, ind2), 则此时ind包含多个结果,按ind1、ind2的顺序存放。
12727
+ 将最多6个Indicator的结果组合在一起放在一个Indicator中。如ind = WEAVE(ind1, ind2), 则此时ind包含多个结果,按ind1、ind2的顺序存放。
12516
12728
 
12517
12729
  :param Indicator ind1: 指标1
12518
12730
  :param Indicator ind2: 指标2
12731
+ :param Indicator ind3: 指标3, 可省略
12732
+ :param Indicator ind4: 指标4, 可省略
12733
+ :param Indicator ind5: 指标5, 可省略
12734
+ :param Indicator ind6: 指标6, 可省略
12519
12735
  :rtype: Indicator
12520
12736
  """
12521
12737
  @typing.overload
@@ -12729,6 +12945,7 @@ def get_date_range(start: Datetime, end: Datetime) -> DatetimeList:
12729
12945
  get_date_range(start, end)
12730
12946
 
12731
12947
  获取指定 [start, end) 日期时间范围的自然日日历日期列表,仅支持到日
12948
+ 为防止内存占用过大,end如果超出系统明日日期,则强制为系统明日日期。
12732
12949
 
12733
12950
  :param Datetime start: 起始日期
12734
12951
  :param Datetime end: 结束日期
hikyuu/cpp/core38.pyd CHANGED
Binary file