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/trade_manage/broker.pyi
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
-
import hikyuu.cpp.
|
|
3
|
-
from hikyuu.cpp.
|
|
2
|
+
import hikyuu.cpp.core313
|
|
3
|
+
from hikyuu.cpp.core313 import OrderBrokerBase
|
|
4
4
|
from hikyuu.util.mylog import hku_error
|
|
5
5
|
import json as json
|
|
6
|
+
import typing
|
|
6
7
|
__all__ = ['OrderBrokerBase', 'OrderBrokerWrap', 'TestOrderBroker', 'crtOB', 'hku_error', 'json']
|
|
7
|
-
class OrderBrokerWrap(hikyuu.cpp.
|
|
8
|
+
class OrderBrokerWrap(hikyuu.cpp.core313.OrderBrokerBase):
|
|
8
9
|
"""
|
|
9
10
|
订单代理包装类,用户可以参考自定义自己的订单代理,加入额外的处理
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
包装只有买卖操作参数只有(code, price, num)的交易接口类
|
|
12
12
|
"""
|
|
13
|
+
__firstlineno__: typing.ClassVar[int] = 37
|
|
14
|
+
__static_attributes__: typing.ClassVar[tuple] = ('_broker')
|
|
13
15
|
def __init__(self, broker, name):
|
|
14
16
|
"""
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
订单代理包装类,用户可以参考自定义自己的订单代理,加入额外的处理
|
|
18
19
|
"""
|
|
19
20
|
def _buy(self, datetime, market, code, price, num, stoploss, goal_price, part_from, remark = ''):
|
|
20
21
|
"""
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
实现 OrderBrokerBase 的 _buy 接口
|
|
24
|
+
:param str market: 证券市场
|
|
25
|
+
:param str code: 证券代码
|
|
26
|
+
:param float price: 买入价格
|
|
27
|
+
:param int num: 买入数量
|
|
28
28
|
"""
|
|
29
29
|
def _get_asset_info(self):
|
|
30
30
|
...
|
|
@@ -36,6 +36,8 @@ class TestOrderBroker:
|
|
|
36
36
|
"""
|
|
37
37
|
用于测试的订单代理,仅在执行买入/卖出时打印信息
|
|
38
38
|
"""
|
|
39
|
+
__firstlineno__: typing.ClassVar[int] = 74
|
|
40
|
+
__static_attributes__: typing.ClassVar[tuple] = tuple()
|
|
39
41
|
def __init__(self):
|
|
40
42
|
...
|
|
41
43
|
def buy(self, market, code, price, num, stoploss, goal_price, part_from, remark = ''):
|
|
@@ -45,10 +47,9 @@ class TestOrderBroker:
|
|
|
45
47
|
def crtOB(broker, name = 'NO_NAME'):
|
|
46
48
|
"""
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
快速生成订单代理包装对象
|
|
49
51
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
:param broker: 订单代理示例,必须拥有buy和sell方法,并且参数为 code, price, num
|
|
53
|
+
:param float slip: 如果当前的卖一价格和指示买入的价格绝对差值不超过slip则下单,
|
|
54
|
+
否则忽略; 对卖出操作无效,立即以当前价卖出
|
|
54
55
|
"""
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
-
from hikyuu.cpp.
|
|
2
|
+
from hikyuu.cpp.core313 import Datetime
|
|
3
3
|
from hikyuu.util.mylog import hku_info
|
|
4
|
+
import typing
|
|
4
5
|
__all__ = ['Datetime', 'EasyTraderOrderBroker', 'hku_info']
|
|
5
6
|
class EasyTraderOrderBroker:
|
|
6
7
|
"""
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
使用华泰客户端实例
|
|
10
|
+
注意:buy|sell 中已屏蔽实际通过easytrade下单,防止调试误操作,请自行根据需要打开
|
|
11
11
|
"""
|
|
12
|
+
__firstlineno__: typing.ClassVar[int] = 10
|
|
13
|
+
__static_attributes__: typing.ClassVar[tuple] = ('buffer', 'user')
|
|
12
14
|
def __init__(self, user):
|
|
13
15
|
...
|
|
14
16
|
def buy(self, market, code, price, num, stoploss, goal_price, part_from, remark = ''):
|
|
@@ -2,54 +2,52 @@ from __future__ import annotations
|
|
|
2
2
|
from email.header import Header
|
|
3
3
|
from email.mime.text import MIMEText
|
|
4
4
|
import smtplib as smtplib
|
|
5
|
+
import typing
|
|
5
6
|
__all__ = ['Header', 'MIMEText', 'MailOrderBroker', 'smtplib']
|
|
6
7
|
class MailOrderBroker:
|
|
7
8
|
"""
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
邮件订单代理
|
|
11
11
|
"""
|
|
12
|
+
__firstlineno__: typing.ClassVar[int] = 37
|
|
13
|
+
__static_attributes__: typing.ClassVar[tuple] = ('_host', '_pwd', '_receivers', '_sender')
|
|
12
14
|
def __init__(self, host, sender, pwd, receivers):
|
|
13
15
|
"""
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
邮件订单代理,执行买入/卖出操作时发送 Email
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
:param str host: smtp服务器地址
|
|
20
|
+
:param int port: smtp服务器端口
|
|
21
|
+
:param str sender: 发件邮箱(既用户名)
|
|
22
|
+
:param str pwd: 密码
|
|
23
|
+
:param list receivers: 接受者邮箱列表
|
|
23
24
|
"""
|
|
24
25
|
def _sendmail(self, title, msg):
|
|
25
26
|
"""
|
|
26
27
|
发送邮件
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
:param str title: 邮件标题
|
|
30
|
+
:param str msg: 邮件内容
|
|
31
31
|
"""
|
|
32
32
|
def buy(self, market, code, price, num, stoploss, goal_price, part_from, remark = ''):
|
|
33
33
|
"""
|
|
34
34
|
执行买入操作,向指定的邮箱发送邮件,格式如下::
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
邮件标题:【Hkyuu提醒】买入 证券代码
|
|
37
|
+
邮件内容:买入:证券代码,价格:买入的价格,数量:买入数量
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
:param str code: 证券代码
|
|
40
|
+
:param float price: 买入价格
|
|
41
|
+
:param int num: 买入数量
|
|
43
42
|
"""
|
|
44
43
|
def sell(self, market, code, price, num, stoploss, goal_price, part_from, remark = ''):
|
|
45
44
|
"""
|
|
46
45
|
执行卖出操作,向指定的邮箱发送邮件,格式如下::
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
邮件标题:【Hkyuu提醒】卖出 证券代码
|
|
48
|
+
邮件内容:卖出:证券代码,价格:卖出的价格,数量:卖出数量
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
:param str code: 证券代码
|
|
51
|
+
:param float price: 卖出价格
|
|
52
|
+
:param int num: 卖出数量
|
|
55
53
|
"""
|
hikyuu/trade_manage/trade.py
CHANGED
|
@@ -36,10 +36,16 @@ import pandas as pd
|
|
|
36
36
|
|
|
37
37
|
TradeRecordList.to_np = lambda self: trades_to_np(self)
|
|
38
38
|
TradeRecordList.to_df = lambda self: trades_to_df(self)
|
|
39
|
+
TradeRecordList.to_numpy = TradeRecordList.to_np
|
|
40
|
+
TradeRecordList.to_pandas = TradeRecordList.to_df
|
|
41
|
+
TradeRecordList.to_pyarrow = lambda self: trades_to_pa(self)
|
|
39
42
|
|
|
40
43
|
|
|
41
44
|
PositionRecordList.to_np = lambda self: positions_to_np(self)
|
|
42
45
|
PositionRecordList.to_df = lambda self: positions_to_df(self)
|
|
46
|
+
PositionRecordList.to_numpy = PositionRecordList.to_np
|
|
47
|
+
PositionRecordList.to_pandas = PositionRecordList.to_df
|
|
48
|
+
PositionRecordList.to_pyarrow = lambda self: positions_to_pa(self)
|
|
43
49
|
|
|
44
50
|
|
|
45
51
|
def Performance_to_df(per):
|