hikyuu 2.6.7__py3-none-win_amd64.whl → 2.6.8.2__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 +6 -2
- hikyuu/__init__.pyi +37 -10
- hikyuu/analysis/__init__.pyi +24 -0
- hikyuu/analysis/analysis.pyi +25 -1
- hikyuu/core.pyi +26 -2
- hikyuu/cpp/concrt140.dll +0 -0
- hikyuu/cpp/core310.pyd +0 -0
- hikyuu/cpp/core310.pyi +419 -31
- hikyuu/cpp/core311.pyd +0 -0
- hikyuu/cpp/core311.pyi +419 -31
- hikyuu/cpp/core312.pyd +0 -0
- hikyuu/cpp/core312.pyi +419 -31
- hikyuu/cpp/core313.pyd +0 -0
- hikyuu/cpp/core313.pyi +419 -31
- hikyuu/cpp/core39.pyd +0 -0
- hikyuu/cpp/core39.pyi +419 -31
- hikyuu/cpp/hikyuu.dll +0 -0
- hikyuu/cpp/hikyuu.lib +0 -0
- hikyuu/cpp/hku_hdf5.dll +0 -0
- hikyuu/cpp/hku_hdf5_cpp.dll +0 -0
- hikyuu/cpp/hku_hdf5_hl.dll +0 -0
- hikyuu/cpp/hku_hdf5_hl_cpp.dll +0 -0
- hikyuu/cpp/i18n/zh_CN/hikyuu.mo +0 -0
- hikyuu/cpp/msvcp140.dll +0 -0
- hikyuu/cpp/msvcp140_1.dll +0 -0
- hikyuu/cpp/msvcp140_2.dll +0 -0
- hikyuu/cpp/msvcp140_atomic_wait.dll +0 -0
- hikyuu/cpp/msvcp140_codecvt_ids.dll +0 -0
- hikyuu/cpp/sqlite3.dll +0 -0
- hikyuu/cpp/vcruntime140.dll +0 -0
- hikyuu/cpp/vcruntime140_1.dll +0 -0
- hikyuu/draw/__init__.pyi +1 -1
- hikyuu/draw/drawplot/bokeh_draw.pyi +33 -8
- hikyuu/draw/drawplot/echarts_draw.pyi +33 -8
- hikyuu/draw/drawplot/matplotlib_draw.pyi +33 -8
- hikyuu/extend.py +19 -0
- hikyuu/extend.pyi +27 -3
- hikyuu/hub.pyi +6 -6
- hikyuu/include/hikyuu/DataType.h +2 -2
- hikyuu/include/hikyuu/KData.h +91 -25
- hikyuu/include/hikyuu/KDataImp.h +31 -46
- hikyuu/include/hikyuu/KDataPrivatedBufferImp.h +73 -0
- hikyuu/include/hikyuu/KDataSharedBufferImp.h +69 -0
- hikyuu/include/hikyuu/KQuery.h +16 -4
- hikyuu/include/hikyuu/KRecord.h +4 -1
- hikyuu/include/hikyuu/Stock.h +10 -4
- hikyuu/include/hikyuu/StockManager.h +11 -3
- hikyuu/include/hikyuu/TransRecord.h +2 -2
- hikyuu/include/hikyuu/data_driver/KDataDriver.h +5 -0
- hikyuu/include/hikyuu/doc.h +2 -2
- hikyuu/include/hikyuu/global/GlobalSpotAgent.h +8 -0
- hikyuu/include/hikyuu/global/agent/SpotAgent.h +12 -7
- hikyuu/include/hikyuu/indicator/Indicator.h +11 -0
- hikyuu/include/hikyuu/indicator/Indicator2InImp.h +9 -0
- hikyuu/include/hikyuu/indicator/IndicatorImp.h +83 -15
- hikyuu/include/hikyuu/indicator/build_in.h +1 -0
- hikyuu/include/hikyuu/indicator/crt/AMA.h +2 -1
- hikyuu/include/hikyuu/indicator/crt/ATR.h +1 -1
- hikyuu/include/hikyuu/indicator/crt/CONTEXT.h +2 -0
- hikyuu/include/hikyuu/indicator/crt/CYCLE.h +3 -0
- hikyuu/include/hikyuu/indicator/crt/DMA.h +1 -1
- hikyuu/include/hikyuu/indicator/crt/IC.h +14 -6
- hikyuu/include/hikyuu/indicator/crt/ICIR.h +8 -4
- hikyuu/include/hikyuu/indicator/crt/INSUM.h +2 -0
- hikyuu/include/hikyuu/indicator/crt/PRICELIST.h +2 -0
- hikyuu/include/hikyuu/indicator/crt/REFX.h +25 -0
- hikyuu/include/hikyuu/indicator/crt/SLICE.h +4 -4
- hikyuu/include/hikyuu/indicator/crt/SPEARMAN.h +3 -2
- hikyuu/include/hikyuu/indicator/imp/IContext.h +5 -0
- hikyuu/include/hikyuu/indicator/imp/ICval.h +6 -0
- hikyuu/include/hikyuu/indicator/imp/IDropna.h +9 -0
- hikyuu/include/hikyuu/indicator/imp/IIc.h +2 -1
- hikyuu/include/hikyuu/indicator/imp/IPriceList.h +1 -0
- hikyuu/include/hikyuu/indicator/imp/IRefX.h +23 -0
- hikyuu/include/hikyuu/plugin/backtest.h +2 -0
- hikyuu/include/hikyuu/plugin/extind.h +45 -0
- hikyuu/include/hikyuu/plugin/hkuextra.h +21 -0
- hikyuu/include/hikyuu/plugin/interface/HkuExtraPluginInterface.h +16 -0
- hikyuu/include/hikyuu/plugin/interface/TMReportPluginInterface.h +1 -0
- hikyuu/include/hikyuu/python/pybind_utils.h +27 -11
- hikyuu/include/hikyuu/trade_manage/Performance.h +0 -1
- hikyuu/include/hikyuu/trade_manage/TradeCostBase.h +5 -0
- hikyuu/include/hikyuu/trade_manage/TradeManager.h +4 -0
- hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +10 -1
- hikyuu/include/hikyuu/trade_sys/allocatefunds/AllocateFundsBase.h +5 -0
- hikyuu/include/hikyuu/trade_sys/condition/ConditionBase.h +5 -0
- hikyuu/include/hikyuu/trade_sys/environment/EnvironmentBase.h +5 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/MoneyManagerBase.h +5 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/MultiFactorBase.h +6 -3
- hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +4 -0
- hikyuu/include/hikyuu/trade_sys/profitgoal/ProfitGoalBase.h +5 -0
- hikyuu/include/hikyuu/trade_sys/selector/SelectorBase.h +5 -2
- hikyuu/include/hikyuu/trade_sys/signal/SignalBase.h +5 -0
- hikyuu/include/hikyuu/trade_sys/slippage/SlippageBase.h +5 -0
- hikyuu/include/hikyuu/trade_sys/stoploss/StoplossBase.h +6 -1
- hikyuu/include/hikyuu/trade_sys/system/System.h +5 -0
- hikyuu/include/hikyuu/utilities/datetime/Datetime.h +2 -2
- hikyuu/include/hikyuu/utilities/os.h +4 -0
- hikyuu/include/hikyuu/utilities/thread/GlobalMQStealThreadPool.h +1 -1
- hikyuu/include/hikyuu/utilities/thread/GlobalMQThreadPool.h +1 -1
- hikyuu/include/hikyuu/utilities/thread/GlobalThreadPool.h +1 -1
- hikyuu/include/hikyuu/utilities/thread/MQThreadPool.h +1 -1
- hikyuu/include/hikyuu/version.h +4 -4
- hikyuu/include/hikyuu/views/arrow_common.h +38 -0
- hikyuu/include/hikyuu/views/arrow_views.h +117 -0
- hikyuu/indicator/indicator.py +4 -5
- hikyuu/plugin/backtest.dll +0 -0
- hikyuu/plugin/clickhousedriver.dll +0 -0
- hikyuu/plugin/dataserver.dll +0 -0
- hikyuu/plugin/device.dll +0 -0
- hikyuu/plugin/extind.dll +0 -0
- hikyuu/plugin/hkuextra.dll +0 -0
- hikyuu/plugin/import2hdf5.dll +0 -0
- hikyuu/plugin/tmreport.dll +0 -0
- hikyuu/strategy/strategy_demo1.py +1 -1
- hikyuu/test/test_init.py +19 -19
- hikyuu/trade_manage/__init__.pyi +32 -7
- hikyuu/trade_manage/trade.py +6 -0
- hikyuu/trade_manage/trade.pyi +32 -7
- hikyuu/trade_sys/__init__.py +4 -0
- hikyuu/util/__init__.pyi +1 -1
- hikyuu/util/singleton.pyi +1 -1
- {hikyuu-2.6.7.dist-info → hikyuu-2.6.8.2.dist-info}/METADATA +15 -3
- {hikyuu-2.6.7.dist-info → hikyuu-2.6.8.2.dist-info}/RECORD +128 -125
- {hikyuu-2.6.7.dist-info → hikyuu-2.6.8.2.dist-info}/WHEEL +1 -1
- {hikyuu-2.6.7.dist-info → hikyuu-2.6.8.2.dist-info}/top_level.txt +1 -1
- hikyuu/include/hikyuu/view/MarketView.h +0 -59
- hikyuu/setup.py +0 -104
- hikyuu-2.6.7.dist-info/LICENSE +0 -201
- /hikyuu/include/hikyuu/{view → views}/__init__.py +0 -0
- {hikyuu-2.6.7.dist-info → hikyuu-2.6.8.2.dist-info}/entry_points.txt +0 -0
hikyuu/cpp/core312.pyi
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
import collections.abc
|
|
3
3
|
import numpy
|
|
4
|
+
import numpy.typing
|
|
4
5
|
import typing
|
|
5
|
-
__all__ = ['ABS', 'ACOS', 'AD', 'ADVANCE', 'AF_EqualWeight', 'AF_FixedWeight', 'AF_FixedWeightList', 'AF_MultiFactor', 'ALIGN', 'AMA', 'ASIN', 'ATAN', 'ATR', 'AVEDEV', 'AllocateFundsBase', 'BACKSET', 'BARSCOUNT', 'BARSLAST', 'BARSLASTCOUNT', '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', 'DISCARD', 'DMA', 'DOWNNDAY', 'DROPNA', 'DataDriverFactory', 'Datetime', 'DatetimeList', 'Days', 'EMA', 'ERROR', 'EVERY', 'EV_Bool', 'EV_TwoLine', 'EXIST', 'EXP', 'EnvironmentBase', 'FATAL', 'FILTER', 'FINANCE', 'FLOOR', 'FundsRecord', 'HHV', 'HHVBARS', 'HKUException', 'HOUR', 'HSL', 'Hours', 'IC', 'ICIR', 'IF', 'INBLOCK', 'INDEXA', 'INDEXADV', 'INDEXC', 'INDEXDEC', 'INDEXH', 'INDEXL', 'INDEXO', 'INDEXV', 'INFO', 'INSUM', 'INTPART', 'IR', 'ISINF', 'ISINFA', 'ISLASTBAR', 'ISNA', 'IndParam', 'Indicator', 'IndicatorImp', 'JUMPDOWN', 'JUMPUP', 'KALMAN', 'KDATA_PART', 'KData', 'KDataDriver', 'KDataToHdf5Importer', 'KRecord', 'KRecordList', 'LAST', 'LASTVALUE', 'LIUTONGPAN', 'LLV', 'LLVBARS', 'LN', 'LOG', 'LOG_LEVEL', 'LONGCROSS', 'LoanRecord', 'MA', 'MACD', 'MAX', 'MDD', 'MF_EqualWeight', 'MF_ICIRWeight', 'MF_ICWeight', 'MF_Weight', 'MIN', 'MINUTE', 'MM_FixedCapital', 'MM_FixedCapitalFunds', 'MM_FixedCount', 'MM_FixedCountTps', 'MM_FixedPercent', 'MM_FixedRisk', 'MM_FixedUnits', 'MM_Nothing', 'MM_WilliamsFixedRisk', 'MOD', 'MONTH', 'MRR', 'MarketInfo', 'Microseconds', 'Milliseconds', 'Minutes', 'MoneyManagerBase', 'MultiFactorBase', 'NDAY', 'NOT', 'OFF', 'OrderBrokerBase', 'PF_Simple', 'PF_WithoutAF', 'PG_FixedHoldDays', 'PG_FixedPercent', 'PG_NoGoal', 'POS', 'POW', 'PRICELIST', 'Parameter', 'Performance', 'Portfolio', 'PositionRecord', 'PositionRecordList', 'ProfitGoalBase', 'Query', 'RANK', 'RECOVER_BACKWARD', 'RECOVER_EQUAL_BACKWARD', 'RECOVER_EQUAL_FORWARD', 'RECOVER_FORWARD', 'REF', 'REPLACE', 'RESULT', 'REVERSE', 'ROC', 'ROCP', 'ROCR', 'ROCR100', 'ROUND', 'ROUNDDOWN', 'ROUNDUP', 'RSI', 'SAFTYLOSS', 'SE_EvaluateOptimal', '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', 'UTCOffset', 'VAR', 'VARP', 'VIGOR', 'WARN', 'WEAVE', 'WEEK', 'WINNER', 'WITHDAY', 'WITHHALFYEAR', 'WITHHOUR', 'WITHHOUR2', 'WITHHOUR4', 'WITHKTYPE', 'WITHMIN', 'WITHMIN15', 'WITHMIN30', 'WITHMIN5', 'WITHMIN60', 'WITHMONTH', 'WITHQUARTER', 'WITHWEEK', 'WITHYEAR', 'WMA', 'YEAR', 'ZHBOND10', 'ZONGGUBEN', 'ZSCORE', 'active_device', 'backtest', 'batch_calculate_inds', 'can_upgrade', 'close_ostream_to_python', 'close_spend_time', 'combinate_ind', 'combinate_index', 'constant', 'crtBrokerTM', 'crtSEOptimal', 'crtTM', 'crt_pf_strategy', 'crt_sys_strategy', 'dates_to_np', 'df_to_krecords', '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_market_view', 'get_spot_from_buffer_server', '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', 'is_valid_license', 'isinf', 'isnan', 'krecords_to_df', 'krecords_to_np', 'open_ostream_to_python', 'open_spend_time', 'positions_to_df', 'positions_to_np', 'register_extra_ktype', 'release_extra_ktype', 'remove_license', 'roundDown', 'roundEx', 'roundUp', 'run_in_strategy', 'scorerecords_to_df', 'scorerecords_to_np', 'set_log_level', 'set_python_in_interactive', 'set_python_in_jupyter', 'start_data_server', 'start_spot_agent', 'stop_data_server', 'stop_spot_agent', 'systemweights_to_df', 'systemweights_to_np', 'timeline_to_df', 'timeline_to_np', 'toPriceList', 'trades_to_df', 'trades_to_np', 'translist_to_df', 'translist_to_np', 'view_license', 'weights_to_df', 'weights_to_np']
|
|
6
|
+
__all__ = ['ABS', 'ACOS', 'AD', 'ADVANCE', 'AF_EqualWeight', 'AF_FixedWeight', 'AF_FixedWeightList', 'AF_MultiFactor', 'AGG_COUNT', 'AGG_MAD', 'AGG_MAX', 'AGG_MEAN', 'AGG_MEDIAN', 'AGG_MIN', 'AGG_PROD', 'AGG_QUANTILE', 'AGG_STD', 'AGG_SUM', 'AGG_VAR', 'ALIGN', 'AMA', 'ASIN', 'ATAN', 'ATR', 'AVEDEV', 'AllocateFundsBase', 'BACKSET', 'BARSCOUNT', 'BARSLAST', 'BARSLASTCOUNT', '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', 'DISCARD', 'DMA', 'DOWNNDAY', 'DROPNA', 'DataDriverFactory', 'Datetime', 'DatetimeList', 'Days', 'EMA', 'ERROR', 'EVERY', 'EV_Bool', 'EV_TwoLine', 'EXIST', 'EXP', 'EnvironmentBase', 'FATAL', 'FILTER', 'FINANCE', 'FLOOR', 'FundsRecord', 'HHV', 'HHVBARS', 'HKUException', 'HOUR', 'HSL', 'Hours', 'IC', 'ICIR', 'IF', 'INBLOCK', 'INDEXA', 'INDEXADV', 'INDEXC', 'INDEXDEC', 'INDEXH', 'INDEXL', 'INDEXO', 'INDEXV', 'INFO', 'INSUM', 'INTPART', 'IR', 'ISINF', 'ISINFA', 'ISLASTBAR', 'ISNA', 'IndParam', 'Indicator', 'IndicatorImp', 'JUMPDOWN', 'JUMPUP', 'KALMAN', 'KDATA_PART', 'KData', 'KDataDriver', 'KDataToHdf5Importer', 'KRecord', 'KRecordList', 'LAST', 'LASTVALUE', 'LIUTONGPAN', 'LLV', 'LLVBARS', 'LN', 'LOG', 'LOG_LEVEL', 'LONGCROSS', 'LoanRecord', 'MA', 'MACD', 'MAX', 'MDD', 'MF_EqualWeight', 'MF_ICIRWeight', 'MF_ICWeight', 'MF_Weight', 'MIN', 'MINUTE', 'MM_FixedCapital', 'MM_FixedCapitalFunds', 'MM_FixedCount', 'MM_FixedCountTps', 'MM_FixedPercent', 'MM_FixedRisk', 'MM_FixedUnits', 'MM_Nothing', 'MM_WilliamsFixedRisk', 'MOD', 'MONTH', 'MRR', 'MarketInfo', 'Microseconds', 'Milliseconds', 'Minutes', 'MoneyManagerBase', 'MultiFactorBase', 'NDAY', 'NOT', 'OFF', 'OrderBrokerBase', 'PF_Simple', 'PF_WithoutAF', 'PG_FixedHoldDays', 'PG_FixedPercent', 'PG_NoGoal', 'POS', 'POW', 'PRICELIST', 'Parameter', 'Performance', 'Portfolio', 'PositionRecord', 'PositionRecordList', 'ProfitGoalBase', 'Query', 'RANK', 'RECOVER_BACKWARD', 'RECOVER_EQUAL_BACKWARD', 'RECOVER_EQUAL_FORWARD', 'RECOVER_FORWARD', 'REF', 'REFX', 'REPLACE', 'RESULT', 'REVERSE', 'ROC', 'ROCP', 'ROCR', 'ROCR100', 'ROUND', 'ROUNDDOWN', 'ROUNDUP', 'RSI', 'SAFTYLOSS', 'SE_EvaluateOptimal', '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', 'UTCOffset', 'VAR', 'VARP', 'VIGOR', 'WARN', 'WEAVE', 'WEEK', 'WINNER', 'WITHDAY', 'WITHHALFYEAR', 'WITHHOUR', 'WITHHOUR2', 'WITHHOUR4', 'WITHKTYPE', 'WITHMIN', 'WITHMIN15', 'WITHMIN30', 'WITHMIN5', 'WITHMIN60', 'WITHMONTH', 'WITHQUARTER', 'WITHWEEK', 'WITHYEAR', 'WMA', 'YEAR', 'ZHBOND10', 'ZONGGUBEN', 'ZSCORE', 'active_device', 'backtest', 'batch_calculate_inds', 'can_upgrade', 'close_ostream_to_python', 'close_spend_time', 'combinate_ind', 'combinate_index', 'constant', 'crtBrokerTM', 'crtSEOptimal', 'crtTM', 'crt_pf_strategy', 'crt_sys_strategy', 'dates_to_np', 'dates_to_pa', 'df_to_krecords', 'fetch_trial_license', 'find_optimal_system', 'find_optimal_system_multi', 'get_block', 'get_business_name', 'get_data_from_buffer_server', 'get_date_range', 'get_inds_view', 'get_inds_view_pyarrow', 'get_kdata', 'get_last_version', 'get_log_level', 'get_market_view', 'get_market_view_pyarrow', 'get_spot_from_buffer_server', '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', 'is_valid_license', 'isinf', 'isnan', 'krecords_to_df', 'krecords_to_np', 'krecords_to_pa', 'open_ostream_to_python', 'open_spend_time', 'positions_to_df', 'positions_to_np', 'positions_to_pa', 'register_extra_ktype', 'release_extra_ktype', 'remove_license', 'roundDown', 'roundEx', 'roundUp', 'run_in_strategy', 'scorerecords_to_df', 'scorerecords_to_np', 'set_log_level', 'set_python_in_interactive', 'set_python_in_jupyter', 'spot_agent_is_connected', 'spot_agent_is_running', 'start_data_server', 'start_spot_agent', 'stop_data_server', 'stop_spot_agent', 'systemweights_to_df', 'systemweights_to_np', 'timeline_to_df', 'timeline_to_np', 'timeline_to_pa', 'toPriceList', 'trades_to_df', 'trades_to_np', 'trades_to_pa', 'translist_to_df', 'translist_to_np', 'translist_to_pa', 'view_license', 'weights_to_df', 'weights_to_np', 'weights_to_pa']
|
|
6
7
|
class AllocateFundsBase:
|
|
7
8
|
"""
|
|
8
9
|
资产分配算法基类, 子类接口:
|
|
@@ -1204,6 +1205,15 @@ class DatetimeList:
|
|
|
1204
1205
|
@staticmethod
|
|
1205
1206
|
def to_np(data: DatetimeList):
|
|
1206
1207
|
...
|
|
1208
|
+
@staticmethod
|
|
1209
|
+
def to_numpy(data: DatetimeList):
|
|
1210
|
+
...
|
|
1211
|
+
@staticmethod
|
|
1212
|
+
def to_pandas(data: DatetimeList):
|
|
1213
|
+
...
|
|
1214
|
+
@staticmethod
|
|
1215
|
+
def to_pyarrow(data):
|
|
1216
|
+
...
|
|
1207
1217
|
def __bool__(self) -> bool:
|
|
1208
1218
|
"""
|
|
1209
1219
|
Check whether the list is nonempty
|
|
@@ -1633,9 +1643,32 @@ class Indicator:
|
|
|
1633
1643
|
|
|
1634
1644
|
"""
|
|
1635
1645
|
@staticmethod
|
|
1636
|
-
def
|
|
1646
|
+
def to_numpy(*args, **kwargs):
|
|
1637
1647
|
"""
|
|
1638
|
-
|
|
1648
|
+
to_np(self: hikyuu.cpp.core312.Indicator) -> numpy.ndarray
|
|
1649
|
+
|
|
1650
|
+
转化为np.array, 如果为时间序列, 则包含 datetime 日期列
|
|
1651
|
+
"""
|
|
1652
|
+
@staticmethod
|
|
1653
|
+
def to_pandas(*args, **kwargs):
|
|
1654
|
+
"""
|
|
1655
|
+
to_df(self: hikyuu.cpp.core312.Indicator) -> object
|
|
1656
|
+
|
|
1657
|
+
转换为 DataFrame
|
|
1658
|
+
"""
|
|
1659
|
+
@staticmethod
|
|
1660
|
+
def value_to_numpy(*args, **kwargs):
|
|
1661
|
+
"""
|
|
1662
|
+
value_to_np(self: hikyuu.cpp.core312.Indicator) -> numpy.ndarray
|
|
1663
|
+
|
|
1664
|
+
仅转化值为np.array, 不包含日期列
|
|
1665
|
+
"""
|
|
1666
|
+
@staticmethod
|
|
1667
|
+
def value_to_pandas(*args, **kwargs):
|
|
1668
|
+
"""
|
|
1669
|
+
value_to_df(self: hikyuu.cpp.core312.Indicator) -> object
|
|
1670
|
+
|
|
1671
|
+
转换为 DataFrame, 仅包含值
|
|
1639
1672
|
"""
|
|
1640
1673
|
@typing.overload
|
|
1641
1674
|
def __add__(self, arg0: Indicator) -> Indicator:
|
|
@@ -1972,14 +2005,30 @@ class Indicator:
|
|
|
1972
2005
|
"""
|
|
1973
2006
|
是否支持动态指标参数
|
|
1974
2007
|
"""
|
|
2008
|
+
def to_array(self, result_index: typing.SupportsInt = 0) -> numpy.typing.NDArray[numpy.float64]:
|
|
2009
|
+
"""
|
|
2010
|
+
将指定结果集转化为numpy.array
|
|
2011
|
+
"""
|
|
2012
|
+
def to_df(self) -> typing.Any:
|
|
2013
|
+
"""
|
|
2014
|
+
转换为 DataFrame
|
|
2015
|
+
"""
|
|
1975
2016
|
def to_np(self) -> numpy.ndarray:
|
|
1976
2017
|
"""
|
|
1977
2018
|
转化为np.array, 如果为时间序列, 则包含 datetime 日期列
|
|
1978
2019
|
"""
|
|
2020
|
+
def to_pyarrow(self) -> typing.Any:
|
|
2021
|
+
...
|
|
2022
|
+
def value_to_df(self) -> typing.Any:
|
|
2023
|
+
"""
|
|
2024
|
+
转换为 DataFrame, 仅包含值
|
|
2025
|
+
"""
|
|
1979
2026
|
def value_to_np(self) -> numpy.ndarray:
|
|
1980
2027
|
"""
|
|
1981
2028
|
仅转化值为np.array, 不包含日期列
|
|
1982
2029
|
"""
|
|
2030
|
+
def value_to_pyarrow(self) -> typing.Any:
|
|
2031
|
+
...
|
|
1983
2032
|
@property
|
|
1984
2033
|
def discard(self) -> int:
|
|
1985
2034
|
"""
|
|
@@ -2071,6 +2120,12 @@ class IndicatorImp:
|
|
|
2071
2120
|
...
|
|
2072
2121
|
def is_serial(self) -> bool:
|
|
2073
2122
|
...
|
|
2123
|
+
def print_all_sub_trees(self, show_long_name: bool = False) -> None:
|
|
2124
|
+
...
|
|
2125
|
+
def print_leaves(self, show_long_name: bool = False) -> None:
|
|
2126
|
+
...
|
|
2127
|
+
def print_tree(self, show_long_name: bool = False) -> None:
|
|
2128
|
+
...
|
|
2074
2129
|
def set_discard(self, arg0: typing.SupportsInt) -> None:
|
|
2075
2130
|
...
|
|
2076
2131
|
@typing.overload
|
|
@@ -2141,6 +2196,25 @@ class KData:
|
|
|
2141
2196
|
:param colordown: the color of the rectangle where close < open
|
|
2142
2197
|
|
|
2143
2198
|
"""
|
|
2199
|
+
@staticmethod
|
|
2200
|
+
def to_numpy(*args, **kwargs):
|
|
2201
|
+
"""
|
|
2202
|
+
to_np(self: hikyuu.cpp.core312.KData) -> numpy.ndarray
|
|
2203
|
+
|
|
2204
|
+
将 KData 转换为 NumPy 数组
|
|
2205
|
+
"""
|
|
2206
|
+
@staticmethod
|
|
2207
|
+
def to_pandas(*args, **kwargs):
|
|
2208
|
+
"""
|
|
2209
|
+
to_df(self: hikyuu.cpp.core312.KData, with_stock: bool = False) -> object
|
|
2210
|
+
|
|
2211
|
+
to_df(self, with_stock=False) -> pandas.DataFrame
|
|
2212
|
+
|
|
2213
|
+
转化为pandas的DataFrame
|
|
2214
|
+
|
|
2215
|
+
:param bool with_stock: 包含Stock的代码与名称
|
|
2216
|
+
:rtype: pandas.DataFrame
|
|
2217
|
+
"""
|
|
2144
2218
|
def __eq__(self, arg0: KData) -> bool:
|
|
2145
2219
|
...
|
|
2146
2220
|
def __getitem__(self, arg0: typing.Any) -> typing.Any:
|
|
@@ -2195,6 +2269,16 @@ class KData:
|
|
|
2195
2269
|
|
|
2196
2270
|
:rtype: DatetimeList
|
|
2197
2271
|
"""
|
|
2272
|
+
@typing.overload
|
|
2273
|
+
def get_kdata(self, ktype: str) -> KData:
|
|
2274
|
+
"""
|
|
2275
|
+
get_kdata(self, ktype
|
|
2276
|
+
|
|
2277
|
+
获取相同时间范围内的其他类型K线数据,如日线下对应的分钟线数据
|
|
2278
|
+
|
|
2279
|
+
:param KQuery::KType ktype: 指定需要的K线类型
|
|
2280
|
+
"""
|
|
2281
|
+
@typing.overload
|
|
2198
2282
|
def get_kdata(self, arg0: Datetime, arg1: Datetime) -> KData:
|
|
2199
2283
|
"""
|
|
2200
2284
|
get_kdata(self, start_date, end_date)
|
|
@@ -2205,6 +2289,17 @@ class KData:
|
|
|
2205
2289
|
:param Datetime end: 新的结束日期
|
|
2206
2290
|
:rtype: KData
|
|
2207
2291
|
"""
|
|
2292
|
+
@typing.overload
|
|
2293
|
+
def get_kdata(self, start: typing.SupportsInt, end: typing.SupportsInt = 9223372036854775807) -> KData:
|
|
2294
|
+
"""
|
|
2295
|
+
get_kdata(self, start, end)
|
|
2296
|
+
|
|
2297
|
+
通过索引获取 KData 子集,相当于切片
|
|
2298
|
+
|
|
2299
|
+
:param int start: 索引起始位置
|
|
2300
|
+
:param int end: 索引结束位置
|
|
2301
|
+
:rtype: KData
|
|
2302
|
+
"""
|
|
2208
2303
|
def get_pos(self, arg0: Datetime) -> typing.Any:
|
|
2209
2304
|
"""
|
|
2210
2305
|
get_pos(self, datetime)
|
|
@@ -2252,6 +2347,8 @@ class KData:
|
|
|
2252
2347
|
"""
|
|
2253
2348
|
将 KData 转换为 NumPy 数组
|
|
2254
2349
|
"""
|
|
2350
|
+
def to_pyarrow(self) -> typing.Any:
|
|
2351
|
+
...
|
|
2255
2352
|
def tocsv(self, arg0: str) -> None:
|
|
2256
2353
|
"""
|
|
2257
2354
|
tocsv(self, filename)
|
|
@@ -2505,6 +2602,15 @@ class KRecordList:
|
|
|
2505
2602
|
@staticmethod
|
|
2506
2603
|
def to_np(data):
|
|
2507
2604
|
...
|
|
2605
|
+
@staticmethod
|
|
2606
|
+
def to_numpy(data):
|
|
2607
|
+
...
|
|
2608
|
+
@staticmethod
|
|
2609
|
+
def to_pandas(data):
|
|
2610
|
+
...
|
|
2611
|
+
@staticmethod
|
|
2612
|
+
def to_pyarrow(data):
|
|
2613
|
+
...
|
|
2508
2614
|
def __bool__(self) -> bool:
|
|
2509
2615
|
"""
|
|
2510
2616
|
Check whether the list is nonempty
|
|
@@ -3693,6 +3799,12 @@ class PositionRecordList:
|
|
|
3693
3799
|
...
|
|
3694
3800
|
def to_np(self):
|
|
3695
3801
|
...
|
|
3802
|
+
def to_numpy(self):
|
|
3803
|
+
...
|
|
3804
|
+
def to_pandas(self):
|
|
3805
|
+
...
|
|
3806
|
+
def to_pyarrow(self):
|
|
3807
|
+
...
|
|
3696
3808
|
class ProfitGoalBase:
|
|
3697
3809
|
"""
|
|
3698
3810
|
盈利目标策略基类
|
|
@@ -3945,6 +4057,8 @@ class Query:
|
|
|
3945
4057
|
MONTH: typing.ClassVar[str] = 'MONTH'
|
|
3946
4058
|
NO_RECOVER: typing.ClassVar[Query.RecoverType] # value = <RecoverType.NO_RECOVER: 0>
|
|
3947
4059
|
QUARTER: typing.ClassVar[str] = 'QUARTER'
|
|
4060
|
+
TIMELINE: typing.ClassVar[str] = 'TIMELINE'
|
|
4061
|
+
TRANS: typing.ClassVar[str] = 'TRANS'
|
|
3948
4062
|
WEEK: typing.ClassVar[str] = 'WEEK'
|
|
3949
4063
|
YEAR: typing.ClassVar[str] = 'YEAR'
|
|
3950
4064
|
@staticmethod
|
|
@@ -3960,6 +4074,31 @@ class Query:
|
|
|
3960
4074
|
"""
|
|
3961
4075
|
获取所有扩展KType
|
|
3962
4076
|
"""
|
|
4077
|
+
@staticmethod
|
|
4078
|
+
def get_ktype_in_min(arg0: str) -> int:
|
|
4079
|
+
"""
|
|
4080
|
+
获取ktype对应的分钟数
|
|
4081
|
+
"""
|
|
4082
|
+
@staticmethod
|
|
4083
|
+
def get_ktype_in_seconds(arg0: str) -> int:
|
|
4084
|
+
"""
|
|
4085
|
+
获取ktype对应的秒数
|
|
4086
|
+
"""
|
|
4087
|
+
@staticmethod
|
|
4088
|
+
def is_base_ktype(arg0: str) -> bool:
|
|
4089
|
+
"""
|
|
4090
|
+
判断是否为基础KType
|
|
4091
|
+
"""
|
|
4092
|
+
@staticmethod
|
|
4093
|
+
def is_extra_ktype(arg0: str) -> bool:
|
|
4094
|
+
"""
|
|
4095
|
+
判断是否为扩展KType
|
|
4096
|
+
"""
|
|
4097
|
+
@staticmethod
|
|
4098
|
+
def is_valid_ktype(arg0: str) -> bool:
|
|
4099
|
+
"""
|
|
4100
|
+
判断KType是否有效
|
|
4101
|
+
"""
|
|
3963
4102
|
def __getstate__(self) -> tuple:
|
|
3964
4103
|
...
|
|
3965
4104
|
def __init__(self, start = 0, end = None, ktype = 'DAY', recover_type = ...):
|
|
@@ -3981,21 +4120,9 @@ class Query:
|
|
|
3981
4120
|
...
|
|
3982
4121
|
def __str__(self) -> str:
|
|
3983
4122
|
...
|
|
3984
|
-
def
|
|
3985
|
-
"""
|
|
3986
|
-
获取ktype对应的分钟数
|
|
3987
|
-
"""
|
|
3988
|
-
def is_base_ktype(self: str) -> bool:
|
|
4123
|
+
def is_right_opening(self) -> bool:
|
|
3989
4124
|
"""
|
|
3990
|
-
|
|
3991
|
-
"""
|
|
3992
|
-
def is_extra_ktype(self: str) -> bool:
|
|
3993
|
-
"""
|
|
3994
|
-
判断是否为扩展KType
|
|
3995
|
-
"""
|
|
3996
|
-
def is_valid_ktype(self: str) -> bool:
|
|
3997
|
-
"""
|
|
3998
|
-
判断KType是否有效
|
|
4125
|
+
判断是否为右开区间,即未指定结束时间
|
|
3999
4126
|
"""
|
|
4000
4127
|
@property
|
|
4001
4128
|
def end(self) -> int:
|
|
@@ -4153,6 +4280,10 @@ class ScoreRecordList:
|
|
|
4153
4280
|
...
|
|
4154
4281
|
def to_np(self):
|
|
4155
4282
|
...
|
|
4283
|
+
def to_numpy(self):
|
|
4284
|
+
...
|
|
4285
|
+
def to_pandas(self):
|
|
4286
|
+
...
|
|
4156
4287
|
class SelectorBase:
|
|
4157
4288
|
"""
|
|
4158
4289
|
选择器策略基类,实现标的、系统策略的评估和选取算法,自定义选择器策略子类接口:
|
|
@@ -4800,6 +4931,15 @@ class Stock:
|
|
|
4800
4931
|
获取所有历史财务信息历史记录, 字段信息可参考 StockManager 中的相关方法: get_history_finance_all_fields/get_history_finance_field_index/get_history_finance_field_name 方法
|
|
4801
4932
|
日常建议直接使用指标 FINANCE 获取财务数据
|
|
4802
4933
|
"""
|
|
4934
|
+
def get_index_range(self, arg0: Query) -> tuple:
|
|
4935
|
+
"""
|
|
4936
|
+
get_index_range(self, query) -> (size_t, size_t)
|
|
4937
|
+
|
|
4938
|
+
根据KQuery指定的条件, 获取对应的K线位置范围: [start_pos, end_pos)
|
|
4939
|
+
|
|
4940
|
+
:param query [in] 指定的查询条件
|
|
4941
|
+
:return (start_pos, end_pos
|
|
4942
|
+
"""
|
|
4803
4943
|
def get_kdata(self, arg0: Query) -> KData:
|
|
4804
4944
|
"""
|
|
4805
4945
|
get_kdata(self, query)
|
|
@@ -5303,9 +5443,20 @@ class StockManager:
|
|
|
5303
5443
|
"""
|
|
5304
5444
|
is_holiday(self, d)
|
|
5305
5445
|
|
|
5306
|
-
|
|
5446
|
+
判断指定时间对应的日期是否为节假日(仅使用A股市场)
|
|
5307
5447
|
|
|
5308
|
-
:param Datetime d:
|
|
5448
|
+
:param Datetime d: 待判断的时间
|
|
5449
|
+
"""
|
|
5450
|
+
def is_trading_hours(self, d: Datetime, market: str = 'SH') -> bool:
|
|
5451
|
+
"""
|
|
5452
|
+
is_trading_hours(self, d)
|
|
5453
|
+
|
|
5454
|
+
判断指定时间对应的日期是否为交易时间
|
|
5455
|
+
|
|
5456
|
+
:param Datetime d: 待判断的时间
|
|
5457
|
+
:param str market: 市场简称
|
|
5458
|
+
:return: 是否为交易时间
|
|
5459
|
+
:rtype: bool
|
|
5309
5460
|
"""
|
|
5310
5461
|
def reload(self) -> None:
|
|
5311
5462
|
"""
|
|
@@ -5511,6 +5662,15 @@ class StockWeightList:
|
|
|
5511
5662
|
@staticmethod
|
|
5512
5663
|
def to_np(data):
|
|
5513
5664
|
...
|
|
5665
|
+
@staticmethod
|
|
5666
|
+
def to_numpy(data):
|
|
5667
|
+
...
|
|
5668
|
+
@staticmethod
|
|
5669
|
+
def to_pandas(data):
|
|
5670
|
+
...
|
|
5671
|
+
@staticmethod
|
|
5672
|
+
def to_pyarrow(data):
|
|
5673
|
+
...
|
|
5514
5674
|
def __bool__(self) -> bool:
|
|
5515
5675
|
"""
|
|
5516
5676
|
Check whether the list is nonempty
|
|
@@ -6474,6 +6634,10 @@ class SystemWeightList:
|
|
|
6474
6634
|
...
|
|
6475
6635
|
def to_np(self):
|
|
6476
6636
|
...
|
|
6637
|
+
def to_numpy(self):
|
|
6638
|
+
...
|
|
6639
|
+
def to_pandas(self):
|
|
6640
|
+
...
|
|
6477
6641
|
class TimeDelta:
|
|
6478
6642
|
"""
|
|
6479
6643
|
时间时长,用于时间计算。可通过以下方式构建:
|
|
@@ -6712,6 +6876,15 @@ class TimeLineList:
|
|
|
6712
6876
|
@staticmethod
|
|
6713
6877
|
def to_np(data):
|
|
6714
6878
|
...
|
|
6879
|
+
@staticmethod
|
|
6880
|
+
def to_numpy(data):
|
|
6881
|
+
...
|
|
6882
|
+
@staticmethod
|
|
6883
|
+
def to_pandas(data):
|
|
6884
|
+
...
|
|
6885
|
+
@staticmethod
|
|
6886
|
+
def to_pyarrow(data):
|
|
6887
|
+
...
|
|
6715
6888
|
def __bool__(self) -> bool:
|
|
6716
6889
|
"""
|
|
6717
6890
|
Check whether the list is nonempty
|
|
@@ -7670,6 +7843,12 @@ class TradeRecordList:
|
|
|
7670
7843
|
...
|
|
7671
7844
|
def to_np(self):
|
|
7672
7845
|
...
|
|
7846
|
+
def to_numpy(self):
|
|
7847
|
+
...
|
|
7848
|
+
def to_pandas(self):
|
|
7849
|
+
...
|
|
7850
|
+
def to_pyarrow(self):
|
|
7851
|
+
...
|
|
7673
7852
|
class TradeRequest:
|
|
7674
7853
|
"""
|
|
7675
7854
|
交易请求记录。系统内部在实现延迟操作时登记的交易请求信息。暴露该结构的主要目的是用于
|
|
@@ -7750,6 +7929,15 @@ class TransList:
|
|
|
7750
7929
|
@staticmethod
|
|
7751
7930
|
def to_np(data):
|
|
7752
7931
|
...
|
|
7932
|
+
@staticmethod
|
|
7933
|
+
def to_numpy(data):
|
|
7934
|
+
...
|
|
7935
|
+
@staticmethod
|
|
7936
|
+
def to_pandas(data):
|
|
7937
|
+
...
|
|
7938
|
+
@staticmethod
|
|
7939
|
+
def to_pyarrow(data):
|
|
7940
|
+
...
|
|
7753
7941
|
def __bool__(self) -> bool:
|
|
7754
7942
|
"""
|
|
7755
7943
|
Check whether the list is nonempty
|
|
@@ -7986,6 +8174,88 @@ def AF_MultiFactor() -> AllocateFundsBase:
|
|
|
7986
8174
|
|
|
7987
8175
|
创建 MultiFactor 评分权重的资产分配算法实例, 即直接以SE返回的评分作为权重。
|
|
7988
8176
|
"""
|
|
8177
|
+
def AGG_COUNT(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8178
|
+
"""
|
|
8179
|
+
聚合函数: 非空值计数, 可参考 AGG_STD 帮助
|
|
8180
|
+
"""
|
|
8181
|
+
def AGG_MAD(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8182
|
+
"""
|
|
8183
|
+
聚合函数: 平均绝对偏差, 可参考 AGG_STD 帮助
|
|
8184
|
+
"""
|
|
8185
|
+
def AGG_MAX(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8186
|
+
"""
|
|
8187
|
+
聚合函数: 最大值, 可参考 AGG_STD 帮助
|
|
8188
|
+
"""
|
|
8189
|
+
def AGG_MEAN(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8190
|
+
"""
|
|
8191
|
+
聚合函数: 平均值, 可参考 AGG_STD 帮助
|
|
8192
|
+
"""
|
|
8193
|
+
def AGG_MEDIAN(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8194
|
+
"""
|
|
8195
|
+
聚合函数: 中位数, 可参考 AGG_STD 帮助
|
|
8196
|
+
"""
|
|
8197
|
+
def AGG_MIN(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8198
|
+
"""
|
|
8199
|
+
聚合函数: 最小值, 可参考 AGG_STD 帮助
|
|
8200
|
+
"""
|
|
8201
|
+
def AGG_PROD(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8202
|
+
"""
|
|
8203
|
+
聚合函数: 乘积, 可参考 AGG_STD 帮助
|
|
8204
|
+
"""
|
|
8205
|
+
def AGG_QUANTILE(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1, quantile: typing.SupportsFloat = 0.75) -> Indicator:
|
|
8206
|
+
"""
|
|
8207
|
+
AGG_QUANTILE(ind[, ktype=Query.MIN, fill_null=False, unit=1, quantile=0.75])
|
|
8208
|
+
|
|
8209
|
+
聚合其他K线周期分位数, 可参考 AGG_STD 帮助
|
|
8210
|
+
|
|
8211
|
+
:param Indicator ind: 待计算指标
|
|
8212
|
+
:param KQuery.KType ktype: 聚合的K线周期
|
|
8213
|
+
:param bool fill_null: 是否填充缺失值
|
|
8214
|
+
:param int unit: 聚合周期单位 (上下文K线分组单位, 使用日线计算分钟线聚合时, unit=2代表聚合2天的分钟线)
|
|
8215
|
+
:param float quantile: 分位数 (0, 1) 之间
|
|
8216
|
+
:return: 指标数据
|
|
8217
|
+
:rtype: Indicator
|
|
8218
|
+
"""
|
|
8219
|
+
def AGG_STD(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1, ddof: typing.SupportsInt = 1) -> Indicator:
|
|
8220
|
+
"""
|
|
8221
|
+
AGG_STD(ind[, ktype=Query.MIN, fill_null=False, unit=1, ddof=1])
|
|
8222
|
+
|
|
8223
|
+
聚合其他K线周期的标准差, 如计算日线时聚合分钟线收盘价的标准差
|
|
8224
|
+
|
|
8225
|
+
>>> kdata = get_kdata('sh600000', Query(Datetime(20250101), ktype=Query.DAY))
|
|
8226
|
+
>>> ind = AGG_STD(CLOSE(), ktype=Query.MIN, fill_null=False, unit=1, ddof=1)
|
|
8227
|
+
>>> ind(k)
|
|
8228
|
+
|
|
8229
|
+
:param Indicator ind: 指标数据
|
|
8230
|
+
:param KQuery.KType ktype: 聚合的K线周期
|
|
8231
|
+
:param bool fill_null: 是否填充缺失值
|
|
8232
|
+
:param int unit: 聚合周期单位 (滚动聚合分组单位, 如使用日线计算分钟线聚合时, unit=2代表聚合2天的分钟线)
|
|
8233
|
+
:param int ddof: 自由度(1: 样本标准差, 0: 总体标准差)
|
|
8234
|
+
:return: 指标数据
|
|
8235
|
+
:rtype: Indicator
|
|
8236
|
+
"""
|
|
8237
|
+
def AGG_SUM(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8238
|
+
"""
|
|
8239
|
+
聚合函数: 总和, 可参考 AGG_STD 帮助
|
|
8240
|
+
"""
|
|
8241
|
+
def AGG_VAR(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1, ddof: typing.SupportsInt = 1) -> Indicator:
|
|
8242
|
+
"""
|
|
8243
|
+
AGG_VAR(ind[, ktype=Query.MIN, fill_null=False, unit=1, ddof=1])
|
|
8244
|
+
|
|
8245
|
+
聚合其他K线周期的方差, 如计算日线时聚合分钟线收盘价的方差
|
|
8246
|
+
|
|
8247
|
+
>>> kdata = get_kdata('sh600000', Query(Datetime(20250101), ktype=Query.DAY))
|
|
8248
|
+
>>> ind = AGG_VAR(CLOSE(), ktype=Query.MIN, fill_null=False, unit=1, ddof=1)
|
|
8249
|
+
>>> ind(k)
|
|
8250
|
+
|
|
8251
|
+
:param Indicator ind: 待计算指标
|
|
8252
|
+
:param KQuery.KType ktype: 聚合的K线周期
|
|
8253
|
+
:param bool fill_null: 是否填充缺失值
|
|
8254
|
+
:param int unit: 聚合周期单位 (上下文K线分组单位, 使用日线计算分钟线聚合时, unit=2代表聚合2天的分钟线)
|
|
8255
|
+
:param int ddof: 自由度(1: 样本标准差, 0: 总体标准差)
|
|
8256
|
+
:return: 指标数据
|
|
8257
|
+
:rtype: Indicator
|
|
8258
|
+
"""
|
|
7989
8259
|
@typing.overload
|
|
7990
8260
|
def ALIGN(ref: DatetimeList, fill_null: bool = True) -> Indicator:
|
|
7991
8261
|
...
|
|
@@ -8968,11 +9238,16 @@ def Hours(arg0: typing.SupportsInt) -> TimeDelta:
|
|
|
8968
9238
|
:param int hours: 小时数
|
|
8969
9239
|
:rtype: TimeDelta
|
|
8970
9240
|
"""
|
|
8971
|
-
def IC(ind: Indicator, stks: typing.Any, query: Query, ref_stk: Stock, n: typing.SupportsInt = 1, spearman: bool = True) -> Indicator:
|
|
9241
|
+
def IC(ind: Indicator, stks: typing.Any, query: Query, ref_stk: Stock, n: typing.SupportsInt = 1, spearman: bool = True, strict: bool = False) -> Indicator:
|
|
8972
9242
|
"""
|
|
8973
|
-
IC(ind, stks, query, ref_stk[, n=1])
|
|
9243
|
+
IC(ind, stks, query, ref_stk[, n=1, spearman=True, strict=False]) -> Indicator
|
|
8974
9244
|
|
|
8975
|
-
计算指定的因子相对于参考证券的 IC
|
|
9245
|
+
计算指定的因子相对于参考证券的 IC (实际为 RankIC)
|
|
9246
|
+
|
|
9247
|
+
IC 原本需要 “t 时刻因子值→t+1 时刻收益”,此处改为计算 “t 时刻因子值→t 时刻之前 N 天的收益”(比如过去 5 天的收益)。
|
|
9248
|
+
(否则当前值都会是缺失NA), 相当于原始预测 IC 右移 n 位。
|
|
9249
|
+
|
|
9250
|
+
如需严格“t 时刻因子值→t+1 时刻收益“计算,请设置 strict=True (注意此模式下, 后n位为 NA)
|
|
8976
9251
|
|
|
8977
9252
|
:param Indicator ind: 输入因子
|
|
8978
9253
|
:param sequence(stock)|Block stks 证券组合
|
|
@@ -8980,10 +9255,11 @@ def IC(ind: Indicator, stks: typing.Any, query: Query, ref_stk: Stock, n: typing
|
|
|
8980
9255
|
:param Stock ref_stk: 参照证券,通常使用 sh000300 沪深300
|
|
8981
9256
|
:param int n: 时间窗口
|
|
8982
9257
|
:param bool spearman: 使用 spearman 相关系数,否则为 pearson
|
|
9258
|
+
:param bool strict: 严格模式
|
|
8983
9259
|
"""
|
|
8984
|
-
def ICIR(ind: Indicator, stks: typing.Any, query: Query, ref_stk: Stock, n: typing.SupportsInt = 1, rolling_n: typing.SupportsInt = 120, spearman: bool = True) -> Indicator:
|
|
9260
|
+
def ICIR(ind: Indicator, stks: typing.Any, query: Query, ref_stk: Stock, n: typing.SupportsInt = 1, rolling_n: typing.SupportsInt = 120, spearman: bool = True, strict: bool = False) -> Indicator:
|
|
8985
9261
|
"""
|
|
8986
|
-
ICIR(ind, stks, query, ref_stk[, n=1, rolling_n=120])
|
|
9262
|
+
ICIR(ind, stks, query, ref_stk[, n=1, rolling_n=120, spearman=True, strict=False])
|
|
8987
9263
|
|
|
8988
9264
|
计算 IC 因子 IR = IC的多周期均值/IC的标准方差
|
|
8989
9265
|
|
|
@@ -8994,6 +9270,7 @@ def ICIR(ind: Indicator, stks: typing.Any, query: Query, ref_stk: Stock, n: typi
|
|
|
8994
9270
|
:param int n: 计算IC时对应的 n 日收益率
|
|
8995
9271
|
:param int rolling_n: 滚动周期
|
|
8996
9272
|
:param bool spearman: 使用 spearman 相关系数,否则为 pearson
|
|
9273
|
+
:param bool strict: 是否严格IC模式
|
|
8997
9274
|
"""
|
|
8998
9275
|
@typing.overload
|
|
8999
9276
|
def IF(arg0: Indicator, arg1: Indicator, arg2: Indicator) -> Indicator:
|
|
@@ -9116,12 +9393,18 @@ def INDEXV(kdata: KData, fill_null: bool = True) -> Indicator:
|
|
|
9116
9393
|
返回对应的大盘成交量,分别是上证指数,深证成指,科创50,创业板指
|
|
9117
9394
|
"""
|
|
9118
9395
|
@typing.overload
|
|
9396
|
+
def INSUM(block: Block, mode: typing.SupportsInt, fill_null: bool = True) -> Indicator:
|
|
9397
|
+
...
|
|
9398
|
+
@typing.overload
|
|
9119
9399
|
def INSUM(block: Block, ind: Indicator, mode: typing.SupportsInt, fill_null: bool = True) -> Indicator:
|
|
9120
9400
|
...
|
|
9121
9401
|
@typing.overload
|
|
9122
9402
|
def INSUM(block: Block, query: Query, ind: Indicator, mode: typing.SupportsInt, fill_null: bool = True) -> Indicator:
|
|
9123
9403
|
...
|
|
9124
9404
|
@typing.overload
|
|
9405
|
+
def INSUM(stks: collections.abc.Sequence, mode: typing.SupportsInt, fill_null: bool = True) -> Indicator:
|
|
9406
|
+
...
|
|
9407
|
+
@typing.overload
|
|
9125
9408
|
def INSUM(stks: collections.abc.Sequence, ind: Indicator, mode: typing.SupportsInt, fill_null: bool = True) -> Indicator:
|
|
9126
9409
|
...
|
|
9127
9410
|
@typing.overload
|
|
@@ -9960,6 +10243,13 @@ def POW(data: typing.SupportsFloat, n: typing.SupportsInt) -> Indicator:
|
|
|
9960
10243
|
:param int|Indicator|IndParam n: 幂
|
|
9961
10244
|
:rtype: Indicator
|
|
9962
10245
|
"""
|
|
10246
|
+
@typing.overload
|
|
10247
|
+
def PRICELIST(dates: DatetimeList, value: typing.SupportsFloat, discard: typing.SupportsInt = 0) -> Indicator:
|
|
10248
|
+
...
|
|
10249
|
+
@typing.overload
|
|
10250
|
+
def PRICELIST(size: typing.SupportsInt, value: typing.SupportsFloat, discard: typing.SupportsInt = 0) -> Indicator:
|
|
10251
|
+
...
|
|
10252
|
+
@typing.overload
|
|
9963
10253
|
def PRICELIST(data: typing.Any = None, discard: typing.SupportsInt = 0, align_dates: typing.Any = None) -> Indicator:
|
|
9964
10254
|
"""
|
|
9965
10255
|
PRICELIST([data=None, discard=0, align_dates=None])
|
|
@@ -9972,7 +10262,7 @@ def PRICELIST(data: typing.Any = None, discard: typing.SupportsInt = 0, align_da
|
|
|
9972
10262
|
:rtype: Indicator
|
|
9973
10263
|
"""
|
|
9974
10264
|
@typing.overload
|
|
9975
|
-
def RANK(
|
|
10265
|
+
def RANK(stks: collections.abc.Sequence, mode: typing.SupportsInt = 0, fill_null: bool = True, market: str = 'SH') -> Indicator:
|
|
9976
10266
|
...
|
|
9977
10267
|
@typing.overload
|
|
9978
10268
|
def RANK(stks: collections.abc.Sequence, ref_ind: Indicator, mode: typing.SupportsInt = 0, fill_null: bool = True, market: str = 'SH') -> Indicator:
|
|
@@ -10079,6 +10369,19 @@ def REF(data: Indicator, n: typing.SupportsInt) -> Indicator:
|
|
|
10079
10369
|
:rtype: Indicator
|
|
10080
10370
|
"""
|
|
10081
10371
|
@typing.overload
|
|
10372
|
+
def REFX(n: typing.SupportsInt) -> Indicator:
|
|
10373
|
+
...
|
|
10374
|
+
@typing.overload
|
|
10375
|
+
def REFX(ind: Indicator, n: typing.SupportsInt) -> Indicator:
|
|
10376
|
+
"""
|
|
10377
|
+
REFX(ind, n)
|
|
10378
|
+
|
|
10379
|
+
REF增强(非安全引用, 勿用于回测)。用于获取指标中第n个周期的值, n为正数时从当前周期向前数, 为负数时从当前周期向后数。
|
|
10380
|
+
|
|
10381
|
+
:param Indicator ind: 指标
|
|
10382
|
+
:param int n: 周期数
|
|
10383
|
+
"""
|
|
10384
|
+
@typing.overload
|
|
10082
10385
|
def REPLACE(old_value: typing.SupportsFloat = ..., new_value: typing.SupportsFloat = 0.0, ignore_discard: bool = False) -> Indicator:
|
|
10083
10386
|
...
|
|
10084
10387
|
@typing.overload
|
|
@@ -10662,19 +10965,19 @@ def SIN(arg0: typing.SupportsFloat) -> Indicator:
|
|
|
10662
10965
|
def SLICE(data: collections.abc.Sequence[typing.SupportsFloat], start: typing.SupportsInt, end: typing.SupportsInt) -> Indicator:
|
|
10663
10966
|
...
|
|
10664
10967
|
@typing.overload
|
|
10665
|
-
def SLICE(start: typing.SupportsInt, end: typing.SupportsInt, result_index: typing.SupportsInt =
|
|
10968
|
+
def SLICE(start: typing.SupportsInt, end: typing.SupportsInt, result_index: typing.SupportsInt = -1) -> Indicator:
|
|
10666
10969
|
...
|
|
10667
10970
|
@typing.overload
|
|
10668
10971
|
def SLICE(data: Indicator, start: typing.SupportsInt, end: typing.SupportsInt, result_index: typing.SupportsInt = 0) -> Indicator:
|
|
10669
10972
|
"""
|
|
10670
|
-
SLICE(data, start, end, result_index
|
|
10973
|
+
SLICE(data, start, end, result_index=-1)
|
|
10671
10974
|
|
|
10672
10975
|
获取某指标中指定范围 [start, end) 的数据,生成新的指标
|
|
10673
10976
|
|
|
10674
10977
|
:param Indicator|PriceList data: 输入数据
|
|
10675
10978
|
:param int start: 起始位置
|
|
10676
10979
|
:param int end: 终止位置(不包含本身)
|
|
10677
|
-
:param int result_index:
|
|
10980
|
+
:param int result_index: 原输入数据中的结果集, 小于0时表示全部结果集
|
|
10678
10981
|
"""
|
|
10679
10982
|
@typing.overload
|
|
10680
10983
|
def SLOPE(n: typing.SupportsInt = 22) -> Indicator:
|
|
@@ -13579,6 +13882,10 @@ def dates_to_np(arg0: DatetimeList) -> numpy.ndarray:
|
|
|
13579
13882
|
"""
|
|
13580
13883
|
将 DatetimeList 转换为 NumPy 元组
|
|
13581
13884
|
"""
|
|
13885
|
+
def dates_to_pa(arg0: DatetimeList) -> typing.Any:
|
|
13886
|
+
"""
|
|
13887
|
+
将日期列表转换为 pyarrow.Table 对象
|
|
13888
|
+
"""
|
|
13582
13889
|
def df_to_krecords(df: typing.Any, columns: collections.abc.Sequence[str] = ['datetime', 'open', 'high', 'low', 'close', 'amount', 'volume']) -> KRecordList:
|
|
13583
13890
|
"""
|
|
13584
13891
|
df_to_krecords(df: pd.DataFrame[, columns: dict]) -> KRecordList
|
|
@@ -13641,6 +13948,37 @@ def get_date_range(start: Datetime, end: Datetime) -> DatetimeList:
|
|
|
13641
13948
|
:rtype: DatetimeList
|
|
13642
13949
|
"""
|
|
13643
13950
|
@typing.overload
|
|
13951
|
+
def get_inds_view(stks: collections.abc.Sequence, inds: collections.abc.Sequence[Indicator], query: Query, market: str = 'SH') -> typing.Any:
|
|
13952
|
+
...
|
|
13953
|
+
@typing.overload
|
|
13954
|
+
def get_inds_view(stks: collections.abc.Sequence, inds: collections.abc.Sequence[Indicator], date: Datetime, cal_len: typing.SupportsInt = 100, ktype: str = 'DAY', market: str = 'SH') -> typing.Any:
|
|
13955
|
+
"""
|
|
13956
|
+
get_inds_view(stks, inds, date[, cal_len=100, ktype=Query.DAY, market='SH']) -> pandas.DataFrame)
|
|
13957
|
+
|
|
13958
|
+
方式1: 获取指定日期的各证券的各指标结果
|
|
13959
|
+
|
|
13960
|
+
:param stks: 证券列表
|
|
13961
|
+
:param list[Indicator] inds: 指标列表
|
|
13962
|
+
:param Datetime date: 指定日期
|
|
13963
|
+
:param int cal_len: 计算需要的数据长度
|
|
13964
|
+
:param str ktype: k线类型
|
|
13965
|
+
:param str market: 指定行情市场(用于日期对齐)
|
|
13966
|
+
|
|
13967
|
+
方式2: 获取按指定Query查询计算的各证券的各指标结果, 结果中将包含指定 Query 包含的所有指定市场交易日日期
|
|
13968
|
+
get_inds_view(stks, inds, query, market='SH'])
|
|
13969
|
+
|
|
13970
|
+
:param stks: 指定证券列表
|
|
13971
|
+
:param list[Indicator] inds: 指定指标列表
|
|
13972
|
+
:param Query query: 查询条件
|
|
13973
|
+
:param str market: 指定行情市场(用于日期对齐)
|
|
13974
|
+
"""
|
|
13975
|
+
@typing.overload
|
|
13976
|
+
def get_inds_view_pyarrow(stks: collections.abc.Sequence, inds: collections.abc.Sequence[Indicator], query: Query, market: str = 'SH') -> typing.Any:
|
|
13977
|
+
...
|
|
13978
|
+
@typing.overload
|
|
13979
|
+
def get_inds_view_pyarrow(stks: collections.abc.Sequence, inds: collections.abc.Sequence[Indicator], date: Datetime, cal_len: typing.SupportsInt = 100, ktype: str = 'DAY', market: str = 'SH') -> typing.Any:
|
|
13980
|
+
...
|
|
13981
|
+
@typing.overload
|
|
13644
13982
|
def get_kdata(arg0: str, arg1: Query) -> KData:
|
|
13645
13983
|
...
|
|
13646
13984
|
@typing.overload
|
|
@@ -13686,6 +14024,8 @@ def get_market_view(stks: collections.abc.Sequence, date: Datetime = ..., market
|
|
|
13686
14024
|
:return: 指定股票列表最后行情数据
|
|
13687
14025
|
:rtype: pandas.DataFrame
|
|
13688
14026
|
"""
|
|
14027
|
+
def get_market_view_pyarrow(stks: collections.abc.Sequence, date: Datetime = ..., market: str = 'SH') -> typing.Any:
|
|
14028
|
+
...
|
|
13689
14029
|
def get_spot_from_buffer_server(arg0: str, arg1: str, arg2: str, arg3: Datetime) -> list[SpotRecord]:
|
|
13690
14030
|
"""
|
|
13691
14031
|
get_spot_from_buffer_server(addr: str, market: str, code: str, datetime: str)
|
|
@@ -13772,6 +14112,10 @@ def krecords_to_df(arg0: KRecordList) -> typing.Any:
|
|
|
13772
14112
|
...
|
|
13773
14113
|
def krecords_to_np(arg0: KRecordList) -> numpy.ndarray:
|
|
13774
14114
|
...
|
|
14115
|
+
def krecords_to_pa(arg0: KRecordList) -> typing.Any:
|
|
14116
|
+
"""
|
|
14117
|
+
将KRecordList转换为parraw.Table
|
|
14118
|
+
"""
|
|
13775
14119
|
def open_ostream_to_python() -> None:
|
|
13776
14120
|
...
|
|
13777
14121
|
def open_spend_time() -> None:
|
|
@@ -13784,12 +14128,22 @@ def positions_to_df(arg0: PositionRecordList) -> typing.Any:
|
|
|
13784
14128
|
|
|
13785
14129
|
将持仓记录列表转换为 pandas DataFrame
|
|
13786
14130
|
|
|
14131
|
+
注意: 其中的当前市值、利润、盈亏等计算值均以日线计算, 如使用日线一下级别回测时, 对未清仓的持仓记录需要自行重新计算!
|
|
14132
|
+
|
|
13787
14133
|
:param PositionRecordList positions: 持仓记录列表
|
|
13788
14134
|
:return: 包含持仓记录的 pandas DataFrame
|
|
13789
14135
|
:rtype: pandas.DataFrame
|
|
13790
14136
|
"""
|
|
13791
14137
|
def positions_to_np(arg0: PositionRecordList) -> numpy.ndarray:
|
|
13792
|
-
|
|
14138
|
+
"""
|
|
14139
|
+
将持仓列表转换为Numpy
|
|
14140
|
+
|
|
14141
|
+
注意: 其中的当前市值、利润、盈亏等计算值均以日线计算, 如使用日线一下级别回测时, 对未清仓的持仓记录需要自行重新计算!
|
|
14142
|
+
"""
|
|
14143
|
+
def positions_to_pa(arg0: PositionRecordList) -> typing.Any:
|
|
14144
|
+
"""
|
|
14145
|
+
将交易记录列表转换为 pyarrow.Table 对象
|
|
14146
|
+
"""
|
|
13793
14147
|
@typing.overload
|
|
13794
14148
|
def register_extra_ktype(ktype: str, basetype: str, minutes: typing.SupportsInt, get_phase_end: collections.abc.Callable[[Datetime], Datetime]) -> None:
|
|
13795
14149
|
...
|
|
@@ -13919,6 +14273,14 @@ def set_python_in_interactive(arg0: bool) -> None:
|
|
|
13919
14273
|
...
|
|
13920
14274
|
def set_python_in_jupyter(arg0: bool) -> None:
|
|
13921
14275
|
...
|
|
14276
|
+
def spot_agent_is_connected() -> bool:
|
|
14277
|
+
"""
|
|
14278
|
+
判断行情数据接收代理是否已连接
|
|
14279
|
+
"""
|
|
14280
|
+
def spot_agent_is_running() -> bool:
|
|
14281
|
+
"""
|
|
14282
|
+
判断行情数据接收代理是否在运行
|
|
14283
|
+
"""
|
|
13922
14284
|
def start_data_server(addr: str = 'tcp://0.0.0.0:9201', work_num: typing.SupportsInt = 2, save_tick: bool = False, buf_tick: bool = False) -> None:
|
|
13923
14285
|
"""
|
|
13924
14286
|
start_data_server(addr: str[, work_num: int=2])
|
|
@@ -13932,7 +14294,15 @@ def start_data_server(addr: str = 'tcp://0.0.0.0:9201', work_num: typing.Support
|
|
|
13932
14294
|
:return: None
|
|
13933
14295
|
"""
|
|
13934
14296
|
def start_spot_agent(print: bool = False, worker_num: typing.SupportsInt = 1, addr: str = '') -> None:
|
|
13935
|
-
|
|
14297
|
+
"""
|
|
14298
|
+
start_spot_agent([print=False, worker_num=1, addr=""])
|
|
14299
|
+
|
|
14300
|
+
启动行情数据接收代理
|
|
14301
|
+
|
|
14302
|
+
:param print: 是否打印日志
|
|
14303
|
+
:param worker_num: 工作线程数
|
|
14304
|
+
:param addr: 行情采集服务地址
|
|
14305
|
+
"""
|
|
13936
14306
|
def stop_data_server() -> None:
|
|
13937
14307
|
"""
|
|
13938
14308
|
stop_data_server()
|
|
@@ -13940,7 +14310,9 @@ def stop_data_server() -> None:
|
|
|
13940
14310
|
停止数据缓存服务
|
|
13941
14311
|
"""
|
|
13942
14312
|
def stop_spot_agent() -> None:
|
|
13943
|
-
|
|
14313
|
+
"""
|
|
14314
|
+
终止行情数据接收代理
|
|
14315
|
+
"""
|
|
13944
14316
|
def systemweights_to_df(arg0: SystemWeightList) -> typing.Any:
|
|
13945
14317
|
...
|
|
13946
14318
|
def systemweights_to_np(arg0: SystemWeightList) -> numpy.ndarray:
|
|
@@ -13953,6 +14325,10 @@ def timeline_to_np(arg0: TimeLineList) -> numpy.ndarray:
|
|
|
13953
14325
|
"""
|
|
13954
14326
|
将分时线记录转换为NumPy元组
|
|
13955
14327
|
"""
|
|
14328
|
+
def timeline_to_pa(arg0: TimeLineList) -> typing.Any:
|
|
14329
|
+
"""
|
|
14330
|
+
将分时线记录转换为 pyarrow.Table 对象
|
|
14331
|
+
"""
|
|
13956
14332
|
def toPriceList(arg0: collections.abc.Sequence) -> list[float]:
|
|
13957
14333
|
"""
|
|
13958
14334
|
将 python list/tuple/np.arry 对象转化为 PriceList 对象
|
|
@@ -13969,6 +14345,10 @@ def trades_to_df(arg0: TradeRecordList) -> typing.Any:
|
|
|
13969
14345
|
"""
|
|
13970
14346
|
def trades_to_np(arg0: TradeRecordList) -> numpy.ndarray:
|
|
13971
14347
|
...
|
|
14348
|
+
def trades_to_pa(arg0: TradeRecordList) -> typing.Any:
|
|
14349
|
+
"""
|
|
14350
|
+
将交易记录列表转换为 pyarrow.Table 对象
|
|
14351
|
+
"""
|
|
13972
14352
|
def translist_to_df(arg0: TransList) -> typing.Any:
|
|
13973
14353
|
"""
|
|
13974
14354
|
将分笔记录转换为 DataFrame
|
|
@@ -13977,6 +14357,10 @@ def translist_to_np(arg0: TransList) -> numpy.ndarray:
|
|
|
13977
14357
|
"""
|
|
13978
14358
|
将分笔记录转换为NumPy元组
|
|
13979
14359
|
"""
|
|
14360
|
+
def translist_to_pa(arg0: TransList) -> typing.Any:
|
|
14361
|
+
"""
|
|
14362
|
+
将分笔记录转换为 pyarrow.Table 对象
|
|
14363
|
+
"""
|
|
13980
14364
|
def view_license() -> str:
|
|
13981
14365
|
"""
|
|
13982
14366
|
view_license()
|
|
@@ -13987,6 +14371,10 @@ def weights_to_df(arg0: StockWeightList) -> typing.Any:
|
|
|
13987
14371
|
...
|
|
13988
14372
|
def weights_to_np(arg0: StockWeightList) -> numpy.ndarray:
|
|
13989
14373
|
...
|
|
14374
|
+
def weights_to_pa(arg0: StockWeightList) -> typing.Any:
|
|
14375
|
+
"""
|
|
14376
|
+
将权息记录列表转换为 pyarrow.Table 对象
|
|
14377
|
+
"""
|
|
13990
14378
|
DEBUG: LOG_LEVEL # value = <LOG_LEVEL.DEBUG: 1>
|
|
13991
14379
|
ERROR: LOG_LEVEL # value = <LOG_LEVEL.ERROR: 4>
|
|
13992
14380
|
FATAL: LOG_LEVEL # value = <LOG_LEVEL.FATAL: 5>
|