hikyuu 2.6.8.5__py3-none-win_amd64.whl → 2.6.9__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 +5 -11
- hikyuu/__init__.pyi +37 -12
- hikyuu/analysis/__init__.pyi +26 -0
- hikyuu/analysis/analysis.pyi +27 -1
- hikyuu/core.py +2 -0
- hikyuu/core.pyi +28 -2
- hikyuu/cpp/arrow.dll +0 -0
- hikyuu/cpp/boost_date_time-mt.dll +0 -0
- hikyuu/cpp/boost_serialization-mt.dll +0 -0
- hikyuu/cpp/boost_system-mt.dll +0 -0
- hikyuu/cpp/boost_wserialization-mt.dll +0 -0
- hikyuu/cpp/core310.pyd +0 -0
- hikyuu/cpp/core310.pyi +446 -9
- hikyuu/cpp/core311.pyd +0 -0
- hikyuu/cpp/core311.pyi +446 -9
- hikyuu/cpp/core312.pyd +0 -0
- hikyuu/cpp/core312.pyi +446 -9
- hikyuu/cpp/core313.pyd +0 -0
- hikyuu/cpp/core313.pyi +446 -9
- hikyuu/cpp/core39.pyd +0 -0
- hikyuu/cpp/core39.pyi +446 -9
- hikyuu/cpp/hikyuu.dll +0 -0
- hikyuu/cpp/hikyuu.lib +0 -0
- hikyuu/cpp/i18n/zh_CN/hikyuu.mo +0 -0
- hikyuu/cpp/msvcp140-a118642f3ae8774fb9dc223e15c4a52e.dll +0 -0
- hikyuu/cpp/parquet.dll +0 -0
- hikyuu/cpp/sqlite3.dll +0 -0
- hikyuu/data/clickhouse_upgrade/createdb.sql +105 -105
- hikyuu/data/common.py +3 -3
- hikyuu/data/common_clickhouse.py +1 -1
- hikyuu/data/download_block.py +318 -0
- hikyuu/data/em_block_to_clickhouse.py +26 -74
- hikyuu/data/em_block_to_mysql.py +25 -75
- hikyuu/data/em_block_to_sqlite.py +26 -78
- hikyuu/data/hku_config_template.py +3 -3
- hikyuu/data/pytdx_to_clickhouse.py +15 -11
- hikyuu/data/pytdx_to_h5.py +6 -2
- hikyuu/data/pytdx_to_mysql.py +5 -1
- hikyuu/data/pytdx_weight_to_clickhouse.py +1 -1
- hikyuu/data/pytdx_weight_to_mysql.py +1 -1
- hikyuu/data/pytdx_weight_to_sqlite.py +1 -1
- hikyuu/data/zh_bond10_to_clickhouse.py +1 -1
- hikyuu/draw/drawplot/bokeh_draw.pyi +33 -8
- hikyuu/draw/drawplot/echarts_draw.pyi +33 -8
- hikyuu/draw/drawplot/matplotlib_draw.py +4 -74
- hikyuu/draw/drawplot/matplotlib_draw.pyi +33 -8
- hikyuu/examples/notebook/Demo/Demo1.ipynb +48 -33
- hikyuu/extend.py +0 -1
- hikyuu/extend.pyi +30 -5
- hikyuu/fetcher/stock/zh_block_em.py +50 -18
- hikyuu/gui/HikyuuTDX.py +81 -30
- hikyuu/gui/data/CollectSpotThread.py +1 -1
- hikyuu/gui/data/EscapetimeThread.py +8 -14
- hikyuu/gui/data/ImportBlockInfoTask.py +3 -10
- hikyuu/gui/data/MainWindow.py +1168 -715
- hikyuu/gui/data/SchedImportThread.py +2 -2
- hikyuu/gui/data/UsePytdxImportToH5Thread.py +3 -3
- hikyuu/gui/data/UseQmtImportToH5Thread.py +2 -2
- hikyuu/gui/data/UseTdxImportToH5Thread.py +3 -3
- hikyuu/gui/data/tool.py +32 -25
- hikyuu/gui/dataserver.py +5 -3
- hikyuu/hub.pyi +6 -6
- hikyuu/include/hikyuu/DataType.h +4 -16
- hikyuu/include/hikyuu/KData.h +6 -3
- hikyuu/include/hikyuu/KDataPrivatedBufferImp.h +1 -1
- hikyuu/include/hikyuu/KDataSharedBufferImp.h +1 -1
- hikyuu/include/hikyuu/KQuery.h +2 -2
- hikyuu/include/hikyuu/Stock.h +3 -0
- hikyuu/include/hikyuu/StockManager.h +13 -3
- hikyuu/include/hikyuu/data_driver/BaseInfoDriver.h +8 -0
- hikyuu/include/hikyuu/data_driver/BlockInfoDriver.h +6 -0
- hikyuu/include/hikyuu/data_driver/KDataDriver.h +26 -1
- hikyuu/include/hikyuu/data_driver/base_info/mysql/MySQLBaseInfoDriver.h +1 -1
- hikyuu/include/hikyuu/data_driver/base_info/sqlite/SQLiteBaseInfoDriver.h +1 -1
- hikyuu/include/hikyuu/data_driver/block_info/mysql/MySQLBlockInfoDriver.h +2 -1
- hikyuu/include/hikyuu/data_driver/block_info/qianlong/QLBlockInfoDriver.h +2 -1
- hikyuu/include/hikyuu/data_driver/block_info/sqlite/SQLiteBlockInfoDriver.h +2 -1
- hikyuu/include/hikyuu/data_driver/kdata/DoNothingKDataDriver.h +1 -1
- hikyuu/include/hikyuu/data_driver/kdata/cvs/KDataTempCsvDriver.h +1 -1
- hikyuu/include/hikyuu/data_driver/kdata/hdf5/H5KDataDriver.h +1 -1
- hikyuu/include/hikyuu/data_driver/kdata/mysql/MySQLKDataDriver.h +1 -1
- hikyuu/include/hikyuu/data_driver/kdata/sqlite/SQLiteKDataDriver.h +1 -1
- hikyuu/include/hikyuu/data_driver/kdata/tdx/TdxKDataDriver.h +1 -1
- hikyuu/include/hikyuu/hikyuu.h +1 -1
- hikyuu/include/hikyuu/indicator/build_in.h +1 -0
- hikyuu/include/hikyuu/indicator/crt/CYCLE.h +4 -4
- hikyuu/include/hikyuu/indicator/crt/HSL.h +2 -2
- hikyuu/include/hikyuu/indicator/crt/QUANTILE_TRUNC.h +30 -0
- hikyuu/include/hikyuu/indicator/crt/TURNOVER.h +1 -0
- hikyuu/include/hikyuu/indicator/crt/ZSCORE.h +2 -2
- hikyuu/include/hikyuu/indicator/imp/IQuantileTrunc.h +25 -0
- hikyuu/include/hikyuu/misc.h +38 -0
- hikyuu/include/hikyuu/plugin/dataserver.h +2 -1
- hikyuu/include/hikyuu/plugin/extind.h +37 -0
- hikyuu/include/hikyuu/plugin/interface/DataServerPluginInterface.h +2 -2
- hikyuu/include/hikyuu/plugin/interface/ExtendIndicatorsPluginInterface.h +12 -0
- hikyuu/include/hikyuu/strategy/RunSystemInStrategy.h +3 -0
- hikyuu/include/hikyuu/trade_manage/Performance.h +4 -4
- hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +10 -1
- hikyuu/include/hikyuu/trade_sys/moneymanager/imp/FixedCapitalFundsMM.h +0 -4
- hikyuu/include/hikyuu/trade_sys/multifactor/MultiFactorBase.h +36 -3
- hikyuu/include/hikyuu/trade_sys/multifactor/NormalizeBase.h +125 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/ScoresFilterBase.h +125 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/build_in.h +3 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/buildin_norm.h +36 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/buildin_scfilter.h +51 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/filter/GroupSCFilter.h +24 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/filter/IgnoreLessOrEqualValueSCFilter.h +24 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/filter/IgnoreNanSCFilter.h +24 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/filter/MinAmountPercentSCFilter.h +25 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/filter/PriceSCFilter.h +24 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/filter/TopNSCFilter.h +24 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/filter/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/imp/EqualWeightMultiFactor.h +1 -1
- hikyuu/include/hikyuu/trade_sys/multifactor/imp/ICIRMultiFactor.h +1 -1
- hikyuu/include/hikyuu/trade_sys/multifactor/imp/ICMultiFactor.h +1 -1
- hikyuu/include/hikyuu/trade_sys/multifactor/imp/WeightMultiFactor.h +1 -1
- hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormMinMax.h +23 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormQuantile.h +28 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormQuantileUniform.h +28 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/normalize/NormZScore.h +25 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/normalize/__init__.py +1 -0
- hikyuu/include/hikyuu/trade_sys/multifactor/normalize/quantile_trunc.h +16 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +7 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/imp/SimplePortfolio.h +7 -0
- hikyuu/include/hikyuu/trade_sys/portfolio/imp/WithoutAFPortfolio.h +7 -0
- hikyuu/include/hikyuu/trade_sys/selector/SelectorBase.h +49 -0
- hikyuu/include/hikyuu/trade_sys/selector/build_in.h +1 -0
- hikyuu/include/hikyuu/trade_sys/selector/crt/SE_MultiFactor2.h +40 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector.h +0 -3
- hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector2.h +49 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorSelector.h +1 -1
- hikyuu/include/hikyuu/trade_sys/selector/imp/logic/OperatorValueSelector.h +1 -1
- hikyuu/include/hikyuu/trade_sys/signal/imp/BandSignal2.h +0 -4
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/AddValueSignal.h +2 -2
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/DivValueSignal.h +2 -2
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/MulValueSignal.h +2 -2
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorSignal.h +1 -1
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/OperatorValueSignal.h +4 -4
- hikyuu/include/hikyuu/trade_sys/signal/imp/logic/SubValueSignal.h +2 -2
- hikyuu/include/hikyuu/trade_sys/system/System.h +14 -1
- hikyuu/include/hikyuu/utilities/SpendTimer.h +17 -7
- hikyuu/include/hikyuu/utilities/arithmetic.h +45 -0
- hikyuu/include/hikyuu/utilities/db_connect/mysql/MySQLConnect.h +1 -1
- hikyuu/include/hikyuu/utilities/db_connect/mysql/MySQLStatement.h +1 -1
- hikyuu/include/hikyuu/utilities/db_connect/sqlite/SQLiteConnect.h +1 -1
- hikyuu/include/hikyuu/utilities/db_connect/sqlite/SQLiteStatement.h +1 -1
- hikyuu/include/hikyuu/utilities/plugin/PluginLoader.h +4 -1
- hikyuu/include/hikyuu/version.h +4 -4
- 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/hkuviews.dll +0 -0
- hikyuu/plugin/import2hdf5.dll +0 -0
- hikyuu/plugin/tmreport.dll +0 -0
- hikyuu/trade_manage/__init__.pyi +33 -8
- hikyuu/trade_manage/trade.pyi +33 -8
- hikyuu/util/__init__.pyi +2 -2
- hikyuu/util/singleton.pyi +1 -1
- {hikyuu-2.6.8.5.dist-info → hikyuu-2.6.9.dist-info}/METADATA +13 -14
- {hikyuu-2.6.8.5.dist-info → hikyuu-2.6.9.dist-info}/RECORD +167 -149
- {hikyuu-2.6.8.5.dist-info → hikyuu-2.6.9.dist-info}/top_level.txt +2 -1
- hikyuu/data_driver/__init__.py +0 -49
- hikyuu/data_driver/jqdata_data_driver.py +0 -277
- hikyuu/data_driver/pytdx_data_driver.py +0 -292
- hikyuu/fetcher/stock/zh_stock_a_huatai.py +0 -51
- hikyuu/fetcher/stock/zh_stock_a_pytdx.py +0 -129
- hikyuu/gui/data/CollectToMemThread.py +0 -123
- hikyuu/gui/data/CollectToMySQLThread.py +0 -178
- hikyuu/gui/start_huatai_insight.py +0 -510
- hikyuu/tools/update_block_info.py +0 -168
- {hikyuu-2.6.8.5.dist-info → hikyuu-2.6.9.dist-info}/WHEEL +0 -0
- {hikyuu-2.6.8.5.dist-info → hikyuu-2.6.9.dist-info}/entry_points.txt +0 -0
hikyuu/extend.py
CHANGED
|
@@ -12,7 +12,6 @@ os.environ["NUMEXPR_MAX_THREADS"] = str(os.cpu_count())
|
|
|
12
12
|
from datetime import datetime, timedelta, date # NOQA: E402
|
|
13
13
|
import numpy as np # NOQA: E402
|
|
14
14
|
import pandas as pd # NOQA: E402
|
|
15
|
-
import pyarrow as pa # NOQA: E402
|
|
16
15
|
|
|
17
16
|
# 解决中文对齐问题
|
|
18
17
|
pd.set_option('display.unicode.ambiguous_as_wide', True)
|
hikyuu/extend.pyi
CHANGED
|
@@ -31,6 +31,7 @@ from hikyuu.cpp.core39 import LoanRecord
|
|
|
31
31
|
from hikyuu.cpp.core39 import MarketInfo
|
|
32
32
|
from hikyuu.cpp.core39 import MoneyManagerBase
|
|
33
33
|
from hikyuu.cpp.core39 import MultiFactorBase
|
|
34
|
+
from hikyuu.cpp.core39 import NormalizeBase
|
|
34
35
|
from hikyuu.cpp.core39 import OrderBrokerBase
|
|
35
36
|
from hikyuu.cpp.core39 import Parameter
|
|
36
37
|
from hikyuu.cpp.core39 import Performance
|
|
@@ -41,6 +42,7 @@ from hikyuu.cpp.core39 import ProfitGoalBase
|
|
|
41
42
|
from hikyuu.cpp.core39 import Query
|
|
42
43
|
from hikyuu.cpp.core39 import ScoreRecord
|
|
43
44
|
from hikyuu.cpp.core39 import ScoreRecordList
|
|
45
|
+
from hikyuu.cpp.core39 import ScoresFilterBase
|
|
44
46
|
from hikyuu.cpp.core39 import SelectorBase
|
|
45
47
|
from hikyuu.cpp.core39 import SignalBase
|
|
46
48
|
from hikyuu.cpp.core39 import SlippageBase
|
|
@@ -76,6 +78,7 @@ from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 impor
|
|
|
76
78
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import AF_FixedWeightList
|
|
77
79
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import AF_MultiFactor
|
|
78
80
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import AGG_COUNT
|
|
81
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import AGG_FUNC
|
|
79
82
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import AGG_MAD
|
|
80
83
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import AGG_MAX
|
|
81
84
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import AGG_MEAN
|
|
@@ -138,6 +141,13 @@ from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 impor
|
|
|
138
141
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import FILTER
|
|
139
142
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import FINANCE
|
|
140
143
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import FLOOR
|
|
144
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import GROUP_COUNT
|
|
145
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import GROUP_FUNC
|
|
146
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import GROUP_MAX
|
|
147
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import GROUP_MEAN
|
|
148
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import GROUP_MIN
|
|
149
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import GROUP_PROD
|
|
150
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import GROUP_SUM
|
|
141
151
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import HHV
|
|
142
152
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import HHVBARS
|
|
143
153
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import HOUR
|
|
@@ -200,6 +210,11 @@ from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 impor
|
|
|
200
210
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import Milliseconds
|
|
201
211
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import Minutes
|
|
202
212
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import NDAY
|
|
213
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import NORM_MinMax
|
|
214
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import NORM_NOTHING
|
|
215
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import NORM_Quantile
|
|
216
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import NORM_Quantile_Uniform
|
|
217
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import NORM_Zscore
|
|
203
218
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import NOT
|
|
204
219
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import PF_Simple
|
|
205
220
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import PF_WithoutAF
|
|
@@ -209,6 +224,7 @@ from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 impor
|
|
|
209
224
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import POS
|
|
210
225
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import POW
|
|
211
226
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import PRICELIST
|
|
227
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import QUANTILE_TRUNC
|
|
212
228
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import RANK
|
|
213
229
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import RECOVER_BACKWARD
|
|
214
230
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import RECOVER_EQUAL_BACKWARD
|
|
@@ -228,10 +244,17 @@ from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 impor
|
|
|
228
244
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import ROUNDUP
|
|
229
245
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import RSI
|
|
230
246
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import SAFTYLOSS
|
|
247
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import SCFilter_AmountLimit
|
|
248
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import SCFilter_Group
|
|
249
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import SCFilter_IgnoreNan
|
|
250
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import SCFilter_LessOrEqualValue
|
|
251
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import SCFilter_Price
|
|
252
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import SCFilter_TopN
|
|
231
253
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import SE_EvaluateOptimal
|
|
232
254
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import SE_Fixed
|
|
233
255
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import SE_MaxFundsOptimal
|
|
234
256
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import SE_MultiFactor
|
|
257
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import SE_MultiFactor2
|
|
235
258
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import SE_PerformanceOptimal
|
|
236
259
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import SE_Signal
|
|
237
260
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import SGN
|
|
@@ -471,13 +494,13 @@ from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 impor
|
|
|
471
494
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import ZHBOND10
|
|
472
495
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import ZONGGUBEN
|
|
473
496
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import ZSCORE
|
|
474
|
-
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import __add__ as __old_Datetime_add__
|
|
475
497
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import __add__ as __old_TimeDelta_add__
|
|
498
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import __add__ as __old_Datetime_add__
|
|
499
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import __init__ as __old_TimeDelta_init__
|
|
476
500
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import __init__ as __old_Datetime_init__
|
|
477
501
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import __init__ as old_Query_init
|
|
478
|
-
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import __init__ as __old_TimeDelta_init__
|
|
479
|
-
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import __sub__ as __old_TimeDelta_sub__
|
|
480
502
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import __sub__ as __old_Datetime_sub__
|
|
503
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import __sub__ as __old_TimeDelta_sub__
|
|
481
504
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import active_device
|
|
482
505
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import backtest
|
|
483
506
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import batch_calculate_inds
|
|
@@ -501,6 +524,7 @@ from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 impor
|
|
|
501
524
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import get_business_name
|
|
502
525
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import get_data_from_buffer_server
|
|
503
526
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import get_date_range
|
|
527
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import get_funds_list
|
|
504
528
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import get_inds_view
|
|
505
529
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import get_inds_view_pyarrow
|
|
506
530
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import get_kdata
|
|
@@ -527,6 +551,8 @@ from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 impor
|
|
|
527
551
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import krecords_to_pa
|
|
528
552
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import open_ostream_to_python
|
|
529
553
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import open_spend_time
|
|
554
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import parallel_run_pf
|
|
555
|
+
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import parallel_run_sys
|
|
530
556
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import positions_to_df
|
|
531
557
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import positions_to_np
|
|
532
558
|
from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 import positions_to_pa
|
|
@@ -567,9 +593,8 @@ from hikyuu.cpp.core39.pybind11_detail_function_record_v1_msvc_md_mscver19 impor
|
|
|
567
593
|
import numpy as np
|
|
568
594
|
import os as os
|
|
569
595
|
import pandas as pd
|
|
570
|
-
import pyarrow as pa
|
|
571
596
|
import sys as sys
|
|
572
|
-
__all__ = ['ABS', 'ACOS', 'AD', 'ADVANCE', 'AF_EqualWeight', 'AF_FixedWeight', 'AF_FixedWeightList', 'AF_MultiFactor', 'AGG_COUNT', 'AGG_MAD', 'AGG_MAX', 'AGG_MEAN', 'AGG_MEDIAN', 'AGG_MIN', 'AGG_PROD', 'AGG_QUANTILE', 'AGG_STD', 'AGG_SUM', 'AGG_VAR', 'ALIGN', 'AMA', 'ASIN', 'ATAN', 'ATR', 'AVEDEV', 'AllocateFundsBase', 'BACKSET', 'BARSCOUNT', 'BARSLAST', 'BARSLASTCOUNT', 'BARSSINCE', 'BARSSINCEN', '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', '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', 'KALMAN', 'KDATA_PART', 'KData', 'KDataDriver', 'KDataToHdf5Importer', 'KRecord', 'KRecordList', 'LAST', 'LASTVALUE', 'LIUTONGPAN', 'LLV', 'LLVBARS', 'LN', 'LOG', 'LOG_LEVEL', 'LONGCROSS', 'LoanRecord', 'MA', 'MACD', 'MAX', 'MDD', 'MF_EqualWeight', 'MF_ICIRWeight', 'MF_ICWeight', 'MF_Weight', 'MIN', 'MINUTE', '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', 'RANK', 'RECOVER_BACKWARD', 'RECOVER_EQUAL_BACKWARD', 'RECOVER_EQUAL_FORWARD', 'RECOVER_FORWARD', 'REF', 'REFX', 'REPLACE', 'RESULT', 'REVERSE', 'ROC', 'ROCP', 'ROCR', 'ROCR100', 'ROUND', 'ROUNDDOWN', 'ROUNDUP', 'RSI', 'SAFTYLOSS', 'SE_EvaluateOptimal', 'SE_Fixed', 'SE_MaxFundsOptimal', 'SE_MultiFactor', 'SE_PerformanceOptimal', 'SE_Signal', 'SGN', 'SG_Add', 'SG_AllwaysBuy', 'SG_And', 'SG_Band', 'SG_Bool', 'SG_Buy', 'SG_Cross', 'SG_CrossGold', 'SG_Cycle', 'SG_Div', 'SG_Flex', 'SG_Mul', 'SG_OneSide', 'SG_Or', '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', 'TR', 'TRACE', 'TURNOVER', 'TimeDelta', 'TimeDelta_timedelta', 'TimeLineList', 'TimeLineRecord', 'TradeCostBase', 'TradeManager', 'TradeRecord', 'TradeRecordList', 'TradeRequest', 'TransList', 'TransRecord', 'UPNDAY', 'UTCOffset', 'VAR', 'VARP', 'VIGOR', 'WARN', 'WEAVE', 'WEEK', 'WINNER', 'WITHDAY', 'WITHHALFYEAR', 'WITHHOUR', 'WITHHOUR2', 'WITHHOUR4', 'WITHKTYPE', 'WITHMIN', 'WITHMIN15', 'WITHMIN30', 'WITHMIN5', 'WITHMIN60', 'WITHMONTH', 'WITHQUARTER', 'WITHWEEK', 'WITHYEAR', 'WMA', 'YEAR', 'ZHBOND10', 'ZONGGUBEN', 'ZSCORE', 'active_device', 'backtest', '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', 'dates_to_np', 'dates_to_pa', 'datetime', 'df_to_krecords', 'fetch_trial_license', 'find_optimal_system', 'find_optimal_system_multi', 'get_block', 'get_business_name', 'get_data_from_buffer_server', 'get_date_range', 'get_inds_view', 'get_inds_view_pyarrow', 'get_kdata', 'get_last_version', 'get_log_level', 'get_market_view', 'get_market_view_pyarrow', 'get_spot_from_buffer_server', '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', 'is_valid_license', 'isinf', 'isnan', 'krecords_to_df', 'krecords_to_np', 'krecords_to_pa', 'new_Query_init', 'np', 'old_Query_init', 'open_ostream_to_python', 'open_spend_time', 'os', '
|
|
597
|
+
__all__ = ['ABS', 'ACOS', 'AD', 'ADVANCE', 'AF_EqualWeight', 'AF_FixedWeight', 'AF_FixedWeightList', 'AF_MultiFactor', 'AGG_COUNT', 'AGG_FUNC', 'AGG_MAD', 'AGG_MAX', 'AGG_MEAN', 'AGG_MEDIAN', 'AGG_MIN', 'AGG_PROD', 'AGG_QUANTILE', 'AGG_STD', 'AGG_SUM', 'AGG_VAR', 'ALIGN', 'AMA', 'ASIN', 'ATAN', 'ATR', 'AVEDEV', 'AllocateFundsBase', 'BACKSET', 'BARSCOUNT', 'BARSLAST', 'BARSLASTCOUNT', 'BARSSINCE', 'BARSSINCEN', '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', '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', 'GROUP_COUNT', 'GROUP_FUNC', 'GROUP_MAX', 'GROUP_MEAN', 'GROUP_MIN', 'GROUP_PROD', 'GROUP_SUM', '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', 'KALMAN', 'KDATA_PART', 'KData', 'KDataDriver', 'KDataToHdf5Importer', 'KRecord', 'KRecordList', 'LAST', 'LASTVALUE', 'LIUTONGPAN', 'LLV', 'LLVBARS', 'LN', 'LOG', 'LOG_LEVEL', 'LONGCROSS', 'LoanRecord', 'MA', 'MACD', 'MAX', 'MDD', 'MF_EqualWeight', 'MF_ICIRWeight', 'MF_ICWeight', 'MF_Weight', 'MIN', 'MINUTE', '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', 'NORM_MinMax', 'NORM_NOTHING', 'NORM_Quantile', 'NORM_Quantile_Uniform', 'NORM_Zscore', 'NOT', 'NormalizeBase', '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', 'QUANTILE_TRUNC', 'Query', 'RANK', 'RECOVER_BACKWARD', 'RECOVER_EQUAL_BACKWARD', 'RECOVER_EQUAL_FORWARD', 'RECOVER_FORWARD', 'REF', 'REFX', 'REPLACE', 'RESULT', 'REVERSE', 'ROC', 'ROCP', 'ROCR', 'ROCR100', 'ROUND', 'ROUNDDOWN', 'ROUNDUP', 'RSI', 'SAFTYLOSS', 'SCFilter_AmountLimit', 'SCFilter_Group', 'SCFilter_IgnoreNan', 'SCFilter_LessOrEqualValue', 'SCFilter_Price', 'SCFilter_TopN', 'SE_EvaluateOptimal', 'SE_Fixed', 'SE_MaxFundsOptimal', 'SE_MultiFactor', 'SE_MultiFactor2', 'SE_PerformanceOptimal', 'SE_Signal', 'SGN', 'SG_Add', 'SG_AllwaysBuy', 'SG_And', 'SG_Band', 'SG_Bool', 'SG_Buy', 'SG_Cross', 'SG_CrossGold', 'SG_Cycle', 'SG_Div', 'SG_Flex', 'SG_Mul', 'SG_OneSide', 'SG_Or', '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', 'ScoresFilterBase', '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', 'TR', 'TRACE', 'TURNOVER', 'TimeDelta', 'TimeDelta_timedelta', 'TimeLineList', 'TimeLineRecord', 'TradeCostBase', 'TradeManager', 'TradeRecord', 'TradeRecordList', 'TradeRequest', 'TransList', 'TransRecord', 'UPNDAY', 'UTCOffset', 'VAR', 'VARP', 'VIGOR', 'WARN', 'WEAVE', 'WEEK', 'WINNER', 'WITHDAY', 'WITHHALFYEAR', 'WITHHOUR', 'WITHHOUR2', 'WITHHOUR4', 'WITHKTYPE', 'WITHMIN', 'WITHMIN15', 'WITHMIN30', 'WITHMIN5', 'WITHMIN60', 'WITHMONTH', 'WITHQUARTER', 'WITHWEEK', 'WITHYEAR', 'WMA', 'YEAR', 'ZHBOND10', 'ZONGGUBEN', 'ZSCORE', 'active_device', 'backtest', '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', 'dates_to_np', 'dates_to_pa', 'datetime', 'df_to_krecords', 'fetch_trial_license', 'find_optimal_system', 'find_optimal_system_multi', 'get_block', 'get_business_name', 'get_data_from_buffer_server', 'get_date_range', 'get_funds_list', 'get_inds_view', 'get_inds_view_pyarrow', 'get_kdata', 'get_last_version', 'get_log_level', 'get_market_view', 'get_market_view_pyarrow', 'get_spot_from_buffer_server', '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', 'is_valid_license', 'isinf', 'isnan', 'krecords_to_df', 'krecords_to_np', 'krecords_to_pa', 'new_Query_init', 'np', 'old_Query_init', 'open_ostream_to_python', 'open_spend_time', 'os', 'parallel_run_pf', 'parallel_run_sys', 'pd', 'positions_to_df', 'positions_to_np', 'positions_to_pa', 'register_extra_ktype', 'release_extra_ktype', 'remove_license', 'roundDown', 'roundEx', 'roundUp', 'run_in_strategy', 'scorerecords_to_df', 'scorerecords_to_np', 'set_log_level', 'set_python_in_interactive', 'set_python_in_jupyter', 'spot_agent_is_connected', 'spot_agent_is_running', 'start_data_server', 'start_spot_agent', 'stop_data_server', 'stop_spot_agent', 'sys', 'systemweights_to_df', 'systemweights_to_np', 'timedelta', 'timeline_to_df', 'timeline_to_np', 'timeline_to_pa', 'toPriceList', 'trades_to_df', 'trades_to_np', 'trades_to_pa', 'translist_to_df', 'translist_to_np', 'translist_to_pa', 'view_license', 'weights_to_df', 'weights_to_np', 'weights_to_pa']
|
|
573
598
|
def DatetimeList_to_df(data: hikyuu.cpp.core39.DatetimeList):
|
|
574
599
|
...
|
|
575
600
|
def DatetimeList_to_np(data: hikyuu.cpp.core39.DatetimeList):
|
|
@@ -17,7 +17,7 @@ from hikyuu.util import *
|
|
|
17
17
|
em_num_per_page = 100
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
@hku_catch(ret=[], trace=
|
|
20
|
+
@hku_catch(ret=[], trace=False)
|
|
21
21
|
def get_hybk_names():
|
|
22
22
|
"""获取所有行业(板块代码,板块名称)列表"""
|
|
23
23
|
url = "https://19.push2.eastmoney.com/api/qt/clist/get"
|
|
@@ -50,7 +50,7 @@ def get_hybk_names():
|
|
|
50
50
|
return ret
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
@hku_catch(ret=[], trace=
|
|
53
|
+
@hku_catch(ret=[], trace=False)
|
|
54
54
|
def get_hybk_cons_code(blk_code):
|
|
55
55
|
"获取指定行业板块成分代码列表"
|
|
56
56
|
url = "http://30.push2.eastmoney.com/api/qt/clist/get"
|
|
@@ -83,16 +83,19 @@ def get_hybk_cons_code(blk_code):
|
|
|
83
83
|
return ret
|
|
84
84
|
|
|
85
85
|
|
|
86
|
-
@hku_catch(ret={}, trace=
|
|
86
|
+
@hku_catch(ret={}, trace=False)
|
|
87
87
|
def get_all_hybk_info(code_market_dict, sep=""):
|
|
88
88
|
"""获取所有行业板块列表"""
|
|
89
89
|
blk_list = get_hybk_names()
|
|
90
|
+
time.sleep(random.uniform(1, 3))
|
|
90
91
|
ret = {}
|
|
91
|
-
|
|
92
|
+
total = len(blk_list)
|
|
93
|
+
for i, blk in enumerate(blk_list):
|
|
92
94
|
stk_codes = get_hybk_cons_code(blk[0])
|
|
93
|
-
hku_info(f"获取行业板块{blk[1]}成分: {len(stk_codes)}")
|
|
95
|
+
hku_info(f"{i}|{total} 获取行业板块{blk[1]}成分: {len(stk_codes)}")
|
|
94
96
|
ret[blk[1]] = [
|
|
95
97
|
f"{code_market_dict[stk_code]}{sep}{stk_code}" for stk_code in stk_codes if stk_code in code_market_dict]
|
|
98
|
+
time.sleep(random.uniform(1, 3))
|
|
96
99
|
return ret
|
|
97
100
|
|
|
98
101
|
|
|
@@ -431,21 +434,23 @@ def stock_board_concept_cons_em(symbol: str = "融资融券") -> pd.DataFrame:
|
|
|
431
434
|
return temp_df
|
|
432
435
|
|
|
433
436
|
|
|
434
|
-
@hku_catch(ret={}, trace=
|
|
437
|
+
@hku_catch(ret={}, trace=False)
|
|
435
438
|
def get_all_gnbk_info(code_market_dict, sep=""):
|
|
436
439
|
"""获取所有概念版本列表"""
|
|
437
440
|
blk_names = stock_board_concept_name_em()['板块名称']
|
|
438
441
|
ret = {}
|
|
442
|
+
total = len(blk_names)
|
|
439
443
|
for i, blk_name in enumerate(blk_names):
|
|
440
444
|
stk_codes = stock_board_concept_cons_em(blk_name)
|
|
441
445
|
stk_codes = stk_codes['代码'].to_list()
|
|
442
|
-
hku_info(f"{i} 获取概念板块{blk_name}成分: {len(stk_codes)}")
|
|
446
|
+
hku_info(f"{i}|{total} 获取概念板块{blk_name}成分: {len(stk_codes)}")
|
|
443
447
|
ret[blk_name] = [
|
|
444
448
|
f"{code_market_dict[stk_code]}{sep}{stk_code}" for stk_code in stk_codes if stk_code in code_market_dict]
|
|
449
|
+
time.sleep(random.uniform(1, 3))
|
|
445
450
|
return ret
|
|
446
451
|
|
|
447
452
|
|
|
448
|
-
@hku_catch(ret=[], trace=
|
|
453
|
+
@hku_catch(ret=[], trace=False)
|
|
449
454
|
def get_dybk_names():
|
|
450
455
|
"""获取所有地域板块名称列表"""
|
|
451
456
|
url = "http://13.push2.eastmoney.com/api/qt/clist/get"
|
|
@@ -478,7 +483,7 @@ def get_dybk_names():
|
|
|
478
483
|
return ret
|
|
479
484
|
|
|
480
485
|
|
|
481
|
-
@hku_catch(ret={}, trace=
|
|
486
|
+
@hku_catch(ret={}, trace=False)
|
|
482
487
|
def get_all_dybk_info(code_market_dict, sep=""):
|
|
483
488
|
"""获取所有地域板块列表"""
|
|
484
489
|
blk_list = get_dybk_names()
|
|
@@ -499,10 +504,12 @@ def get_all_dybk_info(code_market_dict, sep=""):
|
|
|
499
504
|
}
|
|
500
505
|
|
|
501
506
|
ret = {}
|
|
502
|
-
|
|
507
|
+
total = len(blk_list)
|
|
508
|
+
for i, v in enumerate(blk_list):
|
|
503
509
|
blk_code, blk_name = v[0], v[1]
|
|
504
510
|
params["fs"] = f"b:{blk_code} f:!50"
|
|
505
511
|
params["pn"] = 1
|
|
512
|
+
time.sleep(random.uniform(1, 3))
|
|
506
513
|
r = requests.get(url, params=params, timeout=15)
|
|
507
514
|
data = r.json()
|
|
508
515
|
if data["data"] is None:
|
|
@@ -522,15 +529,34 @@ def get_all_dybk_info(code_market_dict, sep=""):
|
|
|
522
529
|
ret[blk_name].extend(
|
|
523
530
|
[f"{code_market_dict[v['f12']]}{sep}{v['f12']}" for v in stk_json if v["f12"] in code_market_dict])
|
|
524
531
|
time.sleep(random.uniform(1, 3))
|
|
525
|
-
hku_info(f'获取地域板块{blk_name}成分: {len(ret[blk_name])}')
|
|
532
|
+
hku_info(f'{i}|{total} 获取地域板块{blk_name}成分: {len(ret[blk_name])}')
|
|
526
533
|
|
|
527
534
|
return ret
|
|
528
535
|
|
|
529
536
|
|
|
530
|
-
@hku_catch(ret={}, trace=
|
|
537
|
+
@hku_catch(ret={}, trace=False)
|
|
531
538
|
def get_all_zsbk_info(code_market_dict, sep=""):
|
|
532
539
|
"""获取所有指数成分股列表"""
|
|
533
540
|
blk_info = ak.index_stock_info()
|
|
541
|
+
blk_info['index_code'] = blk_info['index_code'].astype(str) # 确保是字符串类型
|
|
542
|
+
df_000 = blk_info[blk_info['index_code'].str.startswith('000')].reset_index(drop=True) # 000前缀
|
|
543
|
+
df_399 = blk_info[blk_info['index_code'].str.startswith('399')].reset_index(drop=True) # 399前缀
|
|
544
|
+
|
|
545
|
+
# 2. 交替合并两个DataFrame
|
|
546
|
+
merged_rows = []
|
|
547
|
+
max_length = max(len(df_000), len(df_399)) # 取两个DataFrame的最大长度
|
|
548
|
+
|
|
549
|
+
for i in range(max_length):
|
|
550
|
+
# 先加000前缀的行(如果存在)
|
|
551
|
+
if i < len(df_000):
|
|
552
|
+
merged_rows.append(df_000.iloc[i])
|
|
553
|
+
# 再加399前缀的行(如果存在)
|
|
554
|
+
if i < len(df_399):
|
|
555
|
+
merged_rows.append(df_399.iloc[i])
|
|
556
|
+
|
|
557
|
+
# 3. 转换为DataFrame
|
|
558
|
+
blk_info = pd.DataFrame(merged_rows).reset_index(drop=True)
|
|
559
|
+
|
|
534
560
|
blk_codes = blk_info["index_code"]
|
|
535
561
|
blk_names = blk_info["display_name"]
|
|
536
562
|
ret = {}
|
|
@@ -542,17 +568,23 @@ def get_all_zsbk_info(code_market_dict, sep=""):
|
|
|
542
568
|
# 沪深指数有重复,避免深指覆盖
|
|
543
569
|
if blk_name in ret:
|
|
544
570
|
continue
|
|
571
|
+
|
|
572
|
+
time.sleep(random.uniform(1, 3))
|
|
545
573
|
try:
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
574
|
+
if blk_code[:3] == "399":
|
|
575
|
+
stk_codes = ak.index_stock_cons(symbol=blk_code)
|
|
576
|
+
stk_codes = stk_codes['品种代码'].to_list()
|
|
577
|
+
else:
|
|
578
|
+
stk_codes = ak.index_stock_cons_csindex(symbol=blk_code)
|
|
579
|
+
stk_codes = stk_codes['成分券代码'].to_list()
|
|
580
|
+
hku_info("{}|{} 获取指数板块 {}|{} 成分: {}", i, total, blk_code, blk_name, len(stk_codes))
|
|
549
581
|
ret[blk_name] = [
|
|
550
582
|
f"{code_market_dict[stk_code]}{sep}{stk_code}" for stk_code in stk_codes if stk_code in code_market_dict]
|
|
551
583
|
except KeyboardInterrupt:
|
|
552
584
|
break
|
|
553
|
-
except:
|
|
554
|
-
|
|
555
|
-
|
|
585
|
+
except Exception as e:
|
|
586
|
+
print(f"Failed! {i}, {blk_code}, {blk_name}")
|
|
587
|
+
# raise e
|
|
556
588
|
return ret
|
|
557
589
|
|
|
558
590
|
|
hikyuu/gui/HikyuuTDX.py
CHANGED
|
@@ -12,11 +12,10 @@ from logging.handlers import QueueListener
|
|
|
12
12
|
# 优先加载,处理 VS 17.10 升级后依赖 dll 不兼容问题
|
|
13
13
|
import hikyuu
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
from
|
|
18
|
-
from
|
|
19
|
-
from PyQt5.QtGui import QIcon, QTextCursor, QFont, QPalette, QPixmap
|
|
15
|
+
# 替换PyQt5导入为PySide6
|
|
16
|
+
from PySide6.QtWidgets import QApplication, QMainWindow, QFileDialog, QMessageBox
|
|
17
|
+
from PySide6.QtCore import Slot, QObject, Signal
|
|
18
|
+
from PySide6.QtGui import QIcon, QTextCursor, QFont, QPalette, QPixmap
|
|
20
19
|
|
|
21
20
|
import mysql.connector
|
|
22
21
|
from mysql.connector import errorcode
|
|
@@ -43,7 +42,7 @@ from hikyuu.util import *
|
|
|
43
42
|
|
|
44
43
|
class EmittingStream(QObject):
|
|
45
44
|
"""输出重定向至QT"""
|
|
46
|
-
textWritten =
|
|
45
|
+
textWritten = Signal(str)
|
|
47
46
|
|
|
48
47
|
def write(self, text):
|
|
49
48
|
self.textWritten.emit(str(text))
|
|
@@ -249,7 +248,7 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
249
248
|
except:
|
|
250
249
|
pass
|
|
251
250
|
|
|
252
|
-
@
|
|
251
|
+
@Slot()
|
|
253
252
|
def on_save_pushButton_clicked(self):
|
|
254
253
|
try:
|
|
255
254
|
self.saveConfig()
|
|
@@ -333,7 +332,22 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
333
332
|
icon = QIcon(f"{current_dir}/images/hikyuu_small.png")
|
|
334
333
|
star_img = QPixmap(f"{current_dir}/images/star.png")
|
|
335
334
|
self.label_44.setPixmap(star_img)
|
|
335
|
+
# 修改 label_46 的 HTML 文本,直接在 HTML 中设置字体大小
|
|
336
|
+
|
|
337
|
+
label_46_txt = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
|
338
|
+
<html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">
|
|
339
|
+
p, li { white-space: pre-wrap; }
|
|
340
|
+
hr { height: 1px; border-width: 0; }
|
|
341
|
+
li.unchecked::marker { content: "\2610"; }
|
|
342
|
+
li.checked::marker { content: "\2612"; }
|
|
343
|
+
</style></head><body style="font-weight:400; font-style:normal;">
|
|
344
|
+
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span>Hikyuu </span><span style="font-weight:700;">专注于量化交易领域的核心技术构建,涵盖交易模型开发、极速计算引擎、高效回测框架及实盘拓展能力</span><span>,定位为量化交易计算引擎,为量化交易爱好者提供高性能底层架构支持。随着社区规模扩大,分散了作者在策略研究上的精力。为保障项目的可持续性,现对捐赠用户提供部分额外功能作为回馈,感谢社区伙伴的支持!</span></p>
|
|
345
|
+
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span>捐赠功能以插件的方式提供,采用独立授权许可,完全在 hikyuu 之外,对喜欢自行编译扩展的朋友没有影响。因插件许可授权需要采集硬件信息,如有疑虑只要不申请试用许可和正式许可授权,不会触发硬件信息采集,如申请,视为同意采集。</span></p>
|
|
346
|
+
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span>详情参见:</span><a href="https://hikyuu.readthedocs.io/zh-cn/latest/vip/vip-plan.html"><span style="text-decoration: underline; color:#3586ff;">捐赠权益</span></a><span style="font-weight:700;"> ,感谢大家的支持!</span></p></body></html>
|
|
347
|
+
"""
|
|
348
|
+
self.label_46.setText(label_46_txt)
|
|
336
349
|
self.label_46.setOpenExternalLinks(True)
|
|
350
|
+
|
|
337
351
|
self.label_license.setText(view_license())
|
|
338
352
|
self.fetch_trial_pushButton.setEnabled(not is_valid_license())
|
|
339
353
|
|
|
@@ -434,6 +448,7 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
434
448
|
if (not is_valid_license()) or hdf5_enable or mysql_enable:
|
|
435
449
|
clickhouse_enable = False
|
|
436
450
|
self.enable_clickhouse_radioButton.setChecked(clickhouse_enable)
|
|
451
|
+
self.enable_clickhouse_radioButton.setEnabled(is_valid_license())
|
|
437
452
|
self.clickhouse_tmpdir_lineEdit.setText(import_config.get('clickhouse', 'tmpdir', fallback='d:/stock'))
|
|
438
453
|
self.clickhouse_tmpdir_pushButton.setEnabled(clickhouse_enable)
|
|
439
454
|
clickhouse_ip = import_config.get('clickhouse', 'host', fallback='127.0.0.1')
|
|
@@ -618,7 +633,7 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
618
633
|
'5MIN': self.hdf5_5min_progressBar
|
|
619
634
|
}
|
|
620
635
|
|
|
621
|
-
@
|
|
636
|
+
@Slot()
|
|
622
637
|
def on_fetch_trial_pushButton_clicked(self):
|
|
623
638
|
email = self.email_lineEdit.text()
|
|
624
639
|
info = fetch_trial_license(email)
|
|
@@ -626,7 +641,7 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
626
641
|
self.label_license.setText(view_license())
|
|
627
642
|
self.fetch_trial_pushButton.setEnabled(not is_valid_license())
|
|
628
643
|
|
|
629
|
-
@
|
|
644
|
+
@Slot()
|
|
630
645
|
def on_pytdx_radioButton_clicked(self):
|
|
631
646
|
if self.pytdx_radioButton.isChecked():
|
|
632
647
|
self.tdx_radioButton.setChecked(False)
|
|
@@ -634,7 +649,7 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
634
649
|
self.use_download = 'pytdx'
|
|
635
650
|
self.on_tdx_or_pytdx_toggled()
|
|
636
651
|
|
|
637
|
-
@
|
|
652
|
+
@Slot()
|
|
638
653
|
def on_tdx_radioButton_clicked(self):
|
|
639
654
|
if self.tdx_radioButton.isChecked():
|
|
640
655
|
self.pytdx_radioButton.setChecked(False)
|
|
@@ -642,6 +657,7 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
642
657
|
self.use_download = 'tdx'
|
|
643
658
|
self.on_tdx_or_pytdx_toggled()
|
|
644
659
|
|
|
660
|
+
@Slot()
|
|
645
661
|
def on_qmt_radioButton_clicked(self):
|
|
646
662
|
if self.qmt_radioButton.isChecked():
|
|
647
663
|
self.tdx_radioButton.setChecked(False)
|
|
@@ -675,7 +691,7 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
675
691
|
self.time_start_dateEdit.setEnabled(False)
|
|
676
692
|
self.use_tdx_number_spinBox.setEnabled(False)
|
|
677
693
|
|
|
678
|
-
@
|
|
694
|
+
@Slot()
|
|
679
695
|
def on_select_tdx_dir_pushButton_clicked(self):
|
|
680
696
|
dlg = QFileDialog()
|
|
681
697
|
dlg.setFileMode(QFileDialog.Directory)
|
|
@@ -685,7 +701,7 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
685
701
|
dirname = dlg.selectedFiles()
|
|
686
702
|
self.tdx_dir_lineEdit.setText(dirname[0])
|
|
687
703
|
|
|
688
|
-
@
|
|
704
|
+
@Slot()
|
|
689
705
|
def on_hdf5_dir_pushButton_clicked(self):
|
|
690
706
|
dlg = QFileDialog()
|
|
691
707
|
dlg.setFileMode(QFileDialog.Directory)
|
|
@@ -695,21 +711,21 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
695
711
|
dirname = dlg.selectedFiles()
|
|
696
712
|
self.hdf5_dir_lineEdit.setText(dirname[0])
|
|
697
713
|
|
|
698
|
-
@
|
|
714
|
+
@Slot()
|
|
699
715
|
def on_enable_hdf55_radioButton_clicked(self):
|
|
700
716
|
if self.enable_hdf55_radioButton.isChecked():
|
|
701
717
|
self.enable_mysql_radioButton.setChecked(False)
|
|
702
718
|
self.enable_clickhouse_radioButton.setChecked(False)
|
|
703
719
|
self.on_enable_database_toggled(hdf5=True, mysql=False, clickhouse=False)
|
|
704
720
|
|
|
705
|
-
@
|
|
721
|
+
@Slot()
|
|
706
722
|
def on_enable_mysql_radioButton_clicked(self):
|
|
707
723
|
if self.enable_mysql_radioButton.isChecked():
|
|
708
724
|
self.enable_hdf55_radioButton.setChecked(False)
|
|
709
725
|
self.enable_clickhouse_radioButton.setChecked(False)
|
|
710
726
|
self.on_enable_database_toggled(hdf5=False, mysql=True, clickhouse=False)
|
|
711
727
|
|
|
712
|
-
@
|
|
728
|
+
@Slot()
|
|
713
729
|
def on_enable_clickhouse_radioButton_clicked(self):
|
|
714
730
|
if self.enable_clickhouse_radioButton.isChecked():
|
|
715
731
|
self.enable_hdf55_radioButton.setChecked(False)
|
|
@@ -732,7 +748,7 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
732
748
|
self.clickhouse_test_pushButton.setEnabled(clickhouse)
|
|
733
749
|
self.clickhouse_tmpdir_pushButton.setEnabled(clickhouse)
|
|
734
750
|
|
|
735
|
-
@
|
|
751
|
+
@Slot()
|
|
736
752
|
def on_mysql_tmpdir_pushButton_clicked(self):
|
|
737
753
|
dlg = QFileDialog()
|
|
738
754
|
dlg.setFileMode(QFileDialog.Directory)
|
|
@@ -742,7 +758,7 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
742
758
|
dirname = dlg.selectedFiles()
|
|
743
759
|
self.mysql_tmpdir_lineEdit.setText(dirname[0])
|
|
744
760
|
|
|
745
|
-
@
|
|
761
|
+
@Slot()
|
|
746
762
|
def on_clickhouse_tmpdir_pushButton_clicked(self):
|
|
747
763
|
if not is_valid_license():
|
|
748
764
|
QMessageBox.critical(self, "clickhouse引擎", "需要捐赠授权才能使用clickhouse引擎")
|
|
@@ -756,7 +772,7 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
756
772
|
dirname = dlg.selectedFiles()
|
|
757
773
|
self.clickhouse_tmpdir_lineEdit.setText(dirname[0])
|
|
758
774
|
|
|
759
|
-
@
|
|
775
|
+
@Slot()
|
|
760
776
|
def on_mysql_test_pushButton_clicked(self):
|
|
761
777
|
"""测试数据库连接"""
|
|
762
778
|
db_config = {
|
|
@@ -780,7 +796,7 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
780
796
|
|
|
781
797
|
QMessageBox.about(self, "测试数据库连接", " 连接成功!")
|
|
782
798
|
|
|
783
|
-
@
|
|
799
|
+
@Slot()
|
|
784
800
|
def on_clickhouse_test_pushButton_clicked(self):
|
|
785
801
|
"""测试数据库连接"""
|
|
786
802
|
db_config = {
|
|
@@ -821,7 +837,8 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
821
837
|
if msg_name == 'ESCAPE_TIME':
|
|
822
838
|
self.escape_time = msg_task_name
|
|
823
839
|
self.import_status_label.setText(
|
|
824
|
-
"耗时:{:>.2f} 秒 ({:>.2f}分钟) {}".format(
|
|
840
|
+
"耗时:{:>.2f} 秒 ({:>.2f}分钟) {}".format(
|
|
841
|
+
self.escape_time, self.escape_time / 60, datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
|
|
825
842
|
)
|
|
826
843
|
|
|
827
844
|
elif msg_name == 'HDF5_IMPORT':
|
|
@@ -890,7 +907,7 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
890
907
|
if msg[2] != 'FINISHED':
|
|
891
908
|
self.import_detail_textEdit.append(msg[2])
|
|
892
909
|
|
|
893
|
-
@
|
|
910
|
+
@Slot()
|
|
894
911
|
def on_start_import_pushButton_clicked(self):
|
|
895
912
|
try:
|
|
896
913
|
self.saveConfig()
|
|
@@ -965,7 +982,7 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
965
982
|
self.escape_time_thread.message.connect(self.on_message_from_thread)
|
|
966
983
|
self.escape_time_thread.start()
|
|
967
984
|
|
|
968
|
-
@
|
|
985
|
+
@Slot()
|
|
969
986
|
def on_sched_import_pushButton_clicked(self):
|
|
970
987
|
self.sched_import_pushButton.setEnabled(False)
|
|
971
988
|
if self._is_sched_import_running:
|
|
@@ -993,7 +1010,7 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
|
|
|
993
1010
|
self.sched_import_pushButton.setText("停止定时导入")
|
|
994
1011
|
self.sched_import_pushButton.setEnabled(True)
|
|
995
1012
|
|
|
996
|
-
@
|
|
1013
|
+
@Slot()
|
|
997
1014
|
def on_collect_start_pushButton_clicked(self):
|
|
998
1015
|
if self._is_collect_running:
|
|
999
1016
|
if self.collect_spot_thread is not None and self.collect_spot_thread.isRunning():
|
|
@@ -1033,6 +1050,41 @@ def start():
|
|
|
1033
1050
|
sys.exit(app.exec())
|
|
1034
1051
|
|
|
1035
1052
|
|
|
1053
|
+
def is_font_installed(font_name):
|
|
1054
|
+
"""检查字体是否安装"""
|
|
1055
|
+
if sys.platform == "win32":
|
|
1056
|
+
try:
|
|
1057
|
+
import winreg
|
|
1058
|
+
# 打开注册表中的字体项
|
|
1059
|
+
key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts")
|
|
1060
|
+
i = 0
|
|
1061
|
+
while True:
|
|
1062
|
+
try:
|
|
1063
|
+
name, value, _ = winreg.EnumValue(key, i)
|
|
1064
|
+
if font_name in name:
|
|
1065
|
+
winreg.CloseKey(key)
|
|
1066
|
+
return True
|
|
1067
|
+
i += 1
|
|
1068
|
+
except WindowsError:
|
|
1069
|
+
break
|
|
1070
|
+
winreg.CloseKey(key)
|
|
1071
|
+
except:
|
|
1072
|
+
# 如果注册表检查失败,则尝试创建字体对象
|
|
1073
|
+
try:
|
|
1074
|
+
f = QFont(font_name)
|
|
1075
|
+
return f.exactMatch()
|
|
1076
|
+
except:
|
|
1077
|
+
pass
|
|
1078
|
+
return False
|
|
1079
|
+
else:
|
|
1080
|
+
# 非Windows系统简单检查
|
|
1081
|
+
try:
|
|
1082
|
+
f = QFont(font_name)
|
|
1083
|
+
return f.exactMatch()
|
|
1084
|
+
except:
|
|
1085
|
+
return False
|
|
1086
|
+
|
|
1087
|
+
|
|
1036
1088
|
if __name__ == "__main__":
|
|
1037
1089
|
import requests
|
|
1038
1090
|
import urllib
|
|
@@ -1040,14 +1092,13 @@ if __name__ == "__main__":
|
|
|
1040
1092
|
logging.getLogger("urllib3").setLevel(logging.WARNING)
|
|
1041
1093
|
logging.getLogger("pytdx").setLevel(logging.WARNING)
|
|
1042
1094
|
|
|
1043
|
-
# 自适应分辨率,防止字体显示不全
|
|
1044
|
-
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps)
|
|
1045
|
-
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
|
|
1046
|
-
|
|
1047
1095
|
app = QApplication(sys.argv)
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1096
|
+
if sys.platform == 'win32':
|
|
1097
|
+
# 检查Microsoft YaHei字体是否存在
|
|
1098
|
+
if is_font_installed('Microsoft YaHei'):
|
|
1099
|
+
f = QFont('Microsoft YaHei')
|
|
1100
|
+
f.setPixelSize(12)
|
|
1101
|
+
app.setFont(f)
|
|
1051
1102
|
|
|
1052
1103
|
if (len(sys.argv) > 1 and sys.argv[1] == '0'):
|
|
1053
1104
|
FORMAT = '%(asctime)-15s [%(levelname)s]: %(message)s [%(name)s::%(funcName)s]'
|
|
@@ -6,7 +6,7 @@ import logging
|
|
|
6
6
|
import time
|
|
7
7
|
import datetime
|
|
8
8
|
from math import ceil
|
|
9
|
-
from
|
|
9
|
+
from PySide6.QtCore import QThread, QWaitCondition, QMutex
|
|
10
10
|
|
|
11
11
|
from hikyuu.util import *
|
|
12
12
|
from hikyuu.gui.spot_server import collect, release_nng_senders
|