hikyuu 2.5.0__py3-none-win_amd64.whl → 2.5.2__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hikyuu/__init__.pyi +15 -8
- hikyuu/analysis/__init__.pyi +7 -0
- hikyuu/analysis/analysis.pyi +8 -1
- hikyuu/core.pyi +9 -2
- hikyuu/cpp/core310.pyd +0 -0
- hikyuu/cpp/core310.pyi +12949 -0
- hikyuu/cpp/core311.pyd +0 -0
- hikyuu/cpp/core311.pyi +12949 -0
- hikyuu/cpp/core312.pyd +0 -0
- hikyuu/cpp/core312.pyi +111 -29
- hikyuu/cpp/core313.pyd +0 -0
- hikyuu/cpp/core313.pyi +12933 -0
- hikyuu/cpp/core38.pyd +0 -0
- hikyuu/cpp/core38.pyi +12949 -0
- hikyuu/cpp/core39.pyd +0 -0
- hikyuu/cpp/core39.pyi +12949 -0
- hikyuu/cpp/hikyuu.dll +0 -0
- hikyuu/cpp/hikyuu.lib +0 -0
- hikyuu/draw/__init__.pyi +1 -1
- hikyuu/draw/drawplot/__init__.pyi +1 -1
- hikyuu/draw/drawplot/bokeh_draw.pyi +13 -6
- hikyuu/draw/drawplot/echarts_draw.pyi +13 -6
- hikyuu/draw/drawplot/matplotlib_draw.py +5 -4
- hikyuu/draw/drawplot/matplotlib_draw.pyi +12 -5
- hikyuu/extend.py +0 -24
- hikyuu/extend.pyi +11 -22
- hikyuu/fetcher/stock/zh_block_em.py +2 -2
- hikyuu/hub.py +43 -4
- hikyuu/hub.pyi +19 -7
- hikyuu/include/hikyuu/trade_manage/PositionRecord.h +7 -2
- hikyuu/include/hikyuu/trade_sys/signal/SignalBase.h +1 -7
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_Logic.h +29 -0
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_OneSide.h +10 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorSignal.h +2 -1
- hikyuu/include/hikyuu/version.h +4 -4
- hikyuu/trade_manage/__init__.pyi +11 -6
- hikyuu/trade_manage/trade.pyi +11 -6
- hikyuu/util/singleton.pyi +1 -1
- {hikyuu-2.5.0.dist-info → hikyuu-2.5.2.dist-info}/METADATA +1 -1
- {hikyuu-2.5.0.dist-info → hikyuu-2.5.2.dist-info}/RECORD +44 -39
- {hikyuu-2.5.0.dist-info → hikyuu-2.5.2.dist-info}/LICENSE +0 -0
- {hikyuu-2.5.0.dist-info → hikyuu-2.5.2.dist-info}/WHEEL +0 -0
- {hikyuu-2.5.0.dist-info → hikyuu-2.5.2.dist-info}/entry_points.txt +0 -0
- {hikyuu-2.5.0.dist-info → hikyuu-2.5.2.dist-info}/top_level.txt +0 -0
hikyuu/extend.pyi
CHANGED
|
@@ -193,16 +193,22 @@ from hikyuu.cpp.core312 import SE_MultiFactor
|
|
|
193
193
|
from hikyuu.cpp.core312 import SE_PerformanceOptimal
|
|
194
194
|
from hikyuu.cpp.core312 import SE_Signal
|
|
195
195
|
from hikyuu.cpp.core312 import SGN
|
|
196
|
+
from hikyuu.cpp.core312 import SG_Add
|
|
196
197
|
from hikyuu.cpp.core312 import SG_AllwaysBuy
|
|
197
198
|
from hikyuu.cpp.core312 import SG_Band
|
|
198
199
|
from hikyuu.cpp.core312 import SG_Bool
|
|
200
|
+
from hikyuu.cpp.core312 import SG_Buy
|
|
199
201
|
from hikyuu.cpp.core312 import SG_Cross
|
|
200
202
|
from hikyuu.cpp.core312 import SG_CrossGold
|
|
201
203
|
from hikyuu.cpp.core312 import SG_Cycle
|
|
204
|
+
from hikyuu.cpp.core312 import SG_Div
|
|
202
205
|
from hikyuu.cpp.core312 import SG_Flex
|
|
206
|
+
from hikyuu.cpp.core312 import SG_Mul
|
|
203
207
|
from hikyuu.cpp.core312 import SG_OneSide
|
|
208
|
+
from hikyuu.cpp.core312 import SG_Sell
|
|
204
209
|
from hikyuu.cpp.core312 import SG_Single
|
|
205
210
|
from hikyuu.cpp.core312 import SG_Single2
|
|
211
|
+
from hikyuu.cpp.core312 import SG_Sub
|
|
206
212
|
from hikyuu.cpp.core312 import SIN
|
|
207
213
|
from hikyuu.cpp.core312 import SLICE
|
|
208
214
|
from hikyuu.cpp.core312 import SLOPE
|
|
@@ -434,12 +440,13 @@ from hikyuu.cpp.core312 import ZONGGUBEN
|
|
|
434
440
|
from hikyuu.cpp.core312 import ZSCORE
|
|
435
441
|
from hikyuu.cpp.core312 import __add__ as __old_Datetime_add__
|
|
436
442
|
from hikyuu.cpp.core312 import __add__ as __old_TimeDelta_add__
|
|
437
|
-
from hikyuu.cpp.core312 import __init__ as old_Query_init
|
|
438
|
-
from hikyuu.cpp.core312 import __init__ as __old_StrategyContext_init__
|
|
439
443
|
from hikyuu.cpp.core312 import __init__ as __old_Datetime_init__
|
|
440
444
|
from hikyuu.cpp.core312 import __init__ as __old_TimeDelta_init__
|
|
441
|
-
from hikyuu.cpp.core312 import
|
|
445
|
+
from hikyuu.cpp.core312 import __init__ as old_Query_init
|
|
446
|
+
from hikyuu.cpp.core312 import __init__ as __old_StrategyContext_init__
|
|
442
447
|
from hikyuu.cpp.core312 import __sub__ as __old_TimeDelta_sub__
|
|
448
|
+
from hikyuu.cpp.core312 import __sub__ as __old_Datetime_sub__
|
|
449
|
+
from hikyuu.cpp.core312 import batch_calculate_inds
|
|
443
450
|
from hikyuu.cpp.core312 import can_upgrade
|
|
444
451
|
from hikyuu.cpp.core312 import close_ostream_to_python
|
|
445
452
|
from hikyuu.cpp.core312 import close_spend_time
|
|
@@ -487,7 +494,7 @@ import numpy as np
|
|
|
487
494
|
import os as os
|
|
488
495
|
import pandas as pd
|
|
489
496
|
import sys as sys
|
|
490
|
-
__all__ = ['ABS', 'ACOS', 'AD', 'ADVANCE', 'AF_EqualWeight', 'AF_FixedWeight', 'AF_FixedWeightList', 'AF_MultiFactor', 'ALIGN', 'AMA', 'ASIN', 'ATAN', 'ATR', 'AVEDEV', 'AllocateFundsBase', 'BACKSET', 'BARSCOUNT', 'BARSLAST', 'BARSSINCE', 'BETWEEN', 'BLOCKSETNUM', 'BUSINESS', 'Block', 'BlockInfoDriver', 'BorrowRecord', 'BrokerPositionRecord', 'CEILING', 'CN_Bool', 'CN_OPLine', 'CONTEXT', 'CONTEXT_K', 'CORR', 'COS', 'COST', 'COUNT', 'CROSS', 'CVAL', 'CYCLE', 'C_AMO', 'C_CLOSE', 'C_HIGH', 'C_KDATA', 'C_LOW', 'C_OPEN', 'C_VOL', 'ConditionBase', 'Constant', 'CostRecord', 'DATE', 'DAY', 'DEBUG', 'DECLINE', 'DEVSQ', 'DIFF', 'DIRECT', 'DISCARD', 'DMA', 'DOWNNDAY', 'DROPNA', 'DataDriverFactory', 'Datetime', 'DatetimeList', 'DatetimeList_to_df', 'DatetimeList_to_np', 'Datetime_date', 'Datetime_datetime', 'Days', 'EMA', 'ERROR', 'EVERY', 'EV_Bool', 'EV_TwoLine', 'EXIST', 'EXP', 'EnvironmentBase', 'FATAL', 'FILTER', 'FINANCE', 'FLOOR', 'FundsRecord', 'HHV', 'HHVBARS', 'HKUException', 'HOUR', 'HSL', 'Hours', 'IC', 'ICIR', 'IF', 'INBLOCK', 'INDEXA', 'INDEXADV', 'INDEXC', 'INDEXDEC', 'INDEXH', 'INDEXL', 'INDEXO', 'INDEXV', 'INFO', 'INSUM', 'INTPART', 'IR', 'ISINF', 'ISINFA', 'ISLASTBAR', 'ISNA', 'IndParam', 'Indicator', 'IndicatorImp', 'JUMPDOWN', 'JUMPUP', 'KDATA_PART', 'KData', 'KDataDriver', '
|
|
497
|
+
__all__ = ['ABS', 'ACOS', 'AD', 'ADVANCE', 'AF_EqualWeight', 'AF_FixedWeight', 'AF_FixedWeightList', 'AF_MultiFactor', 'ALIGN', 'AMA', 'ASIN', 'ATAN', 'ATR', 'AVEDEV', 'AllocateFundsBase', 'BACKSET', 'BARSCOUNT', 'BARSLAST', 'BARSSINCE', 'BETWEEN', 'BLOCKSETNUM', 'BUSINESS', 'Block', 'BlockInfoDriver', 'BorrowRecord', 'BrokerPositionRecord', 'CEILING', 'CN_Bool', 'CN_OPLine', 'CONTEXT', 'CONTEXT_K', 'CORR', 'COS', 'COST', 'COUNT', 'CROSS', 'CVAL', 'CYCLE', 'C_AMO', 'C_CLOSE', 'C_HIGH', 'C_KDATA', 'C_LOW', 'C_OPEN', 'C_VOL', 'ConditionBase', 'Constant', 'CostRecord', 'DATE', 'DAY', 'DEBUG', 'DECLINE', 'DEVSQ', 'DIFF', 'DIRECT', 'DISCARD', 'DMA', 'DOWNNDAY', 'DROPNA', 'DataDriverFactory', 'Datetime', 'DatetimeList', 'DatetimeList_to_df', 'DatetimeList_to_np', 'Datetime_date', 'Datetime_datetime', 'Days', 'EMA', 'ERROR', 'EVERY', 'EV_Bool', 'EV_TwoLine', 'EXIST', 'EXP', 'EnvironmentBase', 'FATAL', 'FILTER', 'FINANCE', 'FLOOR', 'FundsRecord', 'HHV', 'HHVBARS', 'HKUException', 'HOUR', 'HSL', 'Hours', 'IC', 'ICIR', 'IF', 'INBLOCK', 'INDEXA', 'INDEXADV', 'INDEXC', 'INDEXDEC', 'INDEXH', 'INDEXL', 'INDEXO', 'INDEXV', 'INFO', 'INSUM', 'INTPART', 'IR', 'ISINF', 'ISINFA', 'ISLASTBAR', 'ISNA', 'IndParam', 'Indicator', 'IndicatorImp', 'JUMPDOWN', 'JUMPUP', 'KDATA_PART', 'KData', 'KDataDriver', 'KData_getitem', 'KData_iter', 'KData_to_df', 'KData_to_np', 'KRecord', 'KRecordList', 'LAST', 'LASTVALUE', 'LIUTONGPAN', 'LLV', 'LLVBARS', 'LN', 'LOG', 'LOG_LEVEL', 'LONGCROSS', 'LoanRecord', 'MA', 'MACD', 'MAX', 'MAXYEAR', 'MDD', 'MF_EqualWeight', 'MF_ICIRWeight', 'MF_ICWeight', 'MF_Weight', 'MIN', 'MINUTE', 'MINYEAR', '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', 'Parameter_items', 'Parameter_iter', 'Parameter_keys', 'Parameter_to_dict', 'Performance', 'Portfolio', 'PositionRecord', 'PositionRecordList', 'ProfitGoalBase', 'Query', 'RECOVER_BACKWARD', 'RECOVER_EQUAL_BACKWARD', 'RECOVER_EQUAL_FORWARD', 'RECOVER_FORWARD', 'REF', 'REPLACE', 'RESULT', 'REVERSE', 'ROC', 'ROCP', 'ROCR', 'ROCR100', 'ROUND', 'ROUNDDOWN', 'ROUNDUP', 'RSI', 'SAFTYLOSS', 'SE_Fixed', 'SE_MaxFundsOptimal', 'SE_MultiFactor', 'SE_PerformanceOptimal', 'SE_Signal', 'SGN', 'SG_Add', 'SG_AllwaysBuy', 'SG_Band', 'SG_Bool', 'SG_Buy', 'SG_Cross', 'SG_CrossGold', 'SG_Cycle', 'SG_Div', 'SG_Flex', 'SG_Mul', 'SG_OneSide', 'SG_Sell', 'SG_Single', 'SG_Single2', 'SG_Sub', 'SIN', 'SLICE', 'SLOPE', 'SMA', 'SPEARMAN', 'SP_FixedPercent', 'SP_FixedValue', 'SQRT', 'STDEV', 'STDP', 'ST_FixedPercent', 'ST_Indicator', 'ST_Saftyloss', 'SUM', 'SUMBARS', 'SYS_Simple', 'SYS_WalkForward', 'ScoreRecord', 'ScoreRecordList', 'Seconds', 'SelectorBase', 'SignalBase', 'SlippageBase', 'SpotRecord', 'Stock', 'StockManager', 'StockTypeInfo', 'StockWeight', 'StockWeightList', 'StoplossBase', 'Strategy', 'StrategyContext', 'System', 'SystemPart', 'SystemWeight', 'SystemWeightList', 'TAN', 'TA_ACCBANDS', 'TA_ACOS', 'TA_AD', 'TA_ADD', 'TA_ADOSC', 'TA_ADX', 'TA_ADXR', 'TA_APO', 'TA_AROON', 'TA_AROONOSC', 'TA_ASIN', 'TA_ATAN', 'TA_ATR', 'TA_AVGDEV', 'TA_AVGPRICE', 'TA_BBANDS', 'TA_BETA', 'TA_BOP', 'TA_CCI', 'TA_CDL2CROWS', 'TA_CDL3BLACKCROWS', 'TA_CDL3INSIDE', 'TA_CDL3LINESTRIKE', 'TA_CDL3OUTSIDE', 'TA_CDL3STARSINSOUTH', 'TA_CDL3WHITESOLDIERS', 'TA_CDLABANDONEDBABY', 'TA_CDLADVANCEBLOCK', 'TA_CDLBELTHOLD', 'TA_CDLBREAKAWAY', 'TA_CDLCLOSINGMARUBOZU', 'TA_CDLCONCEALBABYSWALL', 'TA_CDLCOUNTERATTACK', 'TA_CDLDARKCLOUDCOVER', 'TA_CDLDOJI', 'TA_CDLDOJISTAR', 'TA_CDLDRAGONFLYDOJI', 'TA_CDLENGULFING', 'TA_CDLEVENINGDOJISTAR', 'TA_CDLEVENINGSTAR', 'TA_CDLGAPSIDESIDEWHITE', 'TA_CDLGRAVESTONEDOJI', 'TA_CDLHAMMER', 'TA_CDLHANGINGMAN', 'TA_CDLHARAMI', 'TA_CDLHARAMICROSS', 'TA_CDLHIGHWAVE', 'TA_CDLHIKKAKE', 'TA_CDLHIKKAKEMOD', 'TA_CDLHOMINGPIGEON', 'TA_CDLIDENTICAL3CROWS', 'TA_CDLINNECK', 'TA_CDLINVERTEDHAMMER', 'TA_CDLKICKING', 'TA_CDLKICKINGBYLENGTH', 'TA_CDLLADDERBOTTOM', 'TA_CDLLONGLEGGEDDOJI', 'TA_CDLLONGLINE', 'TA_CDLMARUBOZU', 'TA_CDLMATCHINGLOW', 'TA_CDLMATHOLD', 'TA_CDLMORNINGDOJISTAR', 'TA_CDLMORNINGSTAR', 'TA_CDLONNECK', 'TA_CDLPIERCING', 'TA_CDLRICKSHAWMAN', 'TA_CDLRISEFALL3METHODS', 'TA_CDLSEPARATINGLINES', 'TA_CDLSHOOTINGSTAR', 'TA_CDLSHORTLINE', 'TA_CDLSPINNINGTOP', 'TA_CDLSTALLEDPATTERN', 'TA_CDLSTICKSANDWICH', 'TA_CDLTAKURI', 'TA_CDLTASUKIGAP', 'TA_CDLTHRUSTING', 'TA_CDLTRISTAR', 'TA_CDLUNIQUE3RIVER', 'TA_CDLUPSIDEGAP2CROWS', 'TA_CDLXSIDEGAP3METHODS', 'TA_CEIL', 'TA_CMO', 'TA_CORREL', 'TA_COS', 'TA_COSH', 'TA_DEMA', 'TA_DIV', 'TA_DX', 'TA_EMA', 'TA_EXP', 'TA_FLOOR', 'TA_HT_DCPERIOD', 'TA_HT_DCPHASE', 'TA_HT_PHASOR', 'TA_HT_SINE', 'TA_HT_TRENDLINE', 'TA_HT_TRENDMODE', 'TA_IMI', 'TA_KAMA', 'TA_LINEARREG', 'TA_LINEARREG_ANGLE', 'TA_LINEARREG_INTERCEPT', 'TA_LINEARREG_SLOPE', 'TA_LN', 'TA_LOG10', 'TA_MA', 'TA_MACD', 'TA_MACDEXT', 'TA_MACDFIX', 'TA_MAMA', 'TA_MAVP', 'TA_MAX', 'TA_MAXINDEX', 'TA_MEDPRICE', 'TA_MFI', 'TA_MIDPOINT', 'TA_MIDPRICE', 'TA_MIN', 'TA_MININDEX', 'TA_MINMAX', 'TA_MINMAXINDEX', 'TA_MINUS_DI', 'TA_MINUS_DM', 'TA_MOM', 'TA_MULT', 'TA_NATR', 'TA_OBV', 'TA_PLUS_DI', 'TA_PLUS_DM', 'TA_PPO', 'TA_ROC', 'TA_ROCP', 'TA_ROCR', 'TA_ROCR100', 'TA_RSI', 'TA_SAR', 'TA_SAREXT', 'TA_SIN', 'TA_SINH', 'TA_SMA', 'TA_SQRT', 'TA_STDDEV', 'TA_STOCH', 'TA_STOCHF', 'TA_STOCHRSI', 'TA_SUB', 'TA_SUM', 'TA_T3', 'TA_TAN', 'TA_TANH', 'TA_TEMA', 'TA_TRANGE', 'TA_TRIMA', 'TA_TRIX', 'TA_TSF', 'TA_TYPPRICE', 'TA_ULTOSC', 'TA_VAR', 'TA_WCLPRICE', 'TA_WILLR', 'TA_WMA', 'TC_FixedA', 'TC_FixedA2015', 'TC_FixedA2017', 'TC_TestStub', 'TC_Zero', 'TIME', 'TIMELINE', 'TIMELINEVOL', 'TRACE', 'TURNOVER', 'TimeDelta', 'TimeDelta_timedelta', 'TimeLineList', 'TimeLineRecord', 'TimeLine_to_df', 'TimeLine_to_np', 'TradeCostBase', 'TradeManager', 'TradeRecord', 'TradeRecordList', 'TradeRequest', 'TransList', 'TransList_to_df', 'TransList_to_np', 'TransRecord', 'UPNDAY', 'UTC', 'VAR', 'VARP', 'VIGOR', 'WARN', 'WEAVE', 'WEEK', 'WINNER', 'WMA', 'YEAR', 'ZHBOND10', 'ZONGGUBEN', 'ZSCORE', 'batch_calculate_inds', 'can_upgrade', 'close_ostream_to_python', 'close_spend_time', 'combinate_ind', 'combinate_index', 'constant', 'crtBrokerTM', 'crtSEOptimal', 'crtTM', 'crt_pf_strategy', 'crt_sys_strategy', 'date', 'datetime', 'find_optimal_system', 'find_optimal_system_multi', 'get_block', 'get_business_name', 'get_data_from_buffer_server', 'get_date_range', 'get_kdata', 'get_last_version', 'get_log_level', 'get_stock', 'get_system_part_enum', 'get_system_part_name', 'get_version', 'get_version_git', 'get_version_with_build', 'hikyuu_init', 'inner_analysis_sys_list', 'inner_combinate_ind_analysis', 'inner_combinate_ind_analysis_with_block', 'isinf', 'isnan', 'new_Query_init', 'np', 'old_Query_init', 'open_ostream_to_python', 'open_spend_time', 'os', 'pd', 'roundDown', 'roundEx', 'roundUp', 'run_in_strategy', 'set_log_level', 'set_python_in_interactive', 'set_python_in_jupyter', 'start_spot_agent', 'stop_spot_agent', 'sys', 'time', 'timedelta', 'timezone', 'toPriceList', 'tzinfo']
|
|
491
498
|
def DatetimeList_to_df(data):
|
|
492
499
|
"""
|
|
493
500
|
仅在安装了pandas模块时生效,转换为pandas.DataFrame
|
|
@@ -503,24 +510,6 @@ def Datetime_date(self):
|
|
|
503
510
|
def Datetime_datetime(self):
|
|
504
511
|
"""
|
|
505
512
|
转化生成 python 的 datetime
|
|
506
|
-
"""
|
|
507
|
-
def KData_getPos(kdata, datetime):
|
|
508
|
-
"""
|
|
509
|
-
|
|
510
|
-
获取指定时间对应的索引位置
|
|
511
|
-
|
|
512
|
-
:param Datetime datetime: 指定的时间
|
|
513
|
-
:return: 对应的索引位置,如果不在数据范围内,则返回 None
|
|
514
|
-
|
|
515
|
-
"""
|
|
516
|
-
def KData_getPosInStock(kdata, datetime):
|
|
517
|
-
"""
|
|
518
|
-
|
|
519
|
-
获取指定时间对应的原始K线中的索引位置
|
|
520
|
-
|
|
521
|
-
:param Datetime datetime: 指定的时间
|
|
522
|
-
:return: 对应的索引位置,如果不在数据范围内,则返回 None
|
|
523
|
-
|
|
524
513
|
"""
|
|
525
514
|
def KData_getitem(kdata, i):
|
|
526
515
|
"""
|
|
@@ -158,7 +158,7 @@ def get_all_dybk_info(code_market_dict, sep=""):
|
|
|
158
158
|
stk_json = r.json()
|
|
159
159
|
stk_json = stk_json["data"]["diff"]
|
|
160
160
|
ret[blk_name] = [
|
|
161
|
-
f"{code_market_dict[v[
|
|
161
|
+
f"{code_market_dict[v['f12']]}{sep}{v['f12']}" for v in stk_json if v['f12'] in code_market_dict]
|
|
162
162
|
|
|
163
163
|
total_page = math.ceil(data["data"]["total"] / 200)
|
|
164
164
|
for page in range(2, total_page + 1):
|
|
@@ -167,7 +167,7 @@ def get_all_dybk_info(code_market_dict, sep=""):
|
|
|
167
167
|
stk_json = r.json()
|
|
168
168
|
stk_json = stk_json["data"]["diff"]
|
|
169
169
|
ret[blk_name].extend(
|
|
170
|
-
[f"{code_market_dict[v[
|
|
170
|
+
[f"{code_market_dict[v['f12']]}{sep}{v['f12']}" for v in stk_json if v["f12"] in code_market_dict])
|
|
171
171
|
hku_info(f'获取地域板块{blk_name}成分: {len(ret[blk_name])}')
|
|
172
172
|
|
|
173
173
|
return ret
|
hikyuu/hub.py
CHANGED
|
@@ -426,6 +426,30 @@ class HubManager(metaclass=SingletonType):
|
|
|
426
426
|
pass
|
|
427
427
|
return part
|
|
428
428
|
|
|
429
|
+
@dbsession
|
|
430
|
+
def get_part_module(self, name):
|
|
431
|
+
"""获取指定策略部件
|
|
432
|
+
|
|
433
|
+
:param str name: 策略部件名称
|
|
434
|
+
:param kwargs: 其他部件相关参数
|
|
435
|
+
"""
|
|
436
|
+
name_parts = name.split('.')
|
|
437
|
+
checkif(
|
|
438
|
+
len(name_parts) < 2
|
|
439
|
+
or (name_parts[-2] not in ('af', 'cn', 'ev', 'mf', 'mm', 'pg', 'se', 'sg', 'sp', 'st', 'pf', 'sys', 'ind', 'other')),
|
|
440
|
+
name, PartNameError
|
|
441
|
+
)
|
|
442
|
+
|
|
443
|
+
# 未指定仓库名,则默认使用 'default' 仓库
|
|
444
|
+
part_name = 'default.{}'.format(name) if len(name_parts) == 2 else name
|
|
445
|
+
part_model = self._session.query(PartModel).filter_by(name=part_name).first()
|
|
446
|
+
checkif(part_model is None, part_name, PartNotFoundError, cause='仓库中不存在')
|
|
447
|
+
try:
|
|
448
|
+
part_module = importlib.import_module(part_model.module_name)
|
|
449
|
+
except ModuleNotFoundError:
|
|
450
|
+
raise PartNotFoundError(part_name, '请检查部件对应路径是否存在')
|
|
451
|
+
return part_module
|
|
452
|
+
|
|
429
453
|
@dbsession
|
|
430
454
|
def get_part_info(self, name):
|
|
431
455
|
"""获取策略部件信息
|
|
@@ -434,11 +458,15 @@ class HubManager(metaclass=SingletonType):
|
|
|
434
458
|
"""
|
|
435
459
|
part_model = self._session.query(PartModel).filter_by(name=name).first()
|
|
436
460
|
checkif(part_model is None, name, PartNotFoundError, cause='仓库中不存在')
|
|
461
|
+
try:
|
|
462
|
+
part_module = importlib.import_module(part_model.module_name)
|
|
463
|
+
except ModuleNotFoundError:
|
|
464
|
+
raise PartNotFoundError(name, '请检查部件对应路径是否存在')
|
|
437
465
|
return {
|
|
438
466
|
'name': name,
|
|
439
467
|
'author': part_model.author,
|
|
440
468
|
'version': part_model.version,
|
|
441
|
-
'doc':
|
|
469
|
+
'doc': part_module.part.__doc__,
|
|
442
470
|
}
|
|
443
471
|
|
|
444
472
|
def print_part_info(self, name):
|
|
@@ -450,10 +478,7 @@ class HubManager(metaclass=SingletonType):
|
|
|
450
478
|
print('+---------+------------------------------------------------')
|
|
451
479
|
print('| version | ', info['version'])
|
|
452
480
|
print('+---------+------------------------------------------------')
|
|
453
|
-
# print('\n')
|
|
454
481
|
print(info['doc'])
|
|
455
|
-
# print('\n')
|
|
456
|
-
# print('----------------------------------------------------------')
|
|
457
482
|
|
|
458
483
|
@dbsession
|
|
459
484
|
def get_hub_path(self, name):
|
|
@@ -575,6 +600,9 @@ def print_part_info(name):
|
|
|
575
600
|
HubManager().print_part_info(name)
|
|
576
601
|
|
|
577
602
|
|
|
603
|
+
help_part = print_part_info
|
|
604
|
+
|
|
605
|
+
|
|
578
606
|
def get_hub_name_list():
|
|
579
607
|
"""返回仓库名称列表"""
|
|
580
608
|
return HubManager().get_hub_name_list()
|
|
@@ -588,6 +616,15 @@ def get_part_name_list(hub=None, part_type=None):
|
|
|
588
616
|
return HubManager().get_part_name_list(hub, part_type)
|
|
589
617
|
|
|
590
618
|
|
|
619
|
+
def get_part_module(part_name: str):
|
|
620
|
+
"""获取部件模块
|
|
621
|
+
:param str part_name: 部件名称
|
|
622
|
+
:return: 部件模块
|
|
623
|
+
:rtype: module
|
|
624
|
+
"""
|
|
625
|
+
return HubManager().get_part_module(part_name)
|
|
626
|
+
|
|
627
|
+
|
|
591
628
|
def get_current_hub(filename):
|
|
592
629
|
"""用于在仓库part.py中获取当前所在的仓库名。
|
|
593
630
|
示例: get_current_hub(__file__)
|
|
@@ -607,9 +644,11 @@ __all__ = [
|
|
|
607
644
|
'update_hub',
|
|
608
645
|
'remove_hub',
|
|
609
646
|
'build_hub',
|
|
647
|
+
'help_part',
|
|
610
648
|
'get_part',
|
|
611
649
|
'get_hub_path',
|
|
612
650
|
'get_part_info',
|
|
651
|
+
'get_part_module',
|
|
613
652
|
'print_part_info',
|
|
614
653
|
'get_hub_name_list',
|
|
615
654
|
'get_part_name_list',
|
hikyuu/hub.pyi
CHANGED
|
@@ -26,13 +26,13 @@ from sqlalchemy.sql.sqltypes import String
|
|
|
26
26
|
import stat as stat
|
|
27
27
|
import sys as sys
|
|
28
28
|
import typing
|
|
29
|
-
__all__: list = ['add_remote_hub', 'add_local_hub', 'update_hub', 'remove_hub', 'build_hub', 'get_part', 'get_hub_path', 'get_part_info', 'print_part_info', 'get_hub_name_list', 'get_part_name_list', 'get_current_hub']
|
|
29
|
+
__all__: list = ['add_remote_hub', 'add_local_hub', 'update_hub', 'remove_hub', 'build_hub', 'help_part', 'get_part', 'get_hub_path', 'get_part_info', 'get_part_module', 'print_part_info', 'get_hub_name_list', 'get_part_name_list', 'get_current_hub']
|
|
30
30
|
class ConfigModel(sqlalchemy.orm.decl_api.Base):
|
|
31
|
-
__mapper__: typing.ClassVar[sqlalchemy.orm.mapper.Mapper] # value = <Mapper at
|
|
31
|
+
__mapper__: typing.ClassVar[sqlalchemy.orm.mapper.Mapper] # value = <Mapper at 0x18c15d85310; ConfigModel>
|
|
32
32
|
__table__: typing.ClassVar[sqlalchemy.sql.schema.Table] # value = Table('hub_config', MetaData(), Column('id', Integer(), table=<hub_config>, primary_key=True, nullable=False, default=Sequence('config_id_seq', metadata=MetaData())), Column('key', String(), table=<hub_config>), Column('value', String(), table=<hub_config>), schema=None)
|
|
33
33
|
__table_args__: typing.ClassVar[tuple] # value = (UniqueConstraint(Column('key', String(), table=<hub_config>)))
|
|
34
34
|
__tablename__: typing.ClassVar[str] = 'hub_config'
|
|
35
|
-
_sa_class_manager: typing.ClassVar[sqlalchemy.orm.instrumentation.ClassManager] # value = <ClassManager of <class 'hikyuu.hub.ConfigModel'> at
|
|
35
|
+
_sa_class_manager: typing.ClassVar[sqlalchemy.orm.instrumentation.ClassManager] # value = <ClassManager of <class 'hikyuu.hub.ConfigModel'> at 18c1612aad0>
|
|
36
36
|
def __init__(self, **kwargs):
|
|
37
37
|
"""
|
|
38
38
|
A simple constructor that allows initialization from kwargs.
|
|
@@ -79,6 +79,9 @@ class HubManager:
|
|
|
79
79
|
def get_part_info(*args, **kwargs):
|
|
80
80
|
...
|
|
81
81
|
@staticmethod
|
|
82
|
+
def get_part_module(*args, **kwargs):
|
|
83
|
+
...
|
|
84
|
+
@staticmethod
|
|
82
85
|
def get_part_name_list(*args, **kwargs):
|
|
83
86
|
...
|
|
84
87
|
@staticmethod
|
|
@@ -100,11 +103,11 @@ class HubManager:
|
|
|
100
103
|
def print_part_info(self, name):
|
|
101
104
|
...
|
|
102
105
|
class HubModel(sqlalchemy.orm.decl_api.Base):
|
|
103
|
-
__mapper__: typing.ClassVar[sqlalchemy.orm.mapper.Mapper] # value = <Mapper at
|
|
106
|
+
__mapper__: typing.ClassVar[sqlalchemy.orm.mapper.Mapper] # value = <Mapper at 0x18c14f8be90; HubModel>
|
|
104
107
|
__table__: typing.ClassVar[sqlalchemy.sql.schema.Table] # value = Table('hub_repo', MetaData(), Column('id', Integer(), table=<hub_repo>, primary_key=True, nullable=False, default=Sequence('remote_id_seq', metadata=MetaData())), Column('name', String(), table=<hub_repo>), Column('hub_type', String(), table=<hub_repo>), Column('local_base', String(), table=<hub_repo>), Column('local', String(), table=<hub_repo>), Column('url', String(), table=<hub_repo>), Column('branch', String(), table=<hub_repo>), schema=None)
|
|
105
108
|
__table_args__: typing.ClassVar[tuple] # value = (UniqueConstraint(Column('name', String(), table=<hub_repo>)))
|
|
106
109
|
__tablename__: typing.ClassVar[str] = 'hub_repo'
|
|
107
|
-
_sa_class_manager: typing.ClassVar[sqlalchemy.orm.instrumentation.ClassManager] # value = <ClassManager of <class 'hikyuu.hub.HubModel'> at
|
|
110
|
+
_sa_class_manager: typing.ClassVar[sqlalchemy.orm.instrumentation.ClassManager] # value = <ClassManager of <class 'hikyuu.hub.HubModel'> at 18c1614f2f0>
|
|
108
111
|
def __init__(self, **kwargs):
|
|
109
112
|
"""
|
|
110
113
|
A simple constructor that allows initialization from kwargs.
|
|
@@ -137,10 +140,10 @@ class ModuleConflictError(Exception):
|
|
|
137
140
|
def __str__(self):
|
|
138
141
|
...
|
|
139
142
|
class PartModel(sqlalchemy.orm.decl_api.Base):
|
|
140
|
-
__mapper__: typing.ClassVar[sqlalchemy.orm.mapper.Mapper] # value = <Mapper at
|
|
143
|
+
__mapper__: typing.ClassVar[sqlalchemy.orm.mapper.Mapper] # value = <Mapper at 0x18c1612e090; PartModel>
|
|
141
144
|
__table__: typing.ClassVar[sqlalchemy.sql.schema.Table] # value = Table('hub_part', MetaData(), Column('id', Integer(), table=<hub_part>, primary_key=True, nullable=False, default=Sequence('part_id_seq', metadata=MetaData())), Column('hub_name', String(), table=<hub_part>), Column('part', String(), table=<hub_part>), Column('name', String(), table=<hub_part>), Column('author', String(), table=<hub_part>), Column('version', String(), table=<hub_part>), Column('doc', String(), table=<hub_part>), Column('module_name', String(), table=<hub_part>), schema=None)
|
|
142
145
|
__tablename__: typing.ClassVar[str] = 'hub_part'
|
|
143
|
-
_sa_class_manager: typing.ClassVar[sqlalchemy.orm.instrumentation.ClassManager] # value = <ClassManager of <class 'hikyuu.hub.PartModel'> at
|
|
146
|
+
_sa_class_manager: typing.ClassVar[sqlalchemy.orm.instrumentation.ClassManager] # value = <ClassManager of <class 'hikyuu.hub.PartModel'> at 18c1614fde0>
|
|
144
147
|
def __init__(self, **kwargs):
|
|
145
148
|
"""
|
|
146
149
|
A simple constructor that allows initialization from kwargs.
|
|
@@ -226,6 +229,14 @@ def get_part_info(name):
|
|
|
226
229
|
|
|
227
230
|
:param str name: 部件名称
|
|
228
231
|
|
|
232
|
+
"""
|
|
233
|
+
def get_part_module(part_name: str):
|
|
234
|
+
"""
|
|
235
|
+
获取部件模块
|
|
236
|
+
:param str part_name: 部件名称
|
|
237
|
+
:return: 部件模块
|
|
238
|
+
:rtype: module
|
|
239
|
+
|
|
229
240
|
"""
|
|
230
241
|
def get_part_name_list(hub = None, part_type = None):
|
|
231
242
|
"""
|
|
@@ -252,3 +263,4 @@ def update_hub(name):
|
|
|
252
263
|
:param str name: 仓库名称
|
|
253
264
|
|
|
254
265
|
"""
|
|
266
|
+
help_part = print_part_info
|
|
@@ -28,6 +28,11 @@ public:
|
|
|
28
28
|
/** 仅用于python的__str__ */
|
|
29
29
|
string str() const;
|
|
30
30
|
|
|
31
|
+
/** 盈利 = 买入资金 - 累计交易总成本 - 卖出资金 */
|
|
32
|
+
price_t totalProfit() const {
|
|
33
|
+
return buyMoney - totalCost - sellMoney;
|
|
34
|
+
}
|
|
35
|
+
|
|
31
36
|
Stock stock; ///< 交易对象
|
|
32
37
|
Datetime takeDatetime; ///< 初次建仓日期
|
|
33
38
|
Datetime cleanDatetime; ///< 平仓日期,当前持仓记录中为Null<Datetime>()
|
|
@@ -37,8 +42,8 @@ public:
|
|
|
37
42
|
double totalNumber{0.0}; ///< 累计持仓数量
|
|
38
43
|
price_t buyMoney{0.0}; ///< 累计买入资金
|
|
39
44
|
price_t totalCost{0.0}; ///< 累计交易总成本
|
|
40
|
-
price_t totalRisk{0.0};
|
|
41
|
-
price_t sellMoney{0.0};
|
|
45
|
+
price_t totalRisk{0.0}; ///< 累计交易风险 = 各次 (买入价格-止损)*买入数量, 不包含交易成本
|
|
46
|
+
price_t sellMoney{0.0}; ///< 累计卖出资金
|
|
42
47
|
|
|
43
48
|
//===================
|
|
44
49
|
// 序列化支持
|
|
@@ -107,9 +107,6 @@ public:
|
|
|
107
107
|
void startCycle(const Datetime& start, const Datetime& end);
|
|
108
108
|
const Datetime& getCycleStart() const;
|
|
109
109
|
const Datetime& getCycleEnd() const;
|
|
110
|
-
bool ignoreCycle() const {
|
|
111
|
-
return m_ignore_cycle;
|
|
112
|
-
}
|
|
113
110
|
|
|
114
111
|
/** 复位操作 */
|
|
115
112
|
void reset();
|
|
@@ -146,13 +143,12 @@ protected:
|
|
|
146
143
|
/* 空头持仓 */
|
|
147
144
|
bool m_hold_short;
|
|
148
145
|
|
|
149
|
-
// 用 map
|
|
146
|
+
// 用 map 保存,以便获取时能保持顺序
|
|
150
147
|
std::map<Datetime, double> m_buySig;
|
|
151
148
|
std::map<Datetime, double> m_sellSig;
|
|
152
149
|
|
|
153
150
|
Datetime m_cycle_start;
|
|
154
151
|
Datetime m_cycle_end;
|
|
155
|
-
bool m_ignore_cycle{false}; // 特殊用途,用于 OperatorSignal
|
|
156
152
|
|
|
157
153
|
//============================================
|
|
158
154
|
// 序列化支持
|
|
@@ -168,7 +164,6 @@ private:
|
|
|
168
164
|
ar& BOOST_SERIALIZATION_NVP(m_hold_short);
|
|
169
165
|
ar& BOOST_SERIALIZATION_NVP(m_buySig);
|
|
170
166
|
ar& BOOST_SERIALIZATION_NVP(m_sellSig);
|
|
171
|
-
ar& BOOST_SERIALIZATION_NVP(m_ignore_cycle);
|
|
172
167
|
// m_kdata都是系统运行时临时设置,不需要序列化
|
|
173
168
|
// ar & BOOST_SERIALIZATION_NVP(m_kdata);
|
|
174
169
|
// ar & BOOST_SERIALIZATION_NVP(m_calculated);
|
|
@@ -182,7 +177,6 @@ private:
|
|
|
182
177
|
ar& BOOST_SERIALIZATION_NVP(m_hold_short);
|
|
183
178
|
ar& BOOST_SERIALIZATION_NVP(m_buySig);
|
|
184
179
|
ar& BOOST_SERIALIZATION_NVP(m_sellSig);
|
|
185
|
-
ar& BOOST_SERIALIZATION_NVP(m_ignore_cycle);
|
|
186
180
|
// m_kdata都是系统运行时临时设置,不需要序列化
|
|
187
181
|
// ar & BOOST_SERIALIZATION_NVP(m_kdata);
|
|
188
182
|
// ar & BOOST_SERIALIZATION_NVP(m_calculated);
|
|
@@ -34,4 +34,33 @@ inline SignalPtr operator|(const SignalPtr& sg1, const SignalPtr& sg2) {
|
|
|
34
34
|
return sg1 + sg2;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
//------------------------------------------------------------------
|
|
38
|
+
// 由于 SG 的 alternate 默认为 True, 在使用如 "sg1 + sg2 + sg3"
|
|
39
|
+
// 的形式时,容易忽略 sg1 + sg2 的 alternate 属性,故添加 SG_Add 等函数
|
|
40
|
+
// 建议使用: SG_Add(sg1, sg2, False) + sg3 来避免 alternate 的问题
|
|
41
|
+
//------------------------------------------------------------------
|
|
42
|
+
inline SignalPtr SG_Add(const SignalPtr& sg1, const SignalPtr& sg2, bool alternate) {
|
|
43
|
+
auto sg = sg1 + sg2;
|
|
44
|
+
sg->setParam<bool>("alternate", alternate);
|
|
45
|
+
return sg;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
inline SignalPtr SG_Sub(const SignalPtr& sg1, const SignalPtr& sg2, bool alternate) {
|
|
49
|
+
auto sg = sg1 - sg2;
|
|
50
|
+
sg->setParam<bool>("alternate", alternate);
|
|
51
|
+
return sg;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
inline SignalPtr SG_Mul(const SignalPtr& sg1, const SignalPtr& sg2, bool alternate) {
|
|
55
|
+
auto sg = sg1 * sg2;
|
|
56
|
+
sg->setParam<bool>("alternate", alternate);
|
|
57
|
+
return sg;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
inline SignalPtr SG_Div(const SignalPtr& sg1, const SignalPtr& sg2, bool alternate) {
|
|
61
|
+
auto sg = sg1 / sg2;
|
|
62
|
+
sg->setParam<bool>("alternate", alternate);
|
|
63
|
+
return sg;
|
|
64
|
+
}
|
|
65
|
+
|
|
37
66
|
} // namespace hku
|
|
@@ -23,6 +23,16 @@ namespace hku {
|
|
|
23
23
|
*/
|
|
24
24
|
SignalPtr HKU_API SG_OneSide(const Indicator& ind, bool is_buy);
|
|
25
25
|
|
|
26
|
+
/** 生成单边买入信号 */
|
|
27
|
+
inline SignalPtr SG_Buy(const Indicator& ind) {
|
|
28
|
+
return SG_OneSide(ind, true);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** 生成单边卖出信号 */
|
|
32
|
+
inline SignalPtr SG_Sell(const Indicator& ind) {
|
|
33
|
+
return SG_OneSide(ind, false);
|
|
34
|
+
}
|
|
35
|
+
|
|
26
36
|
} /* namespace hku */
|
|
27
37
|
|
|
28
38
|
#endif /* TRADE_SYS_SIGNAL_CRT_SG_ONESIDE_H_ */
|
|
@@ -18,7 +18,8 @@ public:
|
|
|
18
18
|
OperatorSignal(const string& name, const SignalPtr& sg1, const SignalPtr& sg2);
|
|
19
19
|
virtual ~OperatorSignal();
|
|
20
20
|
|
|
21
|
-
virtual void _reset() override;
|
|
21
|
+
virtual void _reset() override final;
|
|
22
|
+
|
|
22
23
|
virtual SignalPtr _clone() override;
|
|
23
24
|
virtual void _calculate(const KData& kdata) override {}
|
|
24
25
|
|
hikyuu/include/hikyuu/version.h
CHANGED
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
#define HKU_VERSION_H
|
|
13
13
|
|
|
14
14
|
// clang-format off
|
|
15
|
-
#define HKU_VERSION "2.5.
|
|
15
|
+
#define HKU_VERSION "2.5.2"
|
|
16
16
|
#define HKU_VERSION_MAJOR 2
|
|
17
17
|
#define HKU_VERSION_MINOR 5
|
|
18
|
-
#define HKU_VERSION_ALTER
|
|
19
|
-
#define HKU_VERSION_BUILD
|
|
18
|
+
#define HKU_VERSION_ALTER 2
|
|
19
|
+
#define HKU_VERSION_BUILD 202502241314
|
|
20
20
|
#define HKU_VERSION_MODE "RELEASE"
|
|
21
|
-
#define HKU_VERSION_GIT "2.5.
|
|
21
|
+
#define HKU_VERSION_GIT "2.5.2 release.5ea8ba65 (RELEASE)"
|
|
22
22
|
// clang-format on
|
|
23
23
|
|
|
24
24
|
#endif /* HKU_VERSION_H */
|
hikyuu/trade_manage/__init__.pyi
CHANGED
|
@@ -117,8 +117,8 @@ from hikyuu.cpp.core312 import KDataDriver
|
|
|
117
117
|
from hikyuu.cpp.core312 import KRecord
|
|
118
118
|
from hikyuu.cpp.core312 import KRecordList
|
|
119
119
|
from hikyuu.cpp.core312 import LAST
|
|
120
|
-
from hikyuu.cpp.core312 import LASTVALUE as CONST
|
|
121
120
|
from hikyuu.cpp.core312 import LASTVALUE
|
|
121
|
+
from hikyuu.cpp.core312 import LASTVALUE as CONST
|
|
122
122
|
from hikyuu.cpp.core312 import LIUTONGPAN
|
|
123
123
|
from hikyuu.cpp.core312 import LIUTONGPAN as CAPITAL
|
|
124
124
|
from hikyuu.cpp.core312 import LLV
|
|
@@ -166,8 +166,8 @@ from hikyuu.cpp.core312 import PG_FixedPercent
|
|
|
166
166
|
from hikyuu.cpp.core312 import PG_NoGoal
|
|
167
167
|
from hikyuu.cpp.core312 import POS
|
|
168
168
|
from hikyuu.cpp.core312 import POW
|
|
169
|
-
from hikyuu.cpp.core312 import PRICELIST as VALUE
|
|
170
169
|
from hikyuu.cpp.core312 import PRICELIST
|
|
170
|
+
from hikyuu.cpp.core312 import PRICELIST as VALUE
|
|
171
171
|
from hikyuu.cpp.core312 import Parameter
|
|
172
172
|
from hikyuu.cpp.core312 import Performance
|
|
173
173
|
from hikyuu.cpp.core312 import Portfolio
|
|
@@ -198,16 +198,22 @@ from hikyuu.cpp.core312 import SE_MultiFactor
|
|
|
198
198
|
from hikyuu.cpp.core312 import SE_PerformanceOptimal
|
|
199
199
|
from hikyuu.cpp.core312 import SE_Signal
|
|
200
200
|
from hikyuu.cpp.core312 import SGN
|
|
201
|
+
from hikyuu.cpp.core312 import SG_Add
|
|
201
202
|
from hikyuu.cpp.core312 import SG_AllwaysBuy
|
|
202
203
|
from hikyuu.cpp.core312 import SG_Band
|
|
203
204
|
from hikyuu.cpp.core312 import SG_Bool
|
|
205
|
+
from hikyuu.cpp.core312 import SG_Buy
|
|
204
206
|
from hikyuu.cpp.core312 import SG_Cross
|
|
205
207
|
from hikyuu.cpp.core312 import SG_CrossGold
|
|
206
208
|
from hikyuu.cpp.core312 import SG_Cycle
|
|
209
|
+
from hikyuu.cpp.core312 import SG_Div
|
|
207
210
|
from hikyuu.cpp.core312 import SG_Flex
|
|
211
|
+
from hikyuu.cpp.core312 import SG_Mul
|
|
208
212
|
from hikyuu.cpp.core312 import SG_OneSide
|
|
213
|
+
from hikyuu.cpp.core312 import SG_Sell
|
|
209
214
|
from hikyuu.cpp.core312 import SG_Single
|
|
210
215
|
from hikyuu.cpp.core312 import SG_Single2
|
|
216
|
+
from hikyuu.cpp.core312 import SG_Sub
|
|
211
217
|
from hikyuu.cpp.core312 import SIN
|
|
212
218
|
from hikyuu.cpp.core312 import SLICE
|
|
213
219
|
from hikyuu.cpp.core312 import SLOPE
|
|
@@ -438,6 +444,7 @@ from hikyuu.cpp.core312 import ZHBOND10
|
|
|
438
444
|
from hikyuu.cpp.core312 import ZONGGUBEN
|
|
439
445
|
from hikyuu.cpp.core312 import ZSCORE
|
|
440
446
|
from hikyuu.cpp.core312 import __init__ as old_Query_init
|
|
447
|
+
from hikyuu.cpp.core312 import batch_calculate_inds
|
|
441
448
|
from hikyuu.cpp.core312 import can_upgrade
|
|
442
449
|
from hikyuu.cpp.core312 import close_ostream_to_python
|
|
443
450
|
from hikyuu.cpp.core312 import close_spend_time
|
|
@@ -486,8 +493,6 @@ from hikyuu.extend import DatetimeList_to_df
|
|
|
486
493
|
from hikyuu.extend import DatetimeList_to_np
|
|
487
494
|
from hikyuu.extend import Datetime_date
|
|
488
495
|
from hikyuu.extend import Datetime_datetime
|
|
489
|
-
from hikyuu.extend import KData_getPos
|
|
490
|
-
from hikyuu.extend import KData_getPosInStock
|
|
491
496
|
from hikyuu.extend import KData_getitem
|
|
492
497
|
from hikyuu.extend import KData_iter
|
|
493
498
|
from hikyuu.extend import KData_to_df
|
|
@@ -532,8 +537,8 @@ from hikyuu.util.mylog import LoggingContext
|
|
|
532
537
|
from hikyuu.util.mylog import add_class_logger_handler
|
|
533
538
|
from hikyuu.util.mylog import capture_multiprocess_all_logger
|
|
534
539
|
from hikyuu.util.mylog import class_logger
|
|
535
|
-
from hikyuu.util.mylog import hku_debug
|
|
536
540
|
from hikyuu.util.mylog import hku_debug as hku_trace
|
|
541
|
+
from hikyuu.util.mylog import hku_debug
|
|
537
542
|
from hikyuu.util.mylog import hku_debug_if
|
|
538
543
|
from hikyuu.util.mylog import hku_debug_if as hku_trace_if
|
|
539
544
|
from hikyuu.util.mylog import hku_error
|
|
@@ -562,7 +567,7 @@ from . import broker
|
|
|
562
567
|
from . import broker_easytrader
|
|
563
568
|
from . import broker_mail
|
|
564
569
|
from . import trade
|
|
565
|
-
__all__ = ['ABS', 'ACOS', 'AD', 'ADVANCE', 'AF_EqualWeight', 'AF_FixedWeight', 'AF_FixedWeightList', 'AF_MultiFactor', 'ALIGN', 'AMA', 'AMO', 'ASIN', 'ATAN', 'ATR', 'AVEDEV', 'AllocateFundsBase', 'BACKSET', 'BARSCOUNT', 'BARSLAST', 'BARSSINCE', 'BETWEEN', 'BLOCKSETNUM', 'BUSINESS', 'Block', 'BlockInfoDriver', 'BorrowRecord', 'BrokerPositionRecord', 'CAPITAL', 'CEILING', 'CLOSE', 'CN_Bool', 'CN_OPLine', 'CONST', 'CONTEXT', 'CONTEXT_K', 'CORR', 'COS', 'COST', 'COUNT', 'CROSS', 'CVAL', 'CYCLE', 'C_AMO', 'C_CLOSE', 'C_HIGH', 'C_KDATA', 'C_LOW', 'C_OPEN', 'C_VOL', 'ConditionBase', 'Constant', 'CostRecord', 'DATE', 'DAY', 'DEBUG', 'DECLINE', 'DEVSQ', 'DIFF', 'DIRECT', 'DISCARD', 'DMA', 'DOWNNDAY', 'DROPNA', 'DataDriverFactory', 'Datetime', 'DatetimeList', 'DatetimeList_to_df', 'DatetimeList_to_np', 'Datetime_date', 'Datetime_datetime', 'Days', 'EMA', 'ERROR', 'EVERY', 'EV_Bool', 'EV_TwoLine', 'EXIST', 'EXP', 'EasyTraderOrderBroker', 'EnvironmentBase', 'FATAL', 'FILTER', 'FINANCE', 'FLOOR', 'FundsRecord', 'HHV', 'HHVBARS', 'HIGH', 'HKUCheckError', 'HKUException', 'HOUR', 'HSL', 'Hours', 'IC', 'ICIR', 'IF', 'INBLOCK', 'INDEXA', 'INDEXADV', 'INDEXC', 'INDEXDEC', 'INDEXH', 'INDEXL', 'INDEXO', 'INDEXV', 'INFO', 'INSUM', 'INTPART', 'IR', 'ISINF', 'ISINFA', 'ISLASTBAR', 'ISNA', 'IndParam', 'Indicator', 'IndicatorImp', 'JUMPDOWN', 'JUMPUP', 'KDATA', 'KDATA_PART', 'KDJ', 'KData', 'KDataDriver', '
|
|
570
|
+
__all__ = ['ABS', 'ACOS', 'AD', 'ADVANCE', 'AF_EqualWeight', 'AF_FixedWeight', 'AF_FixedWeightList', 'AF_MultiFactor', 'ALIGN', 'AMA', 'AMO', 'ASIN', 'ATAN', 'ATR', 'AVEDEV', 'AllocateFundsBase', 'BACKSET', 'BARSCOUNT', 'BARSLAST', 'BARSSINCE', 'BETWEEN', 'BLOCKSETNUM', 'BUSINESS', 'Block', 'BlockInfoDriver', 'BorrowRecord', 'BrokerPositionRecord', 'CAPITAL', 'CEILING', 'CLOSE', 'CN_Bool', 'CN_OPLine', 'CONST', 'CONTEXT', 'CONTEXT_K', 'CORR', 'COS', 'COST', 'COUNT', 'CROSS', 'CVAL', 'CYCLE', 'C_AMO', 'C_CLOSE', 'C_HIGH', 'C_KDATA', 'C_LOW', 'C_OPEN', 'C_VOL', 'ConditionBase', 'Constant', 'CostRecord', 'DATE', 'DAY', 'DEBUG', 'DECLINE', 'DEVSQ', 'DIFF', 'DIRECT', 'DISCARD', 'DMA', 'DOWNNDAY', 'DROPNA', 'DataDriverFactory', 'Datetime', 'DatetimeList', 'DatetimeList_to_df', 'DatetimeList_to_np', 'Datetime_date', 'Datetime_datetime', 'Days', 'EMA', 'ERROR', 'EVERY', 'EV_Bool', 'EV_TwoLine', 'EXIST', 'EXP', 'EasyTraderOrderBroker', 'EnvironmentBase', 'FATAL', 'FILTER', 'FINANCE', 'FLOOR', 'FundsRecord', 'HHV', 'HHVBARS', 'HIGH', 'HKUCheckError', 'HKUException', 'HOUR', 'HSL', 'Hours', 'IC', 'ICIR', 'IF', 'INBLOCK', 'INDEXA', 'INDEXADV', 'INDEXC', 'INDEXDEC', 'INDEXH', 'INDEXL', 'INDEXO', 'INDEXV', 'INFO', 'INSUM', 'INTPART', 'IR', 'ISINF', 'ISINFA', 'ISLASTBAR', 'ISNA', 'IndParam', 'Indicator', 'IndicatorImp', 'JUMPDOWN', 'JUMPUP', 'KDATA', 'KDATA_PART', 'KDJ', 'KData', 'KDataDriver', 'KData_getitem', 'KData_iter', 'KData_to_df', 'KData_to_np', 'KRecord', 'KRecordList', 'LAST', 'LASTVALUE', 'LIUTONGPAN', 'LLV', 'LLVBARS', 'LN', 'LOG', 'LOG_LEVEL', 'LONGCROSS', 'LOW', 'LoanRecord', 'LoggingContext', 'MA', 'MACD', 'MAX', 'MAXYEAR', 'MDD', 'MF_EqualWeight', 'MF_ICIRWeight', 'MF_ICWeight', 'MF_Weight', 'MIN', 'MINUTE', 'MINYEAR', 'MM_FixedCapital', 'MM_FixedCapitalFunds', 'MM_FixedCount', 'MM_FixedCountTps', 'MM_FixedPercent', 'MM_FixedRisk', 'MM_FixedUnits', 'MM_Nothing', 'MM_WilliamsFixedRisk', 'MOD', 'MONTH', 'MRR', 'MailOrderBroker', 'MarketInfo', 'Microseconds', 'Milliseconds', 'Minutes', 'MoneyManagerBase', 'MultiFactorBase', 'NDAY', 'NOT', 'OFF', 'OPEN', 'OrderBrokerBase', 'OrderBrokerWrap', 'PF_Simple', 'PF_WithoutAF', 'PG_FixedHoldDays', 'PG_FixedPercent', 'PG_NoGoal', 'POS', 'POW', 'PRICELIST', 'Parameter', 'Parameter_items', 'Parameter_iter', 'Parameter_keys', 'Parameter_to_dict', 'Performance', 'Performance_to_df', 'Portfolio', 'PositionList_to_df', 'PositionList_to_np', 'PositionRecord', 'PositionRecordList', 'ProfitGoalBase', 'Query', 'RECOVER_BACKWARD', 'RECOVER_EQUAL_BACKWARD', 'RECOVER_EQUAL_FORWARD', 'RECOVER_FORWARD', 'REF', 'REPLACE', 'RESULT', 'REVERSE', 'ROC', 'ROCP', 'ROCR', 'ROCR100', 'ROUND', 'ROUNDDOWN', 'ROUNDUP', 'RSI', 'SAFTYLOSS', 'SE_Fixed', 'SE_MaxFundsOptimal', 'SE_MultiFactor', 'SE_PerformanceOptimal', 'SE_Signal', 'SGN', 'SG_Add', 'SG_AllwaysBuy', 'SG_Band', 'SG_Bool', 'SG_Buy', 'SG_Cross', 'SG_CrossGold', 'SG_Cycle', 'SG_Div', 'SG_Flex', 'SG_Mul', 'SG_OneSide', 'SG_Sell', 'SG_Single', 'SG_Single2', 'SG_Sub', 'SIN', 'SLICE', 'SLOPE', 'SMA', 'SPEARMAN', 'SP_FixedPercent', 'SP_FixedValue', 'SQRT', 'STDEV', 'STDP', 'ST_FixedPercent', 'ST_Indicator', 'ST_Saftyloss', 'SUM', 'SUMBARS', 'SYS_Simple', 'SYS_WalkForward', 'ScoreRecord', 'ScoreRecordList', 'Seconds', 'SelectorBase', 'SignalBase', 'SlippageBase', 'SpotRecord', 'Stock', 'StockManager', 'StockTypeInfo', 'StockWeight', 'StockWeightList', 'StoplossBase', 'Strategy', 'StrategyContext', 'System', 'SystemPart', 'SystemWeight', 'SystemWeightList', 'TAN', 'TA_ACCBANDS', 'TA_ACOS', 'TA_AD', 'TA_ADD', 'TA_ADOSC', 'TA_ADX', 'TA_ADXR', 'TA_APO', 'TA_AROON', 'TA_AROONOSC', 'TA_ASIN', 'TA_ATAN', 'TA_ATR', 'TA_AVGDEV', 'TA_AVGPRICE', 'TA_BBANDS', 'TA_BETA', 'TA_BOP', 'TA_CCI', 'TA_CDL2CROWS', 'TA_CDL3BLACKCROWS', 'TA_CDL3INSIDE', 'TA_CDL3LINESTRIKE', 'TA_CDL3OUTSIDE', 'TA_CDL3STARSINSOUTH', 'TA_CDL3WHITESOLDIERS', 'TA_CDLABANDONEDBABY', 'TA_CDLADVANCEBLOCK', 'TA_CDLBELTHOLD', 'TA_CDLBREAKAWAY', 'TA_CDLCLOSINGMARUBOZU', 'TA_CDLCONCEALBABYSWALL', 'TA_CDLCOUNTERATTACK', 'TA_CDLDARKCLOUDCOVER', 'TA_CDLDOJI', 'TA_CDLDOJISTAR', 'TA_CDLDRAGONFLYDOJI', 'TA_CDLENGULFING', 'TA_CDLEVENINGDOJISTAR', 'TA_CDLEVENINGSTAR', 'TA_CDLGAPSIDESIDEWHITE', 'TA_CDLGRAVESTONEDOJI', 'TA_CDLHAMMER', 'TA_CDLHANGINGMAN', 'TA_CDLHARAMI', 'TA_CDLHARAMICROSS', 'TA_CDLHIGHWAVE', 'TA_CDLHIKKAKE', 'TA_CDLHIKKAKEMOD', 'TA_CDLHOMINGPIGEON', 'TA_CDLIDENTICAL3CROWS', 'TA_CDLINNECK', 'TA_CDLINVERTEDHAMMER', 'TA_CDLKICKING', 'TA_CDLKICKINGBYLENGTH', 'TA_CDLLADDERBOTTOM', 'TA_CDLLONGLEGGEDDOJI', 'TA_CDLLONGLINE', 'TA_CDLMARUBOZU', 'TA_CDLMATCHINGLOW', 'TA_CDLMATHOLD', 'TA_CDLMORNINGDOJISTAR', 'TA_CDLMORNINGSTAR', 'TA_CDLONNECK', 'TA_CDLPIERCING', 'TA_CDLRICKSHAWMAN', 'TA_CDLRISEFALL3METHODS', 'TA_CDLSEPARATINGLINES', 'TA_CDLSHOOTINGSTAR', 'TA_CDLSHORTLINE', 'TA_CDLSPINNINGTOP', 'TA_CDLSTALLEDPATTERN', 'TA_CDLSTICKSANDWICH', 'TA_CDLTAKURI', 'TA_CDLTASUKIGAP', 'TA_CDLTHRUSTING', 'TA_CDLTRISTAR', 'TA_CDLUNIQUE3RIVER', 'TA_CDLUPSIDEGAP2CROWS', 'TA_CDLXSIDEGAP3METHODS', 'TA_CEIL', 'TA_CMO', 'TA_CORREL', 'TA_COS', 'TA_COSH', 'TA_DEMA', 'TA_DIV', 'TA_DX', 'TA_EMA', 'TA_EXP', 'TA_FLOOR', 'TA_HT_DCPERIOD', 'TA_HT_DCPHASE', 'TA_HT_PHASOR', 'TA_HT_SINE', 'TA_HT_TRENDLINE', 'TA_HT_TRENDMODE', 'TA_IMI', 'TA_KAMA', 'TA_LINEARREG', 'TA_LINEARREG_ANGLE', 'TA_LINEARREG_INTERCEPT', 'TA_LINEARREG_SLOPE', 'TA_LN', 'TA_LOG10', 'TA_MA', 'TA_MACD', 'TA_MACDEXT', 'TA_MACDFIX', 'TA_MAMA', 'TA_MAVP', 'TA_MAX', 'TA_MAXINDEX', 'TA_MEDPRICE', 'TA_MFI', 'TA_MIDPOINT', 'TA_MIDPRICE', 'TA_MIN', 'TA_MININDEX', 'TA_MINMAX', 'TA_MINMAXINDEX', 'TA_MINUS_DI', 'TA_MINUS_DM', 'TA_MOM', 'TA_MULT', 'TA_NATR', 'TA_OBV', 'TA_PLUS_DI', 'TA_PLUS_DM', 'TA_PPO', 'TA_ROC', 'TA_ROCP', 'TA_ROCR', 'TA_ROCR100', 'TA_RSI', 'TA_SAR', 'TA_SAREXT', 'TA_SIN', 'TA_SINH', 'TA_SMA', 'TA_SQRT', 'TA_STDDEV', 'TA_STOCH', 'TA_STOCHF', 'TA_STOCHRSI', 'TA_SUB', 'TA_SUM', 'TA_T3', 'TA_TAN', 'TA_TANH', 'TA_TEMA', 'TA_TRANGE', 'TA_TRIMA', 'TA_TRIX', 'TA_TSF', 'TA_TYPPRICE', 'TA_ULTOSC', 'TA_VAR', 'TA_WCLPRICE', 'TA_WILLR', 'TA_WMA', 'TC_FixedA', 'TC_FixedA2015', 'TC_FixedA2017', 'TC_TestStub', 'TC_Zero', 'TIME', 'TIMELINE', 'TIMELINEVOL', 'TRACE', 'TURNOVER', 'TestOrderBroker', 'TimeDelta', 'TimeDelta_timedelta', 'TimeLineList', 'TimeLineRecord', 'TimeLine_to_df', 'TimeLine_to_np', 'TradeCostBase', 'TradeList_to_df', 'TradeList_to_np', 'TradeManager', 'TradeRecord', 'TradeRecordList', 'TradeRequest', 'TransList', 'TransList_to_df', 'TransList_to_np', 'TransRecord', 'UPNDAY', 'UTC', 'VALUE', 'VAR', 'VARP', 'VIGOR', 'VOL', 'WARN', 'WEAVE', 'WEEK', 'WINNER', 'WMA', 'YEAR', 'ZHBOND10', 'ZONGGUBEN', 'ZSCORE', 'add_class_logger_handler', 'batch_calculate_inds', 'broker', 'broker_easytrader', 'broker_mail', 'can_upgrade', 'capture_multiprocess_all_logger', 'class_logger', 'close_ostream_to_python', 'close_spend_time', 'combinate_ind', 'combinate_index', 'concat_to_df', 'constant', 'core', 'cpp', 'crtBrokerTM', 'crtOB', 'crtSEOptimal', 'crtTM', 'crt_pf_strategy', 'crt_sys_strategy', 'date', 'datetime', 'df_to_ind', 'extend', 'find_optimal_system', 'find_optimal_system_multi', 'get_block', 'get_business_name', 'get_data_from_buffer_server', 'get_date_range', 'get_kdata', 'get_last_version', 'get_log_level', 'get_stock', 'get_system_part_enum', 'get_system_part_name', 'get_version', 'get_version_git', 'get_version_with_build', 'hikyuu_init', 'hku_catch', 'hku_check', 'hku_check_ignore', 'hku_check_throw', 'hku_debug', 'hku_debug_if', 'hku_error', 'hku_error_if', 'hku_fatal', 'hku_fatal_if', 'hku_info', 'hku_info_if', 'hku_logger', 'hku_to_async', 'hku_trace', 'hku_trace_if', 'hku_warn', 'hku_warn_if', 'in_interactive_session', 'in_ipython_frontend', 'indicator', 'indicator_getitem', 'indicator_iter', 'indicator_to_df', 'inner_analysis_sys_list', 'inner_combinate_ind_analysis', 'inner_combinate_ind_analysis_with_block', 'isinf', 'isnan', 'list_getitem', 'new_Query_init', 'np', 'old_Query_init', 'open_ostream_to_python', 'open_spend_time', 'os', 'pd', 'pickle', 'pyind', 'roundDown', 'roundEx', 'roundUp', 'run_in_strategy', 'set_log_level', 'set_my_logger_file', 'set_python_in_interactive', 'set_python_in_jupyter', 'spend_time', 'start_spot_agent', 'stop_spot_agent', 'sys', 'talib_wrap', 'time', 'timedelta', 'timeout', 'timezone', 'toPriceList', 'traceback', 'trade', 'tzinfo', 'util', 'with_trace']
|
|
566
571
|
AMO: hikyuu.cpp.core312.Indicator # value = Indicator{...
|
|
567
572
|
CLOSE: hikyuu.cpp.core312.Indicator # value = Indicator{...
|
|
568
573
|
DEBUG: hikyuu.cpp.core312.LOG_LEVEL # value = <LOG_LEVEL.DEBUG: 1>
|