hikyuu 2.3.0__py3-none-win_amd64.whl → 2.5.0__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 +438 -6
- hikyuu/__init__.pyi +791 -0
- hikyuu/analysis/__init__.pyi +487 -0
- hikyuu/analysis/analysis.pyi +517 -0
- hikyuu/core.pyi +482 -0
- hikyuu/cpp/__init__.pyi +3 -0
- hikyuu/cpp/boost_date_time-mt.dll +0 -0
- hikyuu/cpp/boost_serialization-mt.dll +0 -0
- hikyuu/cpp/boost_wserialization-mt.dll +0 -0
- hikyuu/cpp/core310.pyd +0 -0
- hikyuu/cpp/core311.pyd +0 -0
- hikyuu/cpp/core312.pyd +0 -0
- hikyuu/cpp/core312.pyi +12867 -0
- hikyuu/cpp/core313.pyd +0 -0
- hikyuu/cpp/core38.pyd +0 -0
- hikyuu/cpp/core39.pyd +0 -0
- hikyuu/cpp/hikyuu.dll +0 -0
- hikyuu/cpp/hikyuu.lib +0 -0
- hikyuu/cpp/sqlite3.dll +0 -0
- hikyuu/data/common_mysql.py +24 -7
- hikyuu/data/common_pytdx.py +17 -1
- hikyuu/data/em_block_to_mysql.py +3 -2
- hikyuu/data/em_block_to_sqlite.py +8 -3
- hikyuu/data/mysql_upgrade/0025.sql +61 -0
- hikyuu/data/mysql_upgrade/0026.sql +9 -0
- hikyuu/data/sqlite_upgrade/0025.sql +63 -0
- hikyuu/data/sqlite_upgrade/0026.sql +10 -0
- hikyuu/draw/__init__.pyi +35 -0
- hikyuu/draw/drawplot/__init__.py +3 -0
- hikyuu/draw/drawplot/__init__.pyi +134 -0
- hikyuu/draw/drawplot/bokeh_draw.pyi +796 -0
- hikyuu/draw/drawplot/common.pyi +10 -0
- hikyuu/draw/drawplot/echarts_draw.py +219 -24
- hikyuu/draw/drawplot/echarts_draw.pyi +682 -0
- hikyuu/draw/drawplot/matplotlib_draw.py +18 -3
- hikyuu/draw/drawplot/matplotlib_draw.pyi +1101 -0
- hikyuu/draw/elder.pyi +44 -0
- hikyuu/draw/kaufman.pyi +38 -0
- hikyuu/draw/volume.pyi +31 -0
- hikyuu/examples/notebook/Demo/Demo2.ipynb +1 -1
- hikyuu/extend.py +9 -3
- hikyuu/extend.pyi +636 -0
- hikyuu/fetcher/stock/zh_block_em.py +118 -51
- hikyuu/gui/data/EscapetimeThread.py +4 -4
- hikyuu/gui/data/ImportBlockInfoTask.py +3 -2
- hikyuu/gui/data/ImportHistoryFinanceTask.py +2 -0
- hikyuu/gui/data/MainWindow.py +48 -42
- hikyuu/gui/importdata.py +13 -26
- hikyuu/hub.py +2 -4
- hikyuu/hub.pyi +254 -0
- hikyuu/include/hikyuu/DataType.h +5 -0
- hikyuu/include/hikyuu/Stock.h +7 -0
- hikyuu/include/hikyuu/indicator/Indicator.h +8 -1
- hikyuu/include/hikyuu/indicator/Indicator2InImp.h +65 -0
- hikyuu/include/hikyuu/indicator/IndicatorImp.h +4 -3
- hikyuu/include/hikyuu/indicator/build_in.h +12 -0
- hikyuu/include/hikyuu/indicator/crt/ADVANCE.h +3 -1
- hikyuu/include/hikyuu/indicator/crt/CONTEXT.h +2 -2
- hikyuu/include/hikyuu/indicator/crt/CORR.h +4 -2
- hikyuu/include/hikyuu/indicator/crt/COST.h +3 -0
- hikyuu/include/hikyuu/indicator/crt/CYCLE.h +24 -0
- hikyuu/include/hikyuu/indicator/crt/DECLINE.h +3 -1
- hikyuu/include/hikyuu/indicator/crt/DISCARD.h +27 -0
- hikyuu/include/hikyuu/indicator/crt/DMA.h +2 -1
- hikyuu/include/hikyuu/indicator/crt/HSL.h +1 -13
- hikyuu/include/hikyuu/indicator/crt/INBLOCK.h +31 -0
- hikyuu/include/hikyuu/indicator/crt/INDEX.h +60 -0
- hikyuu/include/hikyuu/indicator/crt/INSUM.h +5 -2
- hikyuu/include/hikyuu/indicator/crt/ISINF.h +28 -0
- hikyuu/include/hikyuu/indicator/crt/ISINFA.h +28 -0
- hikyuu/include/hikyuu/indicator/crt/ISNA.h +29 -0
- hikyuu/include/hikyuu/indicator/crt/JUMPDOWN.h +24 -0
- hikyuu/include/hikyuu/indicator/crt/JUMPUP.h +24 -0
- hikyuu/include/hikyuu/indicator/crt/LASTVALUE.h +29 -0
- hikyuu/include/hikyuu/indicator/crt/LIUTONGPAN.h +1 -0
- hikyuu/include/hikyuu/indicator/crt/REPLACE.h +29 -0
- hikyuu/include/hikyuu/indicator/crt/SPEARMAN.h +3 -2
- hikyuu/include/hikyuu/indicator/crt/WINNER.h +38 -0
- hikyuu/include/hikyuu/indicator/imp/IContext.h +1 -1
- hikyuu/include/hikyuu/indicator/imp/ICorr.h +7 -22
- hikyuu/include/hikyuu/indicator/imp/ICost.h +31 -0
- hikyuu/include/hikyuu/indicator/imp/ICycle.h +30 -0
- hikyuu/include/hikyuu/indicator/imp/IDiscard.h +28 -0
- hikyuu/include/hikyuu/indicator/imp/IDma.h +7 -24
- hikyuu/include/hikyuu/indicator/imp/IHsl.h +30 -0
- hikyuu/include/hikyuu/indicator/imp/IInBlock.h +30 -0
- hikyuu/include/hikyuu/indicator/imp/IIndex.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/IIsInf.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/IIsInfa.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/IIsNa.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/IJumpDown.h +24 -0
- hikyuu/include/hikyuu/indicator/imp/IJumpUp.h +24 -0
- hikyuu/include/hikyuu/indicator/imp/ILastValue.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/IReplace.h +26 -0
- hikyuu/include/hikyuu/indicator/imp/ISpearman.h +6 -21
- hikyuu/include/hikyuu/indicator/imp/IWinner.h +26 -0
- hikyuu/include/hikyuu/indicator_talib/imp/TaMavp.h +6 -20
- hikyuu/include/hikyuu/indicator_talib/imp/ta_defines.h +14 -65
- hikyuu/include/hikyuu/indicator_talib/imp/ta_imp.h +54 -90
- hikyuu/include/hikyuu/indicator_talib/ta_crt.h +11 -9
- hikyuu/include/hikyuu/strategy/RunPortfolioInStrategy.h +3 -4
- hikyuu/include/hikyuu/strategy/Strategy.h +4 -5
- hikyuu/include/hikyuu/trade_manage/TradeRecord.h +5 -1
- hikyuu/include/hikyuu/trade_sys/allocatefunds/build_in.h +1 -0
- hikyuu/include/hikyuu/trade_sys/allocatefunds/crt/AF_FixedWeightList.h +22 -0
- hikyuu/include/hikyuu/trade_sys/allocatefunds/imp/FixedWeightListAllocateFunds.h +25 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/MoneyManagerBase.h +17 -4
- hikyuu/include/hikyuu/trade_sys/moneymanager/build_in.h +2 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedCapital.h +6 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedCapitalFunds.h +26 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedCountTps.h +27 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedRisk.h +6 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_FixedUnits.h +6 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/crt/MM_WilliamsFixedRisk.h +7 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/imp/FixedCapitalFundsMM.h +28 -0
- hikyuu/include/hikyuu/trade_sys/moneymanager/imp/FixedCountTpsMM.h +44 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/build_in.h +1 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_Weight.h +30 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/imp/WeightMultiFactor.h +41 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +38 -37
- hikyuu/include/hikyuu/trade_sys/portfolio/build_in.h +1 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/crt/PF_Simple.h +25 -1
- hikyuu/include/hikyuu/trade_sys/portfolio/crt/PF_WithoutAF.h +50 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/imp/SimplePortfolio.h +53 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/imp/WithoutAFPortfolio.h +57 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector.h +7 -0
- hikyuu/include/hikyuu/trade_sys/signal/SignalBase.h +51 -5
- hikyuu/include/hikyuu/trade_sys/signal/build_in.h +2 -0
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_Bool.h +2 -1
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_Logic.h +37 -0
- hikyuu/include/hikyuu/trade_sys/signal/crt/SG_OneSide.h +28 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/OneSideSignal.h +46 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/AddSignal.h +19 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/AddValueSignal.h +19 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/DivSignal.h +19 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/DivValueSignal.h +22 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/MulSignal.h +19 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/MulValueSignal.h +19 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorSignal.h +68 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorValueSignal.h +67 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/SubSignal.h +19 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/SubValueSignal.h +22 -0
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/stoploss/crt/ST_Indicator.h +1 -1
- hikyuu/include/hikyuu/trade_sys/stoploss/imp/IndicatorStoploss.h +3 -4
- hikyuu/include/hikyuu/utilities/FilterNode.h +2 -2
- hikyuu/include/hikyuu/utilities/Log.h +42 -15
- hikyuu/include/hikyuu/utilities/datetime/Datetime.h +1 -1
- hikyuu/include/hikyuu/utilities/datetime/TimeDelta.h +2 -2
- hikyuu/include/hikyuu/utilities/db_connect/DBCondition.h +4 -0
- hikyuu/include/hikyuu/utilities/db_connect/SQLResultSet.h +2 -2
- hikyuu/include/hikyuu/utilities/db_connect/mysql/MySQLConnect.h +5 -1
- hikyuu/include/hikyuu/utilities/node/NodeServer.h +4 -4
- hikyuu/include/hikyuu/utilities/thread/MQStealThreadPool.h +2 -2
- hikyuu/include/hikyuu/utilities/thread/MQThreadPool.h +2 -2
- hikyuu/include/hikyuu/utilities/thread/StealThreadPool.h +5 -5
- hikyuu/include/hikyuu/utilities/thread/ThreadPool.h +2 -2
- hikyuu/include/hikyuu/utilities/thread/algorithm.h +16 -10
- hikyuu/include/hikyuu/version.h +4 -4
- hikyuu/indicator/indicator.py +1 -0
- hikyuu/interactive.py +3 -266
- hikyuu/trade_manage/__init__.pyi +584 -0
- hikyuu/trade_manage/broker.pyi +54 -0
- hikyuu/trade_manage/broker_easytrader.pyi +21 -0
- hikyuu/trade_manage/broker_mail.pyi +55 -0
- hikyuu/trade_manage/trade.pyi +590 -0
- hikyuu/util/__init__.pyi +55 -0
- hikyuu/util/check.pyi +59 -0
- hikyuu/util/mylog.pyi +70 -0
- hikyuu/util/notebook.pyi +23 -0
- hikyuu/util/singleton.pyi +18 -0
- hikyuu/util/slice.pyi +8 -0
- {hikyuu-2.3.0.dist-info → hikyuu-2.5.0.dist-info}/METADATA +3 -2
- {hikyuu-2.3.0.dist-info → hikyuu-2.5.0.dist-info}/RECORD +178 -95
- {hikyuu-2.3.0.dist-info → hikyuu-2.5.0.dist-info}/top_level.txt +1 -0
- hikyuu/deprecated.py +0 -651
- {hikyuu-2.3.0.dist-info → hikyuu-2.5.0.dist-info}/LICENSE +0 -0
- {hikyuu-2.3.0.dist-info → hikyuu-2.5.0.dist-info}/WHEEL +0 -0
- {hikyuu-2.3.0.dist-info → hikyuu-2.5.0.dist-info}/entry_points.txt +0 -0
hikyuu/util/__init__.pyi
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
import asyncio as asyncio
|
|
3
|
+
import ctypes as ctypes
|
|
4
|
+
import functools as functools
|
|
5
|
+
from hikyuu.util.check import HKUCheckError
|
|
6
|
+
from hikyuu.util.check import HKUIngoreError
|
|
7
|
+
from hikyuu.util.check import checkif
|
|
8
|
+
from hikyuu.util.check import get_exception_info
|
|
9
|
+
from hikyuu.util.check import hku_catch
|
|
10
|
+
from hikyuu.util.check import hku_check
|
|
11
|
+
from hikyuu.util.check import hku_check_ignore
|
|
12
|
+
from hikyuu.util.check import hku_check_throw
|
|
13
|
+
from hikyuu.util.check import hku_to_async
|
|
14
|
+
from hikyuu.util.mylog import LoggingContext
|
|
15
|
+
from hikyuu.util.mylog import add_class_logger_handler
|
|
16
|
+
from hikyuu.util.mylog import capture_multiprocess_all_logger
|
|
17
|
+
from hikyuu.util.mylog import class_logger
|
|
18
|
+
from hikyuu.util.mylog import get_default_logger
|
|
19
|
+
from hikyuu.util.mylog import hku_debug as hku_trace
|
|
20
|
+
from hikyuu.util.mylog import hku_debug
|
|
21
|
+
from hikyuu.util.mylog import hku_debug_if as hku_trace_if
|
|
22
|
+
from hikyuu.util.mylog import hku_debug_if
|
|
23
|
+
from hikyuu.util.mylog import hku_error
|
|
24
|
+
from hikyuu.util.mylog import hku_error_if
|
|
25
|
+
from hikyuu.util.mylog import hku_fatal
|
|
26
|
+
from hikyuu.util.mylog import hku_fatal_if
|
|
27
|
+
from hikyuu.util.mylog import hku_info
|
|
28
|
+
from hikyuu.util.mylog import hku_info_if
|
|
29
|
+
from hikyuu.util.mylog import hku_warn
|
|
30
|
+
from hikyuu.util.mylog import hku_warn_if
|
|
31
|
+
from hikyuu.util.mylog import set_my_logger_file
|
|
32
|
+
from hikyuu.util.mylog import spend_time
|
|
33
|
+
from hikyuu.util.mylog import with_trace
|
|
34
|
+
from hikyuu.util.notebook import in_interactive_session
|
|
35
|
+
from hikyuu.util.notebook import in_ipython_frontend
|
|
36
|
+
from hikyuu.util.timeout import TerminableThread
|
|
37
|
+
from hikyuu.util.timeout import ThreadKiller
|
|
38
|
+
from hikyuu.util.timeout import timeout
|
|
39
|
+
import logging as logging
|
|
40
|
+
import multiprocessing as multiprocessing
|
|
41
|
+
import os as os
|
|
42
|
+
import sys as sys
|
|
43
|
+
import threading as threading
|
|
44
|
+
import time as time
|
|
45
|
+
import traceback as traceback
|
|
46
|
+
from . import check
|
|
47
|
+
from . import mylog
|
|
48
|
+
from . import notebook
|
|
49
|
+
from . import singleton
|
|
50
|
+
from . import slice
|
|
51
|
+
__all__: list = ['spend_time', 'timeout', 'hku_logger', 'class_logger', 'add_class_logger_handler', 'HKUCheckError', 'hku_check', 'hku_check_throw', 'hku_check_ignore', 'hku_catch', 'hku_to_async', 'hku_trace', 'hku_debug', 'hku_info', 'hku_warn', 'hku_error', 'hku_fatal', 'hku_trace_if', 'hku_debug_if', 'hku_info_if', 'hku_warn_if', 'hku_info_if', 'hku_warn_if', 'hku_error_if', 'hku_fatal_if', 'with_trace', 'set_my_logger_file', 'capture_multiprocess_all_logger', 'LoggingContext', 'in_interactive_session', 'in_ipython_frontend']
|
|
52
|
+
FORMAT: str = '%(asctime)-15s [%(levelname)s] %(message)s [%(name)s::%(funcName)s]'
|
|
53
|
+
g_hku_logger_lock: multiprocessing.synchronize.Lock # value = <Lock(owner=None)>
|
|
54
|
+
hku_logger: logging.Logger # value = <Logger hikyuu (INFO)>
|
|
55
|
+
hku_logger_name: str = 'hikyuu'
|
hikyuu/util/check.pyi
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
import asyncio as asyncio
|
|
3
|
+
import functools as functools
|
|
4
|
+
import logging
|
|
5
|
+
import multiprocessing.synchronize
|
|
6
|
+
import sys as sys
|
|
7
|
+
import traceback as traceback
|
|
8
|
+
__all__ = ['HKUCheckError', 'HKUIngoreError', 'asyncio', 'checkif', 'functools', 'g_hku_logger_lock', 'get_exception_info', 'hku_catch', 'hku_check', 'hku_check_ignore', 'hku_check_throw', 'hku_logger', 'hku_to_async', 'sys', 'traceback']
|
|
9
|
+
class HKUCheckError(Exception):
|
|
10
|
+
def __init__(self, expression, message):
|
|
11
|
+
...
|
|
12
|
+
def __str__(self):
|
|
13
|
+
...
|
|
14
|
+
class HKUIngoreError(Exception):
|
|
15
|
+
def __init__(self, expression, message = None):
|
|
16
|
+
...
|
|
17
|
+
def __str__(self):
|
|
18
|
+
...
|
|
19
|
+
def checkif(expression, message, excepion = None, **kwargs):
|
|
20
|
+
"""
|
|
21
|
+
如果 expression 为 True,则抛出异常。注意:该函数的判定和 assert 是相反的。
|
|
22
|
+
|
|
23
|
+
:param boolean expression: 判断条件
|
|
24
|
+
:param str message: 异常注解信息
|
|
25
|
+
:param Exception exception: 指定的异常类,为None时,为默认 HKUCheckError 异常
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
def get_exception_info():
|
|
29
|
+
...
|
|
30
|
+
def hku_catch(ret = None, trace = False, callback = None, retry = 1, with_msg = False, re_raise = False):
|
|
31
|
+
"""
|
|
32
|
+
捕获发生的异常, 包装方式: @hku_catch()
|
|
33
|
+
:param ret: 异常发生时返回值, with_msg为True时, 返回为 (ret, errmsg)
|
|
34
|
+
:param boolean trace: 打印异常堆栈信息
|
|
35
|
+
:param func callback: 发生异常后的回调函数, 入参同func
|
|
36
|
+
:param int retry: 尝试执行的次数
|
|
37
|
+
:param boolean with_msg: 是否返回异常错误信息, 为True时, 函数返回为 (ret, errmsg)
|
|
38
|
+
:param boolean re_raise: 是否将错误信息以异常的方式重新抛出
|
|
39
|
+
|
|
40
|
+
"""
|
|
41
|
+
def hku_check(exp, msg, *args, **kwargs):
|
|
42
|
+
...
|
|
43
|
+
def hku_check_ignore(exp, *args, **kwargs):
|
|
44
|
+
"""
|
|
45
|
+
可忽略的检查
|
|
46
|
+
"""
|
|
47
|
+
def hku_check_throw(expression, message, excepion = None, **kwargs):
|
|
48
|
+
"""
|
|
49
|
+
如果 expression 为 False,则抛出异常。
|
|
50
|
+
|
|
51
|
+
:param boolean expression: 判断条件
|
|
52
|
+
:param str message: 异常注解信息
|
|
53
|
+
:param Exception exception: 指定的异常类,为None时,为默认 HKUCheckError 异常
|
|
54
|
+
|
|
55
|
+
"""
|
|
56
|
+
def hku_to_async(func):
|
|
57
|
+
...
|
|
58
|
+
g_hku_logger_lock: multiprocessing.synchronize.Lock # value = <Lock(owner=None)>
|
|
59
|
+
hku_logger: logging.Logger # value = <Logger hikyuu (INFO)>
|
hikyuu/util/mylog.pyi
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
import functools as functools
|
|
3
|
+
import logging as logging
|
|
4
|
+
import multiprocessing as multiprocessing
|
|
5
|
+
import os as os
|
|
6
|
+
import time as time
|
|
7
|
+
import traceback as traceback
|
|
8
|
+
__all__ = ['FORMAT', 'LoggingContext', 'add_class_logger_handler', 'capture_multiprocess_all_logger', 'class_logger', 'functools', 'g_hku_logger_lock', 'get_default_logger', 'hku_debug', 'hku_debug_if', 'hku_error', 'hku_error_if', 'hku_fatal', 'hku_fatal_if', 'hku_info', 'hku_info_if', 'hku_logger', 'hku_logger_name', 'hku_trace', 'hku_trace_if', 'hku_warn', 'hku_warn_if', 'logging', 'multiprocessing', 'os', 'set_my_logger_file', 'spend_time', 'time', 'traceback', 'with_trace']
|
|
9
|
+
class LoggingContext:
|
|
10
|
+
def __enter__(self):
|
|
11
|
+
...
|
|
12
|
+
def __exit__(self, et, ev, tb):
|
|
13
|
+
...
|
|
14
|
+
def __init__(self, logger, level = None, handler = None, close = True):
|
|
15
|
+
...
|
|
16
|
+
def add_class_logger_handler(class_list, level = 20, handler = None):
|
|
17
|
+
"""
|
|
18
|
+
为指定的类增加日志 handler,并设定级别
|
|
19
|
+
|
|
20
|
+
:param class_list: 类列表
|
|
21
|
+
:param level: 日志级别
|
|
22
|
+
:param handler: logging handler
|
|
23
|
+
|
|
24
|
+
"""
|
|
25
|
+
def capture_multiprocess_all_logger(queue, level = None):
|
|
26
|
+
"""
|
|
27
|
+
重设所有子进程中的 logger 输出指定的 queue,并重设level
|
|
28
|
+
|
|
29
|
+
@param multiprocessing.Queue queue 指定的 mp Queue
|
|
30
|
+
@param level 日志输出等级, None为保持原有等级
|
|
31
|
+
|
|
32
|
+
"""
|
|
33
|
+
def class_logger(cls, enable = False):
|
|
34
|
+
...
|
|
35
|
+
def get_default_logger():
|
|
36
|
+
...
|
|
37
|
+
def hku_debug(msg, *args, **kwargs):
|
|
38
|
+
...
|
|
39
|
+
def hku_debug_if(exp, msg, *args, **kwargs):
|
|
40
|
+
...
|
|
41
|
+
def hku_error(msg, *args, **kwargs):
|
|
42
|
+
...
|
|
43
|
+
def hku_error_if(exp, msg, *args, **kwargs):
|
|
44
|
+
...
|
|
45
|
+
def hku_fatal(msg, *args, **kwargs):
|
|
46
|
+
...
|
|
47
|
+
def hku_fatal_if(exp, msg, *args, **kwargs):
|
|
48
|
+
...
|
|
49
|
+
def hku_info(msg, *args, **kwargs):
|
|
50
|
+
...
|
|
51
|
+
def hku_info_if(exp, msg, *args, **kwargs):
|
|
52
|
+
...
|
|
53
|
+
def hku_warn(msg, *args, **kwargs):
|
|
54
|
+
...
|
|
55
|
+
def hku_warn_if(exp, msg, *args, **kwargs):
|
|
56
|
+
...
|
|
57
|
+
def set_my_logger_file(file_name):
|
|
58
|
+
...
|
|
59
|
+
def spend_time(func):
|
|
60
|
+
...
|
|
61
|
+
def with_trace(level = 20):
|
|
62
|
+
...
|
|
63
|
+
FORMAT: str = '%(asctime)-15s [%(levelname)s] %(message)s [%(name)s::%(funcName)s]'
|
|
64
|
+
_logfile: logging.handlers.RotatingFileHandler # value = <RotatingFileHandler C:\Users\admin\.hikyuu\hikyuu_py.log (WARNING)>
|
|
65
|
+
_usrdir: str = 'C:\\Users\\admin'
|
|
66
|
+
g_hku_logger_lock: multiprocessing.synchronize.Lock # value = <Lock(owner=None)>
|
|
67
|
+
hku_logger: logging.Logger # value = <Logger hikyuu (INFO)>
|
|
68
|
+
hku_logger_name: str = 'hikyuu'
|
|
69
|
+
hku_trace = hku_debug
|
|
70
|
+
hku_trace_if = hku_debug_if
|
hikyuu/util/notebook.pyi
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
__all__ = ['in_interactive_session', 'in_ipython_frontend']
|
|
3
|
+
def in_interactive_session() -> bool:
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
Check if we're running in an interactive shell.
|
|
7
|
+
|
|
8
|
+
Returns
|
|
9
|
+
-------
|
|
10
|
+
bool
|
|
11
|
+
True if running under python/ipython interactive shell.
|
|
12
|
+
|
|
13
|
+
"""
|
|
14
|
+
def in_ipython_frontend() -> bool:
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
Check if we're inside an IPython zmq frontend. 检测是否在 jupyter 环境中
|
|
18
|
+
|
|
19
|
+
Returns
|
|
20
|
+
-------
|
|
21
|
+
bool
|
|
22
|
+
|
|
23
|
+
"""
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
import threading as threading
|
|
3
|
+
import typing
|
|
4
|
+
__all__ = ['SingletonType', 'threading']
|
|
5
|
+
class SingletonType(type):
|
|
6
|
+
"""
|
|
7
|
+
基于 metalclass 实现单例
|
|
8
|
+
|
|
9
|
+
示例:
|
|
10
|
+
class MyClass(metaclass=SingletonType):
|
|
11
|
+
def __init__(self,name):
|
|
12
|
+
self.name = name
|
|
13
|
+
|
|
14
|
+
"""
|
|
15
|
+
_instance_lock: typing.ClassVar[_thread.lock] # value = <unlocked _thread.lock object at 0x0000024738CD4780>
|
|
16
|
+
@classmethod
|
|
17
|
+
def __call__(cls, *args, **kwargs):
|
|
18
|
+
...
|
hikyuu/util/slice.pyi
ADDED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hikyuu
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.5.0
|
|
4
4
|
Summary: Hikyuu Quant Framework for System Trading Analysis and backtester
|
|
5
5
|
Home-page: http://hikyuu.org/
|
|
6
6
|
Author: fasiondog
|
|
@@ -28,7 +28,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
29
29
|
License-File: LICENSE
|
|
30
30
|
Requires-Dist: click
|
|
31
|
-
Requires-Dist: numpy
|
|
31
|
+
Requires-Dist: numpy
|
|
32
32
|
Requires-Dist: matplotlib
|
|
33
33
|
Requires-Dist: pandas>=0.17.1
|
|
34
34
|
Requires-Dist: pytdx
|
|
@@ -148,3 +148,4 @@ Hikyuu直接依赖以下开源项目(由以下项目间接依赖的项目未
|
|
|
148
148
|
| pybind11 | [https://github.com/pybind/pybind11](https://github.com/pybind/pybind11) | [pybind11 license](https://github.com/pybind/pybind11?tab=License-1-ov-file#readme) |
|
|
149
149
|
| gzip-hpp | [https://github.com/mapbox/gzip-hpp](https://github.com/mapbox/gzip-hpp) | BSD-2-Clause license |
|
|
150
150
|
| doctest | [https://github.com/doctest/doctest](https://github.com/doctest/doctest) | MIT |
|
|
151
|
+
| ta-lib | [https://github.com/TA-Lib/ta-lib.git]() | BSD-3-Clause license |
|