hikyuu 2.6.7__py3-none-win_amd64.whl → 2.6.8__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 +656 -632
- hikyuu/analysis/__init__.pyi +563 -539
- hikyuu/analysis/analysis.pyi +583 -561
- hikyuu/core.pyi +565 -541
- hikyuu/cpp/__init__.pyi +2 -2
- hikyuu/cpp/concrt140.dll +0 -0
- hikyuu/cpp/core310.pyd +0 -0
- hikyuu/cpp/core310.pyi +408 -31
- hikyuu/cpp/core311.pyd +0 -0
- hikyuu/cpp/core311.pyi +408 -31
- hikyuu/cpp/core312.pyd +0 -0
- hikyuu/cpp/core312.pyi +408 -31
- hikyuu/cpp/core313.pyd +0 -0
- hikyuu/cpp/core313.pyi +408 -31
- hikyuu/cpp/core39.pyd +0 -0
- hikyuu/cpp/core39.pyi +408 -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/__init__.pyi +31 -36
- hikyuu/draw/drawplot/bokeh_draw.pyi +651 -637
- hikyuu/draw/drawplot/common.pyi +3 -4
- hikyuu/draw/drawplot/echarts_draw.pyi +598 -572
- hikyuu/draw/drawplot/matplotlib_draw.pyi +872 -879
- hikyuu/draw/elder.pyi +19 -20
- hikyuu/draw/kaufman.pyi +18 -18
- hikyuu/draw/volume.pyi +10 -10
- hikyuu/extend.py +19 -0
- hikyuu/extend.pyi +594 -574
- hikyuu/hub.pyi +69 -67
- hikyuu/include/hikyuu/DataType.h +2 -2
- hikyuu/include/hikyuu/KData.h +83 -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 +19 -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 +581 -556
- hikyuu/trade_manage/broker.pyi +19 -18
- hikyuu/trade_manage/broker_easytrader.pyi +6 -4
- hikyuu/trade_manage/broker_mail.pyi +22 -24
- hikyuu/trade_manage/trade.py +6 -0
- hikyuu/trade_manage/trade.pyi +581 -556
- hikyuu/trade_sys/__init__.py +4 -0
- hikyuu/util/check.pyi +17 -15
- hikyuu/util/mylog.pyi +8 -7
- hikyuu/util/notebook.pyi +9 -11
- hikyuu/util/singleton.pyi +8 -6
- {hikyuu-2.6.7.dist-info → hikyuu-2.6.8.dist-info}/METADATA +3 -1
- {hikyuu-2.6.7.dist-info → hikyuu-2.6.8.dist-info}/RECORD +140 -135
- {hikyuu-2.6.7.dist-info → hikyuu-2.6.8.dist-info}/top_level.txt +1 -1
- hikyuu/include/hikyuu/view/MarketView.h +0 -59
- /hikyuu/include/hikyuu/{view → views}/__init__.py +0 -0
- {hikyuu-2.6.7.dist-info → hikyuu-2.6.8.dist-info}/LICENSE +0 -0
- {hikyuu-2.6.7.dist-info → hikyuu-2.6.8.dist-info}/WHEEL +0 -0
- {hikyuu-2.6.7.dist-info → hikyuu-2.6.8.dist-info}/entry_points.txt +0 -0
hikyuu/cpp/core39.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.core39.Indicator) -> numpy.ndarray
|
|
1649
|
+
|
|
1650
|
+
转化为np.array, 如果为时间序列, 则包含 datetime 日期列
|
|
1651
|
+
"""
|
|
1652
|
+
@staticmethod
|
|
1653
|
+
def to_pandas(*args, **kwargs):
|
|
1654
|
+
"""
|
|
1655
|
+
to_df(self: hikyuu.cpp.core39.Indicator) -> object
|
|
1656
|
+
|
|
1657
|
+
转换为 DataFrame
|
|
1658
|
+
"""
|
|
1659
|
+
@staticmethod
|
|
1660
|
+
def value_to_numpy(*args, **kwargs):
|
|
1661
|
+
"""
|
|
1662
|
+
value_to_np(self: hikyuu.cpp.core39.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.core39.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.core39.KData) -> numpy.ndarray
|
|
2203
|
+
|
|
2204
|
+
将 KData 转换为 NumPy 数组
|
|
2205
|
+
"""
|
|
2206
|
+
@staticmethod
|
|
2207
|
+
def to_pandas(*args, **kwargs):
|
|
2208
|
+
"""
|
|
2209
|
+
to_df(self: hikyuu.cpp.core39.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)
|
|
@@ -2252,6 +2336,8 @@ class KData:
|
|
|
2252
2336
|
"""
|
|
2253
2337
|
将 KData 转换为 NumPy 数组
|
|
2254
2338
|
"""
|
|
2339
|
+
def to_pyarrow(self) -> typing.Any:
|
|
2340
|
+
...
|
|
2255
2341
|
def tocsv(self, arg0: str) -> None:
|
|
2256
2342
|
"""
|
|
2257
2343
|
tocsv(self, filename)
|
|
@@ -2505,6 +2591,15 @@ class KRecordList:
|
|
|
2505
2591
|
@staticmethod
|
|
2506
2592
|
def to_np(data):
|
|
2507
2593
|
...
|
|
2594
|
+
@staticmethod
|
|
2595
|
+
def to_numpy(data):
|
|
2596
|
+
...
|
|
2597
|
+
@staticmethod
|
|
2598
|
+
def to_pandas(data):
|
|
2599
|
+
...
|
|
2600
|
+
@staticmethod
|
|
2601
|
+
def to_pyarrow(data):
|
|
2602
|
+
...
|
|
2508
2603
|
def __bool__(self) -> bool:
|
|
2509
2604
|
"""
|
|
2510
2605
|
Check whether the list is nonempty
|
|
@@ -3693,6 +3788,12 @@ class PositionRecordList:
|
|
|
3693
3788
|
...
|
|
3694
3789
|
def to_np(self):
|
|
3695
3790
|
...
|
|
3791
|
+
def to_numpy(self):
|
|
3792
|
+
...
|
|
3793
|
+
def to_pandas(self):
|
|
3794
|
+
...
|
|
3795
|
+
def to_pyarrow(self):
|
|
3796
|
+
...
|
|
3696
3797
|
class ProfitGoalBase:
|
|
3697
3798
|
"""
|
|
3698
3799
|
盈利目标策略基类
|
|
@@ -3945,6 +4046,8 @@ class Query:
|
|
|
3945
4046
|
MONTH: typing.ClassVar[str] = 'MONTH'
|
|
3946
4047
|
NO_RECOVER: typing.ClassVar[Query.RecoverType] # value = <RecoverType.NO_RECOVER: 0>
|
|
3947
4048
|
QUARTER: typing.ClassVar[str] = 'QUARTER'
|
|
4049
|
+
TIMELINE: typing.ClassVar[str] = 'TIMELINE'
|
|
4050
|
+
TRANS: typing.ClassVar[str] = 'TRANS'
|
|
3948
4051
|
WEEK: typing.ClassVar[str] = 'WEEK'
|
|
3949
4052
|
YEAR: typing.ClassVar[str] = 'YEAR'
|
|
3950
4053
|
@staticmethod
|
|
@@ -3960,6 +4063,31 @@ class Query:
|
|
|
3960
4063
|
"""
|
|
3961
4064
|
获取所有扩展KType
|
|
3962
4065
|
"""
|
|
4066
|
+
@staticmethod
|
|
4067
|
+
def get_ktype_in_min(arg0: str) -> int:
|
|
4068
|
+
"""
|
|
4069
|
+
获取ktype对应的分钟数
|
|
4070
|
+
"""
|
|
4071
|
+
@staticmethod
|
|
4072
|
+
def get_ktype_in_seconds(arg0: str) -> int:
|
|
4073
|
+
"""
|
|
4074
|
+
获取ktype对应的秒数
|
|
4075
|
+
"""
|
|
4076
|
+
@staticmethod
|
|
4077
|
+
def is_base_ktype(arg0: str) -> bool:
|
|
4078
|
+
"""
|
|
4079
|
+
判断是否为基础KType
|
|
4080
|
+
"""
|
|
4081
|
+
@staticmethod
|
|
4082
|
+
def is_extra_ktype(arg0: str) -> bool:
|
|
4083
|
+
"""
|
|
4084
|
+
判断是否为扩展KType
|
|
4085
|
+
"""
|
|
4086
|
+
@staticmethod
|
|
4087
|
+
def is_valid_ktype(arg0: str) -> bool:
|
|
4088
|
+
"""
|
|
4089
|
+
判断KType是否有效
|
|
4090
|
+
"""
|
|
3963
4091
|
def __getstate__(self) -> tuple:
|
|
3964
4092
|
...
|
|
3965
4093
|
def __init__(self, start = 0, end = None, ktype = 'DAY', recover_type = ...):
|
|
@@ -3981,21 +4109,9 @@ class Query:
|
|
|
3981
4109
|
...
|
|
3982
4110
|
def __str__(self) -> str:
|
|
3983
4111
|
...
|
|
3984
|
-
def
|
|
3985
|
-
"""
|
|
3986
|
-
获取ktype对应的分钟数
|
|
3987
|
-
"""
|
|
3988
|
-
def is_base_ktype(self: str) -> bool:
|
|
4112
|
+
def is_right_opening(self) -> bool:
|
|
3989
4113
|
"""
|
|
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是否有效
|
|
4114
|
+
判断是否为右开区间,即未指定结束时间
|
|
3999
4115
|
"""
|
|
4000
4116
|
@property
|
|
4001
4117
|
def end(self) -> int:
|
|
@@ -4153,6 +4269,10 @@ class ScoreRecordList:
|
|
|
4153
4269
|
...
|
|
4154
4270
|
def to_np(self):
|
|
4155
4271
|
...
|
|
4272
|
+
def to_numpy(self):
|
|
4273
|
+
...
|
|
4274
|
+
def to_pandas(self):
|
|
4275
|
+
...
|
|
4156
4276
|
class SelectorBase:
|
|
4157
4277
|
"""
|
|
4158
4278
|
选择器策略基类,实现标的、系统策略的评估和选取算法,自定义选择器策略子类接口:
|
|
@@ -4800,6 +4920,15 @@ class Stock:
|
|
|
4800
4920
|
获取所有历史财务信息历史记录, 字段信息可参考 StockManager 中的相关方法: get_history_finance_all_fields/get_history_finance_field_index/get_history_finance_field_name 方法
|
|
4801
4921
|
日常建议直接使用指标 FINANCE 获取财务数据
|
|
4802
4922
|
"""
|
|
4923
|
+
def get_index_range(self, arg0: Query) -> tuple:
|
|
4924
|
+
"""
|
|
4925
|
+
get_index_range(self, query) -> (size_t, size_t)
|
|
4926
|
+
|
|
4927
|
+
根据KQuery指定的条件, 获取对应的K线位置范围: [start_pos, end_pos)
|
|
4928
|
+
|
|
4929
|
+
:param query [in] 指定的查询条件
|
|
4930
|
+
:return (start_pos, end_pos
|
|
4931
|
+
"""
|
|
4803
4932
|
def get_kdata(self, arg0: Query) -> KData:
|
|
4804
4933
|
"""
|
|
4805
4934
|
get_kdata(self, query)
|
|
@@ -5303,9 +5432,20 @@ class StockManager:
|
|
|
5303
5432
|
"""
|
|
5304
5433
|
is_holiday(self, d)
|
|
5305
5434
|
|
|
5306
|
-
|
|
5435
|
+
判断指定时间对应的日期是否为节假日(仅使用A股市场)
|
|
5436
|
+
|
|
5437
|
+
:param Datetime d: 待判断的时间
|
|
5438
|
+
"""
|
|
5439
|
+
def is_trading_hours(self, d: Datetime, market: str = 'SH') -> bool:
|
|
5440
|
+
"""
|
|
5441
|
+
is_trading_hours(self, d)
|
|
5307
5442
|
|
|
5308
|
-
|
|
5443
|
+
判断指定时间对应的日期是否为交易时间
|
|
5444
|
+
|
|
5445
|
+
:param Datetime d: 待判断的时间
|
|
5446
|
+
:param str market: 市场简称
|
|
5447
|
+
:return: 是否为交易时间
|
|
5448
|
+
:rtype: bool
|
|
5309
5449
|
"""
|
|
5310
5450
|
def reload(self) -> None:
|
|
5311
5451
|
"""
|
|
@@ -5511,6 +5651,15 @@ class StockWeightList:
|
|
|
5511
5651
|
@staticmethod
|
|
5512
5652
|
def to_np(data):
|
|
5513
5653
|
...
|
|
5654
|
+
@staticmethod
|
|
5655
|
+
def to_numpy(data):
|
|
5656
|
+
...
|
|
5657
|
+
@staticmethod
|
|
5658
|
+
def to_pandas(data):
|
|
5659
|
+
...
|
|
5660
|
+
@staticmethod
|
|
5661
|
+
def to_pyarrow(data):
|
|
5662
|
+
...
|
|
5514
5663
|
def __bool__(self) -> bool:
|
|
5515
5664
|
"""
|
|
5516
5665
|
Check whether the list is nonempty
|
|
@@ -6474,6 +6623,10 @@ class SystemWeightList:
|
|
|
6474
6623
|
...
|
|
6475
6624
|
def to_np(self):
|
|
6476
6625
|
...
|
|
6626
|
+
def to_numpy(self):
|
|
6627
|
+
...
|
|
6628
|
+
def to_pandas(self):
|
|
6629
|
+
...
|
|
6477
6630
|
class TimeDelta:
|
|
6478
6631
|
"""
|
|
6479
6632
|
时间时长,用于时间计算。可通过以下方式构建:
|
|
@@ -6712,6 +6865,15 @@ class TimeLineList:
|
|
|
6712
6865
|
@staticmethod
|
|
6713
6866
|
def to_np(data):
|
|
6714
6867
|
...
|
|
6868
|
+
@staticmethod
|
|
6869
|
+
def to_numpy(data):
|
|
6870
|
+
...
|
|
6871
|
+
@staticmethod
|
|
6872
|
+
def to_pandas(data):
|
|
6873
|
+
...
|
|
6874
|
+
@staticmethod
|
|
6875
|
+
def to_pyarrow(data):
|
|
6876
|
+
...
|
|
6715
6877
|
def __bool__(self) -> bool:
|
|
6716
6878
|
"""
|
|
6717
6879
|
Check whether the list is nonempty
|
|
@@ -7670,6 +7832,12 @@ class TradeRecordList:
|
|
|
7670
7832
|
...
|
|
7671
7833
|
def to_np(self):
|
|
7672
7834
|
...
|
|
7835
|
+
def to_numpy(self):
|
|
7836
|
+
...
|
|
7837
|
+
def to_pandas(self):
|
|
7838
|
+
...
|
|
7839
|
+
def to_pyarrow(self):
|
|
7840
|
+
...
|
|
7673
7841
|
class TradeRequest:
|
|
7674
7842
|
"""
|
|
7675
7843
|
交易请求记录。系统内部在实现延迟操作时登记的交易请求信息。暴露该结构的主要目的是用于
|
|
@@ -7750,6 +7918,15 @@ class TransList:
|
|
|
7750
7918
|
@staticmethod
|
|
7751
7919
|
def to_np(data):
|
|
7752
7920
|
...
|
|
7921
|
+
@staticmethod
|
|
7922
|
+
def to_numpy(data):
|
|
7923
|
+
...
|
|
7924
|
+
@staticmethod
|
|
7925
|
+
def to_pandas(data):
|
|
7926
|
+
...
|
|
7927
|
+
@staticmethod
|
|
7928
|
+
def to_pyarrow(data):
|
|
7929
|
+
...
|
|
7753
7930
|
def __bool__(self) -> bool:
|
|
7754
7931
|
"""
|
|
7755
7932
|
Check whether the list is nonempty
|
|
@@ -7986,6 +8163,88 @@ def AF_MultiFactor() -> AllocateFundsBase:
|
|
|
7986
8163
|
|
|
7987
8164
|
创建 MultiFactor 评分权重的资产分配算法实例, 即直接以SE返回的评分作为权重。
|
|
7988
8165
|
"""
|
|
8166
|
+
def AGG_COUNT(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8167
|
+
"""
|
|
8168
|
+
聚合函数: 非空值计数, 可参考 AGG_STD 帮助
|
|
8169
|
+
"""
|
|
8170
|
+
def AGG_MAD(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8171
|
+
"""
|
|
8172
|
+
聚合函数: 平均绝对偏差, 可参考 AGG_STD 帮助
|
|
8173
|
+
"""
|
|
8174
|
+
def AGG_MAX(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8175
|
+
"""
|
|
8176
|
+
聚合函数: 最大值, 可参考 AGG_STD 帮助
|
|
8177
|
+
"""
|
|
8178
|
+
def AGG_MEAN(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8179
|
+
"""
|
|
8180
|
+
聚合函数: 平均值, 可参考 AGG_STD 帮助
|
|
8181
|
+
"""
|
|
8182
|
+
def AGG_MEDIAN(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8183
|
+
"""
|
|
8184
|
+
聚合函数: 中位数, 可参考 AGG_STD 帮助
|
|
8185
|
+
"""
|
|
8186
|
+
def AGG_MIN(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8187
|
+
"""
|
|
8188
|
+
聚合函数: 最小值, 可参考 AGG_STD 帮助
|
|
8189
|
+
"""
|
|
8190
|
+
def AGG_PROD(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8191
|
+
"""
|
|
8192
|
+
聚合函数: 乘积, 可参考 AGG_STD 帮助
|
|
8193
|
+
"""
|
|
8194
|
+
def AGG_QUANTILE(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1, quantile: typing.SupportsFloat = 0.75) -> Indicator:
|
|
8195
|
+
"""
|
|
8196
|
+
AGG_QUANTILE(ind[, ktype=Query.MIN, fill_null=False, unit=1, quantile=0.75])
|
|
8197
|
+
|
|
8198
|
+
聚合其他K线周期分位数, 可参考 AGG_STD 帮助
|
|
8199
|
+
|
|
8200
|
+
:param Indicator ind: 待计算指标
|
|
8201
|
+
:param KQuery.KType ktype: 聚合的K线周期
|
|
8202
|
+
:param bool fill_null: 是否填充缺失值
|
|
8203
|
+
:param int unit: 聚合周期单位 (上下文K线分组单位, 使用日线计算分钟线聚合时, unit=2代表聚合2天的分钟线)
|
|
8204
|
+
:param float quantile: 分位数 (0, 1) 之间
|
|
8205
|
+
:return: 指标数据
|
|
8206
|
+
:rtype: Indicator
|
|
8207
|
+
"""
|
|
8208
|
+
def AGG_STD(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1, ddof: typing.SupportsInt = 1) -> Indicator:
|
|
8209
|
+
"""
|
|
8210
|
+
AGG_STD(ind[, ktype=Query.MIN, fill_null=False, unit=1, ddof=1])
|
|
8211
|
+
|
|
8212
|
+
聚合其他K线周期的标准差, 如计算日线时聚合分钟线收盘价的标准差
|
|
8213
|
+
|
|
8214
|
+
>>> kdata = get_kdata('sh600000', Query(Datetime(20250101), ktype=Query.DAY))
|
|
8215
|
+
>>> ind = AGG_STD(CLOSE(), ktype=Query.MIN, fill_null=False, unit=1, ddof=1)
|
|
8216
|
+
>>> ind(k)
|
|
8217
|
+
|
|
8218
|
+
:param Indicator ind: 指标数据
|
|
8219
|
+
:param KQuery.KType ktype: 聚合的K线周期
|
|
8220
|
+
:param bool fill_null: 是否填充缺失值
|
|
8221
|
+
:param int unit: 聚合周期单位 (滚动聚合分组单位, 如使用日线计算分钟线聚合时, unit=2代表聚合2天的分钟线)
|
|
8222
|
+
:param int ddof: 自由度(1: 样本标准差, 0: 总体标准差)
|
|
8223
|
+
:return: 指标数据
|
|
8224
|
+
:rtype: Indicator
|
|
8225
|
+
"""
|
|
8226
|
+
def AGG_SUM(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8227
|
+
"""
|
|
8228
|
+
聚合函数: 总和, 可参考 AGG_STD 帮助
|
|
8229
|
+
"""
|
|
8230
|
+
def AGG_VAR(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1, ddof: typing.SupportsInt = 1) -> Indicator:
|
|
8231
|
+
"""
|
|
8232
|
+
AGG_VAR(ind[, ktype=Query.MIN, fill_null=False, unit=1, ddof=1])
|
|
8233
|
+
|
|
8234
|
+
聚合其他K线周期的方差, 如计算日线时聚合分钟线收盘价的方差
|
|
8235
|
+
|
|
8236
|
+
>>> kdata = get_kdata('sh600000', Query(Datetime(20250101), ktype=Query.DAY))
|
|
8237
|
+
>>> ind = AGG_VAR(CLOSE(), ktype=Query.MIN, fill_null=False, unit=1, ddof=1)
|
|
8238
|
+
>>> ind(k)
|
|
8239
|
+
|
|
8240
|
+
:param Indicator ind: 待计算指标
|
|
8241
|
+
:param KQuery.KType ktype: 聚合的K线周期
|
|
8242
|
+
:param bool fill_null: 是否填充缺失值
|
|
8243
|
+
:param int unit: 聚合周期单位 (上下文K线分组单位, 使用日线计算分钟线聚合时, unit=2代表聚合2天的分钟线)
|
|
8244
|
+
:param int ddof: 自由度(1: 样本标准差, 0: 总体标准差)
|
|
8245
|
+
:return: 指标数据
|
|
8246
|
+
:rtype: Indicator
|
|
8247
|
+
"""
|
|
7989
8248
|
@typing.overload
|
|
7990
8249
|
def ALIGN(ref: DatetimeList, fill_null: bool = True) -> Indicator:
|
|
7991
8250
|
...
|
|
@@ -8968,11 +9227,16 @@ def Hours(arg0: typing.SupportsInt) -> TimeDelta:
|
|
|
8968
9227
|
:param int hours: 小时数
|
|
8969
9228
|
:rtype: TimeDelta
|
|
8970
9229
|
"""
|
|
8971
|
-
def IC(ind: Indicator, stks: typing.Any, query: Query, ref_stk: Stock, n: typing.SupportsInt = 1, spearman: bool = True) -> Indicator:
|
|
9230
|
+
def IC(ind: Indicator, stks: typing.Any, query: Query, ref_stk: Stock, n: typing.SupportsInt = 1, spearman: bool = True, strict: bool = False) -> Indicator:
|
|
8972
9231
|
"""
|
|
8973
|
-
IC(ind, stks, query, ref_stk[, n=1])
|
|
9232
|
+
IC(ind, stks, query, ref_stk[, n=1, spearman=True, strict=False]) -> Indicator
|
|
9233
|
+
|
|
9234
|
+
计算指定的因子相对于参考证券的 IC (实际为 RankIC)
|
|
8974
9235
|
|
|
8975
|
-
|
|
9236
|
+
IC 原本需要 “t 时刻因子值→t+1 时刻收益”,此处改为计算 “t 时刻因子值→t 时刻之前 N 天的收益”(比如过去 5 天的收益)。
|
|
9237
|
+
(否则当前值都会是缺失NA), 相当于原始预测 IC 右移 n 位。
|
|
9238
|
+
|
|
9239
|
+
如需严格“t 时刻因子值→t+1 时刻收益“计算,请设置 strict=True (注意此模式下, 后n位为 NA)
|
|
8976
9240
|
|
|
8977
9241
|
:param Indicator ind: 输入因子
|
|
8978
9242
|
:param sequence(stock)|Block stks 证券组合
|
|
@@ -8980,10 +9244,11 @@ def IC(ind: Indicator, stks: typing.Any, query: Query, ref_stk: Stock, n: typing
|
|
|
8980
9244
|
:param Stock ref_stk: 参照证券,通常使用 sh000300 沪深300
|
|
8981
9245
|
:param int n: 时间窗口
|
|
8982
9246
|
:param bool spearman: 使用 spearman 相关系数,否则为 pearson
|
|
9247
|
+
:param bool strict: 严格模式
|
|
8983
9248
|
"""
|
|
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:
|
|
9249
|
+
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
9250
|
"""
|
|
8986
|
-
ICIR(ind, stks, query, ref_stk[, n=1, rolling_n=120])
|
|
9251
|
+
ICIR(ind, stks, query, ref_stk[, n=1, rolling_n=120, spearman=True, strict=False])
|
|
8987
9252
|
|
|
8988
9253
|
计算 IC 因子 IR = IC的多周期均值/IC的标准方差
|
|
8989
9254
|
|
|
@@ -8994,6 +9259,7 @@ def ICIR(ind: Indicator, stks: typing.Any, query: Query, ref_stk: Stock, n: typi
|
|
|
8994
9259
|
:param int n: 计算IC时对应的 n 日收益率
|
|
8995
9260
|
:param int rolling_n: 滚动周期
|
|
8996
9261
|
:param bool spearman: 使用 spearman 相关系数,否则为 pearson
|
|
9262
|
+
:param bool strict: 是否严格IC模式
|
|
8997
9263
|
"""
|
|
8998
9264
|
@typing.overload
|
|
8999
9265
|
def IF(arg0: Indicator, arg1: Indicator, arg2: Indicator) -> Indicator:
|
|
@@ -9116,12 +9382,18 @@ def INDEXV(kdata: KData, fill_null: bool = True) -> Indicator:
|
|
|
9116
9382
|
返回对应的大盘成交量,分别是上证指数,深证成指,科创50,创业板指
|
|
9117
9383
|
"""
|
|
9118
9384
|
@typing.overload
|
|
9385
|
+
def INSUM(block: Block, mode: typing.SupportsInt, fill_null: bool = True) -> Indicator:
|
|
9386
|
+
...
|
|
9387
|
+
@typing.overload
|
|
9119
9388
|
def INSUM(block: Block, ind: Indicator, mode: typing.SupportsInt, fill_null: bool = True) -> Indicator:
|
|
9120
9389
|
...
|
|
9121
9390
|
@typing.overload
|
|
9122
9391
|
def INSUM(block: Block, query: Query, ind: Indicator, mode: typing.SupportsInt, fill_null: bool = True) -> Indicator:
|
|
9123
9392
|
...
|
|
9124
9393
|
@typing.overload
|
|
9394
|
+
def INSUM(stks: collections.abc.Sequence, mode: typing.SupportsInt, fill_null: bool = True) -> Indicator:
|
|
9395
|
+
...
|
|
9396
|
+
@typing.overload
|
|
9125
9397
|
def INSUM(stks: collections.abc.Sequence, ind: Indicator, mode: typing.SupportsInt, fill_null: bool = True) -> Indicator:
|
|
9126
9398
|
...
|
|
9127
9399
|
@typing.overload
|
|
@@ -9960,6 +10232,13 @@ def POW(data: typing.SupportsFloat, n: typing.SupportsInt) -> Indicator:
|
|
|
9960
10232
|
:param int|Indicator|IndParam n: 幂
|
|
9961
10233
|
:rtype: Indicator
|
|
9962
10234
|
"""
|
|
10235
|
+
@typing.overload
|
|
10236
|
+
def PRICELIST(dates: DatetimeList, value: typing.SupportsFloat, discard: typing.SupportsInt = 0) -> Indicator:
|
|
10237
|
+
...
|
|
10238
|
+
@typing.overload
|
|
10239
|
+
def PRICELIST(size: typing.SupportsInt, value: typing.SupportsFloat, discard: typing.SupportsInt = 0) -> Indicator:
|
|
10240
|
+
...
|
|
10241
|
+
@typing.overload
|
|
9963
10242
|
def PRICELIST(data: typing.Any = None, discard: typing.SupportsInt = 0, align_dates: typing.Any = None) -> Indicator:
|
|
9964
10243
|
"""
|
|
9965
10244
|
PRICELIST([data=None, discard=0, align_dates=None])
|
|
@@ -9972,7 +10251,7 @@ def PRICELIST(data: typing.Any = None, discard: typing.SupportsInt = 0, align_da
|
|
|
9972
10251
|
:rtype: Indicator
|
|
9973
10252
|
"""
|
|
9974
10253
|
@typing.overload
|
|
9975
|
-
def RANK(
|
|
10254
|
+
def RANK(stks: collections.abc.Sequence, mode: typing.SupportsInt = 0, fill_null: bool = True, market: str = 'SH') -> Indicator:
|
|
9976
10255
|
...
|
|
9977
10256
|
@typing.overload
|
|
9978
10257
|
def RANK(stks: collections.abc.Sequence, ref_ind: Indicator, mode: typing.SupportsInt = 0, fill_null: bool = True, market: str = 'SH') -> Indicator:
|
|
@@ -10079,6 +10358,19 @@ def REF(data: Indicator, n: typing.SupportsInt) -> Indicator:
|
|
|
10079
10358
|
:rtype: Indicator
|
|
10080
10359
|
"""
|
|
10081
10360
|
@typing.overload
|
|
10361
|
+
def REFX(n: typing.SupportsInt) -> Indicator:
|
|
10362
|
+
...
|
|
10363
|
+
@typing.overload
|
|
10364
|
+
def REFX(ind: Indicator, n: typing.SupportsInt) -> Indicator:
|
|
10365
|
+
"""
|
|
10366
|
+
REFX(ind, n)
|
|
10367
|
+
|
|
10368
|
+
REF增强(非安全引用, 勿用于回测)。用于获取指标中第n个周期的值, n为正数时从当前周期向前数, 为负数时从当前周期向后数。
|
|
10369
|
+
|
|
10370
|
+
:param Indicator ind: 指标
|
|
10371
|
+
:param int n: 周期数
|
|
10372
|
+
"""
|
|
10373
|
+
@typing.overload
|
|
10082
10374
|
def REPLACE(old_value: typing.SupportsFloat = ..., new_value: typing.SupportsFloat = 0.0, ignore_discard: bool = False) -> Indicator:
|
|
10083
10375
|
...
|
|
10084
10376
|
@typing.overload
|
|
@@ -10662,19 +10954,19 @@ def SIN(arg0: typing.SupportsFloat) -> Indicator:
|
|
|
10662
10954
|
def SLICE(data: collections.abc.Sequence[typing.SupportsFloat], start: typing.SupportsInt, end: typing.SupportsInt) -> Indicator:
|
|
10663
10955
|
...
|
|
10664
10956
|
@typing.overload
|
|
10665
|
-
def SLICE(start: typing.SupportsInt, end: typing.SupportsInt, result_index: typing.SupportsInt =
|
|
10957
|
+
def SLICE(start: typing.SupportsInt, end: typing.SupportsInt, result_index: typing.SupportsInt = -1) -> Indicator:
|
|
10666
10958
|
...
|
|
10667
10959
|
@typing.overload
|
|
10668
10960
|
def SLICE(data: Indicator, start: typing.SupportsInt, end: typing.SupportsInt, result_index: typing.SupportsInt = 0) -> Indicator:
|
|
10669
10961
|
"""
|
|
10670
|
-
SLICE(data, start, end, result_index
|
|
10962
|
+
SLICE(data, start, end, result_index=-1)
|
|
10671
10963
|
|
|
10672
10964
|
获取某指标中指定范围 [start, end) 的数据,生成新的指标
|
|
10673
10965
|
|
|
10674
10966
|
:param Indicator|PriceList data: 输入数据
|
|
10675
10967
|
:param int start: 起始位置
|
|
10676
10968
|
:param int end: 终止位置(不包含本身)
|
|
10677
|
-
:param int result_index:
|
|
10969
|
+
:param int result_index: 原输入数据中的结果集, 小于0时表示全部结果集
|
|
10678
10970
|
"""
|
|
10679
10971
|
@typing.overload
|
|
10680
10972
|
def SLOPE(n: typing.SupportsInt = 22) -> Indicator:
|
|
@@ -13579,6 +13871,10 @@ def dates_to_np(arg0: DatetimeList) -> numpy.ndarray:
|
|
|
13579
13871
|
"""
|
|
13580
13872
|
将 DatetimeList 转换为 NumPy 元组
|
|
13581
13873
|
"""
|
|
13874
|
+
def dates_to_pa(arg0: DatetimeList) -> typing.Any:
|
|
13875
|
+
"""
|
|
13876
|
+
将日期列表转换为 pyarrow.Table 对象
|
|
13877
|
+
"""
|
|
13582
13878
|
def df_to_krecords(df: typing.Any, columns: collections.abc.Sequence[str] = ['datetime', 'open', 'high', 'low', 'close', 'amount', 'volume']) -> KRecordList:
|
|
13583
13879
|
"""
|
|
13584
13880
|
df_to_krecords(df: pd.DataFrame[, columns: dict]) -> KRecordList
|
|
@@ -13641,6 +13937,37 @@ def get_date_range(start: Datetime, end: Datetime) -> DatetimeList:
|
|
|
13641
13937
|
:rtype: DatetimeList
|
|
13642
13938
|
"""
|
|
13643
13939
|
@typing.overload
|
|
13940
|
+
def get_inds_view(stks: collections.abc.Sequence, inds: collections.abc.Sequence[Indicator], query: Query, market: str = 'SH') -> typing.Any:
|
|
13941
|
+
...
|
|
13942
|
+
@typing.overload
|
|
13943
|
+
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:
|
|
13944
|
+
"""
|
|
13945
|
+
get_inds_view(stks, inds, date[, cal_len=100, ktype=Query.DAY, market='SH']) -> pandas.DataFrame)
|
|
13946
|
+
|
|
13947
|
+
方式1: 获取指定日期的各证券的各指标结果
|
|
13948
|
+
|
|
13949
|
+
:param stks: 证券列表
|
|
13950
|
+
:param list[Indicator] inds: 指标列表
|
|
13951
|
+
:param Datetime date: 指定日期
|
|
13952
|
+
:param int cal_len: 计算需要的数据长度
|
|
13953
|
+
:param str ktype: k线类型
|
|
13954
|
+
:param str market: 指定行情市场(用于日期对齐)
|
|
13955
|
+
|
|
13956
|
+
方式2: 获取按指定Query查询计算的各证券的各指标结果, 结果中将包含指定 Query 包含的所有指定市场交易日日期
|
|
13957
|
+
get_inds_view(stks, inds, query, market='SH'])
|
|
13958
|
+
|
|
13959
|
+
:param stks: 指定证券列表
|
|
13960
|
+
:param list[Indicator] inds: 指定指标列表
|
|
13961
|
+
:param Query query: 查询条件
|
|
13962
|
+
:param str market: 指定行情市场(用于日期对齐)
|
|
13963
|
+
"""
|
|
13964
|
+
@typing.overload
|
|
13965
|
+
def get_inds_view_pyarrow(stks: collections.abc.Sequence, inds: collections.abc.Sequence[Indicator], query: Query, market: str = 'SH') -> typing.Any:
|
|
13966
|
+
...
|
|
13967
|
+
@typing.overload
|
|
13968
|
+
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:
|
|
13969
|
+
...
|
|
13970
|
+
@typing.overload
|
|
13644
13971
|
def get_kdata(arg0: str, arg1: Query) -> KData:
|
|
13645
13972
|
...
|
|
13646
13973
|
@typing.overload
|
|
@@ -13686,6 +14013,8 @@ def get_market_view(stks: collections.abc.Sequence, date: Datetime = ..., market
|
|
|
13686
14013
|
:return: 指定股票列表最后行情数据
|
|
13687
14014
|
:rtype: pandas.DataFrame
|
|
13688
14015
|
"""
|
|
14016
|
+
def get_market_view_pyarrow(stks: collections.abc.Sequence, date: Datetime = ..., market: str = 'SH') -> typing.Any:
|
|
14017
|
+
...
|
|
13689
14018
|
def get_spot_from_buffer_server(arg0: str, arg1: str, arg2: str, arg3: Datetime) -> list[SpotRecord]:
|
|
13690
14019
|
"""
|
|
13691
14020
|
get_spot_from_buffer_server(addr: str, market: str, code: str, datetime: str)
|
|
@@ -13772,6 +14101,10 @@ def krecords_to_df(arg0: KRecordList) -> typing.Any:
|
|
|
13772
14101
|
...
|
|
13773
14102
|
def krecords_to_np(arg0: KRecordList) -> numpy.ndarray:
|
|
13774
14103
|
...
|
|
14104
|
+
def krecords_to_pa(arg0: KRecordList) -> typing.Any:
|
|
14105
|
+
"""
|
|
14106
|
+
将KRecordList转换为parraw.Table
|
|
14107
|
+
"""
|
|
13775
14108
|
def open_ostream_to_python() -> None:
|
|
13776
14109
|
...
|
|
13777
14110
|
def open_spend_time() -> None:
|
|
@@ -13784,12 +14117,22 @@ def positions_to_df(arg0: PositionRecordList) -> typing.Any:
|
|
|
13784
14117
|
|
|
13785
14118
|
将持仓记录列表转换为 pandas DataFrame
|
|
13786
14119
|
|
|
14120
|
+
注意: 其中的当前市值、利润、盈亏等计算值均以日线计算, 如使用日线一下级别回测时, 对未清仓的持仓记录需要自行重新计算!
|
|
14121
|
+
|
|
13787
14122
|
:param PositionRecordList positions: 持仓记录列表
|
|
13788
14123
|
:return: 包含持仓记录的 pandas DataFrame
|
|
13789
14124
|
:rtype: pandas.DataFrame
|
|
13790
14125
|
"""
|
|
13791
14126
|
def positions_to_np(arg0: PositionRecordList) -> numpy.ndarray:
|
|
13792
|
-
|
|
14127
|
+
"""
|
|
14128
|
+
将持仓列表转换为Numpy
|
|
14129
|
+
|
|
14130
|
+
注意: 其中的当前市值、利润、盈亏等计算值均以日线计算, 如使用日线一下级别回测时, 对未清仓的持仓记录需要自行重新计算!
|
|
14131
|
+
"""
|
|
14132
|
+
def positions_to_pa(arg0: PositionRecordList) -> typing.Any:
|
|
14133
|
+
"""
|
|
14134
|
+
将交易记录列表转换为 pyarrow.Table 对象
|
|
14135
|
+
"""
|
|
13793
14136
|
@typing.overload
|
|
13794
14137
|
def register_extra_ktype(ktype: str, basetype: str, minutes: typing.SupportsInt, get_phase_end: collections.abc.Callable[[Datetime], Datetime]) -> None:
|
|
13795
14138
|
...
|
|
@@ -13919,6 +14262,14 @@ def set_python_in_interactive(arg0: bool) -> None:
|
|
|
13919
14262
|
...
|
|
13920
14263
|
def set_python_in_jupyter(arg0: bool) -> None:
|
|
13921
14264
|
...
|
|
14265
|
+
def spot_agent_is_connected() -> bool:
|
|
14266
|
+
"""
|
|
14267
|
+
判断行情数据接收代理是否已连接
|
|
14268
|
+
"""
|
|
14269
|
+
def spot_agent_is_running() -> bool:
|
|
14270
|
+
"""
|
|
14271
|
+
判断行情数据接收代理是否在运行
|
|
14272
|
+
"""
|
|
13922
14273
|
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
14274
|
"""
|
|
13924
14275
|
start_data_server(addr: str[, work_num: int=2])
|
|
@@ -13932,7 +14283,15 @@ def start_data_server(addr: str = 'tcp://0.0.0.0:9201', work_num: typing.Support
|
|
|
13932
14283
|
:return: None
|
|
13933
14284
|
"""
|
|
13934
14285
|
def start_spot_agent(print: bool = False, worker_num: typing.SupportsInt = 1, addr: str = '') -> None:
|
|
13935
|
-
|
|
14286
|
+
"""
|
|
14287
|
+
start_spot_agent([print=False, worker_num=1, addr=""])
|
|
14288
|
+
|
|
14289
|
+
启动行情数据接收代理
|
|
14290
|
+
|
|
14291
|
+
:param print: 是否打印日志
|
|
14292
|
+
:param worker_num: 工作线程数
|
|
14293
|
+
:param addr: 行情采集服务地址
|
|
14294
|
+
"""
|
|
13936
14295
|
def stop_data_server() -> None:
|
|
13937
14296
|
"""
|
|
13938
14297
|
stop_data_server()
|
|
@@ -13940,7 +14299,9 @@ def stop_data_server() -> None:
|
|
|
13940
14299
|
停止数据缓存服务
|
|
13941
14300
|
"""
|
|
13942
14301
|
def stop_spot_agent() -> None:
|
|
13943
|
-
|
|
14302
|
+
"""
|
|
14303
|
+
终止行情数据接收代理
|
|
14304
|
+
"""
|
|
13944
14305
|
def systemweights_to_df(arg0: SystemWeightList) -> typing.Any:
|
|
13945
14306
|
...
|
|
13946
14307
|
def systemweights_to_np(arg0: SystemWeightList) -> numpy.ndarray:
|
|
@@ -13953,6 +14314,10 @@ def timeline_to_np(arg0: TimeLineList) -> numpy.ndarray:
|
|
|
13953
14314
|
"""
|
|
13954
14315
|
将分时线记录转换为NumPy元组
|
|
13955
14316
|
"""
|
|
14317
|
+
def timeline_to_pa(arg0: TimeLineList) -> typing.Any:
|
|
14318
|
+
"""
|
|
14319
|
+
将分时线记录转换为 pyarrow.Table 对象
|
|
14320
|
+
"""
|
|
13956
14321
|
def toPriceList(arg0: collections.abc.Sequence) -> list[float]:
|
|
13957
14322
|
"""
|
|
13958
14323
|
将 python list/tuple/np.arry 对象转化为 PriceList 对象
|
|
@@ -13969,6 +14334,10 @@ def trades_to_df(arg0: TradeRecordList) -> typing.Any:
|
|
|
13969
14334
|
"""
|
|
13970
14335
|
def trades_to_np(arg0: TradeRecordList) -> numpy.ndarray:
|
|
13971
14336
|
...
|
|
14337
|
+
def trades_to_pa(arg0: TradeRecordList) -> typing.Any:
|
|
14338
|
+
"""
|
|
14339
|
+
将交易记录列表转换为 pyarrow.Table 对象
|
|
14340
|
+
"""
|
|
13972
14341
|
def translist_to_df(arg0: TransList) -> typing.Any:
|
|
13973
14342
|
"""
|
|
13974
14343
|
将分笔记录转换为 DataFrame
|
|
@@ -13977,6 +14346,10 @@ def translist_to_np(arg0: TransList) -> numpy.ndarray:
|
|
|
13977
14346
|
"""
|
|
13978
14347
|
将分笔记录转换为NumPy元组
|
|
13979
14348
|
"""
|
|
14349
|
+
def translist_to_pa(arg0: TransList) -> typing.Any:
|
|
14350
|
+
"""
|
|
14351
|
+
将分笔记录转换为 pyarrow.Table 对象
|
|
14352
|
+
"""
|
|
13980
14353
|
def view_license() -> str:
|
|
13981
14354
|
"""
|
|
13982
14355
|
view_license()
|
|
@@ -13987,6 +14360,10 @@ def weights_to_df(arg0: StockWeightList) -> typing.Any:
|
|
|
13987
14360
|
...
|
|
13988
14361
|
def weights_to_np(arg0: StockWeightList) -> numpy.ndarray:
|
|
13989
14362
|
...
|
|
14363
|
+
def weights_to_pa(arg0: StockWeightList) -> typing.Any:
|
|
14364
|
+
"""
|
|
14365
|
+
将权息记录列表转换为 pyarrow.Table 对象
|
|
14366
|
+
"""
|
|
13990
14367
|
DEBUG: LOG_LEVEL # value = <LOG_LEVEL.DEBUG: 1>
|
|
13991
14368
|
ERROR: LOG_LEVEL # value = <LOG_LEVEL.ERROR: 4>
|
|
13992
14369
|
FATAL: LOG_LEVEL # value = <LOG_LEVEL.FATAL: 5>
|