hikyuu 2.6.3__py3-none-win_amd64.whl → 2.6.6__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hikyuu/__init__.py +6 -0
- hikyuu/__init__.pyi +548 -546
- hikyuu/analysis/__init__.pyi +519 -514
- hikyuu/analysis/analysis.pyi +520 -515
- hikyuu/core.pyi +521 -516
- hikyuu/cpp/__init__.pyi +2 -2
- 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/core310.pyi +167 -36
- hikyuu/cpp/core311.pyd +0 -0
- hikyuu/cpp/core311.pyi +167 -36
- hikyuu/cpp/core312.pyd +0 -0
- hikyuu/cpp/core312.pyi +167 -36
- hikyuu/cpp/core313.pyd +0 -0
- hikyuu/cpp/core313.pyi +167 -36
- hikyuu/cpp/core39.pyd +0 -0
- hikyuu/cpp/core39.pyi +167 -36
- hikyuu/cpp/hikyuu.dll +0 -0
- hikyuu/cpp/hikyuu.lib +0 -0
- hikyuu/cpp/i18n/__init__.py +0 -0
- hikyuu/cpp/i18n/zh_CN.mo +0 -0
- hikyuu/cpp/sqlite3.dll +0 -0
- hikyuu/data/clickhouse_upgrade/__init__.py +1 -0
- hikyuu/data/clickhouse_upgrade/createdb.sql +1085 -0
- hikyuu/data/common.py +1 -1
- hikyuu/data/common_clickhouse.py +512 -0
- hikyuu/data/common_mysql.py +19 -0
- hikyuu/data/common_pytdx.py +2 -0
- hikyuu/data/common_sqlite3.py +1 -0
- hikyuu/data/em_block_to_clickhouse.py +120 -0
- hikyuu/data/hku_config_template.py +70 -1
- hikyuu/data/mysql_upgrade/0028.sql +95 -0
- hikyuu/data/pytdx_finance_to_clickhouse.py +107 -0
- hikyuu/data/pytdx_to_clickhouse.py +841 -0
- hikyuu/data/pytdx_to_h5.py +53 -13
- hikyuu/data/pytdx_to_mysql.py +42 -9
- hikyuu/data/pytdx_to_taos.py +736 -0
- hikyuu/data/pytdx_weight_to_clickhouse.py +191 -0
- hikyuu/data/sqlite_upgrade/0028.sql +97 -0
- hikyuu/data/tdx_to_clickhouse.py +448 -0
- hikyuu/data/zh_bond10_to_clickhouse.py +49 -0
- hikyuu/draw/__init__.pyi +1 -1
- hikyuu/draw/drawplot/__init__.pyi +8 -8
- hikyuu/draw/drawplot/bokeh_draw.pyi +538 -536
- hikyuu/draw/drawplot/common.pyi +1 -1
- hikyuu/draw/drawplot/echarts_draw.pyi +540 -538
- hikyuu/draw/drawplot/matplotlib_draw.py +7 -7
- hikyuu/draw/drawplot/matplotlib_draw.pyi +550 -548
- hikyuu/draw/elder.pyi +11 -11
- hikyuu/draw/kaufman.pyi +18 -18
- hikyuu/draw/volume.pyi +10 -10
- hikyuu/examples/notebook/001-overview.ipynb +65 -100
- hikyuu/examples/notebook/004-IndicatorOverview.ipynb +34 -32
- hikyuu/examples/notebook/007-SystemDetails.ipynb +64 -50
- hikyuu/examples/notebook/010-Portfolio.ipynb +120 -124
- hikyuu/extend.py +1 -1
- hikyuu/extend.pyi +527 -527
- hikyuu/fetcher/stock/zh_block_em.py +349 -5
- hikyuu/fetcher/stock/zh_stock_a_pytdx.py +11 -21
- hikyuu/fetcher/stock/zh_stock_a_qmt.py +4 -5
- hikyuu/fetcher/stock/zh_stock_a_sina_qq.py +16 -60
- hikyuu/flat/Spot.py +96 -200
- hikyuu/gui/HikyuuTDX.py +175 -23
- hikyuu/gui/data/ImportBlockInfoTask.py +12 -1
- hikyuu/gui/data/ImportHistoryFinanceTask.py +62 -44
- hikyuu/gui/data/ImportPytdxTimeToH5Task.py +14 -2
- hikyuu/gui/data/ImportPytdxToH5Task.py +17 -3
- hikyuu/gui/data/ImportPytdxTransToH5Task.py +14 -2
- hikyuu/gui/data/ImportTdxToH5Task.py +13 -1
- hikyuu/gui/data/ImportWeightToSqliteTask.py +16 -2
- hikyuu/gui/data/ImportZhBond10Task.py +12 -1
- hikyuu/gui/data/MainWindow.py +191 -110
- hikyuu/gui/data/UsePytdxImportToH5Thread.py +52 -29
- hikyuu/gui/data/UseQmtImportToH5Thread.py +1 -0
- hikyuu/gui/data/UseTdxImportToH5Thread.py +21 -2
- hikyuu/gui/dataserver.py +12 -4
- hikyuu/gui/spot_server.py +30 -40
- hikyuu/gui/start_qmt.py +20 -3
- hikyuu/hub.pyi +6 -6
- hikyuu/include/hikyuu/DataType.h +11 -0
- hikyuu/include/hikyuu/MarketInfo.h +6 -0
- hikyuu/include/hikyuu/StockManager.h +8 -0
- hikyuu/include/hikyuu/data_driver/BaseInfoDriver.h +35 -0
- hikyuu/include/hikyuu/data_driver/kdata/mysql/KRecordTable.h +1 -0
- hikyuu/include/hikyuu/global/GlobalSpotAgent.h +1 -1
- hikyuu/include/hikyuu/global/SpotRecord.h +15 -31
- hikyuu/include/hikyuu/global/agent/spot_generated.h +48 -232
- hikyuu/include/hikyuu/global/schedule/scheduler.h +1 -1
- hikyuu/include/hikyuu/indicator/build_in.h +1 -0
- hikyuu/include/hikyuu/indicator/crt/BARSLASTCOUNT.h +33 -0
- hikyuu/include/hikyuu/indicator/imp/IBarsLastCount.h +27 -0
- hikyuu/include/hikyuu/plugin/KDataToHdf5Importer.h +3 -0
- hikyuu/include/hikyuu/plugin/backtest.h +2 -2
- hikyuu/include/hikyuu/plugin/dataserver.h +26 -1
- hikyuu/include/hikyuu/plugin/device.h +8 -4
- hikyuu/include/hikyuu/plugin/interface/BackTestPluginInterface.h +1 -1
- hikyuu/include/hikyuu/plugin/interface/DataDriverPluginInterface.h +27 -0
- hikyuu/include/hikyuu/plugin/interface/DataServerPluginInterface.h +2 -1
- hikyuu/include/hikyuu/plugin/interface/DevicePluginInterface.h +2 -1
- hikyuu/include/hikyuu/plugin/interface/ImportKDataToHdf5PluginInterface.h +3 -0
- hikyuu/include/hikyuu/plugin/interface/TMReportPluginInterface.h +80 -0
- hikyuu/include/hikyuu/plugin/interface/plugins.h +4 -0
- hikyuu/include/hikyuu/strategy/Strategy.h +0 -9
- hikyuu/include/hikyuu/trade_manage/Performance.h +17 -9
- hikyuu/include/hikyuu/trade_manage/PositionExtInfo.h +92 -0
- hikyuu/include/hikyuu/trade_manage/PositionRecord.h +7 -1
- hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +60 -1
- hikyuu/include/hikyuu/trade_sys/selector/crt/SE_Optimal.h +8 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/OptimalEvaluateSelector.h +28 -0
- hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/OptimalSelectorBase.h +1 -0
- hikyuu/include/hikyuu/utilities/DllLoader.h +226 -0
- hikyuu/include/hikyuu/utilities/config.h +1 -1
- hikyuu/include/hikyuu/utilities/datetime/Datetime.h +20 -0
- hikyuu/include/hikyuu/utilities/datetime/TimeDelta.h +6 -0
- hikyuu/include/hikyuu/utilities/mo/mo.h +30 -14
- hikyuu/include/hikyuu/utilities/os.h +6 -0
- hikyuu/include/hikyuu/utilities/plugin/PluginLoader.h +10 -10
- hikyuu/include/hikyuu/utilities/thread/MQThreadPool.h +13 -7
- hikyuu/include/hikyuu/utilities/thread/ThreadPool.h +13 -6
- 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/import2hdf5.dll +0 -0
- hikyuu/plugin/tmreport.dll +0 -0
- hikyuu/trade_manage/__init__.pyi +537 -535
- hikyuu/trade_manage/broker.pyi +3 -3
- hikyuu/trade_manage/broker_easytrader.pyi +1 -1
- hikyuu/trade_manage/trade.pyi +537 -535
- hikyuu/util/__init__.py +1 -0
- hikyuu/util/__init__.pyi +4 -3
- hikyuu/util/check.py +8 -0
- hikyuu/util/check.pyi +5 -1
- hikyuu/util/singleton.pyi +1 -1
- {hikyuu-2.6.3.dist-info → hikyuu-2.6.6.dist-info}/METADATA +4 -3
- {hikyuu-2.6.3.dist-info → hikyuu-2.6.6.dist-info}/RECORD +144 -123
- {hikyuu-2.6.3.dist-info → hikyuu-2.6.6.dist-info}/top_level.txt +2 -2
- hikyuu/include/hikyuu/global/agent/hikyuu/__init__.py +0 -1
- hikyuu/include/hikyuu/global/agent/hikyuu/flat/__init__.py +0 -1
- {hikyuu-2.6.3.dist-info → hikyuu-2.6.6.dist-info}/LICENSE +0 -0
- {hikyuu-2.6.3.dist-info → hikyuu-2.6.6.dist-info}/WHEEL +0 -0
- {hikyuu-2.6.3.dist-info → hikyuu-2.6.6.dist-info}/entry_points.txt +0 -0
|
@@ -26,23 +26,39 @@
|
|
|
26
26
|
#endif
|
|
27
27
|
|
|
28
28
|
namespace hku {
|
|
29
|
+
namespace mo {
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
/**
|
|
32
|
+
* @brief 初始化多语言支持
|
|
33
|
+
* @param path 翻译文件路径
|
|
34
|
+
*/
|
|
35
|
+
void HKU_UTILS_API init(const std::string &path = "i18n");
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @brief 按指定语言获取翻译
|
|
39
|
+
* @param lang
|
|
40
|
+
* @param id
|
|
41
|
+
* @return std::string
|
|
42
|
+
*/
|
|
43
|
+
std::string HKU_UTILS_API translate(const std::string &lang, const char *id);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @brief 按指定语言和上下文获取翻译
|
|
47
|
+
* @param lang
|
|
48
|
+
* @param ctx
|
|
49
|
+
* @param id
|
|
50
|
+
* @return std::string
|
|
51
|
+
*/
|
|
52
|
+
std::string HKU_UTILS_API translate(const std::string &lang, const char *ctx, const char *id);
|
|
33
53
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return iter != ms_dict.end() ? ms_dict[lang].Lookup(id) : std::string(id);
|
|
37
|
-
}
|
|
54
|
+
/** 获取系统语言 */
|
|
55
|
+
std::string HKU_UTILS_API getSystemLanguage();
|
|
38
56
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return iter != ms_dict.end() ? ms_dict[lang].LookupWithContext(ctx, id) : std::string(id);
|
|
42
|
-
}
|
|
57
|
+
/** 按系统语言获取翻译 */
|
|
58
|
+
std::string HKU_UTILS_API _tr(const char *id);
|
|
43
59
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
};
|
|
60
|
+
/** 按系统语言和上下文获取翻译 */
|
|
61
|
+
std::string HKU_UTILS_API _ctr(const char *ctx, const char *id);
|
|
47
62
|
|
|
63
|
+
} // namespace mo
|
|
48
64
|
} // namespace hku
|
|
@@ -79,6 +79,12 @@ std::string HKU_UTILS_API getUserDir();
|
|
|
79
79
|
*/
|
|
80
80
|
std::string HKU_UTILS_API getCurrentDir();
|
|
81
81
|
|
|
82
|
+
/**
|
|
83
|
+
* 获取dll自身所在目录
|
|
84
|
+
* @note 仅支持linux/macos。windows下获取的是exe所在路径!
|
|
85
|
+
*/
|
|
86
|
+
std::string HKU_UTILS_API getDllSelfDir();
|
|
87
|
+
|
|
82
88
|
/**
|
|
83
89
|
* 输出终端是否支持彩色控制字符
|
|
84
90
|
*/
|
|
@@ -71,6 +71,16 @@ public:
|
|
|
71
71
|
return true;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
std::string getFileName(const std::string& pluginname) const noexcept {
|
|
75
|
+
#if HKU_OS_WINDOWS
|
|
76
|
+
return fmt::format("{}/{}.dll", m_path, pluginname);
|
|
77
|
+
#elif HKU_OS_LINUX
|
|
78
|
+
return fmt::format("{}/lib{}.so", m_path, pluginname);
|
|
79
|
+
#elif HKU_OS_OSX
|
|
80
|
+
return fmt::format("{}/lib{}.dylib", m_path, pluginname);
|
|
81
|
+
#endif
|
|
82
|
+
}
|
|
83
|
+
|
|
74
84
|
private:
|
|
75
85
|
void unload() noexcept {
|
|
76
86
|
m_plugin.reset();
|
|
@@ -92,16 +102,6 @@ private:
|
|
|
92
102
|
return func;
|
|
93
103
|
}
|
|
94
104
|
|
|
95
|
-
std::string getFileName(const std::string& pluginname) const noexcept {
|
|
96
|
-
#if HKU_OS_WINDOWS
|
|
97
|
-
return fmt::format("{}/{}.dll", m_path, pluginname);
|
|
98
|
-
#elif HKU_OS_LINUX
|
|
99
|
-
return fmt::format("{}/lib{}.so", m_path, pluginname);
|
|
100
|
-
#elif HKU_OS_OSX
|
|
101
|
-
return fmt::format("{}/lib{}.dylib", m_path, pluginname);
|
|
102
|
-
#endif
|
|
103
|
-
}
|
|
104
|
-
|
|
105
105
|
private:
|
|
106
106
|
#if HKU_OS_WINDOWS
|
|
107
107
|
HMODULE m_handle{nullptr};
|
|
@@ -157,9 +157,12 @@ public:
|
|
|
157
157
|
m_queues[i]->push(FuncWrapper());
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
{
|
|
161
|
+
std::lock_guard<std::mutex> lock(m_mutex_join);
|
|
162
|
+
for (size_t i = 0; i < m_worker_num; i++) {
|
|
163
|
+
if (m_threads[i].joinable()) {
|
|
164
|
+
m_threads[i].join();
|
|
165
|
+
}
|
|
163
166
|
}
|
|
164
167
|
}
|
|
165
168
|
|
|
@@ -190,10 +193,12 @@ public:
|
|
|
190
193
|
m_queues[i]->notify_all();
|
|
191
194
|
}
|
|
192
195
|
|
|
193
|
-
// 等待线程结束
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
m_threads[i].
|
|
196
|
+
{ // 等待线程结束
|
|
197
|
+
std::lock_guard<std::mutex> lock(m_mutex_join);
|
|
198
|
+
for (size_t i = 0; i < m_worker_num; i++) {
|
|
199
|
+
if (m_threads[i].joinable()) {
|
|
200
|
+
m_threads[i].join();
|
|
201
|
+
}
|
|
197
202
|
}
|
|
198
203
|
}
|
|
199
204
|
|
|
@@ -209,6 +214,7 @@ private:
|
|
|
209
214
|
std::vector<std::unique_ptr<ThreadSafeQueue<task_type>>> m_queues; // 线程任务队列
|
|
210
215
|
std::vector<InterruptFlag> m_thread_need_stop; // 线程终止标志
|
|
211
216
|
std::vector<std::thread> m_threads; // 工作线程
|
|
217
|
+
std::mutex m_mutex_join; // 用于保护 joinable
|
|
212
218
|
|
|
213
219
|
void worker_thread(int index) {
|
|
214
220
|
auto *local_queue = m_queues[index].get();
|
|
@@ -125,9 +125,12 @@ public:
|
|
|
125
125
|
|
|
126
126
|
m_master_work_queue.notify_all();
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
{
|
|
129
|
+
std::lock_guard<std::mutex> lock(m_mutex_join);
|
|
130
|
+
for (size_t i = 0; i < m_worker_num; i++) {
|
|
131
|
+
if (m_threads[i].joinable()) {
|
|
132
|
+
m_threads[i].join();
|
|
133
|
+
}
|
|
131
134
|
}
|
|
132
135
|
}
|
|
133
136
|
|
|
@@ -155,9 +158,12 @@ public:
|
|
|
155
158
|
|
|
156
159
|
m_master_work_queue.notify_all();
|
|
157
160
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
+
{
|
|
162
|
+
std::lock_guard<std::mutex> lock(m_mutex_join);
|
|
163
|
+
for (size_t i = 0; i < m_worker_num; i++) {
|
|
164
|
+
if (m_threads[i].joinable()) {
|
|
165
|
+
m_threads[i].join();
|
|
166
|
+
}
|
|
161
167
|
}
|
|
162
168
|
}
|
|
163
169
|
|
|
@@ -173,6 +179,7 @@ private:
|
|
|
173
179
|
|
|
174
180
|
ThreadSafeQueue<task_type> m_master_work_queue; // 主线程任务队列
|
|
175
181
|
std::vector<std::thread> m_threads; // 工作线程
|
|
182
|
+
std::mutex m_mutex_join; // 用于保护 joinable
|
|
176
183
|
|
|
177
184
|
void worker_thread(int index) {
|
|
178
185
|
while (!m_done) {
|
hikyuu/include/hikyuu/version.h
CHANGED
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
#define HKU_VERSION_H
|
|
13
13
|
|
|
14
14
|
// clang-format off
|
|
15
|
-
#define HKU_VERSION "2.6.
|
|
15
|
+
#define HKU_VERSION "2.6.6"
|
|
16
16
|
#define HKU_VERSION_MAJOR 2
|
|
17
17
|
#define HKU_VERSION_MINOR 6
|
|
18
|
-
#define HKU_VERSION_ALTER
|
|
19
|
-
#define HKU_VERSION_BUILD
|
|
18
|
+
#define HKU_VERSION_ALTER 6
|
|
19
|
+
#define HKU_VERSION_BUILD 202507291558
|
|
20
20
|
#define HKU_VERSION_MODE "RELEASE"
|
|
21
|
-
#define HKU_VERSION_GIT "2.6.
|
|
21
|
+
#define HKU_VERSION_GIT "2.6.6 master.c4a12bf4 (RELEASE)"
|
|
22
22
|
// clang-format on
|
|
23
23
|
|
|
24
24
|
#endif /* HKU_VERSION_H */
|
hikyuu/plugin/backtest.dll
CHANGED
|
Binary file
|
|
Binary file
|
hikyuu/plugin/dataserver.dll
CHANGED
|
Binary file
|
hikyuu/plugin/device.dll
CHANGED
|
Binary file
|
hikyuu/plugin/extind.dll
CHANGED
|
Binary file
|
hikyuu/plugin/import2hdf5.dll
CHANGED
|
Binary file
|
|
Binary file
|