diff --git a/requirements.txt b/requirements.txt index 2ef247b6..60d525eb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,7 @@ numpy pandas matplotlib seaborn -jupyter \ No newline at end of file +jupyter +#ta-lib +#https://download.lfd.uci.edu/pythonlibs/r5uhg2lo/TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl + diff --git a/vnpy/api/ctp/vnctp/vnctpmd/vnctpmd.cpp b/vnpy/api/ctp/vnctp/vnctpmd/vnctpmd.cpp index a8398879..6e53c87c 100644 --- a/vnpy/api/ctp/vnctp/vnctpmd/vnctpmd.cpp +++ b/vnpy/api/ctp/vnctp/vnctpmd/vnctpmd.cpp @@ -570,7 +570,8 @@ int MdApi::join() int MdApi::exit() { this->active = false; - //this->task_thread.join(); + this->task_queue.terminate(); + this->task_thread.join(); this->api->RegisterSpi(NULL); this->api->Release(); @@ -808,8 +809,6 @@ public: PYBIND11_MODULE(vnctpmd, m) { - PyEval_InitThreads(); //导入时运行,保证先创建GIL - class_ mdapi(m, "MdApi"); mdapi .def(init<>()) diff --git a/vnpy/api/ctp/vnctp/vnctpmd/vnctpmd.vcxproj b/vnpy/api/ctp/vnctp/vnctpmd/vnctpmd.vcxproj index d5c4473c..d972523a 100644 --- a/vnpy/api/ctp/vnctp/vnctpmd/vnctpmd.vcxproj +++ b/vnpy/api/ctp/vnctp/vnctpmd/vnctpmd.vcxproj @@ -75,12 +75,14 @@ C:\Python37\include;$(SolutionDir);$(SolutionDir)..\include;$(SolutionDir)..\include\ctp;$(IncludePath) C:\Python37\libs;$(SolutionDir)..\libs;$(LibraryPath) .pyd + $(SolutionDir)..\ true C:\Python37\include;$(SolutionDir);$(SolutionDir)..\include;$(SolutionDir)..\include\ctp;$(IncludePath) C:\Python37\libs;$(SolutionDir)..\libs;$(LibraryPath) .pyd + $(SolutionDir)..\ false @@ -88,6 +90,7 @@ C:\Python37\include;$(SolutionDir);$(SolutionDir)..\include;$(SolutionDir)..\include\ctp;$(IncludePath) C:\GitHub\vnpy\vnpy\api\ctp\ctpapi;$(ReferencePath) C:\Python37\libs;$(SolutionDir)..\libs;$(LibraryPath) + $(SolutionDir)..\ false @@ -95,6 +98,7 @@ $(ReferencePath) .pyd C:\Python37\libs;$(SolutionDir)..\libs;$(LibraryPath) + $(SolutionDir)..\ @@ -137,6 +141,7 @@ NOMINMAX;_CRT_SECURE_NO_WARNINGS;NOMINMAX;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;VNCTPMD_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true stdafx.h + MultiThreaded Console @@ -158,6 +163,7 @@ stdafx.h + MultiThreaded Console diff --git a/vnpy/api/ctp/vnctp/vnctptd/vnctptd.cpp b/vnpy/api/ctp/vnctp/vnctptd/vnctptd.cpp index 7f8d9ed4..6a29eb70 100644 --- a/vnpy/api/ctp/vnctp/vnctptd/vnctptd.cpp +++ b/vnpy/api/ctp/vnctp/vnctptd/vnctptd.cpp @@ -7921,7 +7921,8 @@ int TdApi::join() int TdApi::exit() { this->active = false; - //this->task_thread.join(); + this->task_queue.terminate(); + this->task_thread.join(); this->api->RegisterSpi(NULL); this->api->Release(); @@ -10631,8 +10632,6 @@ public: PYBIND11_MODULE(vnctptd, m) { - PyEval_InitThreads(); //导入时运行,保证先创建GIL - class_ TdApi(m, "TdApi"); TdApi .def(init<>()) diff --git a/vnpy/api/ctp/vnctp/vnctptd/vnctptd.vcxproj b/vnpy/api/ctp/vnctp/vnctptd/vnctptd.vcxproj index 625a5bb9..9a90be18 100644 --- a/vnpy/api/ctp/vnctp/vnctptd/vnctptd.vcxproj +++ b/vnpy/api/ctp/vnctp/vnctptd/vnctptd.vcxproj @@ -75,24 +75,28 @@ C:\Python37\include;$(SolutionDir);$(SolutionDir)..\include;$(SolutionDir)..\include\ctp;$(IncludePath) C:\Python37\libs;$(SolutionDir)..\libs;$(LibraryPath) .pyd + $(SolutionDir)..\ true C:\Python37\include;$(SolutionDir);$(SolutionDir)..\include;$(SolutionDir)..\include\ctp;$(IncludePath) C:\Python37\libs;$(SolutionDir)..\libs;$(LibraryPath) .pyd + $(SolutionDir)..\ false C:\Python37\include;$(SolutionDir);$(SolutionDir)..\include;$(SolutionDir)..\include\ctp;$(IncludePath) C:\Python37\libs;$(SolutionDir)..\libs;$(LibraryPath) .pyd + $(SolutionDir)..\ false .pyd C:\Python37\include;$(SolutionDir);$(SolutionDir)..\include;$(SolutionDir)..\include\ctp;$(IncludePath) C:\Python37\libs;$(SolutionDir)..\libs;$(LibraryPath) + $(SolutionDir)..\ @@ -135,6 +139,7 @@ NOMINMAX;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;VNCTPTD_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true stdafx.h + MultiThreaded Console @@ -156,6 +161,7 @@ stdafx.h + MultiThreaded Console diff --git a/vnpy/api/ctp/vnctpmd.pyd b/vnpy/api/ctp/vnctpmd.pyd index 06804964..2207274e 100644 Binary files a/vnpy/api/ctp/vnctpmd.pyd and b/vnpy/api/ctp/vnctpmd.pyd differ diff --git a/vnpy/api/ctp/vnctptd.pyd b/vnpy/api/ctp/vnctptd.pyd index 41fcc880..d56c830b 100644 Binary files a/vnpy/api/ctp/vnctptd.pyd and b/vnpy/api/ctp/vnctptd.pyd differ