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/core313.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
|
资产分配算法基类, 子类接口:
|
|
@@ -1200,6 +1201,15 @@ class DatetimeList:
|
|
|
1200
1201
|
@staticmethod
|
|
1201
1202
|
def to_np(data: DatetimeList):
|
|
1202
1203
|
...
|
|
1204
|
+
@staticmethod
|
|
1205
|
+
def to_numpy(data: DatetimeList):
|
|
1206
|
+
...
|
|
1207
|
+
@staticmethod
|
|
1208
|
+
def to_pandas(data: DatetimeList):
|
|
1209
|
+
...
|
|
1210
|
+
@staticmethod
|
|
1211
|
+
def to_pyarrow(data):
|
|
1212
|
+
...
|
|
1203
1213
|
def __bool__(self) -> bool:
|
|
1204
1214
|
"""
|
|
1205
1215
|
Check whether the list is nonempty
|
|
@@ -1625,9 +1635,32 @@ class Indicator:
|
|
|
1625
1635
|
markeredgecolor(标记的边缘颜色)
|
|
1626
1636
|
"""
|
|
1627
1637
|
@staticmethod
|
|
1628
|
-
def
|
|
1638
|
+
def to_numpy(*args, **kwargs):
|
|
1629
1639
|
"""
|
|
1630
|
-
|
|
1640
|
+
to_np(self: hikyuu.cpp.core313.Indicator) -> numpy.ndarray
|
|
1641
|
+
|
|
1642
|
+
转化为np.array, 如果为时间序列, 则包含 datetime 日期列
|
|
1643
|
+
"""
|
|
1644
|
+
@staticmethod
|
|
1645
|
+
def to_pandas(*args, **kwargs):
|
|
1646
|
+
"""
|
|
1647
|
+
to_df(self: hikyuu.cpp.core313.Indicator) -> object
|
|
1648
|
+
|
|
1649
|
+
转换为 DataFrame
|
|
1650
|
+
"""
|
|
1651
|
+
@staticmethod
|
|
1652
|
+
def value_to_numpy(*args, **kwargs):
|
|
1653
|
+
"""
|
|
1654
|
+
value_to_np(self: hikyuu.cpp.core313.Indicator) -> numpy.ndarray
|
|
1655
|
+
|
|
1656
|
+
仅转化值为np.array, 不包含日期列
|
|
1657
|
+
"""
|
|
1658
|
+
@staticmethod
|
|
1659
|
+
def value_to_pandas(*args, **kwargs):
|
|
1660
|
+
"""
|
|
1661
|
+
value_to_df(self: hikyuu.cpp.core313.Indicator) -> object
|
|
1662
|
+
|
|
1663
|
+
转换为 DataFrame, 仅包含值
|
|
1631
1664
|
"""
|
|
1632
1665
|
@typing.overload
|
|
1633
1666
|
def __add__(self, arg0: Indicator) -> Indicator:
|
|
@@ -1964,14 +1997,30 @@ class Indicator:
|
|
|
1964
1997
|
"""
|
|
1965
1998
|
是否支持动态指标参数
|
|
1966
1999
|
"""
|
|
2000
|
+
def to_array(self, result_index: typing.SupportsInt = 0) -> numpy.typing.NDArray[numpy.float64]:
|
|
2001
|
+
"""
|
|
2002
|
+
将指定结果集转化为numpy.array
|
|
2003
|
+
"""
|
|
2004
|
+
def to_df(self) -> typing.Any:
|
|
2005
|
+
"""
|
|
2006
|
+
转换为 DataFrame
|
|
2007
|
+
"""
|
|
1967
2008
|
def to_np(self) -> numpy.ndarray:
|
|
1968
2009
|
"""
|
|
1969
2010
|
转化为np.array, 如果为时间序列, 则包含 datetime 日期列
|
|
1970
2011
|
"""
|
|
2012
|
+
def to_pyarrow(self) -> typing.Any:
|
|
2013
|
+
...
|
|
2014
|
+
def value_to_df(self) -> typing.Any:
|
|
2015
|
+
"""
|
|
2016
|
+
转换为 DataFrame, 仅包含值
|
|
2017
|
+
"""
|
|
1971
2018
|
def value_to_np(self) -> numpy.ndarray:
|
|
1972
2019
|
"""
|
|
1973
2020
|
仅转化值为np.array, 不包含日期列
|
|
1974
2021
|
"""
|
|
2022
|
+
def value_to_pyarrow(self) -> typing.Any:
|
|
2023
|
+
...
|
|
1975
2024
|
@property
|
|
1976
2025
|
def discard(self) -> int:
|
|
1977
2026
|
"""
|
|
@@ -2063,6 +2112,12 @@ class IndicatorImp:
|
|
|
2063
2112
|
...
|
|
2064
2113
|
def is_serial(self) -> bool:
|
|
2065
2114
|
...
|
|
2115
|
+
def print_all_sub_trees(self, show_long_name: bool = False) -> None:
|
|
2116
|
+
...
|
|
2117
|
+
def print_leaves(self, show_long_name: bool = False) -> None:
|
|
2118
|
+
...
|
|
2119
|
+
def print_tree(self, show_long_name: bool = False) -> None:
|
|
2120
|
+
...
|
|
2066
2121
|
def set_discard(self, arg0: typing.SupportsInt) -> None:
|
|
2067
2122
|
...
|
|
2068
2123
|
@typing.overload
|
|
@@ -2130,6 +2185,25 @@ class KData:
|
|
|
2130
2185
|
:param colorup: the color of the rectangle where close >= open
|
|
2131
2186
|
:param colordown: the color of the rectangle where close < open
|
|
2132
2187
|
"""
|
|
2188
|
+
@staticmethod
|
|
2189
|
+
def to_numpy(*args, **kwargs):
|
|
2190
|
+
"""
|
|
2191
|
+
to_np(self: hikyuu.cpp.core313.KData) -> numpy.ndarray
|
|
2192
|
+
|
|
2193
|
+
将 KData 转换为 NumPy 数组
|
|
2194
|
+
"""
|
|
2195
|
+
@staticmethod
|
|
2196
|
+
def to_pandas(*args, **kwargs):
|
|
2197
|
+
"""
|
|
2198
|
+
to_df(self: hikyuu.cpp.core313.KData, with_stock: bool = False) -> object
|
|
2199
|
+
|
|
2200
|
+
to_df(self, with_stock=False) -> pandas.DataFrame
|
|
2201
|
+
|
|
2202
|
+
转化为pandas的DataFrame
|
|
2203
|
+
|
|
2204
|
+
:param bool with_stock: 包含Stock的代码与名称
|
|
2205
|
+
:rtype: pandas.DataFrame
|
|
2206
|
+
"""
|
|
2133
2207
|
def __eq__(self, arg0: KData) -> bool:
|
|
2134
2208
|
...
|
|
2135
2209
|
def __getitem__(self, arg0: typing.Any) -> typing.Any:
|
|
@@ -2184,6 +2258,16 @@ class KData:
|
|
|
2184
2258
|
|
|
2185
2259
|
:rtype: DatetimeList
|
|
2186
2260
|
"""
|
|
2261
|
+
@typing.overload
|
|
2262
|
+
def get_kdata(self, ktype: str) -> KData:
|
|
2263
|
+
"""
|
|
2264
|
+
get_kdata(self, ktype
|
|
2265
|
+
|
|
2266
|
+
获取相同时间范围内的其他类型K线数据,如日线下对应的分钟线数据
|
|
2267
|
+
|
|
2268
|
+
:param KQuery::KType ktype: 指定需要的K线类型
|
|
2269
|
+
"""
|
|
2270
|
+
@typing.overload
|
|
2187
2271
|
def get_kdata(self, arg0: Datetime, arg1: Datetime) -> KData:
|
|
2188
2272
|
"""
|
|
2189
2273
|
get_kdata(self, start_date, end_date)
|
|
@@ -2241,6 +2325,8 @@ class KData:
|
|
|
2241
2325
|
"""
|
|
2242
2326
|
将 KData 转换为 NumPy 数组
|
|
2243
2327
|
"""
|
|
2328
|
+
def to_pyarrow(self) -> typing.Any:
|
|
2329
|
+
...
|
|
2244
2330
|
def tocsv(self, arg0: str) -> None:
|
|
2245
2331
|
"""
|
|
2246
2332
|
tocsv(self, filename)
|
|
@@ -2494,6 +2580,15 @@ class KRecordList:
|
|
|
2494
2580
|
@staticmethod
|
|
2495
2581
|
def to_np(data):
|
|
2496
2582
|
...
|
|
2583
|
+
@staticmethod
|
|
2584
|
+
def to_numpy(data):
|
|
2585
|
+
...
|
|
2586
|
+
@staticmethod
|
|
2587
|
+
def to_pandas(data):
|
|
2588
|
+
...
|
|
2589
|
+
@staticmethod
|
|
2590
|
+
def to_pyarrow(data):
|
|
2591
|
+
...
|
|
2497
2592
|
def __bool__(self) -> bool:
|
|
2498
2593
|
"""
|
|
2499
2594
|
Check whether the list is nonempty
|
|
@@ -3680,6 +3775,12 @@ class PositionRecordList:
|
|
|
3680
3775
|
...
|
|
3681
3776
|
def to_np(self):
|
|
3682
3777
|
...
|
|
3778
|
+
def to_numpy(self):
|
|
3779
|
+
...
|
|
3780
|
+
def to_pandas(self):
|
|
3781
|
+
...
|
|
3782
|
+
def to_pyarrow(self):
|
|
3783
|
+
...
|
|
3683
3784
|
class ProfitGoalBase:
|
|
3684
3785
|
"""
|
|
3685
3786
|
盈利目标策略基类
|
|
@@ -3932,6 +4033,8 @@ class Query:
|
|
|
3932
4033
|
MONTH: typing.ClassVar[str] = 'MONTH'
|
|
3933
4034
|
NO_RECOVER: typing.ClassVar[Query.RecoverType] # value = <RecoverType.NO_RECOVER: 0>
|
|
3934
4035
|
QUARTER: typing.ClassVar[str] = 'QUARTER'
|
|
4036
|
+
TIMELINE: typing.ClassVar[str] = 'TIMELINE'
|
|
4037
|
+
TRANS: typing.ClassVar[str] = 'TRANS'
|
|
3935
4038
|
WEEK: typing.ClassVar[str] = 'WEEK'
|
|
3936
4039
|
YEAR: typing.ClassVar[str] = 'YEAR'
|
|
3937
4040
|
@staticmethod
|
|
@@ -3947,6 +4050,31 @@ class Query:
|
|
|
3947
4050
|
"""
|
|
3948
4051
|
获取所有扩展KType
|
|
3949
4052
|
"""
|
|
4053
|
+
@staticmethod
|
|
4054
|
+
def get_ktype_in_min(arg0: str) -> int:
|
|
4055
|
+
"""
|
|
4056
|
+
获取ktype对应的分钟数
|
|
4057
|
+
"""
|
|
4058
|
+
@staticmethod
|
|
4059
|
+
def get_ktype_in_seconds(arg0: str) -> int:
|
|
4060
|
+
"""
|
|
4061
|
+
获取ktype对应的秒数
|
|
4062
|
+
"""
|
|
4063
|
+
@staticmethod
|
|
4064
|
+
def is_base_ktype(arg0: str) -> bool:
|
|
4065
|
+
"""
|
|
4066
|
+
判断是否为基础KType
|
|
4067
|
+
"""
|
|
4068
|
+
@staticmethod
|
|
4069
|
+
def is_extra_ktype(arg0: str) -> bool:
|
|
4070
|
+
"""
|
|
4071
|
+
判断是否为扩展KType
|
|
4072
|
+
"""
|
|
4073
|
+
@staticmethod
|
|
4074
|
+
def is_valid_ktype(arg0: str) -> bool:
|
|
4075
|
+
"""
|
|
4076
|
+
判断KType是否有效
|
|
4077
|
+
"""
|
|
3950
4078
|
def __getstate__(self) -> tuple:
|
|
3951
4079
|
...
|
|
3952
4080
|
def __init__(self, start = 0, end = None, ktype = 'DAY', recover_type = ...):
|
|
@@ -3967,21 +4095,9 @@ class Query:
|
|
|
3967
4095
|
...
|
|
3968
4096
|
def __str__(self) -> str:
|
|
3969
4097
|
...
|
|
3970
|
-
def
|
|
3971
|
-
"""
|
|
3972
|
-
获取ktype对应的分钟数
|
|
3973
|
-
"""
|
|
3974
|
-
def is_base_ktype(self: str) -> bool:
|
|
4098
|
+
def is_right_opening(self) -> bool:
|
|
3975
4099
|
"""
|
|
3976
|
-
|
|
3977
|
-
"""
|
|
3978
|
-
def is_extra_ktype(self: str) -> bool:
|
|
3979
|
-
"""
|
|
3980
|
-
判断是否为扩展KType
|
|
3981
|
-
"""
|
|
3982
|
-
def is_valid_ktype(self: str) -> bool:
|
|
3983
|
-
"""
|
|
3984
|
-
判断KType是否有效
|
|
4100
|
+
判断是否为右开区间,即未指定结束时间
|
|
3985
4101
|
"""
|
|
3986
4102
|
@property
|
|
3987
4103
|
def end(self) -> int:
|
|
@@ -4139,6 +4255,10 @@ class ScoreRecordList:
|
|
|
4139
4255
|
...
|
|
4140
4256
|
def to_np(self):
|
|
4141
4257
|
...
|
|
4258
|
+
def to_numpy(self):
|
|
4259
|
+
...
|
|
4260
|
+
def to_pandas(self):
|
|
4261
|
+
...
|
|
4142
4262
|
class SelectorBase:
|
|
4143
4263
|
"""
|
|
4144
4264
|
选择器策略基类,实现标的、系统策略的评估和选取算法,自定义选择器策略子类接口:
|
|
@@ -4785,6 +4905,15 @@ class Stock:
|
|
|
4785
4905
|
获取所有历史财务信息历史记录, 字段信息可参考 StockManager 中的相关方法: get_history_finance_all_fields/get_history_finance_field_index/get_history_finance_field_name 方法
|
|
4786
4906
|
日常建议直接使用指标 FINANCE 获取财务数据
|
|
4787
4907
|
"""
|
|
4908
|
+
def get_index_range(self, arg0: Query) -> tuple:
|
|
4909
|
+
"""
|
|
4910
|
+
get_index_range(self, query) -> (size_t, size_t)
|
|
4911
|
+
|
|
4912
|
+
根据KQuery指定的条件, 获取对应的K线位置范围: [start_pos, end_pos)
|
|
4913
|
+
|
|
4914
|
+
:param query [in] 指定的查询条件
|
|
4915
|
+
:return (start_pos, end_pos
|
|
4916
|
+
"""
|
|
4788
4917
|
def get_kdata(self, arg0: Query) -> KData:
|
|
4789
4918
|
"""
|
|
4790
4919
|
get_kdata(self, query)
|
|
@@ -5288,9 +5417,20 @@ class StockManager:
|
|
|
5288
5417
|
"""
|
|
5289
5418
|
is_holiday(self, d)
|
|
5290
5419
|
|
|
5291
|
-
|
|
5420
|
+
判断指定时间对应的日期是否为节假日(仅使用A股市场)
|
|
5421
|
+
|
|
5422
|
+
:param Datetime d: 待判断的时间
|
|
5423
|
+
"""
|
|
5424
|
+
def is_trading_hours(self, d: Datetime, market: str = 'SH') -> bool:
|
|
5425
|
+
"""
|
|
5426
|
+
is_trading_hours(self, d)
|
|
5292
5427
|
|
|
5293
|
-
|
|
5428
|
+
判断指定时间对应的日期是否为交易时间
|
|
5429
|
+
|
|
5430
|
+
:param Datetime d: 待判断的时间
|
|
5431
|
+
:param str market: 市场简称
|
|
5432
|
+
:return: 是否为交易时间
|
|
5433
|
+
:rtype: bool
|
|
5294
5434
|
"""
|
|
5295
5435
|
def reload(self) -> None:
|
|
5296
5436
|
"""
|
|
@@ -5496,6 +5636,15 @@ class StockWeightList:
|
|
|
5496
5636
|
@staticmethod
|
|
5497
5637
|
def to_np(data):
|
|
5498
5638
|
...
|
|
5639
|
+
@staticmethod
|
|
5640
|
+
def to_numpy(data):
|
|
5641
|
+
...
|
|
5642
|
+
@staticmethod
|
|
5643
|
+
def to_pandas(data):
|
|
5644
|
+
...
|
|
5645
|
+
@staticmethod
|
|
5646
|
+
def to_pyarrow(data):
|
|
5647
|
+
...
|
|
5499
5648
|
def __bool__(self) -> bool:
|
|
5500
5649
|
"""
|
|
5501
5650
|
Check whether the list is nonempty
|
|
@@ -6456,6 +6605,10 @@ class SystemWeightList:
|
|
|
6456
6605
|
...
|
|
6457
6606
|
def to_np(self):
|
|
6458
6607
|
...
|
|
6608
|
+
def to_numpy(self):
|
|
6609
|
+
...
|
|
6610
|
+
def to_pandas(self):
|
|
6611
|
+
...
|
|
6459
6612
|
class TimeDelta:
|
|
6460
6613
|
"""
|
|
6461
6614
|
时间时长,用于时间计算。可通过以下方式构建:
|
|
@@ -6693,6 +6846,15 @@ class TimeLineList:
|
|
|
6693
6846
|
@staticmethod
|
|
6694
6847
|
def to_np(data):
|
|
6695
6848
|
...
|
|
6849
|
+
@staticmethod
|
|
6850
|
+
def to_numpy(data):
|
|
6851
|
+
...
|
|
6852
|
+
@staticmethod
|
|
6853
|
+
def to_pandas(data):
|
|
6854
|
+
...
|
|
6855
|
+
@staticmethod
|
|
6856
|
+
def to_pyarrow(data):
|
|
6857
|
+
...
|
|
6696
6858
|
def __bool__(self) -> bool:
|
|
6697
6859
|
"""
|
|
6698
6860
|
Check whether the list is nonempty
|
|
@@ -7649,6 +7811,12 @@ class TradeRecordList:
|
|
|
7649
7811
|
...
|
|
7650
7812
|
def to_np(self):
|
|
7651
7813
|
...
|
|
7814
|
+
def to_numpy(self):
|
|
7815
|
+
...
|
|
7816
|
+
def to_pandas(self):
|
|
7817
|
+
...
|
|
7818
|
+
def to_pyarrow(self):
|
|
7819
|
+
...
|
|
7652
7820
|
class TradeRequest:
|
|
7653
7821
|
"""
|
|
7654
7822
|
交易请求记录。系统内部在实现延迟操作时登记的交易请求信息。暴露该结构的主要目的是用于
|
|
@@ -7729,6 +7897,15 @@ class TransList:
|
|
|
7729
7897
|
@staticmethod
|
|
7730
7898
|
def to_np(data):
|
|
7731
7899
|
...
|
|
7900
|
+
@staticmethod
|
|
7901
|
+
def to_numpy(data):
|
|
7902
|
+
...
|
|
7903
|
+
@staticmethod
|
|
7904
|
+
def to_pandas(data):
|
|
7905
|
+
...
|
|
7906
|
+
@staticmethod
|
|
7907
|
+
def to_pyarrow(data):
|
|
7908
|
+
...
|
|
7732
7909
|
def __bool__(self) -> bool:
|
|
7733
7910
|
"""
|
|
7734
7911
|
Check whether the list is nonempty
|
|
@@ -7965,6 +8142,88 @@ def AF_MultiFactor() -> AllocateFundsBase:
|
|
|
7965
8142
|
|
|
7966
8143
|
创建 MultiFactor 评分权重的资产分配算法实例, 即直接以SE返回的评分作为权重。
|
|
7967
8144
|
"""
|
|
8145
|
+
def AGG_COUNT(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8146
|
+
"""
|
|
8147
|
+
聚合函数: 非空值计数, 可参考 AGG_STD 帮助
|
|
8148
|
+
"""
|
|
8149
|
+
def AGG_MAD(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8150
|
+
"""
|
|
8151
|
+
聚合函数: 平均绝对偏差, 可参考 AGG_STD 帮助
|
|
8152
|
+
"""
|
|
8153
|
+
def AGG_MAX(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8154
|
+
"""
|
|
8155
|
+
聚合函数: 最大值, 可参考 AGG_STD 帮助
|
|
8156
|
+
"""
|
|
8157
|
+
def AGG_MEAN(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8158
|
+
"""
|
|
8159
|
+
聚合函数: 平均值, 可参考 AGG_STD 帮助
|
|
8160
|
+
"""
|
|
8161
|
+
def AGG_MEDIAN(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8162
|
+
"""
|
|
8163
|
+
聚合函数: 中位数, 可参考 AGG_STD 帮助
|
|
8164
|
+
"""
|
|
8165
|
+
def AGG_MIN(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8166
|
+
"""
|
|
8167
|
+
聚合函数: 最小值, 可参考 AGG_STD 帮助
|
|
8168
|
+
"""
|
|
8169
|
+
def AGG_PROD(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8170
|
+
"""
|
|
8171
|
+
聚合函数: 乘积, 可参考 AGG_STD 帮助
|
|
8172
|
+
"""
|
|
8173
|
+
def AGG_QUANTILE(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1, quantile: typing.SupportsFloat = 0.75) -> Indicator:
|
|
8174
|
+
"""
|
|
8175
|
+
AGG_QUANTILE(ind[, ktype=Query.MIN, fill_null=False, unit=1, quantile=0.75])
|
|
8176
|
+
|
|
8177
|
+
聚合其他K线周期分位数, 可参考 AGG_STD 帮助
|
|
8178
|
+
|
|
8179
|
+
:param Indicator ind: 待计算指标
|
|
8180
|
+
:param KQuery.KType ktype: 聚合的K线周期
|
|
8181
|
+
:param bool fill_null: 是否填充缺失值
|
|
8182
|
+
:param int unit: 聚合周期单位 (上下文K线分组单位, 使用日线计算分钟线聚合时, unit=2代表聚合2天的分钟线)
|
|
8183
|
+
:param float quantile: 分位数 (0, 1) 之间
|
|
8184
|
+
:return: 指标数据
|
|
8185
|
+
:rtype: Indicator
|
|
8186
|
+
"""
|
|
8187
|
+
def AGG_STD(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1, ddof: typing.SupportsInt = 1) -> Indicator:
|
|
8188
|
+
"""
|
|
8189
|
+
AGG_STD(ind[, ktype=Query.MIN, fill_null=False, unit=1, ddof=1])
|
|
8190
|
+
|
|
8191
|
+
聚合其他K线周期的标准差, 如计算日线时聚合分钟线收盘价的标准差
|
|
8192
|
+
|
|
8193
|
+
>>> kdata = get_kdata('sh600000', Query(Datetime(20250101), ktype=Query.DAY))
|
|
8194
|
+
>>> ind = AGG_STD(CLOSE(), ktype=Query.MIN, fill_null=False, unit=1, ddof=1)
|
|
8195
|
+
>>> ind(k)
|
|
8196
|
+
|
|
8197
|
+
:param Indicator ind: 指标数据
|
|
8198
|
+
:param KQuery.KType ktype: 聚合的K线周期
|
|
8199
|
+
:param bool fill_null: 是否填充缺失值
|
|
8200
|
+
:param int unit: 聚合周期单位 (滚动聚合分组单位, 如使用日线计算分钟线聚合时, unit=2代表聚合2天的分钟线)
|
|
8201
|
+
:param int ddof: 自由度(1: 样本标准差, 0: 总体标准差)
|
|
8202
|
+
:return: 指标数据
|
|
8203
|
+
:rtype: Indicator
|
|
8204
|
+
"""
|
|
8205
|
+
def AGG_SUM(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1) -> Indicator:
|
|
8206
|
+
"""
|
|
8207
|
+
聚合函数: 总和, 可参考 AGG_STD 帮助
|
|
8208
|
+
"""
|
|
8209
|
+
def AGG_VAR(ind: Indicator, ktype: str = 'MIN', fill_null: bool = False, unit: typing.SupportsInt = 1, ddof: typing.SupportsInt = 1) -> Indicator:
|
|
8210
|
+
"""
|
|
8211
|
+
AGG_VAR(ind[, ktype=Query.MIN, fill_null=False, unit=1, ddof=1])
|
|
8212
|
+
|
|
8213
|
+
聚合其他K线周期的方差, 如计算日线时聚合分钟线收盘价的方差
|
|
8214
|
+
|
|
8215
|
+
>>> kdata = get_kdata('sh600000', Query(Datetime(20250101), ktype=Query.DAY))
|
|
8216
|
+
>>> ind = AGG_VAR(CLOSE(), ktype=Query.MIN, fill_null=False, unit=1, ddof=1)
|
|
8217
|
+
>>> ind(k)
|
|
8218
|
+
|
|
8219
|
+
:param Indicator ind: 待计算指标
|
|
8220
|
+
:param KQuery.KType ktype: 聚合的K线周期
|
|
8221
|
+
:param bool fill_null: 是否填充缺失值
|
|
8222
|
+
:param int unit: 聚合周期单位 (上下文K线分组单位, 使用日线计算分钟线聚合时, unit=2代表聚合2天的分钟线)
|
|
8223
|
+
:param int ddof: 自由度(1: 样本标准差, 0: 总体标准差)
|
|
8224
|
+
:return: 指标数据
|
|
8225
|
+
:rtype: Indicator
|
|
8226
|
+
"""
|
|
7968
8227
|
@typing.overload
|
|
7969
8228
|
def ALIGN(ref: DatetimeList, fill_null: bool = True) -> Indicator:
|
|
7970
8229
|
...
|
|
@@ -8947,11 +9206,16 @@ def Hours(arg0: typing.SupportsInt) -> TimeDelta:
|
|
|
8947
9206
|
:param int hours: 小时数
|
|
8948
9207
|
:rtype: TimeDelta
|
|
8949
9208
|
"""
|
|
8950
|
-
def IC(ind: Indicator, stks: typing.Any, query: Query, ref_stk: Stock, n: typing.SupportsInt = 1, spearman: bool = True) -> Indicator:
|
|
9209
|
+
def IC(ind: Indicator, stks: typing.Any, query: Query, ref_stk: Stock, n: typing.SupportsInt = 1, spearman: bool = True, strict: bool = False) -> Indicator:
|
|
8951
9210
|
"""
|
|
8952
|
-
IC(ind, stks, query, ref_stk[, n=1])
|
|
9211
|
+
IC(ind, stks, query, ref_stk[, n=1, spearman=True, strict=False]) -> Indicator
|
|
9212
|
+
|
|
9213
|
+
计算指定的因子相对于参考证券的 IC (实际为 RankIC)
|
|
8953
9214
|
|
|
8954
|
-
|
|
9215
|
+
IC 原本需要 “t 时刻因子值→t+1 时刻收益”,此处改为计算 “t 时刻因子值→t 时刻之前 N 天的收益”(比如过去 5 天的收益)。
|
|
9216
|
+
(否则当前值都会是缺失NA), 相当于原始预测 IC 右移 n 位。
|
|
9217
|
+
|
|
9218
|
+
如需严格“t 时刻因子值→t+1 时刻收益“计算,请设置 strict=True (注意此模式下, 后n位为 NA)
|
|
8955
9219
|
|
|
8956
9220
|
:param Indicator ind: 输入因子
|
|
8957
9221
|
:param sequence(stock)|Block stks 证券组合
|
|
@@ -8959,10 +9223,11 @@ def IC(ind: Indicator, stks: typing.Any, query: Query, ref_stk: Stock, n: typing
|
|
|
8959
9223
|
:param Stock ref_stk: 参照证券,通常使用 sh000300 沪深300
|
|
8960
9224
|
:param int n: 时间窗口
|
|
8961
9225
|
:param bool spearman: 使用 spearman 相关系数,否则为 pearson
|
|
9226
|
+
:param bool strict: 严格模式
|
|
8962
9227
|
"""
|
|
8963
|
-
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:
|
|
9228
|
+
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:
|
|
8964
9229
|
"""
|
|
8965
|
-
ICIR(ind, stks, query, ref_stk[, n=1, rolling_n=120])
|
|
9230
|
+
ICIR(ind, stks, query, ref_stk[, n=1, rolling_n=120, spearman=True, strict=False])
|
|
8966
9231
|
|
|
8967
9232
|
计算 IC 因子 IR = IC的多周期均值/IC的标准方差
|
|
8968
9233
|
|
|
@@ -8973,6 +9238,7 @@ def ICIR(ind: Indicator, stks: typing.Any, query: Query, ref_stk: Stock, n: typi
|
|
|
8973
9238
|
:param int n: 计算IC时对应的 n 日收益率
|
|
8974
9239
|
:param int rolling_n: 滚动周期
|
|
8975
9240
|
:param bool spearman: 使用 spearman 相关系数,否则为 pearson
|
|
9241
|
+
:param bool strict: 是否严格IC模式
|
|
8976
9242
|
"""
|
|
8977
9243
|
@typing.overload
|
|
8978
9244
|
def IF(arg0: Indicator, arg1: Indicator, arg2: Indicator) -> Indicator:
|
|
@@ -9095,12 +9361,18 @@ def INDEXV(kdata: KData, fill_null: bool = True) -> Indicator:
|
|
|
9095
9361
|
返回对应的大盘成交量,分别是上证指数,深证成指,科创50,创业板指
|
|
9096
9362
|
"""
|
|
9097
9363
|
@typing.overload
|
|
9364
|
+
def INSUM(block: Block, mode: typing.SupportsInt, fill_null: bool = True) -> Indicator:
|
|
9365
|
+
...
|
|
9366
|
+
@typing.overload
|
|
9098
9367
|
def INSUM(block: Block, ind: Indicator, mode: typing.SupportsInt, fill_null: bool = True) -> Indicator:
|
|
9099
9368
|
...
|
|
9100
9369
|
@typing.overload
|
|
9101
9370
|
def INSUM(block: Block, query: Query, ind: Indicator, mode: typing.SupportsInt, fill_null: bool = True) -> Indicator:
|
|
9102
9371
|
...
|
|
9103
9372
|
@typing.overload
|
|
9373
|
+
def INSUM(stks: collections.abc.Sequence, mode: typing.SupportsInt, fill_null: bool = True) -> Indicator:
|
|
9374
|
+
...
|
|
9375
|
+
@typing.overload
|
|
9104
9376
|
def INSUM(stks: collections.abc.Sequence, ind: Indicator, mode: typing.SupportsInt, fill_null: bool = True) -> Indicator:
|
|
9105
9377
|
...
|
|
9106
9378
|
@typing.overload
|
|
@@ -9939,6 +10211,13 @@ def POW(data: typing.SupportsFloat, n: typing.SupportsInt) -> Indicator:
|
|
|
9939
10211
|
:param int|Indicator|IndParam n: 幂
|
|
9940
10212
|
:rtype: Indicator
|
|
9941
10213
|
"""
|
|
10214
|
+
@typing.overload
|
|
10215
|
+
def PRICELIST(dates: DatetimeList, value: typing.SupportsFloat, discard: typing.SupportsInt = 0) -> Indicator:
|
|
10216
|
+
...
|
|
10217
|
+
@typing.overload
|
|
10218
|
+
def PRICELIST(size: typing.SupportsInt, value: typing.SupportsFloat, discard: typing.SupportsInt = 0) -> Indicator:
|
|
10219
|
+
...
|
|
10220
|
+
@typing.overload
|
|
9942
10221
|
def PRICELIST(data: typing.Any = None, discard: typing.SupportsInt = 0, align_dates: typing.Any = None) -> Indicator:
|
|
9943
10222
|
"""
|
|
9944
10223
|
PRICELIST([data=None, discard=0, align_dates=None])
|
|
@@ -9951,7 +10230,7 @@ def PRICELIST(data: typing.Any = None, discard: typing.SupportsInt = 0, align_da
|
|
|
9951
10230
|
:rtype: Indicator
|
|
9952
10231
|
"""
|
|
9953
10232
|
@typing.overload
|
|
9954
|
-
def RANK(
|
|
10233
|
+
def RANK(stks: collections.abc.Sequence, mode: typing.SupportsInt = 0, fill_null: bool = True, market: str = 'SH') -> Indicator:
|
|
9955
10234
|
...
|
|
9956
10235
|
@typing.overload
|
|
9957
10236
|
def RANK(stks: collections.abc.Sequence, ref_ind: Indicator, mode: typing.SupportsInt = 0, fill_null: bool = True, market: str = 'SH') -> Indicator:
|
|
@@ -10058,6 +10337,19 @@ def REF(data: Indicator, n: typing.SupportsInt) -> Indicator:
|
|
|
10058
10337
|
:rtype: Indicator
|
|
10059
10338
|
"""
|
|
10060
10339
|
@typing.overload
|
|
10340
|
+
def REFX(n: typing.SupportsInt) -> Indicator:
|
|
10341
|
+
...
|
|
10342
|
+
@typing.overload
|
|
10343
|
+
def REFX(ind: Indicator, n: typing.SupportsInt) -> Indicator:
|
|
10344
|
+
"""
|
|
10345
|
+
REFX(ind, n)
|
|
10346
|
+
|
|
10347
|
+
REF增强(非安全引用, 勿用于回测)。用于获取指标中第n个周期的值, n为正数时从当前周期向前数, 为负数时从当前周期向后数。
|
|
10348
|
+
|
|
10349
|
+
:param Indicator ind: 指标
|
|
10350
|
+
:param int n: 周期数
|
|
10351
|
+
"""
|
|
10352
|
+
@typing.overload
|
|
10061
10353
|
def REPLACE(old_value: typing.SupportsFloat = ..., new_value: typing.SupportsFloat = 0.0, ignore_discard: bool = False) -> Indicator:
|
|
10062
10354
|
...
|
|
10063
10355
|
@typing.overload
|
|
@@ -10641,19 +10933,19 @@ def SIN(arg0: typing.SupportsFloat) -> Indicator:
|
|
|
10641
10933
|
def SLICE(data: collections.abc.Sequence[typing.SupportsFloat], start: typing.SupportsInt, end: typing.SupportsInt) -> Indicator:
|
|
10642
10934
|
...
|
|
10643
10935
|
@typing.overload
|
|
10644
|
-
def SLICE(start: typing.SupportsInt, end: typing.SupportsInt, result_index: typing.SupportsInt =
|
|
10936
|
+
def SLICE(start: typing.SupportsInt, end: typing.SupportsInt, result_index: typing.SupportsInt = -1) -> Indicator:
|
|
10645
10937
|
...
|
|
10646
10938
|
@typing.overload
|
|
10647
10939
|
def SLICE(data: Indicator, start: typing.SupportsInt, end: typing.SupportsInt, result_index: typing.SupportsInt = 0) -> Indicator:
|
|
10648
10940
|
"""
|
|
10649
|
-
SLICE(data, start, end, result_index
|
|
10941
|
+
SLICE(data, start, end, result_index=-1)
|
|
10650
10942
|
|
|
10651
10943
|
获取某指标中指定范围 [start, end) 的数据,生成新的指标
|
|
10652
10944
|
|
|
10653
10945
|
:param Indicator|PriceList data: 输入数据
|
|
10654
10946
|
:param int start: 起始位置
|
|
10655
10947
|
:param int end: 终止位置(不包含本身)
|
|
10656
|
-
:param int result_index:
|
|
10948
|
+
:param int result_index: 原输入数据中的结果集, 小于0时表示全部结果集
|
|
10657
10949
|
"""
|
|
10658
10950
|
@typing.overload
|
|
10659
10951
|
def SLOPE(n: typing.SupportsInt = 22) -> Indicator:
|
|
@@ -13558,6 +13850,10 @@ def dates_to_np(arg0: DatetimeList) -> numpy.ndarray:
|
|
|
13558
13850
|
"""
|
|
13559
13851
|
将 DatetimeList 转换为 NumPy 元组
|
|
13560
13852
|
"""
|
|
13853
|
+
def dates_to_pa(arg0: DatetimeList) -> typing.Any:
|
|
13854
|
+
"""
|
|
13855
|
+
将日期列表转换为 pyarrow.Table 对象
|
|
13856
|
+
"""
|
|
13561
13857
|
def df_to_krecords(df: typing.Any, columns: collections.abc.Sequence[str] = ['datetime', 'open', 'high', 'low', 'close', 'amount', 'volume']) -> KRecordList:
|
|
13562
13858
|
"""
|
|
13563
13859
|
df_to_krecords(df: pd.DataFrame[, columns: dict]) -> KRecordList
|
|
@@ -13620,6 +13916,37 @@ def get_date_range(start: Datetime, end: Datetime) -> DatetimeList:
|
|
|
13620
13916
|
:rtype: DatetimeList
|
|
13621
13917
|
"""
|
|
13622
13918
|
@typing.overload
|
|
13919
|
+
def get_inds_view(stks: collections.abc.Sequence, inds: collections.abc.Sequence[Indicator], query: Query, market: str = 'SH') -> typing.Any:
|
|
13920
|
+
...
|
|
13921
|
+
@typing.overload
|
|
13922
|
+
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:
|
|
13923
|
+
"""
|
|
13924
|
+
get_inds_view(stks, inds, date[, cal_len=100, ktype=Query.DAY, market='SH']) -> pandas.DataFrame)
|
|
13925
|
+
|
|
13926
|
+
方式1: 获取指定日期的各证券的各指标结果
|
|
13927
|
+
|
|
13928
|
+
:param stks: 证券列表
|
|
13929
|
+
:param list[Indicator] inds: 指标列表
|
|
13930
|
+
:param Datetime date: 指定日期
|
|
13931
|
+
:param int cal_len: 计算需要的数据长度
|
|
13932
|
+
:param str ktype: k线类型
|
|
13933
|
+
:param str market: 指定行情市场(用于日期对齐)
|
|
13934
|
+
|
|
13935
|
+
方式2: 获取按指定Query查询计算的各证券的各指标结果, 结果中将包含指定 Query 包含的所有指定市场交易日日期
|
|
13936
|
+
get_inds_view(stks, inds, query, market='SH'])
|
|
13937
|
+
|
|
13938
|
+
:param stks: 指定证券列表
|
|
13939
|
+
:param list[Indicator] inds: 指定指标列表
|
|
13940
|
+
:param Query query: 查询条件
|
|
13941
|
+
:param str market: 指定行情市场(用于日期对齐)
|
|
13942
|
+
"""
|
|
13943
|
+
@typing.overload
|
|
13944
|
+
def get_inds_view_pyarrow(stks: collections.abc.Sequence, inds: collections.abc.Sequence[Indicator], query: Query, market: str = 'SH') -> typing.Any:
|
|
13945
|
+
...
|
|
13946
|
+
@typing.overload
|
|
13947
|
+
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:
|
|
13948
|
+
...
|
|
13949
|
+
@typing.overload
|
|
13623
13950
|
def get_kdata(arg0: str, arg1: Query) -> KData:
|
|
13624
13951
|
...
|
|
13625
13952
|
@typing.overload
|
|
@@ -13665,6 +13992,8 @@ def get_market_view(stks: collections.abc.Sequence, date: Datetime = ..., market
|
|
|
13665
13992
|
:return: 指定股票列表最后行情数据
|
|
13666
13993
|
:rtype: pandas.DataFrame
|
|
13667
13994
|
"""
|
|
13995
|
+
def get_market_view_pyarrow(stks: collections.abc.Sequence, date: Datetime = ..., market: str = 'SH') -> typing.Any:
|
|
13996
|
+
...
|
|
13668
13997
|
def get_spot_from_buffer_server(arg0: str, arg1: str, arg2: str, arg3: Datetime) -> list[SpotRecord]:
|
|
13669
13998
|
"""
|
|
13670
13999
|
get_spot_from_buffer_server(addr: str, market: str, code: str, datetime: str)
|
|
@@ -13751,6 +14080,10 @@ def krecords_to_df(arg0: KRecordList) -> typing.Any:
|
|
|
13751
14080
|
...
|
|
13752
14081
|
def krecords_to_np(arg0: KRecordList) -> numpy.ndarray:
|
|
13753
14082
|
...
|
|
14083
|
+
def krecords_to_pa(arg0: KRecordList) -> typing.Any:
|
|
14084
|
+
"""
|
|
14085
|
+
将KRecordList转换为parraw.Table
|
|
14086
|
+
"""
|
|
13754
14087
|
def open_ostream_to_python() -> None:
|
|
13755
14088
|
...
|
|
13756
14089
|
def open_spend_time() -> None:
|
|
@@ -13763,12 +14096,22 @@ def positions_to_df(arg0: PositionRecordList) -> typing.Any:
|
|
|
13763
14096
|
|
|
13764
14097
|
将持仓记录列表转换为 pandas DataFrame
|
|
13765
14098
|
|
|
14099
|
+
注意: 其中的当前市值、利润、盈亏等计算值均以日线计算, 如使用日线一下级别回测时, 对未清仓的持仓记录需要自行重新计算!
|
|
14100
|
+
|
|
13766
14101
|
:param PositionRecordList positions: 持仓记录列表
|
|
13767
14102
|
:return: 包含持仓记录的 pandas DataFrame
|
|
13768
14103
|
:rtype: pandas.DataFrame
|
|
13769
14104
|
"""
|
|
13770
14105
|
def positions_to_np(arg0: PositionRecordList) -> numpy.ndarray:
|
|
13771
|
-
|
|
14106
|
+
"""
|
|
14107
|
+
将持仓列表转换为Numpy
|
|
14108
|
+
|
|
14109
|
+
注意: 其中的当前市值、利润、盈亏等计算值均以日线计算, 如使用日线一下级别回测时, 对未清仓的持仓记录需要自行重新计算!
|
|
14110
|
+
"""
|
|
14111
|
+
def positions_to_pa(arg0: PositionRecordList) -> typing.Any:
|
|
14112
|
+
"""
|
|
14113
|
+
将交易记录列表转换为 pyarrow.Table 对象
|
|
14114
|
+
"""
|
|
13772
14115
|
@typing.overload
|
|
13773
14116
|
def register_extra_ktype(ktype: str, basetype: str, minutes: typing.SupportsInt, get_phase_end: collections.abc.Callable[[Datetime], Datetime]) -> None:
|
|
13774
14117
|
...
|
|
@@ -13898,6 +14241,14 @@ def set_python_in_interactive(arg0: bool) -> None:
|
|
|
13898
14241
|
...
|
|
13899
14242
|
def set_python_in_jupyter(arg0: bool) -> None:
|
|
13900
14243
|
...
|
|
14244
|
+
def spot_agent_is_connected() -> bool:
|
|
14245
|
+
"""
|
|
14246
|
+
判断行情数据接收代理是否已连接
|
|
14247
|
+
"""
|
|
14248
|
+
def spot_agent_is_running() -> bool:
|
|
14249
|
+
"""
|
|
14250
|
+
判断行情数据接收代理是否在运行
|
|
14251
|
+
"""
|
|
13901
14252
|
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:
|
|
13902
14253
|
"""
|
|
13903
14254
|
start_data_server(addr: str[, work_num: int=2])
|
|
@@ -13911,7 +14262,15 @@ def start_data_server(addr: str = 'tcp://0.0.0.0:9201', work_num: typing.Support
|
|
|
13911
14262
|
:return: None
|
|
13912
14263
|
"""
|
|
13913
14264
|
def start_spot_agent(print: bool = False, worker_num: typing.SupportsInt = 1, addr: str = '') -> None:
|
|
13914
|
-
|
|
14265
|
+
"""
|
|
14266
|
+
start_spot_agent([print=False, worker_num=1, addr=""])
|
|
14267
|
+
|
|
14268
|
+
启动行情数据接收代理
|
|
14269
|
+
|
|
14270
|
+
:param print: 是否打印日志
|
|
14271
|
+
:param worker_num: 工作线程数
|
|
14272
|
+
:param addr: 行情采集服务地址
|
|
14273
|
+
"""
|
|
13915
14274
|
def stop_data_server() -> None:
|
|
13916
14275
|
"""
|
|
13917
14276
|
stop_data_server()
|
|
@@ -13919,7 +14278,9 @@ def stop_data_server() -> None:
|
|
|
13919
14278
|
停止数据缓存服务
|
|
13920
14279
|
"""
|
|
13921
14280
|
def stop_spot_agent() -> None:
|
|
13922
|
-
|
|
14281
|
+
"""
|
|
14282
|
+
终止行情数据接收代理
|
|
14283
|
+
"""
|
|
13923
14284
|
def systemweights_to_df(arg0: SystemWeightList) -> typing.Any:
|
|
13924
14285
|
...
|
|
13925
14286
|
def systemweights_to_np(arg0: SystemWeightList) -> numpy.ndarray:
|
|
@@ -13932,6 +14293,10 @@ def timeline_to_np(arg0: TimeLineList) -> numpy.ndarray:
|
|
|
13932
14293
|
"""
|
|
13933
14294
|
将分时线记录转换为NumPy元组
|
|
13934
14295
|
"""
|
|
14296
|
+
def timeline_to_pa(arg0: TimeLineList) -> typing.Any:
|
|
14297
|
+
"""
|
|
14298
|
+
将分时线记录转换为 pyarrow.Table 对象
|
|
14299
|
+
"""
|
|
13935
14300
|
def toPriceList(arg0: collections.abc.Sequence) -> list[float]:
|
|
13936
14301
|
"""
|
|
13937
14302
|
将 python list/tuple/np.arry 对象转化为 PriceList 对象
|
|
@@ -13948,6 +14313,10 @@ def trades_to_df(arg0: TradeRecordList) -> typing.Any:
|
|
|
13948
14313
|
"""
|
|
13949
14314
|
def trades_to_np(arg0: TradeRecordList) -> numpy.ndarray:
|
|
13950
14315
|
...
|
|
14316
|
+
def trades_to_pa(arg0: TradeRecordList) -> typing.Any:
|
|
14317
|
+
"""
|
|
14318
|
+
将交易记录列表转换为 pyarrow.Table 对象
|
|
14319
|
+
"""
|
|
13951
14320
|
def translist_to_df(arg0: TransList) -> typing.Any:
|
|
13952
14321
|
"""
|
|
13953
14322
|
将分笔记录转换为 DataFrame
|
|
@@ -13956,6 +14325,10 @@ def translist_to_np(arg0: TransList) -> numpy.ndarray:
|
|
|
13956
14325
|
"""
|
|
13957
14326
|
将分笔记录转换为NumPy元组
|
|
13958
14327
|
"""
|
|
14328
|
+
def translist_to_pa(arg0: TransList) -> typing.Any:
|
|
14329
|
+
"""
|
|
14330
|
+
将分笔记录转换为 pyarrow.Table 对象
|
|
14331
|
+
"""
|
|
13959
14332
|
def view_license() -> str:
|
|
13960
14333
|
"""
|
|
13961
14334
|
view_license()
|
|
@@ -13966,6 +14339,10 @@ def weights_to_df(arg0: StockWeightList) -> typing.Any:
|
|
|
13966
14339
|
...
|
|
13967
14340
|
def weights_to_np(arg0: StockWeightList) -> numpy.ndarray:
|
|
13968
14341
|
...
|
|
14342
|
+
def weights_to_pa(arg0: StockWeightList) -> typing.Any:
|
|
14343
|
+
"""
|
|
14344
|
+
将权息记录列表转换为 pyarrow.Table 对象
|
|
14345
|
+
"""
|
|
13969
14346
|
DEBUG: LOG_LEVEL # value = <LOG_LEVEL.DEBUG: 1>
|
|
13970
14347
|
ERROR: LOG_LEVEL # value = <LOG_LEVEL.ERROR: 4>
|
|
13971
14348
|
FATAL: LOG_LEVEL # value = <LOG_LEVEL.FATAL: 5>
|