hikyuu 2.5.6__py3-none-win_amd64.whl → 2.6.1__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.
- hikyuu/__init__.py +33 -49
- hikyuu/__init__.pyi +530 -516
- hikyuu/analysis/__init__.pyi +498 -490
- hikyuu/analysis/analysis.pyi +499 -491
- hikyuu/core.pyi +500 -492
- hikyuu/cpp/__init__.pyi +2 -2
- hikyuu/cpp/boost_date_time-mt.dll +0 -0
- hikyuu/cpp/boost_serialization-mt.dll +0 -0
- hikyuu/cpp/boost_wserialization-mt.dll +0 -0
- hikyuu/cpp/core310.pyd +0 -0
- hikyuu/cpp/core310.pyi +187 -22
- hikyuu/cpp/core311.pyd +0 -0
- hikyuu/cpp/core311.pyi +187 -22
- hikyuu/cpp/core312.pyd +0 -0
- hikyuu/cpp/core312.pyi +187 -22
- hikyuu/cpp/core313.pyd +0 -0
- hikyuu/cpp/core313.pyi +186 -22
- hikyuu/cpp/core39.pyd +0 -0
- hikyuu/cpp/core39.pyi +187 -22
- hikyuu/cpp/hikyuu.dll +0 -0
- hikyuu/cpp/hikyuu.lib +0 -0
- hikyuu/draw/__init__.pyi +1 -1
- hikyuu/draw/drawplot/__init__.py +2 -0
- hikyuu/draw/drawplot/__init__.pyi +9 -8
- hikyuu/draw/drawplot/bokeh_draw.pyi +519 -506
- hikyuu/draw/drawplot/common.pyi +1 -1
- hikyuu/draw/drawplot/echarts_draw.pyi +521 -508
- hikyuu/draw/drawplot/matplotlib_draw.py +80 -0
- hikyuu/draw/drawplot/matplotlib_draw.pyi +540 -517
- hikyuu/draw/elder.pyi +11 -11
- hikyuu/draw/kaufman.pyi +18 -18
- hikyuu/draw/volume.pyi +10 -10
- hikyuu/examples/notebook/002-HowToGetStock.ipynb +1 -1
- hikyuu/examples/notebook/004-IndicatorOverview.ipynb +117 -52
- hikyuu/extend.pyi +507 -500
- hikyuu/gui/HikyuuTDX.py +85 -15
- hikyuu/gui/data/ImportQmtToH5Task.py +209 -0
- hikyuu/gui/data/ImportTdxToH5Task.py +8 -1
- hikyuu/gui/data/MainWindow.py +94 -13
- hikyuu/gui/data/UseQmtImportToH5Thread.py +316 -0
- hikyuu/gui/data/UseTdxImportToH5Thread.py +221 -65
- hikyuu/gui/dataserver.py +25 -0
- hikyuu/gui/images/star.png +0 -0
- hikyuu/gui/importdata.py +24 -11
- hikyuu/hub.pyi +6 -6
- hikyuu/include/hikyuu/KData.h +5 -0
- hikyuu/include/hikyuu/KDataImp.h +4 -0
- hikyuu/include/hikyuu/StockManager.h +23 -0
- hikyuu/include/hikyuu/data_driver/kdata/mysql/KRecordTable.h +41 -2
- hikyuu/include/hikyuu/global/agent/spot_generated.h +3 -3
- hikyuu/include/hikyuu/indicator/crt/COUNT.h +3 -3
- hikyuu/include/hikyuu/indicator/crt/DISCARD.h +1 -1
- hikyuu/include/hikyuu/indicator/crt/ISINF.h +1 -1
- hikyuu/include/hikyuu/indicator/crt/ISINFA.h +1 -1
- hikyuu/include/hikyuu/indicator/crt/ISNA.h +1 -1
- hikyuu/include/hikyuu/indicator/crt/LAST.h +2 -2
- hikyuu/include/hikyuu/indicator/crt/MAX.h +1 -1
- hikyuu/include/hikyuu/indicator/crt/MIN.h +1 -1
- hikyuu/include/hikyuu/indicator/crt/PRICELIST.h +1 -15
- hikyuu/include/hikyuu/indicator/crt/SUMBARS.h +1 -1
- hikyuu/include/hikyuu/plugin/KDataToHdf5Importer.h +33 -0
- hikyuu/include/hikyuu/plugin/__init__.py +1 -0
- hikyuu/include/hikyuu/plugin/backtest.h +37 -0
- hikyuu/include/hikyuu/plugin/dataserver.h +18 -0
- hikyuu/include/hikyuu/plugin/device.h +29 -0
- hikyuu/include/hikyuu/plugin/interface/BackTestPluginInterface.h +26 -0
- hikyuu/include/hikyuu/plugin/interface/DataServerPluginInterface.h +23 -0
- hikyuu/include/hikyuu/plugin/interface/DevicePluginInterface.h +25 -0
- hikyuu/include/hikyuu/plugin/interface/ImportKDataToHdf5PluginInterface.h +33 -0
- hikyuu/include/hikyuu/plugin/interface/__init__.py +1 -0
- hikyuu/include/hikyuu/plugin/interface/plugins.h +22 -0
- hikyuu/include/hikyuu/python/pybind_utils.h +8 -0
- hikyuu/include/hikyuu/strategy/BrokerTradeManager.h +2 -1
- hikyuu/include/hikyuu/strategy/RunPortfolioInStrategy.h +1 -0
- hikyuu/include/hikyuu/strategy/Strategy.h +93 -16
- hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +4 -2
- hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +2 -1
- hikyuu/include/hikyuu/trade_sys/selector/SelectorBase.h +12 -9
- hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector.h +1 -1
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorSelector.h +12 -12
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorValueSelector.h +2 -2
- hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/PerformanceOptimalSelector.h +1 -1
- hikyuu/include/hikyuu/trade_sys/system/System.h +12 -3
- hikyuu/include/hikyuu/trade_sys/system/imp/DelegateSystem.h +0 -1
- hikyuu/include/hikyuu/trade_sys/system/imp/WalkForwardSystem.h +0 -1
- hikyuu/include/hikyuu/trade_sys/system/imp/WalkForwardTradeManager.h +3 -2
- hikyuu/include/hikyuu/utilities/arithmetic.h +32 -22
- hikyuu/include/hikyuu/utilities/datetime/Datetime.h +1 -0
- hikyuu/include/hikyuu/utilities/plugin/PluginClient.h +2 -2
- hikyuu/include/hikyuu/utilities/plugin/PluginLoader.h +66 -13
- hikyuu/include/hikyuu/utilities/plugin/PluginManager.h +72 -0
- hikyuu/include/hikyuu/version.h +5 -5
- hikyuu/plugin/__init__.py +1 -0
- hikyuu/plugin/backtest.dll +0 -0
- hikyuu/plugin/dataserver.dll +0 -0
- hikyuu/plugin/device.dll +0 -0
- hikyuu/plugin/import2hdf5.dll +0 -0
- hikyuu/strategy/strategy_demo1.py +7 -8
- hikyuu/strategy/strategy_demo2.py +1 -1
- hikyuu/trade_manage/__init__.pyi +518 -505
- hikyuu/trade_manage/broker.pyi +3 -3
- hikyuu/trade_manage/broker_easytrader.pyi +1 -1
- hikyuu/trade_manage/trade.pyi +518 -505
- hikyuu/util/__init__.py +1 -0
- hikyuu/util/__init__.pyi +2 -1
- hikyuu/util/mylog.py +30 -3
- hikyuu/util/mylog.pyi +3 -1
- hikyuu/util/singleton.pyi +1 -1
- {hikyuu-2.5.6.dist-info → hikyuu-2.6.1.dist-info}/METADATA +6 -2
- {hikyuu-2.5.6.dist-info → hikyuu-2.6.1.dist-info}/RECORD +115 -97
- {hikyuu-2.5.6.dist-info → hikyuu-2.6.1.dist-info}/entry_points.txt +1 -0
- {hikyuu-2.5.6.dist-info → hikyuu-2.6.1.dist-info}/top_level.txt +4 -0
- hikyuu/cpp/core38.pyd +0 -0
- hikyuu/cpp/core38.pyi +0 -13173
- hikyuu/examples/notebook/011-PyechartsDrawplot.ipynb +0 -21821
- /hikyuu/gui/{hikyuu_small.png → images/hikyuu_small.png} +0 -0
- {hikyuu-2.5.6.dist-info → hikyuu-2.6.1.dist-info}/LICENSE +0 -0
- {hikyuu-2.5.6.dist-info → hikyuu-2.6.1.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', 'KDataToHdf5Importer', 'KRecord', 'KRecordList', 'LAST', 'LASTVALUE', 'LIUTONGPAN', 'LLV', 'LLVBARS', 'LN', 'LOG', 'LOG_LEVEL', 'LONGCROSS', 'LoanRecord', 'MA', 'MACD', 'MAX', 'MDD', 'MF_EqualWeight', 'MF_ICIRWeight', 'MF_ICWeight', 'MF_Weight', 'MIN', 'MINUTE', 'MM_FixedCapital', 'MM_FixedCapitalFunds', 'MM_FixedCount', 'MM_FixedCountTps', 'MM_FixedPercent', 'MM_FixedRisk', 'MM_FixedUnits', 'MM_Nothing', 'MM_WilliamsFixedRisk', 'MOD', 'MONTH', 'MRR', 'MarketInfo', 'Microseconds', 'Milliseconds', 'Minutes', 'MoneyManagerBase', 'MultiFactorBase', 'NDAY', 'NOT', 'OFF', 'OrderBrokerBase', 'PF_Simple', 'PF_WithoutAF', 'PG_FixedHoldDays', 'PG_FixedPercent', 'PG_NoGoal', 'POS', 'POW', 'PRICELIST', 'Parameter', 'Performance', 'Portfolio', 'PositionRecord', 'PositionRecordList', 'ProfitGoalBase', 'Query', 'RECOVER_BACKWARD', 'RECOVER_EQUAL_BACKWARD', 'RECOVER_EQUAL_FORWARD', 'RECOVER_FORWARD', 'REF', 'REPLACE', 'RESULT', 'REVERSE', 'ROC', 'ROCP', 'ROCR', 'ROCR100', 'ROUND', 'ROUNDDOWN', 'ROUNDUP', 'RSI', 'SAFTYLOSS', 'SE_Fixed', 'SE_MaxFundsOptimal', 'SE_MultiFactor', 'SE_PerformanceOptimal', 'SE_Signal', 'SGN', 'SG_Add', 'SG_AllwaysBuy', 'SG_And', 'SG_Band', 'SG_Bool', 'SG_Buy', 'SG_Cross', 'SG_CrossGold', 'SG_Cycle', 'SG_Div', 'SG_Flex', 'SG_Mul', 'SG_OneSide', 'SG_Or', 'SG_Sell', 'SG_Single', 'SG_Single2', 'SG_Sub', 'SIN', 'SLICE', 'SLOPE', 'SMA', 'SPEARMAN', 'SP_FixedPercent', 'SP_FixedValue', 'SQRT', 'STDEV', 'STDP', 'ST_FixedPercent', 'ST_Indicator', 'ST_Saftyloss', 'SUM', 'SUMBARS', 'SYS_Simple', 'SYS_WalkForward', 'ScoreRecord', 'ScoreRecordList', 'Seconds', 'SelectorBase', 'SignalBase', 'SlippageBase', 'SpotRecord', 'Stock', 'StockManager', 'StockTypeInfo', 'StockWeight', 'StockWeightList', 'StoplossBase', 'Strategy', 'StrategyContext', 'System', 'SystemPart', 'SystemWeight', 'SystemWeightList', 'TAN', 'TA_ACCBANDS', 'TA_ACOS', 'TA_AD', 'TA_ADD', 'TA_ADOSC', 'TA_ADX', 'TA_ADXR', 'TA_APO', 'TA_AROON', 'TA_AROONOSC', 'TA_ASIN', 'TA_ATAN', 'TA_ATR', 'TA_AVGDEV', 'TA_AVGPRICE', 'TA_BBANDS', 'TA_BETA', 'TA_BOP', 'TA_CCI', 'TA_CDL2CROWS', 'TA_CDL3BLACKCROWS', 'TA_CDL3INSIDE', 'TA_CDL3LINESTRIKE', 'TA_CDL3OUTSIDE', 'TA_CDL3STARSINSOUTH', 'TA_CDL3WHITESOLDIERS', 'TA_CDLABANDONEDBABY', 'TA_CDLADVANCEBLOCK', 'TA_CDLBELTHOLD', 'TA_CDLBREAKAWAY', 'TA_CDLCLOSINGMARUBOZU', 'TA_CDLCONCEALBABYSWALL', 'TA_CDLCOUNTERATTACK', 'TA_CDLDARKCLOUDCOVER', 'TA_CDLDOJI', 'TA_CDLDOJISTAR', 'TA_CDLDRAGONFLYDOJI', 'TA_CDLENGULFING', 'TA_CDLEVENINGDOJISTAR', 'TA_CDLEVENINGSTAR', 'TA_CDLGAPSIDESIDEWHITE', 'TA_CDLGRAVESTONEDOJI', 'TA_CDLHAMMER', 'TA_CDLHANGINGMAN', 'TA_CDLHARAMI', 'TA_CDLHARAMICROSS', 'TA_CDLHIGHWAVE', 'TA_CDLHIKKAKE', 'TA_CDLHIKKAKEMOD', 'TA_CDLHOMINGPIGEON', 'TA_CDLIDENTICAL3CROWS', 'TA_CDLINNECK', 'TA_CDLINVERTEDHAMMER', 'TA_CDLKICKING', 'TA_CDLKICKINGBYLENGTH', 'TA_CDLLADDERBOTTOM', 'TA_CDLLONGLEGGEDDOJI', 'TA_CDLLONGLINE', 'TA_CDLMARUBOZU', 'TA_CDLMATCHINGLOW', 'TA_CDLMATHOLD', 'TA_CDLMORNINGDOJISTAR', 'TA_CDLMORNINGSTAR', 'TA_CDLONNECK', 'TA_CDLPIERCING', 'TA_CDLRICKSHAWMAN', 'TA_CDLRISEFALL3METHODS', 'TA_CDLSEPARATINGLINES', 'TA_CDLSHOOTINGSTAR', 'TA_CDLSHORTLINE', 'TA_CDLSPINNINGTOP', 'TA_CDLSTALLEDPATTERN', 'TA_CDLSTICKSANDWICH', 'TA_CDLTAKURI', 'TA_CDLTASUKIGAP', 'TA_CDLTHRUSTING', 'TA_CDLTRISTAR', 'TA_CDLUNIQUE3RIVER', 'TA_CDLUPSIDEGAP2CROWS', 'TA_CDLXSIDEGAP3METHODS', 'TA_CEIL', 'TA_CMO', 'TA_CORREL', 'TA_COS', 'TA_COSH', 'TA_DEMA', 'TA_DIV', 'TA_DX', 'TA_EMA', 'TA_EXP', 'TA_FLOOR', 'TA_HT_DCPERIOD', 'TA_HT_DCPHASE', 'TA_HT_PHASOR', 'TA_HT_SINE', 'TA_HT_TRENDLINE', 'TA_HT_TRENDMODE', 'TA_IMI', 'TA_KAMA', 'TA_LINEARREG', 'TA_LINEARREG_ANGLE', 'TA_LINEARREG_INTERCEPT', 'TA_LINEARREG_SLOPE', 'TA_LN', 'TA_LOG10', 'TA_MA', 'TA_MACD', 'TA_MACDEXT', 'TA_MACDFIX', 'TA_MAMA', 'TA_MAVP', 'TA_MAX', 'TA_MAXINDEX', 'TA_MEDPRICE', 'TA_MFI', 'TA_MIDPOINT', 'TA_MIDPRICE', 'TA_MIN', 'TA_MININDEX', 'TA_MINMAX', 'TA_MINMAXINDEX', 'TA_MINUS_DI', 'TA_MINUS_DM', 'TA_MOM', 'TA_MULT', 'TA_NATR', 'TA_OBV', 'TA_PLUS_DI', 'TA_PLUS_DM', 'TA_PPO', 'TA_ROC', 'TA_ROCP', 'TA_ROCR', 'TA_ROCR100', 'TA_RSI', 'TA_SAR', 'TA_SAREXT', 'TA_SIN', 'TA_SINH', 'TA_SMA', 'TA_SQRT', 'TA_STDDEV', 'TA_STOCH', 'TA_STOCHF', 'TA_STOCHRSI', 'TA_SUB', 'TA_SUM', 'TA_T3', 'TA_TAN', 'TA_TANH', 'TA_TEMA', 'TA_TRANGE', 'TA_TRIMA', 'TA_TRIX', 'TA_TSF', 'TA_TYPPRICE', 'TA_ULTOSC', 'TA_VAR', 'TA_WCLPRICE', 'TA_WILLR', 'TA_WMA', 'TC_FixedA', 'TC_FixedA2015', 'TC_FixedA2017', 'TC_TestStub', 'TC_Zero', 'TIME', 'TIMELINE', 'TIMELINEVOL', 'TR', 'TRACE', 'TURNOVER', 'TimeDelta', 'TimeLineList', 'TimeLineRecord', 'TradeCostBase', 'TradeManager', 'TradeRecord', 'TradeRecordList', 'TradeRequest', 'TransList', 'TransRecord', 'UPNDAY', 'VAR', 'VARP', 'VIGOR', 'WARN', 'WEAVE', 'WEEK', 'WINNER', 'WMA', 'YEAR', 'ZHBOND10', 'ZONGGUBEN', 'ZSCORE', 'active_device', 'backtest', 'batch_calculate_inds', 'can_upgrade', 'close_ostream_to_python', 'close_spend_time', 'combinate_ind', 'combinate_index', 'constant', 'crtBrokerTM', 'crtSEOptimal', 'crtTM', 'crt_pf_strategy', 'crt_sys_strategy', 'fetch_trial_license', 'find_optimal_system', 'find_optimal_system_multi', 'get_block', 'get_business_name', 'get_data_from_buffer_server', 'get_date_range', 'get_kdata', 'get_last_version', 'get_log_level', 'get_stock', 'get_system_part_enum', 'get_system_part_name', 'get_version', 'get_version_git', 'get_version_with_build', 'hikyuu_init', 'inner_analysis_sys_list', 'inner_combinate_ind_analysis', 'inner_combinate_ind_analysis_with_block', 'isinf', 'isnan', 'open_ostream_to_python', 'open_spend_time', 'remove_license', 'roundDown', 'roundEx', 'roundUp', 'run_in_strategy', 'set_log_level', 'set_python_in_interactive', 'set_python_in_jupyter', 'start_data_server', 'start_spot_agent', 'stop_data_server', 'stop_spot_agent', 'toPriceList', 'view_license']
|
|
5
5
|
class AllocateFundsBase:
|
|
6
6
|
"""
|
|
7
7
|
资产分配算法基类, 子类接口:
|
|
@@ -2365,6 +2365,31 @@ class KDataDriver:
|
|
|
2365
2365
|
"""
|
|
2366
2366
|
驱动名称
|
|
2367
2367
|
"""
|
|
2368
|
+
class KDataToHdf5Importer:
|
|
2369
|
+
"""
|
|
2370
|
+
K线数据导入器
|
|
2371
|
+
"""
|
|
2372
|
+
@staticmethod
|
|
2373
|
+
def _pybind11_conduit_v1_(*args, **kwargs):
|
|
2374
|
+
...
|
|
2375
|
+
def __init__(self) -> None:
|
|
2376
|
+
...
|
|
2377
|
+
def add_krecord_list(self, arg0: str, arg1: str, arg2: KRecordList, arg3: str) -> None:
|
|
2378
|
+
"""
|
|
2379
|
+
添加K线数据
|
|
2380
|
+
"""
|
|
2381
|
+
def get_last_datetime(self, arg0: str, arg1: str, arg2: str) -> Datetime:
|
|
2382
|
+
"""
|
|
2383
|
+
获取指定市场指定证券最后K线时间
|
|
2384
|
+
"""
|
|
2385
|
+
def set_config(self, arg0: str, arg1: list[str]) -> bool:
|
|
2386
|
+
"""
|
|
2387
|
+
设置数据保存路径和数据源列表
|
|
2388
|
+
"""
|
|
2389
|
+
def update_index(self, arg0: str, arg1: str, arg2: str) -> None:
|
|
2390
|
+
"""
|
|
2391
|
+
更新索引
|
|
2392
|
+
"""
|
|
2368
2393
|
class KRecord:
|
|
2369
2394
|
"""
|
|
2370
2395
|
K线记录,组成K线数据,属性可读写
|
|
@@ -3357,16 +3382,6 @@ class Portfolio:
|
|
|
3357
3382
|
|
|
3358
3383
|
运行投资组合策略。在查询条件及各组件没有变化时,PF在第二次执行时,默认不会实际进行计算。
|
|
3359
3384
|
但由于各个组件的参数可能改变,此种情况无法自动判断是否需要重计算,可以手工指定进行强制计算。
|
|
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
3385
|
|
|
3371
3386
|
:param Query query: 查询条件
|
|
3372
3387
|
:param bool force: 强制重新计算
|
|
@@ -4694,7 +4709,8 @@ class Stock:
|
|
|
4694
4709
|
"""
|
|
4695
4710
|
get_history_finance(self)
|
|
4696
4711
|
|
|
4697
|
-
|
|
4712
|
+
获取所有历史财务信息历史记录, 字段信息可参考 StockManager 中的相关方法: get_history_finance_all_fields/get_history_finance_field_index/get_history_finance_field_name 方法
|
|
4713
|
+
日常建议直接使用指标 FINANCE 获取财务数据
|
|
4698
4714
|
"""
|
|
4699
4715
|
def get_kdata(self, arg0: Query) -> KData:
|
|
4700
4716
|
"""
|
|
@@ -5107,6 +5123,12 @@ class StockManager:
|
|
|
5107
5123
|
|
|
5108
5124
|
:rtype: StringList
|
|
5109
5125
|
"""
|
|
5126
|
+
def get_plugin_path(self) -> str:
|
|
5127
|
+
"""
|
|
5128
|
+
get_plugin_path(self)
|
|
5129
|
+
|
|
5130
|
+
获取插件路径
|
|
5131
|
+
"""
|
|
5110
5132
|
def get_preload_parameter(self) -> ...:
|
|
5111
5133
|
"""
|
|
5112
5134
|
获取当前预加载参数
|
|
@@ -5211,6 +5233,12 @@ class StockManager:
|
|
|
5211
5233
|
|
|
5212
5234
|
:param Block block: 板块实例
|
|
5213
5235
|
"""
|
|
5236
|
+
def set_plugin_path(self, arg0: str) -> None:
|
|
5237
|
+
"""
|
|
5238
|
+
set_plugin_path(self, path)
|
|
5239
|
+
|
|
5240
|
+
设置插件路径,仅在初始化之前设置有效
|
|
5241
|
+
"""
|
|
5214
5242
|
def tmpdir(self) -> str:
|
|
5215
5243
|
"""
|
|
5216
5244
|
tmpdir(self) -> str
|
|
@@ -5575,12 +5603,13 @@ class Strategy:
|
|
|
5575
5603
|
def __init__(self) -> None:
|
|
5576
5604
|
...
|
|
5577
5605
|
@typing.overload
|
|
5578
|
-
def __init__(self, code_list: list[str], ktype_list: list[str], name: str = 'Strategy', config: str = '') -> None:
|
|
5606
|
+
def __init__(self, code_list: list[str], ktype_list: list[str], preload_num: dict[str, int] = {}, name: str = 'Strategy', config: str = '') -> None:
|
|
5579
5607
|
"""
|
|
5580
5608
|
创建策略运行时
|
|
5581
5609
|
|
|
5582
5610
|
:param list code_list: 证券代码列表,如:["sz000001", "sz000002"], "all" 代表全部证券
|
|
5583
5611
|
:param list ktype_list: K线类型列表, 如: ["day", "min"]
|
|
5612
|
+
:param dict preload_num: 预加载的K线数量,如:{"day_max": 1000, "min_max": 2000}
|
|
5584
5613
|
:param str name: 策略名称
|
|
5585
5614
|
:param str config: 配置文件名称(如需要使用独立的配置文件,否则为空时使用默认的hikyuu配置文件)
|
|
5586
5615
|
"""
|
|
@@ -5593,13 +5622,27 @@ class Strategy:
|
|
|
5593
5622
|
:param str name: 策略名称
|
|
5594
5623
|
:param str config: 配置文件名称(如需要使用独立的配置文件,否则为空时使用默认的hikyuu配置文件)
|
|
5595
5624
|
"""
|
|
5625
|
+
def buy(self, stock: Stock, price: float, num: float, stoploss: float = 0.0, goal_price: float = 0.0, part: SystemPart = ...) -> TradeRecord:
|
|
5626
|
+
...
|
|
5627
|
+
def get_kdata(self, stk: Stock, start_date: Datetime, end_date: Datetime, ktype: str, recover_type: Query.RecoverType = ...) -> KData:
|
|
5628
|
+
...
|
|
5629
|
+
@typing.overload
|
|
5630
|
+
def get_last_kdata(self, stk: Stock, start_date: Datetime, ktype: str, recover_type: Query.RecoverType = ...) -> KData:
|
|
5631
|
+
...
|
|
5632
|
+
@typing.overload
|
|
5633
|
+
def get_last_kdata(self, stk: Stock, lastnum: int, ktype: str, recover_type: Query.RecoverType = ...) -> KData:
|
|
5634
|
+
...
|
|
5635
|
+
def next_datetime(self) -> Datetime:
|
|
5636
|
+
...
|
|
5637
|
+
def now(self) -> Datetime:
|
|
5638
|
+
...
|
|
5596
5639
|
def on_change(self, arg0: typing.Any) -> None:
|
|
5597
5640
|
"""
|
|
5598
5641
|
onchang(self, func)
|
|
5599
5642
|
|
|
5600
5643
|
设置证券数据更新回调通知
|
|
5601
5644
|
|
|
5602
|
-
:param func:
|
|
5645
|
+
:param func: 一个可调用的对象如普通函数, func(stg: Strategy, stock: Stock, spot: SpotRecord
|
|
5603
5646
|
"""
|
|
5604
5647
|
def on_received_spot(self, arg0: typing.Any) -> None:
|
|
5605
5648
|
"""
|
|
@@ -5607,7 +5650,7 @@ class Strategy:
|
|
|
5607
5650
|
|
|
5608
5651
|
设置证券数据更新通知回调
|
|
5609
5652
|
|
|
5610
|
-
:param func:
|
|
5653
|
+
:param func: 可调用对象如普通函数, func(stg: Strategy, revTime: Datetime)
|
|
5611
5654
|
"""
|
|
5612
5655
|
def run_daily(self, func: typing.Any, time: TimeDelta, market: str = 'SH', ignore_market: bool = False) -> None:
|
|
5613
5656
|
"""
|
|
@@ -5616,7 +5659,7 @@ class Strategy:
|
|
|
5616
5659
|
设置日内循环执行回调。如果忽略市场开闭市,则自启动时刻开始按间隔时间循环,
|
|
5617
5660
|
否则第一次执行时将开盘时间对齐时间间隔,且在非开市时间停止执行。
|
|
5618
5661
|
|
|
5619
|
-
:param func:
|
|
5662
|
+
:param func: 可调用对象如普通函数,func(stg: Strategy)
|
|
5620
5663
|
:param TimeDelta time: 间隔时间,如间隔3秒:TimeDelta(0, 0, 0, 3) 或 Seconds(3)
|
|
5621
5664
|
:param str market: 使用哪个市场的开闭市时间
|
|
5622
5665
|
:param ignore_market: 忽略市场开闭市时间
|
|
@@ -5627,10 +5670,12 @@ class Strategy:
|
|
|
5627
5670
|
|
|
5628
5671
|
设置每日定点执行回调
|
|
5629
5672
|
|
|
5630
|
-
:param func:
|
|
5673
|
+
:param func: 可调用对象如普通函数,func(stg: Strategy)
|
|
5631
5674
|
:param TimeDelta time: 执行时刻,如每日15点:TimeDelta(0, 15)
|
|
5632
5675
|
:param ignore_holiday: 节假日不执行
|
|
5633
5676
|
"""
|
|
5677
|
+
def sell(self, stock: Stock, price: float, num: float, stoploss: float = 0.0, goal_price: float = 0.0, part: SystemPart = ...) -> TradeRecord:
|
|
5678
|
+
...
|
|
5634
5679
|
def start(self, auto_recieve_spot: bool = True) -> None:
|
|
5635
5680
|
"""
|
|
5636
5681
|
start(self)
|
|
@@ -5639,12 +5684,19 @@ class Strategy:
|
|
|
5639
5684
|
|
|
5640
5685
|
:param bool auto_recieve_spot: 是否自动接收行情数据
|
|
5641
5686
|
"""
|
|
5687
|
+
def today(self) -> Datetime:
|
|
5688
|
+
...
|
|
5642
5689
|
@property
|
|
5643
5690
|
def context(self) -> StrategyContext:
|
|
5644
5691
|
"""
|
|
5645
5692
|
获取策略上下文
|
|
5646
5693
|
"""
|
|
5647
5694
|
@property
|
|
5695
|
+
def is_backtesting(self) -> bool:
|
|
5696
|
+
"""
|
|
5697
|
+
回测状态
|
|
5698
|
+
"""
|
|
5699
|
+
@property
|
|
5648
5700
|
def name(self) -> str:
|
|
5649
5701
|
"""
|
|
5650
5702
|
策略名称
|
|
@@ -5652,6 +5704,27 @@ class Strategy:
|
|
|
5652
5704
|
@name.setter
|
|
5653
5705
|
def name(self, arg1: str) -> None:
|
|
5654
5706
|
...
|
|
5707
|
+
@property
|
|
5708
|
+
def running(self) -> bool:
|
|
5709
|
+
"""
|
|
5710
|
+
获取当前运行状态
|
|
5711
|
+
"""
|
|
5712
|
+
@property
|
|
5713
|
+
def sp(self) -> SlippageBase:
|
|
5714
|
+
"""
|
|
5715
|
+
移滑价差算法
|
|
5716
|
+
"""
|
|
5717
|
+
@sp.setter
|
|
5718
|
+
def sp(self, arg1: SlippageBase) -> None:
|
|
5719
|
+
...
|
|
5720
|
+
@property
|
|
5721
|
+
def tm(self) -> TradeManager:
|
|
5722
|
+
"""
|
|
5723
|
+
关联的交易管理实例
|
|
5724
|
+
"""
|
|
5725
|
+
@tm.setter
|
|
5726
|
+
def tm(self, arg1: TradeManager) -> None:
|
|
5727
|
+
...
|
|
5655
5728
|
class StrategyContext:
|
|
5656
5729
|
"""
|
|
5657
5730
|
策略上下文
|
|
@@ -6685,6 +6758,16 @@ class TradeManager:
|
|
|
6685
6758
|
:param axes: 绘制的轴对象,默认为None,表示创建新的轴对象
|
|
6686
6759
|
:return: None
|
|
6687
6760
|
"""
|
|
6761
|
+
@staticmethod
|
|
6762
|
+
def performance(tm: TradeManager, query: Query, ref_stk: Stock = None):
|
|
6763
|
+
"""
|
|
6764
|
+
|
|
6765
|
+
绘制系统绩效,即账户累积收益率曲线
|
|
6766
|
+
|
|
6767
|
+
:param SystemBase | PortfolioBase sys: SYS或PF实例
|
|
6768
|
+
:param Stock ref_stk: 参考股票, 默认为沪深300: sh000300, 绘制参考标的的收益曲线
|
|
6769
|
+
:return: None
|
|
6770
|
+
"""
|
|
6688
6771
|
def __getstate__(self) -> tuple:
|
|
6689
6772
|
...
|
|
6690
6773
|
@typing.overload
|
|
@@ -6784,7 +6867,7 @@ class TradeManager:
|
|
|
6784
6867
|
"""
|
|
6785
6868
|
克隆(深复制)实例
|
|
6786
6869
|
"""
|
|
6787
|
-
def fetch_asset_info_from_broker(self, arg0: OrderBrokerBase) -> None:
|
|
6870
|
+
def fetch_asset_info_from_broker(self, arg0: OrderBrokerBase, arg1: Datetime) -> None:
|
|
6788
6871
|
...
|
|
6789
6872
|
def getParam(self, arg0: str) -> any:
|
|
6790
6873
|
"""
|
|
@@ -9253,7 +9336,7 @@ def MF_ICWeight(inds: typing.Sequence, stks: typing.Sequence, query: Query, ref_
|
|
|
9253
9336
|
def MF_Weight() -> MultiFactorBase:
|
|
9254
9337
|
...
|
|
9255
9338
|
@typing.overload
|
|
9256
|
-
def MF_Weight(inds: typing.Sequence,
|
|
9339
|
+
def MF_Weight(inds: typing.Sequence, stks: typing.Sequence, weights: typing.Sequence, query: Query, ref_stk: typing.Any = None, ic_n: int = 5, spearman: bool = True) -> MultiFactorBase:
|
|
9257
9340
|
"""
|
|
9258
9341
|
MF_EqualWeight(inds, stks, query, ref_stk[, ic_n=5])
|
|
9259
9342
|
|
|
@@ -9589,8 +9672,17 @@ def POW(data: float, n: int) -> Indicator:
|
|
|
9589
9672
|
:param int|Indicator|IndParam n: 幂
|
|
9590
9673
|
:rtype: Indicator
|
|
9591
9674
|
"""
|
|
9592
|
-
def PRICELIST(data: typing.Any
|
|
9593
|
-
|
|
9675
|
+
def PRICELIST(data: typing.Any = None, discard: int = 0, align_dates: typing.Any = None) -> Indicator:
|
|
9676
|
+
"""
|
|
9677
|
+
PRICELIST([data=None, discard=0, align_dates=None])
|
|
9678
|
+
|
|
9679
|
+
将python数组(如 list, tuple, numpy.array)转换为Indicator对象。
|
|
9680
|
+
|
|
9681
|
+
:param sequence data: 输入数据
|
|
9682
|
+
:param int discard: 丢弃前多少个数据
|
|
9683
|
+
:param sequence align_dates: 对齐日期列表,如果为空则不进行对齐
|
|
9684
|
+
:rtype: Indicator
|
|
9685
|
+
"""
|
|
9594
9686
|
@typing.overload
|
|
9595
9687
|
def RECOVER_BACKWARD() -> Indicator:
|
|
9596
9688
|
...
|
|
@@ -12850,6 +12942,36 @@ def ZSCORE(data: Indicator, out_extreme: bool = False, nsigma: float = 3.0, recu
|
|
|
12850
12942
|
:param bool recursive: 是否进行递归剔除极值,默认 False
|
|
12851
12943
|
:rtype: Indicator
|
|
12852
12944
|
"""
|
|
12945
|
+
def active_device(arg0: str) -> None:
|
|
12946
|
+
"""
|
|
12947
|
+
active_device(active_code: str)
|
|
12948
|
+
|
|
12949
|
+
VIP功能授权码激活设备
|
|
12950
|
+
|
|
12951
|
+
:param str active_code: 授权码
|
|
12952
|
+
"""
|
|
12953
|
+
@typing.overload
|
|
12954
|
+
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:
|
|
12955
|
+
...
|
|
12956
|
+
@typing.overload
|
|
12957
|
+
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:
|
|
12958
|
+
"""
|
|
12959
|
+
backtest([context], on_bar, tm, start_date, end_date, ktype, ref_market, mode)
|
|
12960
|
+
|
|
12961
|
+
事件驱动式回测, 通常直接测试 Strategy 中的主体函数
|
|
12962
|
+
|
|
12963
|
+
如果 hikyuu 已经加载数据,可以忽略 context 参数。否则通 Strategy 类似,需要主动传入 context 参数,
|
|
12964
|
+
context 中包含需要加载的股票代码、K线类型、K线数量、K线起始日期等信息。
|
|
12965
|
+
|
|
12966
|
+
:param StrategyContext context: 策略上下文 ()
|
|
12967
|
+
:param func on_bar: 策略主体执行函数, 如: on_bar(stg: Strategy)
|
|
12968
|
+
:param TradeManager tm: 策略测试账户
|
|
12969
|
+
:param Datetime start_date: 起始日期
|
|
12970
|
+
:param Datetime end_date: 结束日期(不包含其本身)
|
|
12971
|
+
:param Query.KType ktype: K线类型(按该类型逐 Bar 执行测试)
|
|
12972
|
+
:param str ref_market: 所属市场
|
|
12973
|
+
:param mode 模式 0: 当前bar收盘价执行买卖操作; 1: 下一bar开盘价执行买卖操作
|
|
12974
|
+
"""
|
|
12853
12975
|
def batch_calculate_inds(arg0: typing.Sequence, arg1: KData) -> list:
|
|
12854
12976
|
"""
|
|
12855
12977
|
batch_calculate_inds(inds, kdata) -> list)
|
|
@@ -12917,6 +13039,14 @@ def crt_pf_strategy(pf: Portfolio, query: Query, broker: OrderBrokerBase, cost_f
|
|
|
12917
13039
|
...
|
|
12918
13040
|
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
13041
|
...
|
|
13042
|
+
def fetch_trial_license(arg0: str) -> str:
|
|
13043
|
+
"""
|
|
13044
|
+
fetch_trial_license(email: str)
|
|
13045
|
+
|
|
13046
|
+
获取试用授权码
|
|
13047
|
+
|
|
13048
|
+
:param str email: 邮箱地址
|
|
13049
|
+
"""
|
|
12920
13050
|
def find_optimal_system(sys_list: list[System], stock: Stock, query: Query, sort_key: str = '', sort_mode: int = 0) -> tuple[float, System]:
|
|
12921
13051
|
...
|
|
12922
13052
|
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 +13070,13 @@ def get_business_name(arg0: BUSINESS) -> str:
|
|
|
12940
13070
|
:rtype: string
|
|
12941
13071
|
"""
|
|
12942
13072
|
def get_data_from_buffer_server(arg0: str, arg1: list[Stock], arg2: str) -> None:
|
|
12943
|
-
|
|
13073
|
+
"""
|
|
13074
|
+
get_data_from_buffer_server(addr: str, stklist: list, ktype: Query.KType)
|
|
13075
|
+
|
|
13076
|
+
:param str addr: 数据服务器地址
|
|
13077
|
+
:param list stklist: 需要获取数据的股票列表
|
|
13078
|
+
:param Query.KType ktype: 数据类型
|
|
13079
|
+
"""
|
|
12944
13080
|
def get_date_range(start: Datetime, end: Datetime) -> DatetimeList:
|
|
12945
13081
|
"""
|
|
12946
13082
|
get_date_range(start, end)
|
|
@@ -13054,6 +13190,12 @@ def open_spend_time() -> None:
|
|
|
13054
13190
|
"""
|
|
13055
13191
|
全局开启 c++ 部分耗时打印
|
|
13056
13192
|
"""
|
|
13193
|
+
def remove_license() -> None:
|
|
13194
|
+
"""
|
|
13195
|
+
remove_license()
|
|
13196
|
+
|
|
13197
|
+
移除当前授权
|
|
13198
|
+
"""
|
|
13057
13199
|
@typing.overload
|
|
13058
13200
|
def roundDown(number: float, ndigits: int = 0) -> float:
|
|
13059
13201
|
...
|
|
@@ -13133,14 +13275,36 @@ def set_python_in_interactive(arg0: bool) -> None:
|
|
|
13133
13275
|
...
|
|
13134
13276
|
def set_python_in_jupyter(arg0: bool) -> None:
|
|
13135
13277
|
...
|
|
13278
|
+
def start_data_server(addr: str = 'tcp://0.0.0.0:9201', work_num: int = 2) -> None:
|
|
13279
|
+
"""
|
|
13280
|
+
start_data_server(addr: str[, work_num: int=2])
|
|
13281
|
+
|
|
13282
|
+
启动数据缓存服务
|
|
13283
|
+
|
|
13284
|
+
:param str addr: 服务器地址
|
|
13285
|
+
:param int work_num: 工作线程数
|
|
13286
|
+
:return: None
|
|
13287
|
+
"""
|
|
13136
13288
|
def start_spot_agent(print: bool = False, worker_num: int = 1, addr: str = '') -> None:
|
|
13137
13289
|
...
|
|
13290
|
+
def stop_data_server() -> None:
|
|
13291
|
+
"""
|
|
13292
|
+
stop_data_server()
|
|
13293
|
+
|
|
13294
|
+
停止数据缓存服务
|
|
13295
|
+
"""
|
|
13138
13296
|
def stop_spot_agent() -> None:
|
|
13139
13297
|
...
|
|
13140
13298
|
def toPriceList(arg0: typing.Sequence) -> list[float]:
|
|
13141
13299
|
"""
|
|
13142
13300
|
将 python list/tuple/np.arry 对象转化为 PriceList 对象
|
|
13143
13301
|
"""
|
|
13302
|
+
def view_license() -> str:
|
|
13303
|
+
"""
|
|
13304
|
+
view_license()
|
|
13305
|
+
|
|
13306
|
+
查看设备授权信息
|
|
13307
|
+
"""
|
|
13144
13308
|
DEBUG: LOG_LEVEL # value = <LOG_LEVEL.DEBUG: 1>
|
|
13145
13309
|
ERROR: LOG_LEVEL # value = <LOG_LEVEL.ERROR: 4>
|
|
13146
13310
|
FATAL: LOG_LEVEL # value = <LOG_LEVEL.FATAL: 5>
|
hikyuu/cpp/core39.pyd
CHANGED
|
Binary file
|