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/draw/elder.pyi
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""
|
|
2
|
+
|
|
3
|
+
绘制亚历山大.艾尔德交易系统图形
|
|
4
|
+
参见:《走进我的交易室》(2007年 地震出版社) Alexander Elder
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
import hikyuu.cpp.core312
|
|
8
|
+
from hikyuu.cpp.core312 import CVAL
|
|
9
|
+
from hikyuu.cpp.core312 import EMA
|
|
10
|
+
from hikyuu.cpp.core312 import Indicator
|
|
11
|
+
from hikyuu.cpp.core312 import MACD
|
|
12
|
+
from hikyuu.cpp.core312 import PRICELIST
|
|
13
|
+
from hikyuu.cpp.core312 import Query
|
|
14
|
+
from hikyuu.cpp.core312 import SAFTYLOSS
|
|
15
|
+
from hikyuu.cpp.core312 import VIGOR
|
|
16
|
+
from hikyuu.draw.drawplot import adjust_axes_show
|
|
17
|
+
from hikyuu.draw.drawplot import ax_draw_macd2
|
|
18
|
+
from hikyuu.draw.drawplot import ax_set_locator_formatter
|
|
19
|
+
from hikyuu.draw.drawplot import create_figure
|
|
20
|
+
from hikyuu.draw.drawplot import show_gcf
|
|
21
|
+
from matplotlib.pyplot import plot
|
|
22
|
+
from numpy import mean
|
|
23
|
+
__all__ = ['CLOSE', 'CVAL', 'EMA', 'Indicator', 'MACD', 'PRICELIST', 'Query', 'SAFTYLOSS', 'VIGOR', 'adjust_axes_show', 'ax_draw_macd2', 'ax_set_locator_formatter', 'constant', 'create_figure', 'draw', 'mean', 'plot', 'show_gcf']
|
|
24
|
+
def _draw_ema_pipe(axes, kdata, ema, n = 22, w = 0.1):
|
|
25
|
+
...
|
|
26
|
+
def _find_ema_coefficient(closes, emas, number = 66, percent = 0.95):
|
|
27
|
+
"""
|
|
28
|
+
计算EMA通道系数。
|
|
29
|
+
在《走进我的交易室》中,艾尔德介绍的价格通道为:
|
|
30
|
+
通道上轨 = EMA + EMA*通道系数
|
|
31
|
+
通道下轨 = EMA - EMA*通道系数
|
|
32
|
+
其中一条绘制得恰到好处的通道应能将绝大多数价格包含在内,一般调节通道系数使其能够包含95%的价格
|
|
33
|
+
参数:closes:收盘价序列
|
|
34
|
+
emas:收盘价对应的EMA序列
|
|
35
|
+
number: 以最近多少天的数据来计算,即取最后N天的数据作为计算标准
|
|
36
|
+
percent:通道包含多少的价格,如0.95表示通道将包含95%的价格
|
|
37
|
+
|
|
38
|
+
"""
|
|
39
|
+
def draw(stock, query = ..., ma_n = 22, ma_w = 'auto', vigor_n = 13):
|
|
40
|
+
"""
|
|
41
|
+
绘制亚历山大.艾尔德交易系统图形
|
|
42
|
+
"""
|
|
43
|
+
CLOSE: hikyuu.cpp.core312.Indicator # value = Indicator{...
|
|
44
|
+
constant: hikyuu.cpp.core312.Constant # value = <hikyuu.cpp.core312.Constant object>
|
hikyuu/draw/kaufman.pyi
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""
|
|
2
|
+
|
|
3
|
+
绘制佩里.J.考夫曼(Perry J.Kaufman) 自适应移动平均系统(AMA)
|
|
4
|
+
参见:《精明交易者》(2006年 广东经济出版社)
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
import hikyuu.cpp.core312
|
|
8
|
+
from hikyuu.cpp.core312 import AMA
|
|
9
|
+
from hikyuu.cpp.core312 import BUSINESS
|
|
10
|
+
from hikyuu.cpp.core312 import CVAL
|
|
11
|
+
from hikyuu.cpp.core312 import EMA
|
|
12
|
+
from hikyuu.cpp.core312 import POS
|
|
13
|
+
from hikyuu.cpp.core312 import PRICELIST
|
|
14
|
+
from hikyuu.cpp.core312 import Query
|
|
15
|
+
from hikyuu.cpp.core312 import SG_Cross
|
|
16
|
+
from hikyuu.cpp.core312 import SG_Flex
|
|
17
|
+
from hikyuu.cpp.core312 import SG_Single
|
|
18
|
+
from hikyuu.cpp.core312 import STDEV
|
|
19
|
+
from hikyuu.cpp.core312 import StockManager
|
|
20
|
+
from hikyuu.draw.drawplot import adjust_axes_show
|
|
21
|
+
from hikyuu.draw.drawplot import ax_draw_macd
|
|
22
|
+
from hikyuu.draw.drawplot import ax_set_locator_formatter
|
|
23
|
+
from hikyuu.draw.drawplot import create_figure
|
|
24
|
+
from hikyuu.draw.drawplot import show_gcf
|
|
25
|
+
__all__ = ['AMA', 'BUSINESS', 'CLOSE', 'CVAL', 'EMA', 'HIGH', 'KDATA', 'LOW', 'OPEN', 'POS', 'PRICELIST', 'Query', 'SG_Cross', 'SG_Flex', 'SG_Single', 'STDEV', 'StockManager', 'adjust_axes_show', 'ax_draw_macd', 'ax_set_locator_formatter', 'create_figure', 'draw', 'draw2', 'show_gcf']
|
|
26
|
+
def draw(stock, query = ..., n = 10, filter_n = 20, filter_p = 0.1, sg_type = 'CROSS', show_high_low = False, arrow_style = 1):
|
|
27
|
+
"""
|
|
28
|
+
绘制佩里.J.考夫曼(Perry J.Kaufman) 自适应移动平均系统(AMA)
|
|
29
|
+
"""
|
|
30
|
+
def draw2(block, query = ..., ama1 = None, ama2 = None, n = 10, filter_n = 20, filter_p = 0.1, sg_type = 'CROSS', show_high_low = True, arrow_style = 1):
|
|
31
|
+
"""
|
|
32
|
+
绘制佩里.J.考夫曼(Perry J.Kaufman) 自适应移动平均系统(AMA)
|
|
33
|
+
"""
|
|
34
|
+
CLOSE: hikyuu.cpp.core312.Indicator # value = Indicator{...
|
|
35
|
+
HIGH: hikyuu.cpp.core312.Indicator # value = Indicator{...
|
|
36
|
+
KDATA: hikyuu.cpp.core312.Indicator # value = Indicator{...
|
|
37
|
+
LOW: hikyuu.cpp.core312.Indicator # value = Indicator{...
|
|
38
|
+
OPEN: hikyuu.cpp.core312.Indicator # value = Indicator{...
|
hikyuu/draw/volume.pyi
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""
|
|
2
|
+
|
|
3
|
+
绘制普通K线图 + 成交量(成交金额)
|
|
4
|
+
"""
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
import hikyuu.cpp.core312
|
|
7
|
+
from hikyuu.cpp.core312 import CVAL
|
|
8
|
+
from hikyuu.cpp.core312 import IF
|
|
9
|
+
from hikyuu.cpp.core312 import Indicator
|
|
10
|
+
from hikyuu.cpp.core312 import MA
|
|
11
|
+
from hikyuu.cpp.core312 import PRICELIST
|
|
12
|
+
from hikyuu.cpp.core312 import Query
|
|
13
|
+
from hikyuu.cpp.core312 import SG_Cross
|
|
14
|
+
from hikyuu.draw.drawplot import adjust_axes_show
|
|
15
|
+
from hikyuu.draw.drawplot import ax_draw_macd
|
|
16
|
+
from hikyuu.draw.drawplot import ax_set_locator_formatter
|
|
17
|
+
from hikyuu.draw.drawplot import create_figure
|
|
18
|
+
from hikyuu.draw.drawplot import get_current_draw_engine
|
|
19
|
+
from hikyuu.draw.drawplot import show_gcf
|
|
20
|
+
from hikyuu.util.mylog import spend_time
|
|
21
|
+
__all__ = ['CLOSE', 'CVAL', 'IF', 'Indicator', 'MA', 'PRICELIST', 'Query', 'SG_Cross', 'VOL', 'adjust_axes_show', 'ax_draw_macd', 'ax_set_locator_formatter', 'create_figure', 'draw', 'draw2', 'get_current_draw_engine', 'show_gcf', 'spend_time']
|
|
22
|
+
def draw(stock, query = ..., ma1_n = 5, ma2_n = 10, ma3_n = 20, ma4_n = 60, ma5_n = 100, vma1_n = 5, vma2_n = 10):
|
|
23
|
+
"""
|
|
24
|
+
绘制普通K线图 + 成交量(成交金额)
|
|
25
|
+
"""
|
|
26
|
+
def draw2(stock, query = ..., ma1_n = 7, ma2_n = 20, ma3_n = 30, ma4_n = 42, ma5_n = 100, vma1_n = 5, vma2_n = 10):
|
|
27
|
+
"""
|
|
28
|
+
绘制普通K线图 + 成交量(成交金额)+ MACD
|
|
29
|
+
"""
|
|
30
|
+
CLOSE: hikyuu.cpp.core312.Indicator # value = Indicator{...
|
|
31
|
+
VOL: hikyuu.cpp.core312.Indicator # value = Indicator{...
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
" #非初次建仓,买入同等数量\n",
|
|
203
203
|
" return self.next_buy_num\n",
|
|
204
204
|
" \n",
|
|
205
|
-
" def
|
|
205
|
+
" def _get_sell_num(self, datetime, stk, price, risk, part_from):\n",
|
|
206
206
|
" tm = self.tm\n",
|
|
207
207
|
" position = tm.get_position(datetime, stk)\n",
|
|
208
208
|
" current_num = int(position.number * 0.5)\n",
|
hikyuu/extend.py
CHANGED
|
@@ -4,9 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
# 优先加载 hikyuu 库,防止 windows 公共依赖库不同导致DLL初始化失败
|
|
6
6
|
from .core import *
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
# 过滤掉 numpy 告警
|
|
9
|
+
import os
|
|
10
|
+
os.environ["NUMEXPR_MAX_THREADS"] = str(os.cpu_count())
|
|
11
|
+
|
|
12
|
+
from datetime import * # NOQA: E402
|
|
13
|
+
import numpy as np # NOQA: E402
|
|
14
|
+
import pandas as pd # NOQA: E402
|
|
15
|
+
|
|
10
16
|
|
|
11
17
|
# ------------------------------------------------------------------
|
|
12
18
|
# 增加Datetime、Stock的hash支持,以便可做为dict的key
|