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/cpp/core313.pyd
CHANGED
|
Binary file
|
hikyuu/cpp/core38.pyd
CHANGED
|
Binary file
|
hikyuu/cpp/core39.pyd
CHANGED
|
Binary file
|
hikyuu/cpp/hikyuu.dll
CHANGED
|
Binary file
|
hikyuu/cpp/hikyuu.lib
CHANGED
|
Binary file
|
hikyuu/cpp/sqlite3.dll
CHANGED
|
Binary file
|
hikyuu/data/common_mysql.py
CHANGED
|
@@ -29,7 +29,12 @@ from pathlib import Path
|
|
|
29
29
|
import mysql.connector
|
|
30
30
|
|
|
31
31
|
from hikyuu.data.common import get_stktype_list, get_new_holidays
|
|
32
|
-
from hikyuu.util import hku_debug
|
|
32
|
+
from hikyuu.util import hku_debug, hku_info
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def get_mysql_connect_version():
|
|
36
|
+
m, n, _ = mysql.connector.__version__.split('.')
|
|
37
|
+
return int(m) + float(n) * 0.1
|
|
33
38
|
|
|
34
39
|
|
|
35
40
|
def is_exist_db(connect):
|
|
@@ -56,13 +61,19 @@ def create_database(connect):
|
|
|
56
61
|
"""创建数据库"""
|
|
57
62
|
sql_dir = os.path.dirname(__file__) + "/mysql_upgrade"
|
|
58
63
|
cur = connect.cursor()
|
|
64
|
+
mysql_version = get_mysql_connect_version()
|
|
59
65
|
if not is_exist_db(connect):
|
|
60
66
|
filename = sql_dir + "/createdb.sql"
|
|
61
67
|
with open(filename, 'r', encoding='utf8') as f:
|
|
62
68
|
sql = f.read()
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
69
|
+
if mysql_version >= 9.2:
|
|
70
|
+
cur.execute(sql)
|
|
71
|
+
_ = cur.fetchall()
|
|
72
|
+
while cur.nextset():
|
|
73
|
+
_ = cur.fetchall()
|
|
74
|
+
else:
|
|
75
|
+
for x in cur.execute(sql, multi=True):
|
|
76
|
+
pass
|
|
66
77
|
|
|
67
78
|
db_version = get_db_version(connect)
|
|
68
79
|
files = [x for x in Path(sql_dir).iterdir()
|
|
@@ -73,9 +84,15 @@ def create_database(connect):
|
|
|
73
84
|
files.sort()
|
|
74
85
|
for file in files:
|
|
75
86
|
sql = file.read_text(encoding='utf8')
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
87
|
+
if mysql_version >= 9.2:
|
|
88
|
+
cur.execute(sql, map_results=False)
|
|
89
|
+
_ = cur.fetchall()
|
|
90
|
+
while cur.nextset():
|
|
91
|
+
_ = cur.fetchall()
|
|
92
|
+
else:
|
|
93
|
+
for x in cur.execute(sql, multi=True):
|
|
94
|
+
# print(x.statement)
|
|
95
|
+
pass
|
|
79
96
|
|
|
80
97
|
connect.commit()
|
|
81
98
|
cur.close()
|
hikyuu/data/common_pytdx.py
CHANGED
|
@@ -77,7 +77,23 @@ def search_best_tdx():
|
|
|
77
77
|
res = executor.map(ping2, hosts, timeout=2)
|
|
78
78
|
x = [i for i in res if i[0] == True]
|
|
79
79
|
x.sort(key=lambda item: item[1])
|
|
80
|
-
|
|
80
|
+
|
|
81
|
+
# 校验 host 是否存在错误,取同样数据,相同结果最多的集合
|
|
82
|
+
values = {}
|
|
83
|
+
for host in x:
|
|
84
|
+
api = TdxHq_API(multithread=False)
|
|
85
|
+
if api.connect(host[2], host[3]):
|
|
86
|
+
x = api.get_security_bars(9, 0, '159915', 0, 1)
|
|
87
|
+
if x and len(x) > 0:
|
|
88
|
+
if x[0]['close'] not in values:
|
|
89
|
+
values[x[0]['close']] = [host]
|
|
90
|
+
else:
|
|
91
|
+
values[x[0]['close']].append(host)
|
|
92
|
+
ret = []
|
|
93
|
+
for _, host in values.items():
|
|
94
|
+
if len(host) > len(ret):
|
|
95
|
+
ret = host
|
|
96
|
+
return ret
|
|
81
97
|
|
|
82
98
|
|
|
83
99
|
def pytdx_get_day_trans(api, pymarket, code, date):
|
hikyuu/data/em_block_to_mysql.py
CHANGED
|
@@ -74,7 +74,7 @@ def em_import_block_to_mysql(connect, code_market_dict, categorys=('行业板块
|
|
|
74
74
|
hku_info("更新数据库")
|
|
75
75
|
cur = connect.cursor()
|
|
76
76
|
if len(blks) == 1:
|
|
77
|
-
sql = f"delete from hku_base.block where category in ({blks[0]})"
|
|
77
|
+
sql = f"delete from hku_base.block where category in ('{blks[0]}')"
|
|
78
78
|
else:
|
|
79
79
|
sql = f"delete from hku_base.block where category in {tuple(blks)}"
|
|
80
80
|
cur.execute(sql)
|
|
@@ -88,11 +88,12 @@ def em_import_block_to_mysql(connect, code_market_dict, categorys=('行业板块
|
|
|
88
88
|
|
|
89
89
|
if insert_records:
|
|
90
90
|
sql = "insert into hku_base.block (category, name, market_code) values (%s,%s,%s)"
|
|
91
|
+
hku_info(f"insert block records: {len(insert_records)}")
|
|
91
92
|
cur.executemany(sql, insert_records)
|
|
92
93
|
|
|
93
94
|
connect.commit()
|
|
94
95
|
cur.close()
|
|
95
|
-
|
|
96
|
+
return len(insert_records)
|
|
96
97
|
|
|
97
98
|
|
|
98
99
|
if __name__ == "__main__":
|
|
@@ -69,13 +69,15 @@ def em_import_block_to_sqlite(connect, code_market_dict, categorys=('行业板
|
|
|
69
69
|
if success_fetch_zs:
|
|
70
70
|
blks.append('指数板块')
|
|
71
71
|
|
|
72
|
+
print(blks)
|
|
73
|
+
|
|
72
74
|
if not blks:
|
|
73
75
|
return
|
|
74
76
|
|
|
75
77
|
hku_info("更新数据库")
|
|
76
78
|
cur = connect.cursor()
|
|
77
79
|
if len(blks) == 1:
|
|
78
|
-
sql = f"delete from block where category in ({blks[0]})"
|
|
80
|
+
sql = f"delete from block where category in ('{blks[0]}')"
|
|
79
81
|
else:
|
|
80
82
|
sql = f"delete from block where category in {tuple(blks)}"
|
|
81
83
|
hku_info(sql)
|
|
@@ -90,10 +92,12 @@ def em_import_block_to_sqlite(connect, code_market_dict, categorys=('行业板
|
|
|
90
92
|
|
|
91
93
|
if insert_records:
|
|
92
94
|
sql = "insert into block (category, name, market_code) values (?,?,?)"
|
|
95
|
+
hku_info(f"insert block records: {len(insert_records)}")
|
|
93
96
|
cur.executemany(sql, insert_records)
|
|
94
97
|
|
|
95
98
|
connect.commit()
|
|
96
99
|
cur.close()
|
|
100
|
+
return len(insert_records)
|
|
97
101
|
|
|
98
102
|
|
|
99
103
|
if __name__ == "__main__":
|
|
@@ -101,7 +105,8 @@ if __name__ == "__main__":
|
|
|
101
105
|
from hikyuu.data.common_sqlite3 import create_database
|
|
102
106
|
|
|
103
107
|
# dest_dir = "/home/fasiondog/stock"
|
|
104
|
-
dest_dir = "
|
|
108
|
+
dest_dir = "/Users/fasiondog/stock"
|
|
109
|
+
# dest_dir = "d:\\stock"
|
|
105
110
|
|
|
106
111
|
connect = sqlite3.connect(dest_dir + "/stock.db")
|
|
107
112
|
create_database(connect)
|
|
@@ -112,6 +117,6 @@ if __name__ == "__main__":
|
|
|
112
117
|
code_market_dict[v["code"]] = MARKET.SH
|
|
113
118
|
# print(code_market_dict)
|
|
114
119
|
|
|
115
|
-
em_import_block_to_sqlite(connect, code_market_dict)
|
|
120
|
+
em_import_block_to_sqlite(connect, code_market_dict, categorys=('地域板块',))
|
|
116
121
|
|
|
117
122
|
connect.close()
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
INSERT INTO `hku_base`.`stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
2
|
+
SELECT 1, '880001', '通达信总市值', 2, 1, 20160126, 99999999
|
|
3
|
+
WHERE NOT EXISTS (
|
|
4
|
+
SELECT `stockid` FROM `hku_base`.`stock` WHERE `marketid`=1 and `code`='880001'
|
|
5
|
+
);
|
|
6
|
+
INSERT INTO `hku_base`.`stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
7
|
+
SELECT 1, '880002', '通达信流通市值', 2, 1, 20160126, 99999999
|
|
8
|
+
WHERE NOT EXISTS (
|
|
9
|
+
SELECT `stockid` FROM `hku_base`.`stock` WHERE `marketid`=1 and `code`='880002'
|
|
10
|
+
);
|
|
11
|
+
INSERT INTO `hku_base`.`stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
12
|
+
SELECT 1, '880003', '通达信平均股价', 2, 1, 20160126, 99999999
|
|
13
|
+
WHERE NOT EXISTS (
|
|
14
|
+
SELECT `stockid` FROM `hku_base`.`stock` WHERE `marketid`=1 and `code`='880003'
|
|
15
|
+
);
|
|
16
|
+
INSERT INTO `hku_base`.`stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
17
|
+
SELECT 1, '880004', '通达信成交均价', 2, 1, 20160126, 99999999
|
|
18
|
+
WHERE NOT EXISTS (
|
|
19
|
+
SELECT `stockid` FROM `hku_base`.`stock` WHERE `marketid`=1 and `code`='880004'
|
|
20
|
+
);
|
|
21
|
+
INSERT INTO `hku_base`.`stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
22
|
+
SELECT 1, '880005', '通达信涨跌家数', 2, 1, 20160126, 99999999
|
|
23
|
+
WHERE NOT EXISTS (
|
|
24
|
+
SELECT `stockid` FROM `hku_base`.`stock` WHERE `marketid`=1 and `code`='880005'
|
|
25
|
+
);
|
|
26
|
+
INSERT INTO `hku_base`.`stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
27
|
+
SELECT 1, '880006', '通达信停板家数', 2, 1, 19901220, 99999999
|
|
28
|
+
WHERE NOT EXISTS (
|
|
29
|
+
SELECT `stockid` FROM `hku_base`.`stock` WHERE `marketid`=1 and `code`='880006'
|
|
30
|
+
);
|
|
31
|
+
INSERT INTO `hku_base`.`stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
32
|
+
SELECT 1, '880008', '通达信全A等权', 2, 1, 19901220, 99999999
|
|
33
|
+
WHERE NOT EXISTS (
|
|
34
|
+
SELECT `stockid` FROM `hku_base`.`stock` WHERE `marketid`=1 and `code`='880008'
|
|
35
|
+
);
|
|
36
|
+
INSERT INTO `hku_base`.`stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
37
|
+
SELECT 1, '880011', '通达信主板总值', 2, 1, 19901220, 99999999
|
|
38
|
+
WHERE NOT EXISTS (
|
|
39
|
+
SELECT `stockid` FROM `hku_base`.`stock` WHERE `marketid`=1 and `code`='880011'
|
|
40
|
+
);
|
|
41
|
+
INSERT INTO `hku_base`.`stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
42
|
+
SELECT 1, '880031', '通达信创业总值', 2, 1, 19901220, 99999999
|
|
43
|
+
WHERE NOT EXISTS (
|
|
44
|
+
SELECT `stockid` FROM `hku_base`.`stock` WHERE `marketid`=1 and `code`='880031'
|
|
45
|
+
);
|
|
46
|
+
INSERT INTO `hku_base`.`stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
47
|
+
SELECT 1, '880041', '通达信科创总值', 2, 1, 19901220, 99999999
|
|
48
|
+
WHERE NOT EXISTS (
|
|
49
|
+
SELECT `stockid` FROM `hku_base`.`stock` WHERE `marketid`=1 and `code`='880041'
|
|
50
|
+
);
|
|
51
|
+
INSERT INTO `hku_base`.`stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
52
|
+
SELECT 1, '880098', '通达信可转债指数', 2, 1, 19901220, 99999999
|
|
53
|
+
WHERE NOT EXISTS (
|
|
54
|
+
SELECT `stockid` FROM `hku_base`.`stock` WHERE `marketid`=1 and `code`='880098'
|
|
55
|
+
);
|
|
56
|
+
INSERT INTO `hku_base`.`stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
57
|
+
SELECT 1, '880099', '通达信逆回购', 2, 1, 19901220, 99999999
|
|
58
|
+
WHERE NOT EXISTS (
|
|
59
|
+
SELECT `stockid` FROM `hku_base`.`stock` WHERE `marketid`=1 and `code`='880099'
|
|
60
|
+
);
|
|
61
|
+
UPDATE `hku_base`.`version` set `version` = 25;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
ALTER TABLE `hku_base`.`coderuletype` modify `id` int(11) auto_increment;
|
|
2
|
+
INSERT INTO `hku_base`.`coderuletype` (`marketid`,`codepre`,`type`,`description`) VALUES (3,'899',2,'北证指数');
|
|
3
|
+
UPDATE `hku_base`.`market` SET `code`='899050' WHERE `marketid`=3;
|
|
4
|
+
INSERT INTO `hku_base`.`stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
5
|
+
SELECT 3, '899050', '北证50', 2, 1, 20220429, 99999999
|
|
6
|
+
WHERE NOT EXISTS (
|
|
7
|
+
SELECT `stockid` FROM `hku_base`.`stock` WHERE `marketid`=3 and `code`='899050'
|
|
8
|
+
);
|
|
9
|
+
UPDATE `hku_base`.`version` set `version` = 26;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
BEGIN TRANSACTION;
|
|
2
|
+
INSERT INTO `Stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
3
|
+
SELECT 1, '880001', '通达信总市值', 2, 1, 20160126, 99999999
|
|
4
|
+
WHERE NOT EXISTS (
|
|
5
|
+
SELECT stockid FROM `Stock` WHERE `marketid`=1 and `code`='880001'
|
|
6
|
+
);
|
|
7
|
+
INSERT INTO `Stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
8
|
+
SELECT 1, '880002', '通达信流通市值', 2, 1, 20160126, 99999999
|
|
9
|
+
WHERE NOT EXISTS (
|
|
10
|
+
SELECT stockid FROM `Stock` WHERE `marketid`=1 and `code`='880002'
|
|
11
|
+
);
|
|
12
|
+
INSERT INTO `Stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
13
|
+
SELECT 1, '880003', '通达信平均股价', 2, 1, 20160126, 99999999
|
|
14
|
+
WHERE NOT EXISTS (
|
|
15
|
+
SELECT stockid FROM `Stock` WHERE `marketid`=1 and `code`='880003'
|
|
16
|
+
);
|
|
17
|
+
INSERT INTO `Stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
18
|
+
SELECT 1, '880004', '通达信成交均价', 2, 1, 20160126, 99999999
|
|
19
|
+
WHERE NOT EXISTS (
|
|
20
|
+
SELECT stockid FROM `Stock` WHERE `marketid`=1 and `code`='880004'
|
|
21
|
+
);
|
|
22
|
+
INSERT INTO `Stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
23
|
+
SELECT 1, '880005', '通达信涨跌家数', 2, 1, 20160126, 99999999
|
|
24
|
+
WHERE NOT EXISTS (
|
|
25
|
+
SELECT stockid FROM `Stock` WHERE `marketid`=1 and `code`='880005'
|
|
26
|
+
);
|
|
27
|
+
INSERT INTO `Stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
28
|
+
SELECT 1, '880006', '通达信停板家数', 2, 1, 20160126, 99999999
|
|
29
|
+
WHERE NOT EXISTS (
|
|
30
|
+
SELECT stockid FROM `Stock` WHERE `marketid`=1 and `code`='880006'
|
|
31
|
+
);
|
|
32
|
+
INSERT INTO `Stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
33
|
+
SELECT 1, '880006', '通达信全A等权', 2, 1, 20160126, 99999999
|
|
34
|
+
WHERE NOT EXISTS (
|
|
35
|
+
SELECT stockid FROM `Stock` WHERE `marketid`=1 and `code`='880008'
|
|
36
|
+
);
|
|
37
|
+
INSERT INTO `Stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
38
|
+
SELECT 1, '880011', '通达信主板总值', 2, 1, 20160126, 99999999
|
|
39
|
+
WHERE NOT EXISTS (
|
|
40
|
+
SELECT stockid FROM `Stock` WHERE `marketid`=1 and `code`='880011'
|
|
41
|
+
);
|
|
42
|
+
INSERT INTO `Stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
43
|
+
SELECT 1, '880031', '通达信创业总值', 2, 1, 20160126, 99999999
|
|
44
|
+
WHERE NOT EXISTS (
|
|
45
|
+
SELECT stockid FROM `Stock` WHERE `marketid`=1 and `code`='880031'
|
|
46
|
+
);
|
|
47
|
+
INSERT INTO `Stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
48
|
+
SELECT 1, '880041', '通达信科创总值', 2, 1, 20160126, 99999999
|
|
49
|
+
WHERE NOT EXISTS (
|
|
50
|
+
SELECT stockid FROM `Stock` WHERE `marketid`=1 and `code`='880041'
|
|
51
|
+
);
|
|
52
|
+
INSERT INTO `Stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
53
|
+
SELECT 1, '880098', '通达信可转债指数', 2, 1, 20160126, 99999999
|
|
54
|
+
WHERE NOT EXISTS (
|
|
55
|
+
SELECT stockid FROM `Stock` WHERE `marketid`=1 and `code`='880098'
|
|
56
|
+
);
|
|
57
|
+
INSERT INTO `Stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
58
|
+
SELECT 1, '880099', '通达信逆回购', 2, 1, 20160126, 99999999
|
|
59
|
+
WHERE NOT EXISTS (
|
|
60
|
+
SELECT stockid FROM `Stock` WHERE `marketid`=1 and `code`='880099'
|
|
61
|
+
);
|
|
62
|
+
UPDATE `version` set `version` = 25;
|
|
63
|
+
COMMIT;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
BEGIN TRANSACTION;
|
|
2
|
+
INSERT INTO `coderuletype` (marketid,codepre,type,description) VALUES (3,'899',2,'北证指数');
|
|
3
|
+
UPDATE `market` SET `code`='899050' WHERE `marketid`=3;
|
|
4
|
+
INSERT INTO `Stock` (`marketid`, `code`, `name`, `type`, `valid`, `startDate`, `endDate`)
|
|
5
|
+
SELECT 3, '899050', '北证50', 2, 1, 20220429, 99999999
|
|
6
|
+
WHERE NOT EXISTS (
|
|
7
|
+
SELECT stockid FROM `Stock` WHERE `marketid`=3 and `code`='899050'
|
|
8
|
+
);
|
|
9
|
+
UPDATE `version` set `version` = 26;
|
|
10
|
+
COMMIT;
|
hikyuu/draw/__init__.pyi
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from hikyuu.draw.drawplot import adjust_axes_show
|
|
3
|
+
from hikyuu.draw.drawplot import ax_draw_macd
|
|
4
|
+
from hikyuu.draw.drawplot import ax_draw_macd2
|
|
5
|
+
from hikyuu.draw.drawplot import ax_set_locator_formatter
|
|
6
|
+
from hikyuu.draw.drawplot import create_figure
|
|
7
|
+
from hikyuu.draw.drawplot import gca
|
|
8
|
+
from hikyuu.draw.drawplot import gcf
|
|
9
|
+
from hikyuu.draw.drawplot import get_current_draw_engine
|
|
10
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWBAND
|
|
11
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWICON
|
|
12
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWIMG
|
|
13
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWIMG as DRAWBMP
|
|
14
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWLINE
|
|
15
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWNUMBER
|
|
16
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWNUMBER_FIX
|
|
17
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWRECTREL
|
|
18
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWSL
|
|
19
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWTEXT
|
|
20
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWTEXT_FIX
|
|
21
|
+
from hikyuu.draw.drawplot.matplotlib_draw import PLOYLINE
|
|
22
|
+
from hikyuu.draw.drawplot.matplotlib_draw import RGB
|
|
23
|
+
from hikyuu.draw.drawplot.matplotlib_draw import SHOWICONS
|
|
24
|
+
from hikyuu.draw.drawplot.matplotlib_draw import STICKLINE
|
|
25
|
+
from hikyuu.draw.drawplot import show_gcf
|
|
26
|
+
from hikyuu.draw.drawplot import use_draw_engine
|
|
27
|
+
from . import drawplot
|
|
28
|
+
from . import elder
|
|
29
|
+
from . import kaufman
|
|
30
|
+
from . import volume
|
|
31
|
+
__all__: list = ['vl', 'el', 'kf', 'use_draw_engine', 'get_current_draw_engine', 'create_figure', 'ax_set_locator_formatter', 'adjust_axes_show', 'ax_draw_macd', 'ax_draw_macd2', 'gcf', 'gca', 'show_gcf', 'DRAWNULL', 'STICKLINE', 'DRAWBAND', 'RGB', 'PLOYLINE', 'DRAWLINE', 'DRAWTEXT', 'DRAWNUMBER', 'DRAWTEXT_FIX', 'DRAWNUMBER_FIX', 'DRAWSL', 'DRAWIMG', 'DRAWICON', 'DRAWBMP', 'SHOWICONS', 'DRAWRECTREL']
|
|
32
|
+
DRAWNULL: float # value = nan
|
|
33
|
+
el = elder
|
|
34
|
+
kf = kaufman
|
|
35
|
+
vl = volume
|
hikyuu/draw/drawplot/__init__.py
CHANGED
|
@@ -69,6 +69,7 @@ from .echarts_draw import sysplot as ec_sysplot
|
|
|
69
69
|
from .echarts_draw import iplot as ec_iplot
|
|
70
70
|
from .echarts_draw import ibar as ec_ibar
|
|
71
71
|
from .echarts_draw import kplot as ec_kplot
|
|
72
|
+
from .echarts_draw import sys_performance as ec_sys_performance
|
|
72
73
|
|
|
73
74
|
g_draw_engine = 'matplotlib'
|
|
74
75
|
|
|
@@ -140,6 +141,8 @@ def use_draw_with_echarts():
|
|
|
140
141
|
Indicator.bar = ec_ibar
|
|
141
142
|
|
|
142
143
|
System.plot = ec_sysplot
|
|
144
|
+
System.performance = ec_sys_performance
|
|
145
|
+
Portfolio.performance = ec_sys_performance
|
|
143
146
|
|
|
144
147
|
|
|
145
148
|
def create_figure(n=1, figsize=None):
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from hikyuu.cpp.core312 import ConditionBase
|
|
3
|
+
from hikyuu.cpp.core312 import EnvironmentBase
|
|
4
|
+
from hikyuu.cpp.core312 import Indicator
|
|
5
|
+
from hikyuu.cpp.core312 import KData
|
|
6
|
+
from hikyuu.cpp.core312 import Portfolio
|
|
7
|
+
from hikyuu.cpp.core312 import SignalBase
|
|
8
|
+
from hikyuu.cpp.core312 import System
|
|
9
|
+
from hikyuu.draw.drawplot.bokeh_draw import ax_draw_macd as bk_ax_draw_macd
|
|
10
|
+
from hikyuu.draw.drawplot.bokeh_draw import ax_draw_macd2 as bk_ax_draw_macd2
|
|
11
|
+
from hikyuu.draw.drawplot.bokeh_draw import create_figure as bk_create_figure
|
|
12
|
+
from hikyuu.draw.drawplot.bokeh_draw import gca as bk_gca
|
|
13
|
+
from hikyuu.draw.drawplot.bokeh_draw import gcf as bk_gcf
|
|
14
|
+
from hikyuu.draw.drawplot.bokeh_draw import ibar as bk_ibar
|
|
15
|
+
from hikyuu.draw.drawplot.bokeh_draw import iplot as bk_iplot
|
|
16
|
+
from hikyuu.draw.drawplot.bokeh_draw import kplot as bk_kplot
|
|
17
|
+
from hikyuu.draw.drawplot.bokeh_draw import sgplot as bk_sgplot
|
|
18
|
+
from hikyuu.draw.drawplot.bokeh_draw import show_gcf as bk_show_gcf
|
|
19
|
+
from hikyuu.draw.drawplot.bokeh_draw import use_bokeh_in_notebook
|
|
20
|
+
from hikyuu.draw.drawplot.echarts_draw import ibar as ec_ibar
|
|
21
|
+
from hikyuu.draw.drawplot.echarts_draw import iplot as ec_iplot
|
|
22
|
+
from hikyuu.draw.drawplot.echarts_draw import kplot as ec_kplot
|
|
23
|
+
from hikyuu.draw.drawplot.echarts_draw import sys_performance as ec_sys_performance
|
|
24
|
+
from hikyuu.draw.drawplot.echarts_draw import sysplot as ec_sysplot
|
|
25
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWBAND
|
|
26
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWICON
|
|
27
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWIMG
|
|
28
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWIMG as DRAWBMP
|
|
29
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWLINE
|
|
30
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWNUMBER
|
|
31
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWNUMBER_FIX
|
|
32
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWRECTREL
|
|
33
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWSL
|
|
34
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWTEXT
|
|
35
|
+
from hikyuu.draw.drawplot.matplotlib_draw import DRAWTEXT_FIX
|
|
36
|
+
from hikyuu.draw.drawplot.matplotlib_draw import PLOYLINE
|
|
37
|
+
from hikyuu.draw.drawplot.matplotlib_draw import RGB
|
|
38
|
+
from hikyuu.draw.drawplot.matplotlib_draw import SHOWICONS
|
|
39
|
+
from hikyuu.draw.drawplot.matplotlib_draw import STICKLINE
|
|
40
|
+
from hikyuu.draw.drawplot.matplotlib_draw import adjust_axes_show as mpl_adjust_axes_show
|
|
41
|
+
from hikyuu.draw.drawplot.matplotlib_draw import ax_draw_macd as mpl_ax_draw_macd
|
|
42
|
+
from hikyuu.draw.drawplot.matplotlib_draw import ax_draw_macd2 as mpl_ax_draw_macd2
|
|
43
|
+
from hikyuu.draw.drawplot.matplotlib_draw import ax_set_locator_formatter as mpl_ax_set_locator_formatter
|
|
44
|
+
from hikyuu.draw.drawplot.matplotlib_draw import cnplot as mpl_cnplot
|
|
45
|
+
from hikyuu.draw.drawplot.matplotlib_draw import create_figure as mpl_create_figure
|
|
46
|
+
from hikyuu.draw.drawplot.matplotlib_draw import evplot as mpl_evplot
|
|
47
|
+
from hikyuu.draw.drawplot.matplotlib_draw import ibar as mpl_ibar
|
|
48
|
+
from hikyuu.draw.drawplot.matplotlib_draw import iplot as mpl_iplot
|
|
49
|
+
from hikyuu.draw.drawplot.matplotlib_draw import kplot as mpl_kplot
|
|
50
|
+
from hikyuu.draw.drawplot.matplotlib_draw import mkplot as mpl_mkplot
|
|
51
|
+
from hikyuu.draw.drawplot.matplotlib_draw import set_mpl_params
|
|
52
|
+
from hikyuu.draw.drawplot.matplotlib_draw import sgplot as mpl_sgplot
|
|
53
|
+
from hikyuu.draw.drawplot.matplotlib_draw import sys_performance as mpl_sys_performance
|
|
54
|
+
from hikyuu.draw.drawplot.matplotlib_draw import sysplot as mpl_sysplot
|
|
55
|
+
import matplotlib as matplotlib
|
|
56
|
+
from matplotlib.pyplot import gca as mpl_gca
|
|
57
|
+
from matplotlib.pyplot import gcf as mpl_gcf
|
|
58
|
+
from . import bokeh_draw
|
|
59
|
+
from . import common
|
|
60
|
+
from . import echarts_draw
|
|
61
|
+
from . import matplotlib_draw
|
|
62
|
+
__all__: list = ['use_draw_engine', 'get_current_draw_engine', 'create_figure', 'gcf', 'show_gcf', 'gca', 'ax_draw_macd', 'ax_draw_macd2', 'use_bokeh_in_notebook', 'use_draw_with_echarts', 'DRAWNULL', 'STICKLINE', 'DRAWBAND', 'RGB', 'PLOYLINE', 'DRAWLINE', 'DRAWTEXT', 'DRAWNUMBER', 'DRAWTEXT_FIX', 'DRAWNUMBER_FIX', 'DRAWSL', 'DRAWIMG', 'DRAWICON', 'DRAWBMP', 'SHOWICONS', 'DRAWRECTREL']
|
|
63
|
+
def adjust_axes_show(axeslist):
|
|
64
|
+
"""
|
|
65
|
+
用于调整上下紧密相连的坐标轴显示时,其上一坐标轴最小值刻度和下一坐标轴最大值刻度
|
|
66
|
+
显示重叠的问题。
|
|
67
|
+
|
|
68
|
+
:param axeslist: 上下相连的坐标轴列表 (ax1,ax2,...)
|
|
69
|
+
|
|
70
|
+
"""
|
|
71
|
+
def ax_draw_macd(axes, kdata, n1 = 12, n2 = 26, n3 = 9):
|
|
72
|
+
"""
|
|
73
|
+
绘制MACD
|
|
74
|
+
|
|
75
|
+
:param axes: 指定的坐标轴
|
|
76
|
+
:param KData kdata: KData
|
|
77
|
+
:param int n1: 指标 MACD 的参数1
|
|
78
|
+
:param int n2: 指标 MACD 的参数2
|
|
79
|
+
:param int n3: 指标 MACD 的参数3
|
|
80
|
+
|
|
81
|
+
"""
|
|
82
|
+
def ax_draw_macd2(axes, ref, kdata, n1 = 12, n2 = 26, n3 = 9):
|
|
83
|
+
"""
|
|
84
|
+
绘制MACD。
|
|
85
|
+
当BAR值变化与参考序列ref变化不一致时,显示为灰色,
|
|
86
|
+
当BAR和参考序列ref同时上涨,显示红色
|
|
87
|
+
当BAR和参考序列ref同时下跌,显示绿色
|
|
88
|
+
|
|
89
|
+
:param axes: 指定的坐标轴
|
|
90
|
+
:param ref: 参考序列,EMA
|
|
91
|
+
:param KData kdata: KData
|
|
92
|
+
:param int n1: 指标 MACD 的参数1
|
|
93
|
+
:param int n2: 指标 MACD 的参数2
|
|
94
|
+
:param int n3: 指标 MACD 的参数3
|
|
95
|
+
|
|
96
|
+
"""
|
|
97
|
+
def ax_set_locator_formatter(axes, dates, typ):
|
|
98
|
+
"""
|
|
99
|
+
设置指定坐标轴的日期显示,根据指定的K线类型优化X轴坐标显示
|
|
100
|
+
|
|
101
|
+
:param axes: 指定的坐标轴
|
|
102
|
+
:param dates: Datetime构成可迭代序列
|
|
103
|
+
:param Query.KType typ: K线类型
|
|
104
|
+
|
|
105
|
+
"""
|
|
106
|
+
def create_figure(n = 1, figsize = None):
|
|
107
|
+
"""
|
|
108
|
+
生成含有指定坐标轴数量的窗口,最大只支持4个坐标轴。
|
|
109
|
+
|
|
110
|
+
:param int n: 坐标轴数量
|
|
111
|
+
:param figsize: (宽, 高)
|
|
112
|
+
:return: (ax1, ax2, ...) 根据指定的坐标轴数量而定,超出[1,4]个坐标轴时,返回None
|
|
113
|
+
|
|
114
|
+
"""
|
|
115
|
+
def gca():
|
|
116
|
+
...
|
|
117
|
+
def gcf():
|
|
118
|
+
...
|
|
119
|
+
def get_current_draw_engine():
|
|
120
|
+
...
|
|
121
|
+
def set_current_draw_engine(engine):
|
|
122
|
+
...
|
|
123
|
+
def show_gcf():
|
|
124
|
+
...
|
|
125
|
+
def use_draw_engine(engine = 'matplotlib'):
|
|
126
|
+
...
|
|
127
|
+
def use_draw_with_bokeh():
|
|
128
|
+
...
|
|
129
|
+
def use_draw_with_echarts():
|
|
130
|
+
...
|
|
131
|
+
def use_draw_with_matplotlib():
|
|
132
|
+
...
|
|
133
|
+
DRAWNULL: float # value = nan
|
|
134
|
+
g_draw_engine: str = 'matplotlib'
|