diff --git a/vnpy/api/mini/vnctp/vnctp.h b/vnpy/api/mini/vnctp/vnctp.h deleted file mode 100644 index 5e0eb69d..00000000 --- a/vnpy/api/mini/vnctp/vnctp.h +++ /dev/null @@ -1,146 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#include "pybind11/pybind11.h" - - -using namespace std; -using namespace pybind11; - - -//任务结构体 -struct Task -{ - int task_name; //回调函数名称对应的常量 - void *task_data; //数据指针 - void *task_error; //错误指针 - int task_id; //请求id - bool task_last; //是否为最后返回 -}; - -class TerminatedError : std::exception -{}; - -class TaskQueue -{ -private: - queue queue_; //标准库队列 - mutex mutex_; //互斥锁 - condition_variable cond_; //条件变量 - - bool _terminate = false; - -public: - - //存入新的任务 - void push(const Task &task) - { - unique_lock mlock(mutex_); - queue_.push(task); //向队列中存入数据 - mlock.unlock(); //释放锁 - cond_.notify_one(); //通知正在阻塞等待的线程 - } - - //取出老的任务 - Task pop() - { - unique_lock mlock(mutex_); - cond_.wait(mlock, [&]() { - return !queue_.empty() || _terminate; - }); //等待条件变量通知 - if (_terminate) - throw TerminatedError(); - Task task = queue_.front(); //获取队列中的最后一个任务 - queue_.pop(); //删除该任务 - return task; //返回该任务 - } - - void terminate() - { - _terminate = true; - cond_.notify_all(); //通知正在阻塞等待的线程 - } -}; - - -//从字典中获取某个建值对应的整数,并赋值到请求结构体对象的值上 -void getInt(const dict &d, const char *key, int *value) -{ - if (d.contains(key)) //检查字典中是否存在该键值 - { - object o = d[key]; //获取该键值 - *value = o.cast(); - } -}; - - -//从字典中获取某个建值对应的浮点数,并赋值到请求结构体对象的值上 -void getDouble(const dict &d, const char *key, double *value) -{ - if (d.contains(key)) - { - object o = d[key]; - *value = o.cast(); - } -}; - - -//从字典中获取某个建值对应的字符,并赋值到请求结构体对象的值上 -void getChar(const dict &d, const char *key, char *value) -{ - if (d.contains(key)) - { - object o = d[key]; - *value = o.cast(); - } -}; - - -template -using string_literal = char[size]; - -//从字典中获取某个建值对应的字符串,并赋值到请求结构体对象的值上 -template -void getString(const pybind11::dict &d, const char *key, string_literal &value) -{ - if (d.contains(key)) - { - object o = d[key]; - string s = o.cast(); - const char *buf = s.c_str(); - strcpy(value, buf); - } -}; - -//将GBK编码的字符串转换为UTF8 -inline string toUtf(const string &gb2312) -{ -#ifdef _MSC_VER - const static locale loc("zh-CN"); -#else - const static locale loc("zh_CN.GB18030"); -#endif - - vector wstr(gb2312.size()); - wchar_t* wstrEnd = nullptr; - const char* gbEnd = nullptr; - mbstate_t state = {}; - int res = use_facet > - (loc).in(state, - gb2312.data(), gb2312.data() + gb2312.size(), gbEnd, - wstr.data(), wstr.data() + wstr.size(), wstrEnd); - - if (codecvt_base::ok == res) - { - wstring_convert> cutf8; - return cutf8.to_bytes(wstring(wstr.data(), wstrEnd)); - } - - return string(); -} diff --git a/vnpy/api/mini/vnctp/vnctp.sln b/vnpy/api/mini/vnctp/vnctp.sln deleted file mode 100644 index 20b4cf6f..00000000 --- a/vnpy/api/mini/vnctp/vnctp.sln +++ /dev/null @@ -1,41 +0,0 @@ -锘 -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.329 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vnctptd", "vnctptd\vnctptd.vcxproj", "{016732E6-5789-4F7C-9A1C-C46A249080CF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vnctpmd", "vnctpmd\vnctpmd.vcxproj", "{F00054FF-282F-4826-848E-D58BFB9E9D9F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {016732E6-5789-4F7C-9A1C-C46A249080CF}.Debug|x64.ActiveCfg = Debug|x64 - {016732E6-5789-4F7C-9A1C-C46A249080CF}.Debug|x64.Build.0 = Debug|x64 - {016732E6-5789-4F7C-9A1C-C46A249080CF}.Debug|x86.ActiveCfg = Debug|Win32 - {016732E6-5789-4F7C-9A1C-C46A249080CF}.Debug|x86.Build.0 = Debug|Win32 - {016732E6-5789-4F7C-9A1C-C46A249080CF}.Release|x64.ActiveCfg = Release|x64 - {016732E6-5789-4F7C-9A1C-C46A249080CF}.Release|x64.Build.0 = Release|x64 - {016732E6-5789-4F7C-9A1C-C46A249080CF}.Release|x86.ActiveCfg = Release|Win32 - {016732E6-5789-4F7C-9A1C-C46A249080CF}.Release|x86.Build.0 = Release|Win32 - {F00054FF-282F-4826-848E-D58BFB9E9D9F}.Debug|x64.ActiveCfg = Debug|x64 - {F00054FF-282F-4826-848E-D58BFB9E9D9F}.Debug|x64.Build.0 = Debug|x64 - {F00054FF-282F-4826-848E-D58BFB9E9D9F}.Debug|x86.ActiveCfg = Debug|Win32 - {F00054FF-282F-4826-848E-D58BFB9E9D9F}.Debug|x86.Build.0 = Debug|Win32 - {F00054FF-282F-4826-848E-D58BFB9E9D9F}.Release|x64.ActiveCfg = Release|x64 - {F00054FF-282F-4826-848E-D58BFB9E9D9F}.Release|x64.Build.0 = Release|x64 - {F00054FF-282F-4826-848E-D58BFB9E9D9F}.Release|x86.ActiveCfg = Release|Win32 - {F00054FF-282F-4826-848E-D58BFB9E9D9F}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {C24EA8F8-8E45-4556-A1D8-AF8DEE29D09F} - EndGlobalSection -EndGlobal diff --git a/vnpy/api/mini/vnctp/vnctpmd/dllmain.cpp b/vnpy/api/mini/vnctp/vnctpmd/dllmain.cpp deleted file mode 100644 index 6785c0ec..00000000 --- a/vnpy/api/mini/vnctp/vnctpmd/dllmain.cpp +++ /dev/null @@ -1,19 +0,0 @@ -锘// dllmain.cpp : 瀹氫箟 DLL 搴旂敤绋嬪簭鐨勫叆鍙g偣銆 -#include "stdafx.h" - -BOOL APIENTRY DllMain( HMODULE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved - ) -{ - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} - diff --git a/vnpy/api/mini/vnctp/vnctpmd/stdafx.cpp b/vnpy/api/mini/vnctp/vnctpmd/stdafx.cpp deleted file mode 100644 index fd4f341c..00000000 --- a/vnpy/api/mini/vnctp/vnctpmd/stdafx.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "stdafx.h" diff --git a/vnpy/api/mini/vnctp/vnctpmd/stdafx.h b/vnpy/api/mini/vnctp/vnctpmd/stdafx.h deleted file mode 100644 index 56244c66..00000000 --- a/vnpy/api/mini/vnctp/vnctpmd/stdafx.h +++ /dev/null @@ -1,17 +0,0 @@ -锘// stdafx.h: 鏍囧噯绯荤粺鍖呭惈鏂囦欢鐨勫寘鍚枃浠讹紝 -// 鎴栨槸缁忓父浣跨敤浣嗕笉甯告洿鏀圭殑 -// 椤圭洰鐗瑰畾鐨勫寘鍚枃浠 -// - -#pragma once - -#include "targetver.h" - - -#define WIN32_LEAN_AND_MEAN // 浠 Windows 澶存枃浠朵腑鎺掗櫎鏋佸皯浣跨敤鐨勫唴瀹 -// Windows 澶存枃浠 -#include - - - -// 鍦ㄦ澶勫紩鐢ㄧ▼搴忛渶瑕佺殑鍏朵粬鏍囧ご diff --git a/vnpy/api/mini/vnctp/vnctpmd/targetver.h b/vnpy/api/mini/vnctp/vnctpmd/targetver.h deleted file mode 100644 index 2895aefa..00000000 --- a/vnpy/api/mini/vnctp/vnctpmd/targetver.h +++ /dev/null @@ -1,8 +0,0 @@ -锘#pragma once - -// 鍖呮嫭 SDKDDKVer.h 灏嗗畾涔夊彲鐢ㄧ殑鏈楂樼増鏈殑 Windows 骞冲彴銆 - -// 濡傛灉瑕佷负浠ュ墠鐨 Windows 骞冲彴鐢熸垚搴旂敤绋嬪簭锛岃鍖呮嫭 WinSDKVer.h锛屽苟 -// 灏 _WIN32_WINNT 瀹忚缃负瑕佹敮鎸佺殑骞冲彴锛岀劧鍚庡啀鍖呮嫭 SDKDDKVer.h銆 - -#include diff --git a/vnpy/api/mini/vnctp/vnctpmd/vnctpmd.cpp b/vnpy/api/mini/vnctp/vnctpmd/vnctpmd.cpp deleted file mode 100644 index e05bcdd4..00000000 --- a/vnpy/api/mini/vnctp/vnctpmd/vnctpmd.cpp +++ /dev/null @@ -1,842 +0,0 @@ -// vnctpmd.cpp : 定义 DLL 应用程序的导出函数。 -// - -#include "vnctpmd.h" - - -///------------------------------------------------------------------------------------- -///C++的回调函数将数据保存到队列中 -///------------------------------------------------------------------------------------- - -void MdApi::OnFrontConnected() -{ - Task task = Task(); - task.task_name = ONFRONTCONNECTED; - this->task_queue.push(task); -}; - -void MdApi::OnFrontDisconnected(int nReason) -{ - Task task = Task(); - task.task_name = ONFRONTDISCONNECTED; - task.task_id = nReason; - this->task_queue.push(task); -}; - -void MdApi::OnHeartBeatWarning(int nTimeLapse) -{ - Task task = Task(); - task.task_name = ONHEARTBEATWARNING; - task.task_id = nTimeLapse; - this->task_queue.push(task); -}; - -void MdApi::OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPUSERLOGIN; - if (pRspUserLogin) - { - CThostFtdcRspUserLoginField *task_data = new CThostFtdcRspUserLoginField(); - *task_data = *pRspUserLogin; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void MdApi::OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPUSERLOGOUT; - if (pUserLogout) - { - CThostFtdcUserLogoutField *task_data = new CThostFtdcUserLogoutField(); - *task_data = *pUserLogout; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void MdApi::OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPERROR; - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void MdApi::OnRspSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPSUBMARKETDATA; - if (pSpecificInstrument) - { - CThostFtdcSpecificInstrumentField *task_data = new CThostFtdcSpecificInstrumentField(); - *task_data = *pSpecificInstrument; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void MdApi::OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPUNSUBMARKETDATA; - if (pSpecificInstrument) - { - CThostFtdcSpecificInstrumentField *task_data = new CThostFtdcSpecificInstrumentField(); - *task_data = *pSpecificInstrument; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void MdApi::OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPSUBFORQUOTERSP; - if (pSpecificInstrument) - { - CThostFtdcSpecificInstrumentField *task_data = new CThostFtdcSpecificInstrumentField(); - *task_data = *pSpecificInstrument; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void MdApi::OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPUNSUBFORQUOTERSP; - if (pSpecificInstrument) - { - CThostFtdcSpecificInstrumentField *task_data = new CThostFtdcSpecificInstrumentField(); - *task_data = *pSpecificInstrument; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void MdApi::OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData) -{ - Task task = Task(); - task.task_name = ONRTNDEPTHMARKETDATA; - if (pDepthMarketData) - { - CThostFtdcDepthMarketDataField *task_data = new CThostFtdcDepthMarketDataField(); - *task_data = *pDepthMarketData; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void MdApi::OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) -{ - Task task = Task(); - task.task_name = ONRTNFORQUOTERSP; - if (pForQuoteRsp) - { - CThostFtdcForQuoteRspField *task_data = new CThostFtdcForQuoteRspField(); - *task_data = *pForQuoteRsp; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - - - -///------------------------------------------------------------------------------------- -///工作线程从队列中取出数据,转化为python对象后,进行推送 -///------------------------------------------------------------------------------------- - -void MdApi::processTask() -{ - try - { - while (this->active) - { - Task task = this->task_queue.pop(); - - switch (task.task_name) - { - case ONFRONTCONNECTED: - { - this->processFrontConnected(&task); - break; - } - - case ONFRONTDISCONNECTED: - { - this->processFrontDisconnected(&task); - break; - } - - case ONHEARTBEATWARNING: - { - this->processHeartBeatWarning(&task); - break; - } - - case ONRSPUSERLOGIN: - { - this->processRspUserLogin(&task); - break; - } - - case ONRSPUSERLOGOUT: - { - this->processRspUserLogout(&task); - break; - } - - case ONRSPERROR: - { - this->processRspError(&task); - break; - } - - case ONRSPSUBMARKETDATA: - { - this->processRspSubMarketData(&task); - break; - } - - case ONRSPUNSUBMARKETDATA: - { - this->processRspUnSubMarketData(&task); - break; - } - - case ONRSPSUBFORQUOTERSP: - { - this->processRspSubForQuoteRsp(&task); - break; - } - - case ONRSPUNSUBFORQUOTERSP: - { - this->processRspUnSubForQuoteRsp(&task); - break; - } - - case ONRTNDEPTHMARKETDATA: - { - this->processRtnDepthMarketData(&task); - break; - } - - case ONRTNFORQUOTERSP: - { - this->processRtnForQuoteRsp(&task); - break; - } - }; - } - } - catch (const TerminatedError&) - { - } -}; - -void MdApi::processFrontConnected(Task *task) -{ - gil_scoped_acquire acquire; - this->onFrontConnected(); -}; - -void MdApi::processFrontDisconnected(Task *task) -{ - gil_scoped_acquire acquire; - this->onFrontDisconnected(task->task_id); -}; - -void MdApi::processHeartBeatWarning(Task *task) -{ - gil_scoped_acquire acquire; - this->onHeartBeatWarning(task->task_id); -}; - -void MdApi::processRspUserLogin(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRspUserLoginField *task_data = (CThostFtdcRspUserLoginField*)task->task_data; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["LoginTime"] = toUtf(task_data->LoginTime); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["UserID"] = toUtf(task_data->UserID); - data["SystemName"] = toUtf(task_data->SystemName); - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["MaxOrderRef"] = toUtf(task_data->MaxOrderRef); - data["SHFETime"] = toUtf(task_data->SHFETime); - data["DCETime"] = toUtf(task_data->DCETime); - data["CZCETime"] = toUtf(task_data->CZCETime); - data["FFEXTime"] = toUtf(task_data->FFEXTime); - data["INETime"] = toUtf(task_data->INETime); - delete task->task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task->task_error; - } - this->onRspUserLogin(data, error, task->task_id, task->task_last); -}; - -void MdApi::processRspUserLogout(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcUserLogoutField *task_data = (CThostFtdcUserLogoutField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["UserID"] = toUtf(task_data->UserID); - delete task->task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task->task_error; - } - this->onRspUserLogout(data, error, task->task_id, task->task_last); -}; - -void MdApi::processRspError(Task *task) -{ - gil_scoped_acquire acquire; - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task->task_error; - } - this->onRspError(error, task->task_id, task->task_last); -}; - -void MdApi::processRspSubMarketData(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcSpecificInstrumentField *task_data = (CThostFtdcSpecificInstrumentField*)task->task_data; - data["InstrumentID"] = toUtf(task_data->InstrumentID); - delete task->task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task->task_error; - } - this->onRspSubMarketData(data, error, task->task_id, task->task_last); -}; - -void MdApi::processRspUnSubMarketData(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcSpecificInstrumentField *task_data = (CThostFtdcSpecificInstrumentField*)task->task_data; - data["InstrumentID"] = toUtf(task_data->InstrumentID); - delete task->task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task->task_error; - } - this->onRspUnSubMarketData(data, error, task->task_id, task->task_last); -}; - -void MdApi::processRspSubForQuoteRsp(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcSpecificInstrumentField *task_data = (CThostFtdcSpecificInstrumentField*)task->task_data; - data["InstrumentID"] = toUtf(task_data->InstrumentID); - delete task->task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task->task_error; - } - this->onRspSubForQuoteRsp(data, error, task->task_id, task->task_last); -}; - -void MdApi::processRspUnSubForQuoteRsp(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcSpecificInstrumentField *task_data = (CThostFtdcSpecificInstrumentField*)task->task_data; - data["InstrumentID"] = toUtf(task_data->InstrumentID); - delete task->task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task->task_error; - } - this->onRspUnSubForQuoteRsp(data, error, task->task_id, task->task_last); -}; - -void MdApi::processRtnDepthMarketData(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcDepthMarketDataField *task_data = (CThostFtdcDepthMarketDataField*)task->task_data; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["LastPrice"] = task_data->LastPrice; - data["PreSettlementPrice"] = task_data->PreSettlementPrice; - data["PreClosePrice"] = task_data->PreClosePrice; - data["PreOpenInterest"] = task_data->PreOpenInterest; - data["OpenPrice"] = task_data->OpenPrice; - data["HighestPrice"] = task_data->HighestPrice; - data["LowestPrice"] = task_data->LowestPrice; - data["Volume"] = task_data->Volume; - data["Turnover"] = task_data->Turnover; - data["OpenInterest"] = task_data->OpenInterest; - data["ClosePrice"] = task_data->ClosePrice; - data["SettlementPrice"] = task_data->SettlementPrice; - data["UpperLimitPrice"] = task_data->UpperLimitPrice; - data["LowerLimitPrice"] = task_data->LowerLimitPrice; - data["PreDelta"] = task_data->PreDelta; - data["CurrDelta"] = task_data->CurrDelta; - data["UpdateTime"] = toUtf(task_data->UpdateTime); - data["UpdateMillisec"] = task_data->UpdateMillisec; - data["BidPrice1"] = task_data->BidPrice1; - data["BidVolume1"] = task_data->BidVolume1; - data["AskPrice1"] = task_data->AskPrice1; - data["AskVolume1"] = task_data->AskVolume1; - data["BidPrice2"] = task_data->BidPrice2; - data["BidVolume2"] = task_data->BidVolume2; - data["AskPrice2"] = task_data->AskPrice2; - data["AskVolume2"] = task_data->AskVolume2; - data["BidPrice3"] = task_data->BidPrice3; - data["BidVolume3"] = task_data->BidVolume3; - data["AskPrice3"] = task_data->AskPrice3; - data["AskVolume3"] = task_data->AskVolume3; - data["BidPrice4"] = task_data->BidPrice4; - data["BidVolume4"] = task_data->BidVolume4; - data["AskPrice4"] = task_data->AskPrice4; - data["AskVolume4"] = task_data->AskVolume4; - data["BidPrice5"] = task_data->BidPrice5; - data["BidVolume5"] = task_data->BidVolume5; - data["AskPrice5"] = task_data->AskPrice5; - data["AskVolume5"] = task_data->AskVolume5; - data["AveragePrice"] = task_data->AveragePrice; - data["ActionDay"] = toUtf(task_data->ActionDay); - delete task->task_data; - } - this->onRtnDepthMarketData(data); -}; - -void MdApi::processRtnForQuoteRsp(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcForQuoteRspField *task_data = (CThostFtdcForQuoteRspField*)task->task_data; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["ForQuoteSysID"] = toUtf(task_data->ForQuoteSysID); - data["ForQuoteTime"] = toUtf(task_data->ForQuoteTime); - data["ActionDay"] = toUtf(task_data->ActionDay); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - delete task->task_data; - } - this->onRtnForQuoteRsp(data); -}; - -///------------------------------------------------------------------------------------- -///主动函数 -///------------------------------------------------------------------------------------- - -void MdApi::createFtdcMdApi(string pszFlowPath) -{ - this->api = CThostFtdcMdApi::CreateFtdcMdApi(pszFlowPath.c_str()); - this->api->RegisterSpi(this); -}; - -void MdApi::release() -{ - this->api->Release(); -}; - -void MdApi::init() -{ - this->active = true; - this->task_thread = thread(&MdApi::processTask, this); - - this->api->Init(); -}; - -int MdApi::join() -{ - int i = this->api->Join(); - return i; -}; - -int MdApi::exit() -{ - this->active = false; - this->task_queue.terminate(); - this->task_thread.join(); - - this->api->RegisterSpi(NULL); - this->api->Release(); - this->api = NULL; - return 1; -}; - -string MdApi::getTradingDay() -{ - string day = this->api->GetTradingDay(); - return day; -}; - -void MdApi::registerFront(string pszFrontAddress) -{ - this->api->RegisterFront((char*)pszFrontAddress.c_str()); -}; - -int MdApi::subscribeMarketData(string instrumentID) -{ - char* buffer = (char*) instrumentID.c_str(); - char* myreq[1] = { buffer }; - int i = this->api->SubscribeMarketData(myreq, 1); - return i; -}; - -int MdApi::unSubscribeMarketData(string instrumentID) -{ - char* buffer = (char*)instrumentID.c_str(); - char* myreq[1] = { buffer };; - int i = this->api->UnSubscribeMarketData(myreq, 1); - return i; -}; - -int MdApi::subscribeForQuoteRsp(string instrumentID) -{ - char* buffer = (char*)instrumentID.c_str(); - char* myreq[1] = { buffer }; - int i = this->api->SubscribeForQuoteRsp(myreq, 1); - return i; -}; - -int MdApi::unSubscribeForQuoteRsp(string instrumentID) -{ - char* buffer = (char*)instrumentID.c_str(); - char* myreq[1] = { buffer };; - int i = this->api->UnSubscribeForQuoteRsp(myreq, 1); - return i; -}; - -int MdApi::reqUserLogin(const dict &req, int reqid) -{ - CThostFtdcReqUserLoginField myreq = CThostFtdcReqUserLoginField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "TradingDay", myreq.TradingDay); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "UserID", myreq.UserID); - getString(req, "Password", myreq.Password); - getString(req, "UserProductInfo", myreq.UserProductInfo); - getString(req, "InterfaceProductInfo", myreq.InterfaceProductInfo); - getString(req, "ProtocolInfo", myreq.ProtocolInfo); - getString(req, "MacAddress", myreq.MacAddress); - getString(req, "OneTimePassword", myreq.OneTimePassword); - getString(req, "ClientIPAddress", myreq.ClientIPAddress); - getString(req, "LoginRemark", myreq.LoginRemark); - int i = this->api->ReqUserLogin(&myreq, reqid); - return i; -}; - -int MdApi::reqUserLogout(const dict &req, int reqid) -{ - CThostFtdcUserLogoutField myreq = CThostFtdcUserLogoutField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "UserID", myreq.UserID); - int i = this->api->ReqUserLogout(&myreq, reqid); - return i; -}; - - -///------------------------------------------------------------------------------------- -///Boost.Python封装 -///------------------------------------------------------------------------------------- - -class PyMdApi: public MdApi -{ -public: - using MdApi::MdApi; - - void onFrontConnected() override - { - try - { - PYBIND11_OVERLOAD(void, MdApi, onFrontConnected); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onFrontDisconnected(int reqid) override - { - try - { - PYBIND11_OVERLOAD(void, MdApi, onFrontDisconnected, reqid); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onHeartBeatWarning(int reqid) override - { - try - { - PYBIND11_OVERLOAD(void, MdApi, onHeartBeatWarning, reqid); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspUserLogin(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, MdApi, onRspUserLogin, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspUserLogout(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, MdApi, onRspUserLogout, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspError(const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, MdApi, onRspError, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspSubMarketData(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, MdApi, onRspSubMarketData, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspUnSubMarketData(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, MdApi, onRspUnSubMarketData, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspSubForQuoteRsp(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, MdApi, onRspSubForQuoteRsp, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspUnSubForQuoteRsp(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, MdApi, onRspUnSubForQuoteRsp, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnDepthMarketData(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, MdApi, onRtnDepthMarketData, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnForQuoteRsp(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, MdApi, onRtnForQuoteRsp, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; -}; - - -PYBIND11_MODULE(vnctpmd, m) -{ - class_ mdapi(m, "MdApi", module_local()); - mdapi - .def(init<>()) - .def("createFtdcMdApi", &MdApi::createFtdcMdApi) - .def("release", &MdApi::release) - .def("init", &MdApi::init) - .def("join", &MdApi::join) - .def("exit", &MdApi::exit) - .def("getTradingDay", &MdApi::getTradingDay) - .def("registerFront", &MdApi::registerFront) - .def("subscribeMarketData", &MdApi::subscribeMarketData) - .def("unSubscribeMarketData", &MdApi::unSubscribeMarketData) - .def("subscribeForQuoteRsp", &MdApi::subscribeForQuoteRsp) - .def("unSubscribeForQuoteRsp", &MdApi::unSubscribeForQuoteRsp) - .def("reqUserLogin", &MdApi::reqUserLogin) - .def("reqUserLogout", &MdApi::reqUserLogout) - - .def("onFrontConnected", &MdApi::onFrontConnected) - .def("onFrontDisconnected", &MdApi::onFrontDisconnected) - .def("onHeartBeatWarning", &MdApi::onHeartBeatWarning) - .def("onRspUserLogin", &MdApi::onRspUserLogin) - .def("onRspUserLogout", &MdApi::onRspUserLogout) - .def("onRspError", &MdApi::onRspError) - .def("onRspSubMarketData", &MdApi::onRspSubMarketData) - .def("onRspUnSubMarketData", &MdApi::onRspUnSubMarketData) - .def("onRspSubForQuoteRsp", &MdApi::onRspSubForQuoteRsp) - .def("onRspUnSubForQuoteRsp", &MdApi::onRspUnSubForQuoteRsp) - .def("onRtnDepthMarketData", &MdApi::onRtnDepthMarketData) - .def("onRtnForQuoteRsp", &MdApi::onRtnForQuoteRsp) - ; -} diff --git a/vnpy/api/mini/vnctp/vnctpmd/vnctpmd.h b/vnpy/api/mini/vnctp/vnctpmd/vnctpmd.h deleted file mode 100644 index 5b894f3f..00000000 --- a/vnpy/api/mini/vnctp/vnctpmd/vnctpmd.h +++ /dev/null @@ -1,194 +0,0 @@ -//系统 -#ifdef WIN32 -#include "stdafx.h" -#endif - -#include "vnctp.h" -#include "pybind11/pybind11.h" -#include "ctp/ThostFtdcMdApi.h" - - -using namespace pybind11; - -//常量 -#define ONFRONTCONNECTED 0 -#define ONFRONTDISCONNECTED 1 -#define ONHEARTBEATWARNING 2 -#define ONRSPUSERLOGIN 3 -#define ONRSPUSERLOGOUT 4 -#define ONRSPERROR 5 -#define ONRSPSUBMARKETDATA 6 -#define ONRSPUNSUBMARKETDATA 7 -#define ONRSPSUBFORQUOTERSP 8 -#define ONRSPUNSUBFORQUOTERSP 9 -#define ONRTNDEPTHMARKETDATA 10 -#define ONRTNFORQUOTERSP 11 - - -///------------------------------------------------------------------------------------- -///C++ SPI的回调函数方法实现 -///------------------------------------------------------------------------------------- - -//API的继承实现 -class MdApi : public CThostFtdcMdSpi -{ -private: - CThostFtdcMdApi* api; //API对象 - thread task_thread; //工作线程指针(向python中推送数据) - TaskQueue task_queue; //任务队列 - bool active = false; //工作状态 - -public: - MdApi() - { - }; - - ~MdApi() - { - if (this->active) - { - this->exit(); - } - }; - - //------------------------------------------------------------------------------------- - //API回调函数 - //------------------------------------------------------------------------------------- - - ///当客户端与交易后台建立起通信连接时(还未登录前),该方法被调用。 - virtual void OnFrontConnected() ; - - ///当客户端与交易后台通信连接断开时,该方法被调用。当发生这个情况后,API会自动重新连接,客户端可不做处理。 - ///@param nReason 错误原因 - /// 0x1001 网络读失败 - /// 0x1002 网络写失败 - /// 0x2001 接收心跳超时 - /// 0x2002 发送心跳失败 - /// 0x2003 收到错误报文 - virtual void OnFrontDisconnected(int nReason) ; - - ///心跳超时警告。当长时间未收到报文时,该方法被调用。 - ///@param nTimeLapse 距离上次接收报文的时间 - virtual void OnHeartBeatWarning(int nTimeLapse) ; - - - ///登录请求响应 - virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; - - ///登出请求响应 - virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; - - ///错误应答 - virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; - - ///订阅行情应答 - virtual void OnRspSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; - - ///取消订阅行情应答 - virtual void OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; - - ///订阅询价应答 - virtual void OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; - - ///取消订阅询价应答 - virtual void OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; - - ///深度行情通知 - virtual void OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData) ; - - ///询价通知 - virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) ; - - //------------------------------------------------------------------------------------- - //task:任务 - //------------------------------------------------------------------------------------- - - void processTask(); - - void processFrontConnected(Task *task); - - void processFrontDisconnected(Task *task); - - void processHeartBeatWarning(Task *task); - - void processRspUserLogin(Task *task); - - void processRspUserLogout(Task *task); - - void processRspError(Task *task); - - void processRspSubMarketData(Task *task); - - void processRspUnSubMarketData(Task *task); - - void processRspSubForQuoteRsp(Task *task); - - void processRspUnSubForQuoteRsp(Task *task); - - void processRtnDepthMarketData(Task *task); - - void processRtnForQuoteRsp(Task *task); - - - //------------------------------------------------------------------------------------- - //data:回调函数的数据字典 - //error:回调函数的错误字典 - //id:请求id - //last:是否为最后返回 - //i:整数 - //------------------------------------------------------------------------------------- - - virtual void onFrontConnected() {}; - - virtual void onFrontDisconnected(int reqid) {}; - - virtual void onHeartBeatWarning(int reqid) {}; - - virtual void onRspUserLogin(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspUserLogout(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspError(const dict &error, int reqid, bool last) {}; - - virtual void onRspSubMarketData(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspUnSubMarketData(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspSubForQuoteRsp(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspUnSubForQuoteRsp(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRtnDepthMarketData(const dict &data) {}; - - virtual void onRtnForQuoteRsp(const dict &data) {}; - - //------------------------------------------------------------------------------------- - //req:主动函数的请求字典 - //------------------------------------------------------------------------------------- - - void createFtdcMdApi(string pszFlowPath = ""); - - void release(); - - void init(); - - int join(); - - int exit(); - - string getTradingDay(); - - void registerFront(string pszFrontAddress); - - int subscribeMarketData(string instrumentID); - - int unSubscribeMarketData(string instrumentID); - - int subscribeForQuoteRsp(string instrumentID); - - int unSubscribeForQuoteRsp(string instrumentID); - - int reqUserLogin(const dict &req, int reqid); - - int reqUserLogout(const dict &req, int reqid); -}; diff --git a/vnpy/api/mini/vnctp/vnctpmd/vnctpmd.vcxproj b/vnpy/api/mini/vnctp/vnctpmd/vnctpmd.vcxproj deleted file mode 100644 index 781eeaf2..00000000 --- a/vnpy/api/mini/vnctp/vnctpmd/vnctpmd.vcxproj +++ /dev/null @@ -1,200 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {F00054FF-282F-4826-848E-D58BFB9E9D9F} - Win32Proj - vnctpmd - 10.0.17134.0 - - - - DynamicLibrary - true - v141 - Unicode - - - DynamicLibrary - false - v141 - true - Unicode - - - DynamicLibrary - true - v141 - Unicode - - - DynamicLibrary - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - 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 - .pyd - 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 - C:\Miniconda3\include;$(SolutionDir);$(SolutionDir)..\include;$(SolutionDir)..\include\ctp;$(IncludePath) - $(ReferencePath) - .pyd - C:\Miniconda3\libs;$(SolutionDir)..\libs;$(LibraryPath) - $(SolutionDir)..\ - - - - Use - Level3 - Disabled - true - NOMINMAX;_CRT_SECURE_NO_WARNINGS;NOMINMAX;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;VNCTPMD_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - stdafx.h - - - Console - true - - - - - Use - Level3 - Disabled - true - NOMINMAX;_CRT_SECURE_NO_WARNINGS;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_DEBUG;VNCTPMD_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - stdafx.h - - - Console - true - - - - - Use - Level3 - MaxSpeed - true - true - true - NOMINMAX;_CRT_SECURE_NO_WARNINGS;NOMINMAX;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;VNCTPMD_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - stdafx.h - MultiThreaded - - - Console - true - true - true - - - - - Use - Level3 - MaxSpeed - true - true - true - NOMINMAX;_CRT_SECURE_NO_WARNINGS;NDEBUG;VNCTPMD_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - - - stdafx.h - MultiThreaded - - - Console - true - true - true - C:\GitHub\vnpy\vnpy\api\ctp\libs;C:\Miniconda3\libs;%(AdditionalLibraryDirectories) - thostmduserapi_se.lib;thosttraderapi_se.lib;%(AdditionalDependencies) - - - - - - - - - - - - - - - - Create - Create - Create - Create - - - - - - - \ No newline at end of file diff --git a/vnpy/api/mini/vnctp/vnctpmd/vnctpmd.vcxproj.filters b/vnpy/api/mini/vnctp/vnctpmd/vnctpmd.vcxproj.filters deleted file mode 100644 index 169e20b9..00000000 --- a/vnpy/api/mini/vnctp/vnctpmd/vnctpmd.vcxproj.filters +++ /dev/null @@ -1,54 +0,0 @@ -锘 - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - 澶存枃浠 - - - 澶存枃浠 - - - 澶存枃浠 - - - 澶存枃浠 - - - 澶存枃浠 - - - 澶存枃浠 - - - 澶存枃浠 - - - 澶存枃浠 - - - - - 婧愭枃浠 - - - 婧愭枃浠 - - - 婧愭枃浠 - - - \ No newline at end of file diff --git a/vnpy/api/mini/vnctp/vnctpmd/vnctpmd.vcxproj.user b/vnpy/api/mini/vnctp/vnctpmd/vnctpmd.vcxproj.user deleted file mode 100644 index be250787..00000000 --- a/vnpy/api/mini/vnctp/vnctpmd/vnctpmd.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ -锘 - - - \ No newline at end of file diff --git a/vnpy/api/mini/vnctp/vnctptd/dllmain.cpp b/vnpy/api/mini/vnctp/vnctptd/dllmain.cpp deleted file mode 100644 index 6785c0ec..00000000 --- a/vnpy/api/mini/vnctp/vnctptd/dllmain.cpp +++ /dev/null @@ -1,19 +0,0 @@ -锘// dllmain.cpp : 瀹氫箟 DLL 搴旂敤绋嬪簭鐨勫叆鍙g偣銆 -#include "stdafx.h" - -BOOL APIENTRY DllMain( HMODULE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved - ) -{ - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} - diff --git a/vnpy/api/mini/vnctp/vnctptd/stdafx.cpp b/vnpy/api/mini/vnctp/vnctptd/stdafx.cpp deleted file mode 100644 index fd4f341c..00000000 --- a/vnpy/api/mini/vnctp/vnctptd/stdafx.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "stdafx.h" diff --git a/vnpy/api/mini/vnctp/vnctptd/stdafx.h b/vnpy/api/mini/vnctp/vnctptd/stdafx.h deleted file mode 100644 index 88cf2f86..00000000 --- a/vnpy/api/mini/vnctp/vnctptd/stdafx.h +++ /dev/null @@ -1,16 +0,0 @@ -锘// stdafx.h: 鏍囧噯绯荤粺鍖呭惈鏂囦欢鐨勫寘鍚枃浠讹紝 -// 鎴栨槸缁忓父浣跨敤浣嗕笉甯告洿鏀圭殑 -// 椤圭洰鐗瑰畾鐨勫寘鍚枃浠 -// - -#pragma once - -#include "targetver.h" - -#define WIN32_LEAN_AND_MEAN // 浠 Windows 澶存枃浠朵腑鎺掗櫎鏋佸皯浣跨敤鐨勫唴瀹 -// Windows 澶存枃浠 -#include - - - -// 鍦ㄦ澶勫紩鐢ㄧ▼搴忛渶瑕佺殑鍏朵粬鏍囧ご diff --git a/vnpy/api/mini/vnctp/vnctptd/targetver.h b/vnpy/api/mini/vnctp/vnctptd/targetver.h deleted file mode 100644 index 2895aefa..00000000 --- a/vnpy/api/mini/vnctp/vnctptd/targetver.h +++ /dev/null @@ -1,8 +0,0 @@ -锘#pragma once - -// 鍖呮嫭 SDKDDKVer.h 灏嗗畾涔夊彲鐢ㄧ殑鏈楂樼増鏈殑 Windows 骞冲彴銆 - -// 濡傛灉瑕佷负浠ュ墠鐨 Windows 骞冲彴鐢熸垚搴旂敤绋嬪簭锛岃鍖呮嫭 WinSDKVer.h锛屽苟 -// 灏 _WIN32_WINNT 瀹忚缃负瑕佹敮鎸佺殑骞冲彴锛岀劧鍚庡啀鍖呮嫭 SDKDDKVer.h銆 - -#include diff --git a/vnpy/api/mini/vnctp/vnctptd/vnctptd.cpp b/vnpy/api/mini/vnctp/vnctptd/vnctptd.cpp deleted file mode 100644 index af1b9b82..00000000 --- a/vnpy/api/mini/vnctp/vnctptd/vnctptd.cpp +++ /dev/null @@ -1,11375 +0,0 @@ -// vnctpmd.cpp : 定义 DLL 应用程序的导出函数。 -// - -#include "vnctptd.h" - - -///------------------------------------------------------------------------------------- -///C++的回调函数将数据保存到队列中 -///------------------------------------------------------------------------------------- - -void TdApi::OnFrontConnected() -{ - Task task = Task(); - task.task_name = ONFRONTCONNECTED; - this->task_queue.push(task); -}; - -void TdApi::OnFrontDisconnected(int nReason) -{ - Task task = Task(); - task.task_name = ONFRONTDISCONNECTED; - task.task_id = nReason; - this->task_queue.push(task); -}; - -void TdApi::OnHeartBeatWarning(int nTimeLapse) -{ - Task task = Task(); - task.task_name = ONHEARTBEATWARNING; - task.task_id = nTimeLapse; - this->task_queue.push(task); -}; - -void TdApi::OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthenticateField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPAUTHENTICATE; - if (pRspAuthenticateField) - { - CThostFtdcRspAuthenticateField *task_data = new CThostFtdcRspAuthenticateField(); - *task_data = *pRspAuthenticateField; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPUSERLOGIN; - if (pRspUserLogin) - { - CThostFtdcRspUserLoginField *task_data = new CThostFtdcRspUserLoginField(); - *task_data = *pRspUserLogin; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPUSERLOGOUT; - if (pUserLogout) - { - CThostFtdcUserLogoutField *task_data = new CThostFtdcUserLogoutField(); - *task_data = *pUserLogout; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPUSERPASSWORDUPDATE; - if (pUserPasswordUpdate) - { - CThostFtdcUserPasswordUpdateField *task_data = new CThostFtdcUserPasswordUpdateField(); - *task_data = *pUserPasswordUpdate; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPTRADINGACCOUNTPASSWORDUPDATE; - if (pTradingAccountPasswordUpdate) - { - CThostFtdcTradingAccountPasswordUpdateField *task_data = new CThostFtdcTradingAccountPasswordUpdateField(); - *task_data = *pTradingAccountPasswordUpdate; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspUserAuthMethod(CThostFtdcRspUserAuthMethodField *pRspUserAuthMethod, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPUSERAUTHMETHOD; - if (pRspUserAuthMethod) - { - CThostFtdcRspUserAuthMethodField *task_data = new CThostFtdcRspUserAuthMethodField(); - *task_data = *pRspUserAuthMethod; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspGenUserCaptcha(CThostFtdcRspGenUserCaptchaField *pRspGenUserCaptcha, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPGENUSERCAPTCHA; - if (pRspGenUserCaptcha) - { - CThostFtdcRspGenUserCaptchaField *task_data = new CThostFtdcRspGenUserCaptchaField(); - *task_data = *pRspGenUserCaptcha; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspGenUserText(CThostFtdcRspGenUserTextField *pRspGenUserText, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPGENUSERTEXT; - if (pRspGenUserText) - { - CThostFtdcRspGenUserTextField *task_data = new CThostFtdcRspGenUserTextField(); - *task_data = *pRspGenUserText; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPORDERINSERT; - if (pInputOrder) - { - CThostFtdcInputOrderField *task_data = new CThostFtdcInputOrderField(); - *task_data = *pInputOrder; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPPARKEDORDERINSERT; - if (pParkedOrder) - { - CThostFtdcParkedOrderField *task_data = new CThostFtdcParkedOrderField(); - *task_data = *pParkedOrder; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPPARKEDORDERACTION; - if (pParkedOrderAction) - { - CThostFtdcParkedOrderActionField *task_data = new CThostFtdcParkedOrderActionField(); - *task_data = *pParkedOrderAction; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPORDERACTION; - if (pInputOrderAction) - { - CThostFtdcInputOrderActionField *task_data = new CThostFtdcInputOrderActionField(); - *task_data = *pInputOrderAction; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQUERYMAXORDERVOLUME; - if (pQueryMaxOrderVolume) - { - CThostFtdcQueryMaxOrderVolumeField *task_data = new CThostFtdcQueryMaxOrderVolumeField(); - *task_data = *pQueryMaxOrderVolume; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPSETTLEMENTINFOCONFIRM; - if (pSettlementInfoConfirm) - { - CThostFtdcSettlementInfoConfirmField *task_data = new CThostFtdcSettlementInfoConfirmField(); - *task_data = *pSettlementInfoConfirm; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPREMOVEPARKEDORDER; - if (pRemoveParkedOrder) - { - CThostFtdcRemoveParkedOrderField *task_data = new CThostFtdcRemoveParkedOrderField(); - *task_data = *pRemoveParkedOrder; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPREMOVEPARKEDORDERACTION; - if (pRemoveParkedOrderAction) - { - CThostFtdcRemoveParkedOrderActionField *task_data = new CThostFtdcRemoveParkedOrderActionField(); - *task_data = *pRemoveParkedOrderAction; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPEXECORDERINSERT; - if (pInputExecOrder) - { - CThostFtdcInputExecOrderField *task_data = new CThostFtdcInputExecOrderField(); - *task_data = *pInputExecOrder; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPEXECORDERACTION; - if (pInputExecOrderAction) - { - CThostFtdcInputExecOrderActionField *task_data = new CThostFtdcInputExecOrderActionField(); - *task_data = *pInputExecOrderAction; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPFORQUOTEINSERT; - if (pInputForQuote) - { - CThostFtdcInputForQuoteField *task_data = new CThostFtdcInputForQuoteField(); - *task_data = *pInputForQuote; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQUOTEINSERT; - if (pInputQuote) - { - CThostFtdcInputQuoteField *task_data = new CThostFtdcInputQuoteField(); - *task_data = *pInputQuote; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQUOTEACTION; - if (pInputQuoteAction) - { - CThostFtdcInputQuoteActionField *task_data = new CThostFtdcInputQuoteActionField(); - *task_data = *pInputQuoteAction; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspBatchOrderAction(CThostFtdcInputBatchOrderActionField *pInputBatchOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPBATCHORDERACTION; - if (pInputBatchOrderAction) - { - CThostFtdcInputBatchOrderActionField *task_data = new CThostFtdcInputBatchOrderActionField(); - *task_data = *pInputBatchOrderAction; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspOptionSelfCloseInsert(CThostFtdcInputOptionSelfCloseField *pInputOptionSelfClose, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPOPTIONSELFCLOSEINSERT; - if (pInputOptionSelfClose) - { - CThostFtdcInputOptionSelfCloseField *task_data = new CThostFtdcInputOptionSelfCloseField(); - *task_data = *pInputOptionSelfClose; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspOptionSelfCloseAction(CThostFtdcInputOptionSelfCloseActionField *pInputOptionSelfCloseAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPOPTIONSELFCLOSEACTION; - if (pInputOptionSelfCloseAction) - { - CThostFtdcInputOptionSelfCloseActionField *task_data = new CThostFtdcInputOptionSelfCloseActionField(); - *task_data = *pInputOptionSelfCloseAction; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPCOMBACTIONINSERT; - if (pInputCombAction) - { - CThostFtdcInputCombActionField *task_data = new CThostFtdcInputCombActionField(); - *task_data = *pInputCombAction; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYORDER; - if (pOrder) - { - CThostFtdcOrderField *task_data = new CThostFtdcOrderField(); - *task_data = *pOrder; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYTRADE; - if (pTrade) - { - CThostFtdcTradeField *task_data = new CThostFtdcTradeField(); - *task_data = *pTrade; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYINVESTORPOSITION; - if (pInvestorPosition) - { - CThostFtdcInvestorPositionField *task_data = new CThostFtdcInvestorPositionField(); - *task_data = *pInvestorPosition; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYTRADINGACCOUNT; - if (pTradingAccount) - { - CThostFtdcTradingAccountField *task_data = new CThostFtdcTradingAccountField(); - *task_data = *pTradingAccount; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryInvestor(CThostFtdcInvestorField *pInvestor, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYINVESTOR; - if (pInvestor) - { - CThostFtdcInvestorField *task_data = new CThostFtdcInvestorField(); - *task_data = *pInvestor; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryTradingCode(CThostFtdcTradingCodeField *pTradingCode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYTRADINGCODE; - if (pTradingCode) - { - CThostFtdcTradingCodeField *task_data = new CThostFtdcTradingCodeField(); - *task_data = *pTradingCode; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYINSTRUMENTMARGINRATE; - if (pInstrumentMarginRate) - { - CThostFtdcInstrumentMarginRateField *task_data = new CThostFtdcInstrumentMarginRateField(); - *task_data = *pInstrumentMarginRate; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYINSTRUMENTCOMMISSIONRATE; - if (pInstrumentCommissionRate) - { - CThostFtdcInstrumentCommissionRateField *task_data = new CThostFtdcInstrumentCommissionRateField(); - *task_data = *pInstrumentCommissionRate; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryExchange(CThostFtdcExchangeField *pExchange, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYEXCHANGE; - if (pExchange) - { - CThostFtdcExchangeField *task_data = new CThostFtdcExchangeField(); - *task_data = *pExchange; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryProduct(CThostFtdcProductField *pProduct, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYPRODUCT; - if (pProduct) - { - CThostFtdcProductField *task_data = new CThostFtdcProductField(); - *task_data = *pProduct; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYINSTRUMENT; - if (pInstrument) - { - CThostFtdcInstrumentField *task_data = new CThostFtdcInstrumentField(); - *task_data = *pInstrument; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYDEPTHMARKETDATA; - if (pDepthMarketData) - { - CThostFtdcDepthMarketDataField *task_data = new CThostFtdcDepthMarketDataField(); - *task_data = *pDepthMarketData; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYSETTLEMENTINFO; - if (pSettlementInfo) - { - CThostFtdcSettlementInfoField *task_data = new CThostFtdcSettlementInfoField(); - *task_data = *pSettlementInfo; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryTransferBank(CThostFtdcTransferBankField *pTransferBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYTRANSFERBANK; - if (pTransferBank) - { - CThostFtdcTransferBankField *task_data = new CThostFtdcTransferBankField(); - *task_data = *pTransferBank; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYINVESTORPOSITIONDETAIL; - if (pInvestorPositionDetail) - { - CThostFtdcInvestorPositionDetailField *task_data = new CThostFtdcInvestorPositionDetailField(); - *task_data = *pInvestorPositionDetail; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryNotice(CThostFtdcNoticeField *pNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYNOTICE; - if (pNotice) - { - CThostFtdcNoticeField *task_data = new CThostFtdcNoticeField(); - *task_data = *pNotice; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQrySettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYSETTLEMENTINFOCONFIRM; - if (pSettlementInfoConfirm) - { - CThostFtdcSettlementInfoConfirmField *task_data = new CThostFtdcSettlementInfoConfirmField(); - *task_data = *pSettlementInfoConfirm; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryInvestorPositionCombineDetail(CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYINVESTORPOSITIONCOMBINEDETAIL; - if (pInvestorPositionCombineDetail) - { - CThostFtdcInvestorPositionCombineDetailField *task_data = new CThostFtdcInvestorPositionCombineDetailField(); - *task_data = *pInvestorPositionCombineDetail; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryCFMMCTradingAccountKey(CThostFtdcCFMMCTradingAccountKeyField *pCFMMCTradingAccountKey, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYCFMMCTRADINGACCOUNTKEY; - if (pCFMMCTradingAccountKey) - { - CThostFtdcCFMMCTradingAccountKeyField *task_data = new CThostFtdcCFMMCTradingAccountKeyField(); - *task_data = *pCFMMCTradingAccountKey; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryEWarrantOffset(CThostFtdcEWarrantOffsetField *pEWarrantOffset, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYEWARRANTOFFSET; - if (pEWarrantOffset) - { - CThostFtdcEWarrantOffsetField *task_data = new CThostFtdcEWarrantOffsetField(); - *task_data = *pEWarrantOffset; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryInvestorProductGroupMargin(CThostFtdcInvestorProductGroupMarginField *pInvestorProductGroupMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYINVESTORPRODUCTGROUPMARGIN; - if (pInvestorProductGroupMargin) - { - CThostFtdcInvestorProductGroupMarginField *task_data = new CThostFtdcInvestorProductGroupMarginField(); - *task_data = *pInvestorProductGroupMargin; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryExchangeMarginRate(CThostFtdcExchangeMarginRateField *pExchangeMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYEXCHANGEMARGINRATE; - if (pExchangeMarginRate) - { - CThostFtdcExchangeMarginRateField *task_data = new CThostFtdcExchangeMarginRateField(); - *task_data = *pExchangeMarginRate; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryExchangeMarginRateAdjust(CThostFtdcExchangeMarginRateAdjustField *pExchangeMarginRateAdjust, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYEXCHANGEMARGINRATEADJUST; - if (pExchangeMarginRateAdjust) - { - CThostFtdcExchangeMarginRateAdjustField *task_data = new CThostFtdcExchangeMarginRateAdjustField(); - *task_data = *pExchangeMarginRateAdjust; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryExchangeRate(CThostFtdcExchangeRateField *pExchangeRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYEXCHANGERATE; - if (pExchangeRate) - { - CThostFtdcExchangeRateField *task_data = new CThostFtdcExchangeRateField(); - *task_data = *pExchangeRate; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQrySecAgentACIDMap(CThostFtdcSecAgentACIDMapField *pSecAgentACIDMap, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYSECAGENTACIDMAP; - if (pSecAgentACIDMap) - { - CThostFtdcSecAgentACIDMapField *task_data = new CThostFtdcSecAgentACIDMapField(); - *task_data = *pSecAgentACIDMap; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryProductExchRate(CThostFtdcProductExchRateField *pProductExchRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYPRODUCTEXCHRATE; - if (pProductExchRate) - { - CThostFtdcProductExchRateField *task_data = new CThostFtdcProductExchRateField(); - *task_data = *pProductExchRate; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryProductGroup(CThostFtdcProductGroupField *pProductGroup, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYPRODUCTGROUP; - if (pProductGroup) - { - CThostFtdcProductGroupField *task_data = new CThostFtdcProductGroupField(); - *task_data = *pProductGroup; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryMMInstrumentCommissionRate(CThostFtdcMMInstrumentCommissionRateField *pMMInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYMMINSTRUMENTCOMMISSIONRATE; - if (pMMInstrumentCommissionRate) - { - CThostFtdcMMInstrumentCommissionRateField *task_data = new CThostFtdcMMInstrumentCommissionRateField(); - *task_data = *pMMInstrumentCommissionRate; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryMMOptionInstrCommRate(CThostFtdcMMOptionInstrCommRateField *pMMOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYMMOPTIONINSTRCOMMRATE; - if (pMMOptionInstrCommRate) - { - CThostFtdcMMOptionInstrCommRateField *task_data = new CThostFtdcMMOptionInstrCommRateField(); - *task_data = *pMMOptionInstrCommRate; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryInstrumentOrderCommRate(CThostFtdcInstrumentOrderCommRateField *pInstrumentOrderCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYINSTRUMENTORDERCOMMRATE; - if (pInstrumentOrderCommRate) - { - CThostFtdcInstrumentOrderCommRateField *task_data = new CThostFtdcInstrumentOrderCommRateField(); - *task_data = *pInstrumentOrderCommRate; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQrySecAgentTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYSECAGENTTRADINGACCOUNT; - if (pTradingAccount) - { - CThostFtdcTradingAccountField *task_data = new CThostFtdcTradingAccountField(); - *task_data = *pTradingAccount; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQrySecAgentCheckMode(CThostFtdcSecAgentCheckModeField *pSecAgentCheckMode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYSECAGENTCHECKMODE; - if (pSecAgentCheckMode) - { - CThostFtdcSecAgentCheckModeField *task_data = new CThostFtdcSecAgentCheckModeField(); - *task_data = *pSecAgentCheckMode; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQrySecAgentTradeInfo(CThostFtdcSecAgentTradeInfoField *pSecAgentTradeInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYSECAGENTTRADEINFO; - if (pSecAgentTradeInfo) - { - CThostFtdcSecAgentTradeInfoField *task_data = new CThostFtdcSecAgentTradeInfoField(); - *task_data = *pSecAgentTradeInfo; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryOptionInstrTradeCost(CThostFtdcOptionInstrTradeCostField *pOptionInstrTradeCost, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYOPTIONINSTRTRADECOST; - if (pOptionInstrTradeCost) - { - CThostFtdcOptionInstrTradeCostField *task_data = new CThostFtdcOptionInstrTradeCostField(); - *task_data = *pOptionInstrTradeCost; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryOptionInstrCommRate(CThostFtdcOptionInstrCommRateField *pOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYOPTIONINSTRCOMMRATE; - if (pOptionInstrCommRate) - { - CThostFtdcOptionInstrCommRateField *task_data = new CThostFtdcOptionInstrCommRateField(); - *task_data = *pOptionInstrCommRate; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryExecOrder(CThostFtdcExecOrderField *pExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYEXECORDER; - if (pExecOrder) - { - CThostFtdcExecOrderField *task_data = new CThostFtdcExecOrderField(); - *task_data = *pExecOrder; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryForQuote(CThostFtdcForQuoteField *pForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYFORQUOTE; - if (pForQuote) - { - CThostFtdcForQuoteField *task_data = new CThostFtdcForQuoteField(); - *task_data = *pForQuote; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryQuote(CThostFtdcQuoteField *pQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYQUOTE; - if (pQuote) - { - CThostFtdcQuoteField *task_data = new CThostFtdcQuoteField(); - *task_data = *pQuote; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryOptionSelfClose(CThostFtdcOptionSelfCloseField *pOptionSelfClose, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYOPTIONSELFCLOSE; - if (pOptionSelfClose) - { - CThostFtdcOptionSelfCloseField *task_data = new CThostFtdcOptionSelfCloseField(); - *task_data = *pOptionSelfClose; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryInvestUnit(CThostFtdcInvestUnitField *pInvestUnit, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYINVESTUNIT; - if (pInvestUnit) - { - CThostFtdcInvestUnitField *task_data = new CThostFtdcInvestUnitField(); - *task_data = *pInvestUnit; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryCombInstrumentGuard(CThostFtdcCombInstrumentGuardField *pCombInstrumentGuard, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYCOMBINSTRUMENTGUARD; - if (pCombInstrumentGuard) - { - CThostFtdcCombInstrumentGuardField *task_data = new CThostFtdcCombInstrumentGuardField(); - *task_data = *pCombInstrumentGuard; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryCombAction(CThostFtdcCombActionField *pCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYCOMBACTION; - if (pCombAction) - { - CThostFtdcCombActionField *task_data = new CThostFtdcCombActionField(); - *task_data = *pCombAction; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryTransferSerial(CThostFtdcTransferSerialField *pTransferSerial, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYTRANSFERSERIAL; - if (pTransferSerial) - { - CThostFtdcTransferSerialField *task_data = new CThostFtdcTransferSerialField(); - *task_data = *pTransferSerial; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryAccountregister(CThostFtdcAccountregisterField *pAccountregister, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYACCOUNTREGISTER; - if (pAccountregister) - { - CThostFtdcAccountregisterField *task_data = new CThostFtdcAccountregisterField(); - *task_data = *pAccountregister; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPERROR; - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRtnOrder(CThostFtdcOrderField *pOrder) -{ - Task task = Task(); - task.task_name = ONRTNORDER; - if (pOrder) - { - CThostFtdcOrderField *task_data = new CThostFtdcOrderField(); - *task_data = *pOrder; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnTrade(CThostFtdcTradeField *pTrade) -{ - Task task = Task(); - task.task_name = ONRTNTRADE; - if (pTrade) - { - CThostFtdcTradeField *task_data = new CThostFtdcTradeField(); - *task_data = *pTrade; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo) -{ - Task task = Task(); - task.task_name = ONERRRTNORDERINSERT; - if (pInputOrder) - { - CThostFtdcInputOrderField *task_data = new CThostFtdcInputOrderField(); - *task_data = *pInputOrder; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - this->task_queue.push(task); -}; - -void TdApi::OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, CThostFtdcRspInfoField *pRspInfo) -{ - Task task = Task(); - task.task_name = ONERRRTNORDERACTION; - if (pOrderAction) - { - CThostFtdcOrderActionField *task_data = new CThostFtdcOrderActionField(); - *task_data = *pOrderAction; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus) -{ - Task task = Task(); - task.task_name = ONRTNINSTRUMENTSTATUS; - if (pInstrumentStatus) - { - CThostFtdcInstrumentStatusField *task_data = new CThostFtdcInstrumentStatusField(); - *task_data = *pInstrumentStatus; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnBulletin(CThostFtdcBulletinField *pBulletin) -{ - Task task = Task(); - task.task_name = ONRTNBULLETIN; - if (pBulletin) - { - CThostFtdcBulletinField *task_data = new CThostFtdcBulletinField(); - *task_data = *pBulletin; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnTradingNotice(CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) -{ - Task task = Task(); - task.task_name = ONRTNTRADINGNOTICE; - if (pTradingNoticeInfo) - { - CThostFtdcTradingNoticeInfoField *task_data = new CThostFtdcTradingNoticeInfoField(); - *task_data = *pTradingNoticeInfo; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnErrorConditionalOrder(CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) -{ - Task task = Task(); - task.task_name = ONRTNERRORCONDITIONALORDER; - if (pErrorConditionalOrder) - { - CThostFtdcErrorConditionalOrderField *task_data = new CThostFtdcErrorConditionalOrderField(); - *task_data = *pErrorConditionalOrder; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnExecOrder(CThostFtdcExecOrderField *pExecOrder) -{ - Task task = Task(); - task.task_name = ONRTNEXECORDER; - if (pExecOrder) - { - CThostFtdcExecOrderField *task_data = new CThostFtdcExecOrderField(); - *task_data = *pExecOrder; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnErrRtnExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo) -{ - Task task = Task(); - task.task_name = ONERRRTNEXECORDERINSERT; - if (pInputExecOrder) - { - CThostFtdcInputExecOrderField *task_data = new CThostFtdcInputExecOrderField(); - *task_data = *pInputExecOrder; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - this->task_queue.push(task); -}; - -void TdApi::OnErrRtnExecOrderAction(CThostFtdcExecOrderActionField *pExecOrderAction, CThostFtdcRspInfoField *pRspInfo) -{ - Task task = Task(); - task.task_name = ONERRRTNEXECORDERACTION; - if (pExecOrderAction) - { - CThostFtdcExecOrderActionField *task_data = new CThostFtdcExecOrderActionField(); - *task_data = *pExecOrderAction; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - this->task_queue.push(task); -}; - -void TdApi::OnErrRtnForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo) -{ - Task task = Task(); - task.task_name = ONERRRTNFORQUOTEINSERT; - if (pInputForQuote) - { - CThostFtdcInputForQuoteField *task_data = new CThostFtdcInputForQuoteField(); - *task_data = *pInputForQuote; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnQuote(CThostFtdcQuoteField *pQuote) -{ - Task task = Task(); - task.task_name = ONRTNQUOTE; - if (pQuote) - { - CThostFtdcQuoteField *task_data = new CThostFtdcQuoteField(); - *task_data = *pQuote; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnErrRtnQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo) -{ - Task task = Task(); - task.task_name = ONERRRTNQUOTEINSERT; - if (pInputQuote) - { - CThostFtdcInputQuoteField *task_data = new CThostFtdcInputQuoteField(); - *task_data = *pInputQuote; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - this->task_queue.push(task); -}; - -void TdApi::OnErrRtnQuoteAction(CThostFtdcQuoteActionField *pQuoteAction, CThostFtdcRspInfoField *pRspInfo) -{ - Task task = Task(); - task.task_name = ONERRRTNQUOTEACTION; - if (pQuoteAction) - { - CThostFtdcQuoteActionField *task_data = new CThostFtdcQuoteActionField(); - *task_data = *pQuoteAction; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) -{ - Task task = Task(); - task.task_name = ONRTNFORQUOTERSP; - if (pForQuoteRsp) - { - CThostFtdcForQuoteRspField *task_data = new CThostFtdcForQuoteRspField(); - *task_data = *pForQuoteRsp; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnCFMMCTradingAccountToken(CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken) -{ - Task task = Task(); - task.task_name = ONRTNCFMMCTRADINGACCOUNTTOKEN; - if (pCFMMCTradingAccountToken) - { - CThostFtdcCFMMCTradingAccountTokenField *task_data = new CThostFtdcCFMMCTradingAccountTokenField(); - *task_data = *pCFMMCTradingAccountToken; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnErrRtnBatchOrderAction(CThostFtdcBatchOrderActionField *pBatchOrderAction, CThostFtdcRspInfoField *pRspInfo) -{ - Task task = Task(); - task.task_name = ONERRRTNBATCHORDERACTION; - if (pBatchOrderAction) - { - CThostFtdcBatchOrderActionField *task_data = new CThostFtdcBatchOrderActionField(); - *task_data = *pBatchOrderAction; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnOptionSelfClose(CThostFtdcOptionSelfCloseField *pOptionSelfClose) -{ - Task task = Task(); - task.task_name = ONRTNOPTIONSELFCLOSE; - if (pOptionSelfClose) - { - CThostFtdcOptionSelfCloseField *task_data = new CThostFtdcOptionSelfCloseField(); - *task_data = *pOptionSelfClose; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnErrRtnOptionSelfCloseInsert(CThostFtdcInputOptionSelfCloseField *pInputOptionSelfClose, CThostFtdcRspInfoField *pRspInfo) -{ - Task task = Task(); - task.task_name = ONERRRTNOPTIONSELFCLOSEINSERT; - if (pInputOptionSelfClose) - { - CThostFtdcInputOptionSelfCloseField *task_data = new CThostFtdcInputOptionSelfCloseField(); - *task_data = *pInputOptionSelfClose; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - this->task_queue.push(task); -}; - -void TdApi::OnErrRtnOptionSelfCloseAction(CThostFtdcOptionSelfCloseActionField *pOptionSelfCloseAction, CThostFtdcRspInfoField *pRspInfo) -{ - Task task = Task(); - task.task_name = ONERRRTNOPTIONSELFCLOSEACTION; - if (pOptionSelfCloseAction) - { - CThostFtdcOptionSelfCloseActionField *task_data = new CThostFtdcOptionSelfCloseActionField(); - *task_data = *pOptionSelfCloseAction; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnCombAction(CThostFtdcCombActionField *pCombAction) -{ - Task task = Task(); - task.task_name = ONRTNCOMBACTION; - if (pCombAction) - { - CThostFtdcCombActionField *task_data = new CThostFtdcCombActionField(); - *task_data = *pCombAction; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnErrRtnCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo) -{ - Task task = Task(); - task.task_name = ONERRRTNCOMBACTIONINSERT; - if (pInputCombAction) - { - CThostFtdcInputCombActionField *task_data = new CThostFtdcInputCombActionField(); - *task_data = *pInputCombAction; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - this->task_queue.push(task); -}; - -void TdApi::OnRspQryContractBank(CThostFtdcContractBankField *pContractBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYCONTRACTBANK; - if (pContractBank) - { - CThostFtdcContractBankField *task_data = new CThostFtdcContractBankField(); - *task_data = *pContractBank; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryParkedOrder(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYPARKEDORDER; - if (pParkedOrder) - { - CThostFtdcParkedOrderField *task_data = new CThostFtdcParkedOrderField(); - *task_data = *pParkedOrder; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYPARKEDORDERACTION; - if (pParkedOrderAction) - { - CThostFtdcParkedOrderActionField *task_data = new CThostFtdcParkedOrderActionField(); - *task_data = *pParkedOrderAction; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryTradingNotice(CThostFtdcTradingNoticeField *pTradingNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYTRADINGNOTICE; - if (pTradingNotice) - { - CThostFtdcTradingNoticeField *task_data = new CThostFtdcTradingNoticeField(); - *task_data = *pTradingNotice; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryBrokerTradingParams(CThostFtdcBrokerTradingParamsField *pBrokerTradingParams, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYBROKERTRADINGPARAMS; - if (pBrokerTradingParams) - { - CThostFtdcBrokerTradingParamsField *task_data = new CThostFtdcBrokerTradingParamsField(); - *task_data = *pBrokerTradingParams; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQryBrokerTradingAlgos(CThostFtdcBrokerTradingAlgosField *pBrokerTradingAlgos, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQRYBROKERTRADINGALGOS; - if (pBrokerTradingAlgos) - { - CThostFtdcBrokerTradingAlgosField *task_data = new CThostFtdcBrokerTradingAlgosField(); - *task_data = *pBrokerTradingAlgos; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQUERYCFMMCTRADINGACCOUNTTOKEN; - if (pQueryCFMMCTradingAccountToken) - { - CThostFtdcQueryCFMMCTradingAccountTokenField *task_data = new CThostFtdcQueryCFMMCTradingAccountTokenField(); - *task_data = *pQueryCFMMCTradingAccountToken; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRtnFromBankToFutureByBank(CThostFtdcRspTransferField *pRspTransfer) -{ - Task task = Task(); - task.task_name = ONRTNFROMBANKTOFUTUREBYBANK; - if (pRspTransfer) - { - CThostFtdcRspTransferField *task_data = new CThostFtdcRspTransferField(); - *task_data = *pRspTransfer; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnFromFutureToBankByBank(CThostFtdcRspTransferField *pRspTransfer) -{ - Task task = Task(); - task.task_name = ONRTNFROMFUTURETOBANKBYBANK; - if (pRspTransfer) - { - CThostFtdcRspTransferField *task_data = new CThostFtdcRspTransferField(); - *task_data = *pRspTransfer; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnRepealFromBankToFutureByBank(CThostFtdcRspRepealField *pRspRepeal) -{ - Task task = Task(); - task.task_name = ONRTNREPEALFROMBANKTOFUTUREBYBANK; - if (pRspRepeal) - { - CThostFtdcRspRepealField *task_data = new CThostFtdcRspRepealField(); - *task_data = *pRspRepeal; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnRepealFromFutureToBankByBank(CThostFtdcRspRepealField *pRspRepeal) -{ - Task task = Task(); - task.task_name = ONRTNREPEALFROMFUTURETOBANKBYBANK; - if (pRspRepeal) - { - CThostFtdcRspRepealField *task_data = new CThostFtdcRspRepealField(); - *task_data = *pRspRepeal; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnFromBankToFutureByFuture(CThostFtdcRspTransferField *pRspTransfer) -{ - Task task = Task(); - task.task_name = ONRTNFROMBANKTOFUTUREBYFUTURE; - if (pRspTransfer) - { - CThostFtdcRspTransferField *task_data = new CThostFtdcRspTransferField(); - *task_data = *pRspTransfer; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnFromFutureToBankByFuture(CThostFtdcRspTransferField *pRspTransfer) -{ - Task task = Task(); - task.task_name = ONRTNFROMFUTURETOBANKBYFUTURE; - if (pRspTransfer) - { - CThostFtdcRspTransferField *task_data = new CThostFtdcRspTransferField(); - *task_data = *pRspTransfer; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnRepealFromBankToFutureByFutureManual(CThostFtdcRspRepealField *pRspRepeal) -{ - Task task = Task(); - task.task_name = ONRTNREPEALFROMBANKTOFUTUREBYFUTUREMANUAL; - if (pRspRepeal) - { - CThostFtdcRspRepealField *task_data = new CThostFtdcRspRepealField(); - *task_data = *pRspRepeal; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnRepealFromFutureToBankByFutureManual(CThostFtdcRspRepealField *pRspRepeal) -{ - Task task = Task(); - task.task_name = ONRTNREPEALFROMFUTURETOBANKBYFUTUREMANUAL; - if (pRspRepeal) - { - CThostFtdcRspRepealField *task_data = new CThostFtdcRspRepealField(); - *task_data = *pRspRepeal; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnQueryBankBalanceByFuture(CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount) -{ - Task task = Task(); - task.task_name = ONRTNQUERYBANKBALANCEBYFUTURE; - if (pNotifyQueryAccount) - { - CThostFtdcNotifyQueryAccountField *task_data = new CThostFtdcNotifyQueryAccountField(); - *task_data = *pNotifyQueryAccount; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnErrRtnBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) -{ - Task task = Task(); - task.task_name = ONERRRTNBANKTOFUTUREBYFUTURE; - if (pReqTransfer) - { - CThostFtdcReqTransferField *task_data = new CThostFtdcReqTransferField(); - *task_data = *pReqTransfer; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - this->task_queue.push(task); -}; - -void TdApi::OnErrRtnFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) -{ - Task task = Task(); - task.task_name = ONERRRTNFUTURETOBANKBYFUTURE; - if (pReqTransfer) - { - CThostFtdcReqTransferField *task_data = new CThostFtdcReqTransferField(); - *task_data = *pReqTransfer; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - this->task_queue.push(task); -}; - -void TdApi::OnErrRtnRepealBankToFutureByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) -{ - Task task = Task(); - task.task_name = ONERRRTNREPEALBANKTOFUTUREBYFUTUREMANUAL; - if (pReqRepeal) - { - CThostFtdcReqRepealField *task_data = new CThostFtdcReqRepealField(); - *task_data = *pReqRepeal; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - this->task_queue.push(task); -}; - -void TdApi::OnErrRtnRepealFutureToBankByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) -{ - Task task = Task(); - task.task_name = ONERRRTNREPEALFUTURETOBANKBYFUTUREMANUAL; - if (pReqRepeal) - { - CThostFtdcReqRepealField *task_data = new CThostFtdcReqRepealField(); - *task_data = *pReqRepeal; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - this->task_queue.push(task); -}; - -void TdApi::OnErrRtnQueryBankBalanceByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo) -{ - Task task = Task(); - task.task_name = ONERRRTNQUERYBANKBALANCEBYFUTURE; - if (pReqQueryAccount) - { - CThostFtdcReqQueryAccountField *task_data = new CThostFtdcReqQueryAccountField(); - *task_data = *pReqQueryAccount; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnRepealFromBankToFutureByFuture(CThostFtdcRspRepealField *pRspRepeal) -{ - Task task = Task(); - task.task_name = ONRTNREPEALFROMBANKTOFUTUREBYFUTURE; - if (pRspRepeal) - { - CThostFtdcRspRepealField *task_data = new CThostFtdcRspRepealField(); - *task_data = *pRspRepeal; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnRepealFromFutureToBankByFuture(CThostFtdcRspRepealField *pRspRepeal) -{ - Task task = Task(); - task.task_name = ONRTNREPEALFROMFUTURETOBANKBYFUTURE; - if (pRspRepeal) - { - CThostFtdcRspRepealField *task_data = new CThostFtdcRspRepealField(); - *task_data = *pRspRepeal; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRspFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPFROMBANKTOFUTUREBYFUTURE; - if (pReqTransfer) - { - CThostFtdcReqTransferField *task_data = new CThostFtdcReqTransferField(); - *task_data = *pReqTransfer; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPFROMFUTURETOBANKBYFUTURE; - if (pReqTransfer) - { - CThostFtdcReqTransferField *task_data = new CThostFtdcReqTransferField(); - *task_data = *pReqTransfer; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRspQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) -{ - Task task = Task(); - task.task_name = ONRSPQUERYBANKACCOUNTMONEYBYFUTURE; - if (pReqQueryAccount) - { - CThostFtdcReqQueryAccountField *task_data = new CThostFtdcReqQueryAccountField(); - *task_data = *pReqQueryAccount; - task.task_data = task_data; - } - if (pRspInfo) - { - CThostFtdcRspInfoField *task_error = new CThostFtdcRspInfoField(); - *task_error = *pRspInfo; - task.task_error = task_error; - } - task.task_id = nRequestID; - task.task_last = bIsLast; - this->task_queue.push(task); -}; - -void TdApi::OnRtnOpenAccountByBank(CThostFtdcOpenAccountField *pOpenAccount) -{ - Task task = Task(); - task.task_name = ONRTNOPENACCOUNTBYBANK; - if (pOpenAccount) - { - CThostFtdcOpenAccountField *task_data = new CThostFtdcOpenAccountField(); - *task_data = *pOpenAccount; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnCancelAccountByBank(CThostFtdcCancelAccountField *pCancelAccount) -{ - Task task = Task(); - task.task_name = ONRTNCANCELACCOUNTBYBANK; - if (pCancelAccount) - { - CThostFtdcCancelAccountField *task_data = new CThostFtdcCancelAccountField(); - *task_data = *pCancelAccount; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - -void TdApi::OnRtnChangeAccountByBank(CThostFtdcChangeAccountField *pChangeAccount) -{ - Task task = Task(); - task.task_name = ONRTNCHANGEACCOUNTBYBANK; - if (pChangeAccount) - { - CThostFtdcChangeAccountField *task_data = new CThostFtdcChangeAccountField(); - *task_data = *pChangeAccount; - task.task_data = task_data; - } - this->task_queue.push(task); -}; - - -///------------------------------------------------------------------------------------- -///工作线程从队列中取出数据,转化为python对象后,进行推送 -///------------------------------------------------------------------------------------- - -void TdApi::processTask() -{ - try - { - while (this->active) - { - Task task = this->task_queue.pop(); - - switch (task.task_name) - { - case ONFRONTCONNECTED: - { - this->processFrontConnected(&task); - break; - } - - case ONFRONTDISCONNECTED: - { - this->processFrontDisconnected(&task); - break; - } - - case ONHEARTBEATWARNING: - { - this->processHeartBeatWarning(&task); - break; - } - - case ONRSPAUTHENTICATE: - { - this->processRspAuthenticate(&task); - break; - } - - case ONRSPUSERLOGIN: - { - this->processRspUserLogin(&task); - break; - } - - case ONRSPUSERLOGOUT: - { - this->processRspUserLogout(&task); - break; - } - - case ONRSPUSERPASSWORDUPDATE: - { - this->processRspUserPasswordUpdate(&task); - break; - } - - case ONRSPTRADINGACCOUNTPASSWORDUPDATE: - { - this->processRspTradingAccountPasswordUpdate(&task); - break; - } - - case ONRSPUSERAUTHMETHOD: - { - this->processRspUserAuthMethod(&task); - break; - } - - case ONRSPGENUSERCAPTCHA: - { - this->processRspGenUserCaptcha(&task); - break; - } - - case ONRSPGENUSERTEXT: - { - this->processRspGenUserText(&task); - break; - } - - case ONRSPORDERINSERT: - { - this->processRspOrderInsert(&task); - break; - } - - case ONRSPPARKEDORDERINSERT: - { - this->processRspParkedOrderInsert(&task); - break; - } - - case ONRSPPARKEDORDERACTION: - { - this->processRspParkedOrderAction(&task); - break; - } - - case ONRSPORDERACTION: - { - this->processRspOrderAction(&task); - break; - } - - case ONRSPQUERYMAXORDERVOLUME: - { - this->processRspQueryMaxOrderVolume(&task); - break; - } - - case ONRSPSETTLEMENTINFOCONFIRM: - { - this->processRspSettlementInfoConfirm(&task); - break; - } - - case ONRSPREMOVEPARKEDORDER: - { - this->processRspRemoveParkedOrder(&task); - break; - } - - case ONRSPREMOVEPARKEDORDERACTION: - { - this->processRspRemoveParkedOrderAction(&task); - break; - } - - case ONRSPEXECORDERINSERT: - { - this->processRspExecOrderInsert(&task); - break; - } - - case ONRSPEXECORDERACTION: - { - this->processRspExecOrderAction(&task); - break; - } - - case ONRSPFORQUOTEINSERT: - { - this->processRspForQuoteInsert(&task); - break; - } - - case ONRSPQUOTEINSERT: - { - this->processRspQuoteInsert(&task); - break; - } - - case ONRSPQUOTEACTION: - { - this->processRspQuoteAction(&task); - break; - } - - case ONRSPBATCHORDERACTION: - { - this->processRspBatchOrderAction(&task); - break; - } - - case ONRSPOPTIONSELFCLOSEINSERT: - { - this->processRspOptionSelfCloseInsert(&task); - break; - } - - case ONRSPOPTIONSELFCLOSEACTION: - { - this->processRspOptionSelfCloseAction(&task); - break; - } - - case ONRSPCOMBACTIONINSERT: - { - this->processRspCombActionInsert(&task); - break; - } - - case ONRSPQRYORDER: - { - this->processRspQryOrder(&task); - break; - } - - case ONRSPQRYTRADE: - { - this->processRspQryTrade(&task); - break; - } - - case ONRSPQRYINVESTORPOSITION: - { - this->processRspQryInvestorPosition(&task); - break; - } - - case ONRSPQRYTRADINGACCOUNT: - { - this->processRspQryTradingAccount(&task); - break; - } - - case ONRSPQRYINVESTOR: - { - this->processRspQryInvestor(&task); - break; - } - - case ONRSPQRYTRADINGCODE: - { - this->processRspQryTradingCode(&task); - break; - } - - case ONRSPQRYINSTRUMENTMARGINRATE: - { - this->processRspQryInstrumentMarginRate(&task); - break; - } - - case ONRSPQRYINSTRUMENTCOMMISSIONRATE: - { - this->processRspQryInstrumentCommissionRate(&task); - break; - } - - case ONRSPQRYEXCHANGE: - { - this->processRspQryExchange(&task); - break; - } - - case ONRSPQRYPRODUCT: - { - this->processRspQryProduct(&task); - break; - } - - case ONRSPQRYINSTRUMENT: - { - this->processRspQryInstrument(&task); - break; - } - - case ONRSPQRYDEPTHMARKETDATA: - { - this->processRspQryDepthMarketData(&task); - break; - } - - case ONRSPQRYSETTLEMENTINFO: - { - this->processRspQrySettlementInfo(&task); - break; - } - - case ONRSPQRYTRANSFERBANK: - { - this->processRspQryTransferBank(&task); - break; - } - - case ONRSPQRYINVESTORPOSITIONDETAIL: - { - this->processRspQryInvestorPositionDetail(&task); - break; - } - - case ONRSPQRYNOTICE: - { - this->processRspQryNotice(&task); - break; - } - - case ONRSPQRYSETTLEMENTINFOCONFIRM: - { - this->processRspQrySettlementInfoConfirm(&task); - break; - } - - case ONRSPQRYINVESTORPOSITIONCOMBINEDETAIL: - { - this->processRspQryInvestorPositionCombineDetail(&task); - break; - } - - case ONRSPQRYCFMMCTRADINGACCOUNTKEY: - { - this->processRspQryCFMMCTradingAccountKey(&task); - break; - } - - case ONRSPQRYEWARRANTOFFSET: - { - this->processRspQryEWarrantOffset(&task); - break; - } - - case ONRSPQRYINVESTORPRODUCTGROUPMARGIN: - { - this->processRspQryInvestorProductGroupMargin(&task); - break; - } - - case ONRSPQRYEXCHANGEMARGINRATE: - { - this->processRspQryExchangeMarginRate(&task); - break; - } - - case ONRSPQRYEXCHANGEMARGINRATEADJUST: - { - this->processRspQryExchangeMarginRateAdjust(&task); - break; - } - - case ONRSPQRYEXCHANGERATE: - { - this->processRspQryExchangeRate(&task); - break; - } - - case ONRSPQRYSECAGENTACIDMAP: - { - this->processRspQrySecAgentACIDMap(&task); - break; - } - - case ONRSPQRYPRODUCTEXCHRATE: - { - this->processRspQryProductExchRate(&task); - break; - } - - case ONRSPQRYPRODUCTGROUP: - { - this->processRspQryProductGroup(&task); - break; - } - - case ONRSPQRYMMINSTRUMENTCOMMISSIONRATE: - { - this->processRspQryMMInstrumentCommissionRate(&task); - break; - } - - case ONRSPQRYMMOPTIONINSTRCOMMRATE: - { - this->processRspQryMMOptionInstrCommRate(&task); - break; - } - - case ONRSPQRYINSTRUMENTORDERCOMMRATE: - { - this->processRspQryInstrumentOrderCommRate(&task); - break; - } - - case ONRSPQRYSECAGENTTRADINGACCOUNT: - { - this->processRspQrySecAgentTradingAccount(&task); - break; - } - - case ONRSPQRYSECAGENTCHECKMODE: - { - this->processRspQrySecAgentCheckMode(&task); - break; - } - - case ONRSPQRYSECAGENTTRADEINFO: - { - this->processRspQrySecAgentTradeInfo(&task); - break; - } - - case ONRSPQRYOPTIONINSTRTRADECOST: - { - this->processRspQryOptionInstrTradeCost(&task); - break; - } - - case ONRSPQRYOPTIONINSTRCOMMRATE: - { - this->processRspQryOptionInstrCommRate(&task); - break; - } - - case ONRSPQRYEXECORDER: - { - this->processRspQryExecOrder(&task); - break; - } - - case ONRSPQRYFORQUOTE: - { - this->processRspQryForQuote(&task); - break; - } - - case ONRSPQRYQUOTE: - { - this->processRspQryQuote(&task); - break; - } - - case ONRSPQRYOPTIONSELFCLOSE: - { - this->processRspQryOptionSelfClose(&task); - break; - } - - case ONRSPQRYINVESTUNIT: - { - this->processRspQryInvestUnit(&task); - break; - } - - case ONRSPQRYCOMBINSTRUMENTGUARD: - { - this->processRspQryCombInstrumentGuard(&task); - break; - } - - case ONRSPQRYCOMBACTION: - { - this->processRspQryCombAction(&task); - break; - } - - case ONRSPQRYTRANSFERSERIAL: - { - this->processRspQryTransferSerial(&task); - break; - } - - case ONRSPQRYACCOUNTREGISTER: - { - this->processRspQryAccountregister(&task); - break; - } - - case ONRSPERROR: - { - this->processRspError(&task); - break; - } - - case ONRTNORDER: - { - this->processRtnOrder(&task); - break; - } - - case ONRTNTRADE: - { - this->processRtnTrade(&task); - break; - } - - case ONERRRTNORDERINSERT: - { - this->processErrRtnOrderInsert(&task); - break; - } - - case ONERRRTNORDERACTION: - { - this->processErrRtnOrderAction(&task); - break; - } - - case ONRTNINSTRUMENTSTATUS: - { - this->processRtnInstrumentStatus(&task); - break; - } - - case ONRTNBULLETIN: - { - this->processRtnBulletin(&task); - break; - } - - case ONRTNTRADINGNOTICE: - { - this->processRtnTradingNotice(&task); - break; - } - - case ONRTNERRORCONDITIONALORDER: - { - this->processRtnErrorConditionalOrder(&task); - break; - } - - case ONRTNEXECORDER: - { - this->processRtnExecOrder(&task); - break; - } - - case ONERRRTNEXECORDERINSERT: - { - this->processErrRtnExecOrderInsert(&task); - break; - } - - case ONERRRTNEXECORDERACTION: - { - this->processErrRtnExecOrderAction(&task); - break; - } - - case ONERRRTNFORQUOTEINSERT: - { - this->processErrRtnForQuoteInsert(&task); - break; - } - - case ONRTNQUOTE: - { - this->processRtnQuote(&task); - break; - } - - case ONERRRTNQUOTEINSERT: - { - this->processErrRtnQuoteInsert(&task); - break; - } - - case ONERRRTNQUOTEACTION: - { - this->processErrRtnQuoteAction(&task); - break; - } - - case ONRTNFORQUOTERSP: - { - this->processRtnForQuoteRsp(&task); - break; - } - - case ONRTNCFMMCTRADINGACCOUNTTOKEN: - { - this->processRtnCFMMCTradingAccountToken(&task); - break; - } - - case ONERRRTNBATCHORDERACTION: - { - this->processErrRtnBatchOrderAction(&task); - break; - } - - case ONRTNOPTIONSELFCLOSE: - { - this->processRtnOptionSelfClose(&task); - break; - } - - case ONERRRTNOPTIONSELFCLOSEINSERT: - { - this->processErrRtnOptionSelfCloseInsert(&task); - break; - } - - case ONERRRTNOPTIONSELFCLOSEACTION: - { - this->processErrRtnOptionSelfCloseAction(&task); - break; - } - - case ONRTNCOMBACTION: - { - this->processRtnCombAction(&task); - break; - } - - case ONERRRTNCOMBACTIONINSERT: - { - this->processErrRtnCombActionInsert(&task); - break; - } - - case ONRSPQRYCONTRACTBANK: - { - this->processRspQryContractBank(&task); - break; - } - - case ONRSPQRYPARKEDORDER: - { - this->processRspQryParkedOrder(&task); - break; - } - - case ONRSPQRYPARKEDORDERACTION: - { - this->processRspQryParkedOrderAction(&task); - break; - } - - case ONRSPQRYTRADINGNOTICE: - { - this->processRspQryTradingNotice(&task); - break; - } - - case ONRSPQRYBROKERTRADINGPARAMS: - { - this->processRspQryBrokerTradingParams(&task); - break; - } - - case ONRSPQRYBROKERTRADINGALGOS: - { - this->processRspQryBrokerTradingAlgos(&task); - break; - } - - case ONRSPQUERYCFMMCTRADINGACCOUNTTOKEN: - { - this->processRspQueryCFMMCTradingAccountToken(&task); - break; - } - - case ONRTNFROMBANKTOFUTUREBYBANK: - { - this->processRtnFromBankToFutureByBank(&task); - break; - } - - case ONRTNFROMFUTURETOBANKBYBANK: - { - this->processRtnFromFutureToBankByBank(&task); - break; - } - - case ONRTNREPEALFROMBANKTOFUTUREBYBANK: - { - this->processRtnRepealFromBankToFutureByBank(&task); - break; - } - - case ONRTNREPEALFROMFUTURETOBANKBYBANK: - { - this->processRtnRepealFromFutureToBankByBank(&task); - break; - } - - case ONRTNFROMBANKTOFUTUREBYFUTURE: - { - this->processRtnFromBankToFutureByFuture(&task); - break; - } - - case ONRTNFROMFUTURETOBANKBYFUTURE: - { - this->processRtnFromFutureToBankByFuture(&task); - break; - } - - case ONRTNREPEALFROMBANKTOFUTUREBYFUTUREMANUAL: - { - this->processRtnRepealFromBankToFutureByFutureManual(&task); - break; - } - - case ONRTNREPEALFROMFUTURETOBANKBYFUTUREMANUAL: - { - this->processRtnRepealFromFutureToBankByFutureManual(&task); - break; - } - - case ONRTNQUERYBANKBALANCEBYFUTURE: - { - this->processRtnQueryBankBalanceByFuture(&task); - break; - } - - case ONERRRTNBANKTOFUTUREBYFUTURE: - { - this->processErrRtnBankToFutureByFuture(&task); - break; - } - - case ONERRRTNFUTURETOBANKBYFUTURE: - { - this->processErrRtnFutureToBankByFuture(&task); - break; - } - - case ONERRRTNREPEALBANKTOFUTUREBYFUTUREMANUAL: - { - this->processErrRtnRepealBankToFutureByFutureManual(&task); - break; - } - - case ONERRRTNREPEALFUTURETOBANKBYFUTUREMANUAL: - { - this->processErrRtnRepealFutureToBankByFutureManual(&task); - break; - } - - case ONERRRTNQUERYBANKBALANCEBYFUTURE: - { - this->processErrRtnQueryBankBalanceByFuture(&task); - break; - } - - case ONRTNREPEALFROMBANKTOFUTUREBYFUTURE: - { - this->processRtnRepealFromBankToFutureByFuture(&task); - break; - } - - case ONRTNREPEALFROMFUTURETOBANKBYFUTURE: - { - this->processRtnRepealFromFutureToBankByFuture(&task); - break; - } - - case ONRSPFROMBANKTOFUTUREBYFUTURE: - { - this->processRspFromBankToFutureByFuture(&task); - break; - } - - case ONRSPFROMFUTURETOBANKBYFUTURE: - { - this->processRspFromFutureToBankByFuture(&task); - break; - } - - case ONRSPQUERYBANKACCOUNTMONEYBYFUTURE: - { - this->processRspQueryBankAccountMoneyByFuture(&task); - break; - } - - case ONRTNOPENACCOUNTBYBANK: - { - this->processRtnOpenAccountByBank(&task); - break; - } - - case ONRTNCANCELACCOUNTBYBANK: - { - this->processRtnCancelAccountByBank(&task); - break; - } - - case ONRTNCHANGEACCOUNTBYBANK: - { - this->processRtnChangeAccountByBank(&task); - break; - } - }; - } - } - catch (const TerminatedError&) - { - } -}; - -void TdApi::processFrontConnected(Task *task) -{ - gil_scoped_acquire acquire; - this->onFrontConnected(); -}; - -void TdApi::processFrontDisconnected(Task *task) -{ - gil_scoped_acquire acquire; - this->onFrontDisconnected(task->task_id); -}; - -void TdApi::processHeartBeatWarning(Task *task) -{ - gil_scoped_acquire acquire; - this->onHeartBeatWarning(task->task_id); -}; - -void TdApi::processRspAuthenticate(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRspAuthenticateField *task_data = (CThostFtdcRspAuthenticateField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["UserID"] = toUtf(task_data->UserID); - data["UserProductInfo"] = toUtf(task_data->UserProductInfo); - data["AppID"] = toUtf(task_data->AppID); - data["AppType"] = task_data->AppType; - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspAuthenticate(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspUserLogin(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRspUserLoginField *task_data = (CThostFtdcRspUserLoginField*)task->task_data; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["LoginTime"] = toUtf(task_data->LoginTime); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["UserID"] = toUtf(task_data->UserID); - data["SystemName"] = toUtf(task_data->SystemName); - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["MaxOrderRef"] = toUtf(task_data->MaxOrderRef); - data["SHFETime"] = toUtf(task_data->SHFETime); - data["DCETime"] = toUtf(task_data->DCETime); - data["CZCETime"] = toUtf(task_data->CZCETime); - data["FFEXTime"] = toUtf(task_data->FFEXTime); - data["INETime"] = toUtf(task_data->INETime); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspUserLogin(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspUserLogout(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcUserLogoutField *task_data = (CThostFtdcUserLogoutField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["UserID"] = toUtf(task_data->UserID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspUserLogout(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspUserPasswordUpdate(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcUserPasswordUpdateField *task_data = (CThostFtdcUserPasswordUpdateField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["UserID"] = toUtf(task_data->UserID); - data["OldPassword"] = toUtf(task_data->OldPassword); - data["NewPassword"] = toUtf(task_data->NewPassword); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspUserPasswordUpdate(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspTradingAccountPasswordUpdate(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcTradingAccountPasswordUpdateField *task_data = (CThostFtdcTradingAccountPasswordUpdateField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["AccountID"] = toUtf(task_data->AccountID); - data["OldPassword"] = toUtf(task_data->OldPassword); - data["NewPassword"] = toUtf(task_data->NewPassword); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspTradingAccountPasswordUpdate(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspUserAuthMethod(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRspUserAuthMethodField *task_data = (CThostFtdcRspUserAuthMethodField*)task->task_data; - data["UsableAuthMethod"] = task_data->UsableAuthMethod; - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspUserAuthMethod(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspGenUserCaptcha(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRspGenUserCaptchaField *task_data = (CThostFtdcRspGenUserCaptchaField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["UserID"] = toUtf(task_data->UserID); - data["CaptchaInfoLen"] = task_data->CaptchaInfoLen; - data["CaptchaInfo"] = toUtf(task_data->CaptchaInfo); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspGenUserCaptcha(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspGenUserText(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRspGenUserTextField *task_data = (CThostFtdcRspGenUserTextField*)task->task_data; - data["UserTextSeq"] = task_data->UserTextSeq; - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspGenUserText(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspOrderInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInputOrderField *task_data = (CThostFtdcInputOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["OrderRef"] = toUtf(task_data->OrderRef); - data["UserID"] = toUtf(task_data->UserID); - data["OrderPriceType"] = task_data->OrderPriceType; - data["Direction"] = task_data->Direction; - data["CombOffsetFlag"] = toUtf(task_data->CombOffsetFlag); - data["CombHedgeFlag"] = toUtf(task_data->CombHedgeFlag); - data["LimitPrice"] = task_data->LimitPrice; - data["VolumeTotalOriginal"] = task_data->VolumeTotalOriginal; - data["TimeCondition"] = task_data->TimeCondition; - data["GTDDate"] = toUtf(task_data->GTDDate); - data["VolumeCondition"] = task_data->VolumeCondition; - data["MinVolume"] = task_data->MinVolume; - data["ContingentCondition"] = task_data->ContingentCondition; - data["StopPrice"] = task_data->StopPrice; - data["ForceCloseReason"] = task_data->ForceCloseReason; - data["IsAutoSuspend"] = task_data->IsAutoSuspend; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["RequestID"] = task_data->RequestID; - data["UserForceClose"] = task_data->UserForceClose; - data["IsSwapOrder"] = task_data->IsSwapOrder; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["ClientID"] = toUtf(task_data->ClientID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspOrderInsert(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspParkedOrderInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcParkedOrderField *task_data = (CThostFtdcParkedOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["OrderRef"] = toUtf(task_data->OrderRef); - data["UserID"] = toUtf(task_data->UserID); - data["OrderPriceType"] = task_data->OrderPriceType; - data["Direction"] = task_data->Direction; - data["CombOffsetFlag"] = toUtf(task_data->CombOffsetFlag); - data["CombHedgeFlag"] = toUtf(task_data->CombHedgeFlag); - data["LimitPrice"] = task_data->LimitPrice; - data["VolumeTotalOriginal"] = task_data->VolumeTotalOriginal; - data["TimeCondition"] = task_data->TimeCondition; - data["GTDDate"] = toUtf(task_data->GTDDate); - data["VolumeCondition"] = task_data->VolumeCondition; - data["MinVolume"] = task_data->MinVolume; - data["ContingentCondition"] = task_data->ContingentCondition; - data["StopPrice"] = task_data->StopPrice; - data["ForceCloseReason"] = task_data->ForceCloseReason; - data["IsAutoSuspend"] = task_data->IsAutoSuspend; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["RequestID"] = task_data->RequestID; - data["UserForceClose"] = task_data->UserForceClose; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ParkedOrderID"] = toUtf(task_data->ParkedOrderID); - data["UserType"] = task_data->UserType; - data["Status"] = task_data->Status; - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["IsSwapOrder"] = task_data->IsSwapOrder; - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["ClientID"] = toUtf(task_data->ClientID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspParkedOrderInsert(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspParkedOrderAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcParkedOrderActionField *task_data = (CThostFtdcParkedOrderActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["OrderActionRef"] = task_data->OrderActionRef; - data["OrderRef"] = toUtf(task_data->OrderRef); - data["RequestID"] = task_data->RequestID; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["ActionFlag"] = task_data->ActionFlag; - data["LimitPrice"] = task_data->LimitPrice; - data["VolumeChange"] = task_data->VolumeChange; - data["UserID"] = toUtf(task_data->UserID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["ParkedOrderActionID"] = toUtf(task_data->ParkedOrderActionID); - data["UserType"] = task_data->UserType; - data["Status"] = task_data->Status; - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspParkedOrderAction(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspOrderAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInputOrderActionField *task_data = (CThostFtdcInputOrderActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["OrderActionRef"] = task_data->OrderActionRef; - data["OrderRef"] = toUtf(task_data->OrderRef); - data["RequestID"] = task_data->RequestID; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["ActionFlag"] = task_data->ActionFlag; - data["LimitPrice"] = task_data->LimitPrice; - data["VolumeChange"] = task_data->VolumeChange; - data["UserID"] = toUtf(task_data->UserID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspOrderAction(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQueryMaxOrderVolume(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcQueryMaxOrderVolumeField *task_data = (CThostFtdcQueryMaxOrderVolumeField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["Direction"] = task_data->Direction; - data["OffsetFlag"] = task_data->OffsetFlag; - data["HedgeFlag"] = task_data->HedgeFlag; - data["MaxVolume"] = task_data->MaxVolume; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQueryMaxOrderVolume(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspSettlementInfoConfirm(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcSettlementInfoConfirmField *task_data = (CThostFtdcSettlementInfoConfirmField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["ConfirmDate"] = toUtf(task_data->ConfirmDate); - data["ConfirmTime"] = toUtf(task_data->ConfirmTime); - data["SettlementID"] = task_data->SettlementID; - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspSettlementInfoConfirm(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspRemoveParkedOrder(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRemoveParkedOrderField *task_data = (CThostFtdcRemoveParkedOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["ParkedOrderID"] = toUtf(task_data->ParkedOrderID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspRemoveParkedOrder(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspRemoveParkedOrderAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRemoveParkedOrderActionField *task_data = (CThostFtdcRemoveParkedOrderActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["ParkedOrderActionID"] = toUtf(task_data->ParkedOrderActionID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspRemoveParkedOrderAction(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspExecOrderInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInputExecOrderField *task_data = (CThostFtdcInputExecOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["ExecOrderRef"] = toUtf(task_data->ExecOrderRef); - data["UserID"] = toUtf(task_data->UserID); - data["Volume"] = task_data->Volume; - data["RequestID"] = task_data->RequestID; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["OffsetFlag"] = task_data->OffsetFlag; - data["HedgeFlag"] = task_data->HedgeFlag; - data["ActionType"] = task_data->ActionType; - data["PosiDirection"] = task_data->PosiDirection; - data["ReservePositionFlag"] = task_data->ReservePositionFlag; - data["CloseFlag"] = task_data->CloseFlag; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["ClientID"] = toUtf(task_data->ClientID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspExecOrderInsert(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspExecOrderAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInputExecOrderActionField *task_data = (CThostFtdcInputExecOrderActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["ExecOrderActionRef"] = task_data->ExecOrderActionRef; - data["ExecOrderRef"] = toUtf(task_data->ExecOrderRef); - data["RequestID"] = task_data->RequestID; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ExecOrderSysID"] = toUtf(task_data->ExecOrderSysID); - data["ActionFlag"] = task_data->ActionFlag; - data["UserID"] = toUtf(task_data->UserID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspExecOrderAction(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspForQuoteInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInputForQuoteField *task_data = (CThostFtdcInputForQuoteField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["ForQuoteRef"] = toUtf(task_data->ForQuoteRef); - data["UserID"] = toUtf(task_data->UserID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspForQuoteInsert(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQuoteInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInputQuoteField *task_data = (CThostFtdcInputQuoteField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["QuoteRef"] = toUtf(task_data->QuoteRef); - data["UserID"] = toUtf(task_data->UserID); - data["AskPrice"] = task_data->AskPrice; - data["BidPrice"] = task_data->BidPrice; - data["AskVolume"] = task_data->AskVolume; - data["BidVolume"] = task_data->BidVolume; - data["RequestID"] = task_data->RequestID; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["AskOffsetFlag"] = task_data->AskOffsetFlag; - data["BidOffsetFlag"] = task_data->BidOffsetFlag; - data["AskHedgeFlag"] = task_data->AskHedgeFlag; - data["BidHedgeFlag"] = task_data->BidHedgeFlag; - data["AskOrderRef"] = toUtf(task_data->AskOrderRef); - data["BidOrderRef"] = toUtf(task_data->BidOrderRef); - data["ForQuoteSysID"] = toUtf(task_data->ForQuoteSysID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["ClientID"] = toUtf(task_data->ClientID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQuoteInsert(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQuoteAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInputQuoteActionField *task_data = (CThostFtdcInputQuoteActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["QuoteActionRef"] = task_data->QuoteActionRef; - data["QuoteRef"] = toUtf(task_data->QuoteRef); - data["RequestID"] = task_data->RequestID; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["QuoteSysID"] = toUtf(task_data->QuoteSysID); - data["ActionFlag"] = task_data->ActionFlag; - data["UserID"] = toUtf(task_data->UserID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["ClientID"] = toUtf(task_data->ClientID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQuoteAction(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspBatchOrderAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInputBatchOrderActionField *task_data = (CThostFtdcInputBatchOrderActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["OrderActionRef"] = task_data->OrderActionRef; - data["RequestID"] = task_data->RequestID; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["UserID"] = toUtf(task_data->UserID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspBatchOrderAction(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspOptionSelfCloseInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInputOptionSelfCloseField *task_data = (CThostFtdcInputOptionSelfCloseField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["OptionSelfCloseRef"] = toUtf(task_data->OptionSelfCloseRef); - data["UserID"] = toUtf(task_data->UserID); - data["Volume"] = task_data->Volume; - data["RequestID"] = task_data->RequestID; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["HedgeFlag"] = task_data->HedgeFlag; - data["OptSelfCloseFlag"] = task_data->OptSelfCloseFlag; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["ClientID"] = toUtf(task_data->ClientID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspOptionSelfCloseInsert(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspOptionSelfCloseAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInputOptionSelfCloseActionField *task_data = (CThostFtdcInputOptionSelfCloseActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["OptionSelfCloseActionRef"] = task_data->OptionSelfCloseActionRef; - data["OptionSelfCloseRef"] = toUtf(task_data->OptionSelfCloseRef); - data["RequestID"] = task_data->RequestID; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["OptionSelfCloseSysID"] = toUtf(task_data->OptionSelfCloseSysID); - data["ActionFlag"] = task_data->ActionFlag; - data["UserID"] = toUtf(task_data->UserID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspOptionSelfCloseAction(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspCombActionInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInputCombActionField *task_data = (CThostFtdcInputCombActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["CombActionRef"] = toUtf(task_data->CombActionRef); - data["UserID"] = toUtf(task_data->UserID); - data["Direction"] = task_data->Direction; - data["Volume"] = task_data->Volume; - data["CombDirection"] = task_data->CombDirection; - data["HedgeFlag"] = task_data->HedgeFlag; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspCombActionInsert(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryOrder(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcOrderField *task_data = (CThostFtdcOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["OrderRef"] = toUtf(task_data->OrderRef); - data["UserID"] = toUtf(task_data->UserID); - data["OrderPriceType"] = task_data->OrderPriceType; - data["Direction"] = task_data->Direction; - data["CombOffsetFlag"] = toUtf(task_data->CombOffsetFlag); - data["CombHedgeFlag"] = toUtf(task_data->CombHedgeFlag); - data["LimitPrice"] = task_data->LimitPrice; - data["VolumeTotalOriginal"] = task_data->VolumeTotalOriginal; - data["TimeCondition"] = task_data->TimeCondition; - data["GTDDate"] = toUtf(task_data->GTDDate); - data["VolumeCondition"] = task_data->VolumeCondition; - data["MinVolume"] = task_data->MinVolume; - data["ContingentCondition"] = task_data->ContingentCondition; - data["StopPrice"] = task_data->StopPrice; - data["ForceCloseReason"] = task_data->ForceCloseReason; - data["IsAutoSuspend"] = task_data->IsAutoSuspend; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["RequestID"] = task_data->RequestID; - data["OrderLocalID"] = toUtf(task_data->OrderLocalID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["TraderID"] = toUtf(task_data->TraderID); - data["InstallID"] = task_data->InstallID; - data["OrderSubmitStatus"] = task_data->OrderSubmitStatus; - data["NotifySequence"] = task_data->NotifySequence; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["OrderSource"] = task_data->OrderSource; - data["OrderStatus"] = task_data->OrderStatus; - data["OrderType"] = task_data->OrderType; - data["VolumeTraded"] = task_data->VolumeTraded; - data["VolumeTotal"] = task_data->VolumeTotal; - data["InsertDate"] = toUtf(task_data->InsertDate); - data["InsertTime"] = toUtf(task_data->InsertTime); - data["ActiveTime"] = toUtf(task_data->ActiveTime); - data["SuspendTime"] = toUtf(task_data->SuspendTime); - data["UpdateTime"] = toUtf(task_data->UpdateTime); - data["CancelTime"] = toUtf(task_data->CancelTime); - data["ActiveTraderID"] = toUtf(task_data->ActiveTraderID); - data["ClearingPartID"] = toUtf(task_data->ClearingPartID); - data["SequenceNo"] = task_data->SequenceNo; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["UserProductInfo"] = toUtf(task_data->UserProductInfo); - data["StatusMsg"] = toUtf(task_data->StatusMsg); - data["UserForceClose"] = task_data->UserForceClose; - data["ActiveUserID"] = toUtf(task_data->ActiveUserID); - data["BrokerOrderSeq"] = task_data->BrokerOrderSeq; - data["RelativeOrderSysID"] = toUtf(task_data->RelativeOrderSysID); - data["ZCETotalTradedVolume"] = task_data->ZCETotalTradedVolume; - data["IsSwapOrder"] = task_data->IsSwapOrder; - data["BranchID"] = toUtf(task_data->BranchID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryOrder(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryTrade(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcTradeField *task_data = (CThostFtdcTradeField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["OrderRef"] = toUtf(task_data->OrderRef); - data["UserID"] = toUtf(task_data->UserID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["TradeID"] = toUtf(task_data->TradeID); - data["Direction"] = task_data->Direction; - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["TradingRole"] = task_data->TradingRole; - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["OffsetFlag"] = task_data->OffsetFlag; - data["HedgeFlag"] = task_data->HedgeFlag; - data["Price"] = task_data->Price; - data["Volume"] = task_data->Volume; - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["TradeType"] = task_data->TradeType; - data["PriceSource"] = task_data->PriceSource; - data["TraderID"] = toUtf(task_data->TraderID); - data["OrderLocalID"] = toUtf(task_data->OrderLocalID); - data["ClearingPartID"] = toUtf(task_data->ClearingPartID); - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["SequenceNo"] = task_data->SequenceNo; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["BrokerOrderSeq"] = task_data->BrokerOrderSeq; - data["TradeSource"] = task_data->TradeSource; - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryTrade(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInvestorPosition(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInvestorPositionField *task_data = (CThostFtdcInvestorPositionField*)task->task_data; - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["PosiDirection"] = task_data->PosiDirection; - data["HedgeFlag"] = task_data->HedgeFlag; - data["PositionDate"] = task_data->PositionDate; - data["YdPosition"] = task_data->YdPosition; - data["Position"] = task_data->Position; - data["LongFrozen"] = task_data->LongFrozen; - data["ShortFrozen"] = task_data->ShortFrozen; - data["LongFrozenAmount"] = task_data->LongFrozenAmount; - data["ShortFrozenAmount"] = task_data->ShortFrozenAmount; - data["OpenVolume"] = task_data->OpenVolume; - data["CloseVolume"] = task_data->CloseVolume; - data["OpenAmount"] = task_data->OpenAmount; - data["CloseAmount"] = task_data->CloseAmount; - data["PositionCost"] = task_data->PositionCost; - data["PreMargin"] = task_data->PreMargin; - data["UseMargin"] = task_data->UseMargin; - data["FrozenMargin"] = task_data->FrozenMargin; - data["FrozenCash"] = task_data->FrozenCash; - data["FrozenCommission"] = task_data->FrozenCommission; - data["CashIn"] = task_data->CashIn; - data["Commission"] = task_data->Commission; - data["CloseProfit"] = task_data->CloseProfit; - data["PositionProfit"] = task_data->PositionProfit; - data["PreSettlementPrice"] = task_data->PreSettlementPrice; - data["SettlementPrice"] = task_data->SettlementPrice; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["OpenCost"] = task_data->OpenCost; - data["ExchangeMargin"] = task_data->ExchangeMargin; - data["CombPosition"] = task_data->CombPosition; - data["CombLongFrozen"] = task_data->CombLongFrozen; - data["CombShortFrozen"] = task_data->CombShortFrozen; - data["CloseProfitByDate"] = task_data->CloseProfitByDate; - data["CloseProfitByTrade"] = task_data->CloseProfitByTrade; - data["TodayPosition"] = task_data->TodayPosition; - data["MarginRateByMoney"] = task_data->MarginRateByMoney; - data["MarginRateByVolume"] = task_data->MarginRateByVolume; - data["StrikeFrozen"] = task_data->StrikeFrozen; - data["StrikeFrozenAmount"] = task_data->StrikeFrozenAmount; - data["AbandonFrozen"] = task_data->AbandonFrozen; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["YdStrikeFrozen"] = task_data->YdStrikeFrozen; - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryInvestorPosition(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryTradingAccount(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcTradingAccountField *task_data = (CThostFtdcTradingAccountField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["AccountID"] = toUtf(task_data->AccountID); - data["PreMortgage"] = task_data->PreMortgage; - data["PreCredit"] = task_data->PreCredit; - data["PreDeposit"] = task_data->PreDeposit; - data["PreBalance"] = task_data->PreBalance; - data["PreMargin"] = task_data->PreMargin; - data["InterestBase"] = task_data->InterestBase; - data["Interest"] = task_data->Interest; - data["Deposit"] = task_data->Deposit; - data["Withdraw"] = task_data->Withdraw; - data["FrozenMargin"] = task_data->FrozenMargin; - data["FrozenCash"] = task_data->FrozenCash; - data["FrozenCommission"] = task_data->FrozenCommission; - data["CurrMargin"] = task_data->CurrMargin; - data["CashIn"] = task_data->CashIn; - data["Commission"] = task_data->Commission; - data["CloseProfit"] = task_data->CloseProfit; - data["PositionProfit"] = task_data->PositionProfit; - data["Balance"] = task_data->Balance; - data["Available"] = task_data->Available; - data["WithdrawQuota"] = task_data->WithdrawQuota; - data["Reserve"] = task_data->Reserve; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["Credit"] = task_data->Credit; - data["Mortgage"] = task_data->Mortgage; - data["ExchangeMargin"] = task_data->ExchangeMargin; - data["DeliveryMargin"] = task_data->DeliveryMargin; - data["ExchangeDeliveryMargin"] = task_data->ExchangeDeliveryMargin; - data["ReserveBalance"] = task_data->ReserveBalance; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["PreFundMortgageIn"] = task_data->PreFundMortgageIn; - data["PreFundMortgageOut"] = task_data->PreFundMortgageOut; - data["FundMortgageIn"] = task_data->FundMortgageIn; - data["FundMortgageOut"] = task_data->FundMortgageOut; - data["FundMortgageAvailable"] = task_data->FundMortgageAvailable; - data["MortgageableFund"] = task_data->MortgageableFund; - data["SpecProductMargin"] = task_data->SpecProductMargin; - data["SpecProductFrozenMargin"] = task_data->SpecProductFrozenMargin; - data["SpecProductCommission"] = task_data->SpecProductCommission; - data["SpecProductFrozenCommission"] = task_data->SpecProductFrozenCommission; - data["SpecProductPositionProfit"] = task_data->SpecProductPositionProfit; - data["SpecProductCloseProfit"] = task_data->SpecProductCloseProfit; - data["SpecProductPositionProfitByAlg"] = task_data->SpecProductPositionProfitByAlg; - data["SpecProductExchangeMargin"] = task_data->SpecProductExchangeMargin; - data["BizType"] = task_data->BizType; - data["FrozenSwap"] = task_data->FrozenSwap; - data["RemainSwap"] = task_data->RemainSwap; - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryTradingAccount(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInvestor(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInvestorField *task_data = (CThostFtdcInvestorField*)task->task_data; - data["InvestorID"] = toUtf(task_data->InvestorID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorGroupID"] = toUtf(task_data->InvestorGroupID); - data["InvestorName"] = toUtf(task_data->InvestorName); - data["IdentifiedCardType"] = task_data->IdentifiedCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["IsActive"] = task_data->IsActive; - data["Telephone"] = toUtf(task_data->Telephone); - data["Address"] = toUtf(task_data->Address); - data["OpenDate"] = toUtf(task_data->OpenDate); - data["Mobile"] = toUtf(task_data->Mobile); - data["CommModelID"] = toUtf(task_data->CommModelID); - data["MarginModelID"] = toUtf(task_data->MarginModelID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryInvestor(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryTradingCode(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcTradingCodeField *task_data = (CThostFtdcTradingCodeField*)task->task_data; - data["InvestorID"] = toUtf(task_data->InvestorID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ClientID"] = toUtf(task_data->ClientID); - data["IsActive"] = task_data->IsActive; - data["ClientIDType"] = task_data->ClientIDType; - data["BranchID"] = toUtf(task_data->BranchID); - data["BizType"] = task_data->BizType; - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryTradingCode(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInstrumentMarginRate(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInstrumentMarginRateField *task_data = (CThostFtdcInstrumentMarginRateField*)task->task_data; - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["InvestorRange"] = task_data->InvestorRange; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["HedgeFlag"] = task_data->HedgeFlag; - data["LongMarginRatioByMoney"] = task_data->LongMarginRatioByMoney; - data["LongMarginRatioByVolume"] = task_data->LongMarginRatioByVolume; - data["ShortMarginRatioByMoney"] = task_data->ShortMarginRatioByMoney; - data["ShortMarginRatioByVolume"] = task_data->ShortMarginRatioByVolume; - data["IsRelative"] = task_data->IsRelative; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryInstrumentMarginRate(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInstrumentCommissionRate(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInstrumentCommissionRateField *task_data = (CThostFtdcInstrumentCommissionRateField*)task->task_data; - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["InvestorRange"] = task_data->InvestorRange; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["OpenRatioByMoney"] = task_data->OpenRatioByMoney; - data["OpenRatioByVolume"] = task_data->OpenRatioByVolume; - data["CloseRatioByMoney"] = task_data->CloseRatioByMoney; - data["CloseRatioByVolume"] = task_data->CloseRatioByVolume; - data["CloseTodayRatioByMoney"] = task_data->CloseTodayRatioByMoney; - data["CloseTodayRatioByVolume"] = task_data->CloseTodayRatioByVolume; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["BizType"] = task_data->BizType; - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryInstrumentCommissionRate(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryExchange(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcExchangeField *task_data = (CThostFtdcExchangeField*)task->task_data; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ExchangeName"] = toUtf(task_data->ExchangeName); - data["ExchangeProperty"] = task_data->ExchangeProperty; - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryExchange(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryProduct(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcProductField *task_data = (CThostFtdcProductField*)task->task_data; - data["ProductID"] = toUtf(task_data->ProductID); - data["ProductName"] = toUtf(task_data->ProductName); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ProductClass"] = task_data->ProductClass; - data["VolumeMultiple"] = task_data->VolumeMultiple; - data["PriceTick"] = task_data->PriceTick; - data["MaxMarketOrderVolume"] = task_data->MaxMarketOrderVolume; - data["MinMarketOrderVolume"] = task_data->MinMarketOrderVolume; - data["MaxLimitOrderVolume"] = task_data->MaxLimitOrderVolume; - data["MinLimitOrderVolume"] = task_data->MinLimitOrderVolume; - data["PositionType"] = task_data->PositionType; - data["PositionDateType"] = task_data->PositionDateType; - data["CloseDealType"] = task_data->CloseDealType; - data["TradeCurrencyID"] = toUtf(task_data->TradeCurrencyID); - data["MortgageFundUseRange"] = task_data->MortgageFundUseRange; - data["ExchangeProductID"] = toUtf(task_data->ExchangeProductID); - data["UnderlyingMultiple"] = task_data->UnderlyingMultiple; - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryProduct(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInstrument(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInstrumentField *task_data = (CThostFtdcInstrumentField*)task->task_data; - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InstrumentName"] = toUtf(task_data->InstrumentName); - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["ProductID"] = toUtf(task_data->ProductID); - data["ProductClass"] = task_data->ProductClass; - data["DeliveryYear"] = task_data->DeliveryYear; - data["DeliveryMonth"] = task_data->DeliveryMonth; - data["MaxMarketOrderVolume"] = task_data->MaxMarketOrderVolume; - data["MinMarketOrderVolume"] = task_data->MinMarketOrderVolume; - data["MaxLimitOrderVolume"] = task_data->MaxLimitOrderVolume; - data["MinLimitOrderVolume"] = task_data->MinLimitOrderVolume; - data["VolumeMultiple"] = task_data->VolumeMultiple; - data["PriceTick"] = task_data->PriceTick; - data["CreateDate"] = toUtf(task_data->CreateDate); - data["OpenDate"] = toUtf(task_data->OpenDate); - data["ExpireDate"] = toUtf(task_data->ExpireDate); - data["StartDelivDate"] = toUtf(task_data->StartDelivDate); - data["EndDelivDate"] = toUtf(task_data->EndDelivDate); - data["InstLifePhase"] = task_data->InstLifePhase; - data["IsTrading"] = task_data->IsTrading; - data["PositionType"] = task_data->PositionType; - data["PositionDateType"] = task_data->PositionDateType; - data["LongMarginRatio"] = task_data->LongMarginRatio; - data["ShortMarginRatio"] = task_data->ShortMarginRatio; - data["MaxMarginSideAlgorithm"] = task_data->MaxMarginSideAlgorithm; - data["UnderlyingInstrID"] = toUtf(task_data->UnderlyingInstrID); - data["StrikePrice"] = task_data->StrikePrice; - data["OptionsType"] = task_data->OptionsType; - data["UnderlyingMultiple"] = task_data->UnderlyingMultiple; - data["CombinationType"] = task_data->CombinationType; - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryInstrument(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryDepthMarketData(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcDepthMarketDataField *task_data = (CThostFtdcDepthMarketDataField*)task->task_data; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["LastPrice"] = task_data->LastPrice; - data["PreSettlementPrice"] = task_data->PreSettlementPrice; - data["PreClosePrice"] = task_data->PreClosePrice; - data["PreOpenInterest"] = task_data->PreOpenInterest; - data["OpenPrice"] = task_data->OpenPrice; - data["HighestPrice"] = task_data->HighestPrice; - data["LowestPrice"] = task_data->LowestPrice; - data["Volume"] = task_data->Volume; - data["Turnover"] = task_data->Turnover; - data["OpenInterest"] = task_data->OpenInterest; - data["ClosePrice"] = task_data->ClosePrice; - data["SettlementPrice"] = task_data->SettlementPrice; - data["UpperLimitPrice"] = task_data->UpperLimitPrice; - data["LowerLimitPrice"] = task_data->LowerLimitPrice; - data["PreDelta"] = task_data->PreDelta; - data["CurrDelta"] = task_data->CurrDelta; - data["UpdateTime"] = toUtf(task_data->UpdateTime); - data["UpdateMillisec"] = task_data->UpdateMillisec; - data["BidPrice1"] = task_data->BidPrice1; - data["BidVolume1"] = task_data->BidVolume1; - data["AskPrice1"] = task_data->AskPrice1; - data["AskVolume1"] = task_data->AskVolume1; - data["BidPrice2"] = task_data->BidPrice2; - data["BidVolume2"] = task_data->BidVolume2; - data["AskPrice2"] = task_data->AskPrice2; - data["AskVolume2"] = task_data->AskVolume2; - data["BidPrice3"] = task_data->BidPrice3; - data["BidVolume3"] = task_data->BidVolume3; - data["AskPrice3"] = task_data->AskPrice3; - data["AskVolume3"] = task_data->AskVolume3; - data["BidPrice4"] = task_data->BidPrice4; - data["BidVolume4"] = task_data->BidVolume4; - data["AskPrice4"] = task_data->AskPrice4; - data["AskVolume4"] = task_data->AskVolume4; - data["BidPrice5"] = task_data->BidPrice5; - data["BidVolume5"] = task_data->BidVolume5; - data["AskPrice5"] = task_data->AskPrice5; - data["AskVolume5"] = task_data->AskVolume5; - data["AveragePrice"] = task_data->AveragePrice; - data["ActionDay"] = toUtf(task_data->ActionDay); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryDepthMarketData(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQrySettlementInfo(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcSettlementInfoField *task_data = (CThostFtdcSettlementInfoField*)task->task_data; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["SequenceNo"] = task_data->SequenceNo; - data["Content"] = toUtf(task_data->Content); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQrySettlementInfo(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryTransferBank(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcTransferBankField *task_data = (CThostFtdcTransferBankField*)task->task_data; - data["BankID"] = toUtf(task_data->BankID); - data["BankBrchID"] = toUtf(task_data->BankBrchID); - data["BankName"] = toUtf(task_data->BankName); - data["IsActive"] = task_data->IsActive; - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryTransferBank(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInvestorPositionDetail(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInvestorPositionDetailField *task_data = (CThostFtdcInvestorPositionDetailField*)task->task_data; - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["HedgeFlag"] = task_data->HedgeFlag; - data["Direction"] = task_data->Direction; - data["OpenDate"] = toUtf(task_data->OpenDate); - data["TradeID"] = toUtf(task_data->TradeID); - data["Volume"] = task_data->Volume; - data["OpenPrice"] = task_data->OpenPrice; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["TradeType"] = task_data->TradeType; - data["CombInstrumentID"] = toUtf(task_data->CombInstrumentID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["CloseProfitByDate"] = task_data->CloseProfitByDate; - data["CloseProfitByTrade"] = task_data->CloseProfitByTrade; - data["PositionProfitByDate"] = task_data->PositionProfitByDate; - data["PositionProfitByTrade"] = task_data->PositionProfitByTrade; - data["Margin"] = task_data->Margin; - data["ExchMargin"] = task_data->ExchMargin; - data["MarginRateByMoney"] = task_data->MarginRateByMoney; - data["MarginRateByVolume"] = task_data->MarginRateByVolume; - data["LastSettlementPrice"] = task_data->LastSettlementPrice; - data["SettlementPrice"] = task_data->SettlementPrice; - data["CloseVolume"] = task_data->CloseVolume; - data["CloseAmount"] = task_data->CloseAmount; - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryInvestorPositionDetail(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryNotice(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcNoticeField *task_data = (CThostFtdcNoticeField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["Content"] = toUtf(task_data->Content); - data["SequenceLabel"] = toUtf(task_data->SequenceLabel); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryNotice(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQrySettlementInfoConfirm(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcSettlementInfoConfirmField *task_data = (CThostFtdcSettlementInfoConfirmField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["ConfirmDate"] = toUtf(task_data->ConfirmDate); - data["ConfirmTime"] = toUtf(task_data->ConfirmTime); - data["SettlementID"] = task_data->SettlementID; - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQrySettlementInfoConfirm(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInvestorPositionCombineDetail(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInvestorPositionCombineDetailField *task_data = (CThostFtdcInvestorPositionCombineDetailField*)task->task_data; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["OpenDate"] = toUtf(task_data->OpenDate); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["SettlementID"] = task_data->SettlementID; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["ComTradeID"] = toUtf(task_data->ComTradeID); - data["TradeID"] = toUtf(task_data->TradeID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["HedgeFlag"] = task_data->HedgeFlag; - data["Direction"] = task_data->Direction; - data["TotalAmt"] = task_data->TotalAmt; - data["Margin"] = task_data->Margin; - data["ExchMargin"] = task_data->ExchMargin; - data["MarginRateByMoney"] = task_data->MarginRateByMoney; - data["MarginRateByVolume"] = task_data->MarginRateByVolume; - data["LegID"] = task_data->LegID; - data["LegMultiple"] = task_data->LegMultiple; - data["CombInstrumentID"] = toUtf(task_data->CombInstrumentID); - data["TradeGroupID"] = task_data->TradeGroupID; - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryInvestorPositionCombineDetail(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryCFMMCTradingAccountKey(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcCFMMCTradingAccountKeyField *task_data = (CThostFtdcCFMMCTradingAccountKeyField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["AccountID"] = toUtf(task_data->AccountID); - data["KeyID"] = task_data->KeyID; - data["CurrentKey"] = toUtf(task_data->CurrentKey); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryCFMMCTradingAccountKey(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryEWarrantOffset(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcEWarrantOffsetField *task_data = (CThostFtdcEWarrantOffsetField*)task->task_data; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["Direction"] = task_data->Direction; - data["HedgeFlag"] = task_data->HedgeFlag; - data["Volume"] = task_data->Volume; - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryEWarrantOffset(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInvestorProductGroupMargin(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInvestorProductGroupMarginField *task_data = (CThostFtdcInvestorProductGroupMarginField*)task->task_data; - data["ProductGroupID"] = toUtf(task_data->ProductGroupID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["FrozenMargin"] = task_data->FrozenMargin; - data["LongFrozenMargin"] = task_data->LongFrozenMargin; - data["ShortFrozenMargin"] = task_data->ShortFrozenMargin; - data["UseMargin"] = task_data->UseMargin; - data["LongUseMargin"] = task_data->LongUseMargin; - data["ShortUseMargin"] = task_data->ShortUseMargin; - data["ExchMargin"] = task_data->ExchMargin; - data["LongExchMargin"] = task_data->LongExchMargin; - data["ShortExchMargin"] = task_data->ShortExchMargin; - data["CloseProfit"] = task_data->CloseProfit; - data["FrozenCommission"] = task_data->FrozenCommission; - data["Commission"] = task_data->Commission; - data["FrozenCash"] = task_data->FrozenCash; - data["CashIn"] = task_data->CashIn; - data["PositionProfit"] = task_data->PositionProfit; - data["OffsetAmount"] = task_data->OffsetAmount; - data["LongOffsetAmount"] = task_data->LongOffsetAmount; - data["ShortOffsetAmount"] = task_data->ShortOffsetAmount; - data["ExchOffsetAmount"] = task_data->ExchOffsetAmount; - data["LongExchOffsetAmount"] = task_data->LongExchOffsetAmount; - data["ShortExchOffsetAmount"] = task_data->ShortExchOffsetAmount; - data["HedgeFlag"] = task_data->HedgeFlag; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryInvestorProductGroupMargin(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryExchangeMarginRate(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcExchangeMarginRateField *task_data = (CThostFtdcExchangeMarginRateField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["HedgeFlag"] = task_data->HedgeFlag; - data["LongMarginRatioByMoney"] = task_data->LongMarginRatioByMoney; - data["LongMarginRatioByVolume"] = task_data->LongMarginRatioByVolume; - data["ShortMarginRatioByMoney"] = task_data->ShortMarginRatioByMoney; - data["ShortMarginRatioByVolume"] = task_data->ShortMarginRatioByVolume; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryExchangeMarginRate(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryExchangeMarginRateAdjust(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcExchangeMarginRateAdjustField *task_data = (CThostFtdcExchangeMarginRateAdjustField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["HedgeFlag"] = task_data->HedgeFlag; - data["LongMarginRatioByMoney"] = task_data->LongMarginRatioByMoney; - data["LongMarginRatioByVolume"] = task_data->LongMarginRatioByVolume; - data["ShortMarginRatioByMoney"] = task_data->ShortMarginRatioByMoney; - data["ShortMarginRatioByVolume"] = task_data->ShortMarginRatioByVolume; - data["ExchLongMarginRatioByMoney"] = task_data->ExchLongMarginRatioByMoney; - data["ExchLongMarginRatioByVolume"] = task_data->ExchLongMarginRatioByVolume; - data["ExchShortMarginRatioByMoney"] = task_data->ExchShortMarginRatioByMoney; - data["ExchShortMarginRatioByVolume"] = task_data->ExchShortMarginRatioByVolume; - data["NoLongMarginRatioByMoney"] = task_data->NoLongMarginRatioByMoney; - data["NoLongMarginRatioByVolume"] = task_data->NoLongMarginRatioByVolume; - data["NoShortMarginRatioByMoney"] = task_data->NoShortMarginRatioByMoney; - data["NoShortMarginRatioByVolume"] = task_data->NoShortMarginRatioByVolume; - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryExchangeMarginRateAdjust(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryExchangeRate(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcExchangeRateField *task_data = (CThostFtdcExchangeRateField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["FromCurrencyID"] = toUtf(task_data->FromCurrencyID); - data["FromCurrencyUnit"] = task_data->FromCurrencyUnit; - data["ToCurrencyID"] = toUtf(task_data->ToCurrencyID); - data["ExchangeRate"] = task_data->ExchangeRate; - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryExchangeRate(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQrySecAgentACIDMap(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcSecAgentACIDMapField *task_data = (CThostFtdcSecAgentACIDMapField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["UserID"] = toUtf(task_data->UserID); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["BrokerSecAgentID"] = toUtf(task_data->BrokerSecAgentID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQrySecAgentACIDMap(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryProductExchRate(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcProductExchRateField *task_data = (CThostFtdcProductExchRateField*)task->task_data; - data["ProductID"] = toUtf(task_data->ProductID); - data["QuoteCurrencyID"] = toUtf(task_data->QuoteCurrencyID); - data["ExchangeRate"] = task_data->ExchangeRate; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryProductExchRate(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryProductGroup(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcProductGroupField *task_data = (CThostFtdcProductGroupField*)task->task_data; - data["ProductID"] = toUtf(task_data->ProductID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ProductGroupID"] = toUtf(task_data->ProductGroupID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryProductGroup(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryMMInstrumentCommissionRate(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcMMInstrumentCommissionRateField *task_data = (CThostFtdcMMInstrumentCommissionRateField*)task->task_data; - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["InvestorRange"] = task_data->InvestorRange; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["OpenRatioByMoney"] = task_data->OpenRatioByMoney; - data["OpenRatioByVolume"] = task_data->OpenRatioByVolume; - data["CloseRatioByMoney"] = task_data->CloseRatioByMoney; - data["CloseRatioByVolume"] = task_data->CloseRatioByVolume; - data["CloseTodayRatioByMoney"] = task_data->CloseTodayRatioByMoney; - data["CloseTodayRatioByVolume"] = task_data->CloseTodayRatioByVolume; - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryMMInstrumentCommissionRate(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryMMOptionInstrCommRate(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcMMOptionInstrCommRateField *task_data = (CThostFtdcMMOptionInstrCommRateField*)task->task_data; - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["InvestorRange"] = task_data->InvestorRange; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["OpenRatioByMoney"] = task_data->OpenRatioByMoney; - data["OpenRatioByVolume"] = task_data->OpenRatioByVolume; - data["CloseRatioByMoney"] = task_data->CloseRatioByMoney; - data["CloseRatioByVolume"] = task_data->CloseRatioByVolume; - data["CloseTodayRatioByMoney"] = task_data->CloseTodayRatioByMoney; - data["CloseTodayRatioByVolume"] = task_data->CloseTodayRatioByVolume; - data["StrikeRatioByMoney"] = task_data->StrikeRatioByMoney; - data["StrikeRatioByVolume"] = task_data->StrikeRatioByVolume; - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryMMOptionInstrCommRate(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInstrumentOrderCommRate(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInstrumentOrderCommRateField *task_data = (CThostFtdcInstrumentOrderCommRateField*)task->task_data; - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["InvestorRange"] = task_data->InvestorRange; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["HedgeFlag"] = task_data->HedgeFlag; - data["OrderCommByVolume"] = task_data->OrderCommByVolume; - data["OrderActionCommByVolume"] = task_data->OrderActionCommByVolume; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryInstrumentOrderCommRate(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQrySecAgentTradingAccount(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcTradingAccountField *task_data = (CThostFtdcTradingAccountField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["AccountID"] = toUtf(task_data->AccountID); - data["PreMortgage"] = task_data->PreMortgage; - data["PreCredit"] = task_data->PreCredit; - data["PreDeposit"] = task_data->PreDeposit; - data["PreBalance"] = task_data->PreBalance; - data["PreMargin"] = task_data->PreMargin; - data["InterestBase"] = task_data->InterestBase; - data["Interest"] = task_data->Interest; - data["Deposit"] = task_data->Deposit; - data["Withdraw"] = task_data->Withdraw; - data["FrozenMargin"] = task_data->FrozenMargin; - data["FrozenCash"] = task_data->FrozenCash; - data["FrozenCommission"] = task_data->FrozenCommission; - data["CurrMargin"] = task_data->CurrMargin; - data["CashIn"] = task_data->CashIn; - data["Commission"] = task_data->Commission; - data["CloseProfit"] = task_data->CloseProfit; - data["PositionProfit"] = task_data->PositionProfit; - data["Balance"] = task_data->Balance; - data["Available"] = task_data->Available; - data["WithdrawQuota"] = task_data->WithdrawQuota; - data["Reserve"] = task_data->Reserve; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["Credit"] = task_data->Credit; - data["Mortgage"] = task_data->Mortgage; - data["ExchangeMargin"] = task_data->ExchangeMargin; - data["DeliveryMargin"] = task_data->DeliveryMargin; - data["ExchangeDeliveryMargin"] = task_data->ExchangeDeliveryMargin; - data["ReserveBalance"] = task_data->ReserveBalance; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["PreFundMortgageIn"] = task_data->PreFundMortgageIn; - data["PreFundMortgageOut"] = task_data->PreFundMortgageOut; - data["FundMortgageIn"] = task_data->FundMortgageIn; - data["FundMortgageOut"] = task_data->FundMortgageOut; - data["FundMortgageAvailable"] = task_data->FundMortgageAvailable; - data["MortgageableFund"] = task_data->MortgageableFund; - data["SpecProductMargin"] = task_data->SpecProductMargin; - data["SpecProductFrozenMargin"] = task_data->SpecProductFrozenMargin; - data["SpecProductCommission"] = task_data->SpecProductCommission; - data["SpecProductFrozenCommission"] = task_data->SpecProductFrozenCommission; - data["SpecProductPositionProfit"] = task_data->SpecProductPositionProfit; - data["SpecProductCloseProfit"] = task_data->SpecProductCloseProfit; - data["SpecProductPositionProfitByAlg"] = task_data->SpecProductPositionProfitByAlg; - data["SpecProductExchangeMargin"] = task_data->SpecProductExchangeMargin; - data["BizType"] = task_data->BizType; - data["FrozenSwap"] = task_data->FrozenSwap; - data["RemainSwap"] = task_data->RemainSwap; - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQrySecAgentTradingAccount(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQrySecAgentCheckMode(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcSecAgentCheckModeField *task_data = (CThostFtdcSecAgentCheckModeField*)task->task_data; - data["InvestorID"] = toUtf(task_data->InvestorID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["BrokerSecAgentID"] = toUtf(task_data->BrokerSecAgentID); - data["CheckSelfAccount"] = task_data->CheckSelfAccount; - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQrySecAgentCheckMode(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQrySecAgentTradeInfo(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcSecAgentTradeInfoField *task_data = (CThostFtdcSecAgentTradeInfoField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerSecAgentID"] = toUtf(task_data->BrokerSecAgentID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQrySecAgentTradeInfo(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryOptionInstrTradeCost(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcOptionInstrTradeCostField *task_data = (CThostFtdcOptionInstrTradeCostField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["HedgeFlag"] = task_data->HedgeFlag; - data["FixedMargin"] = task_data->FixedMargin; - data["MiniMargin"] = task_data->MiniMargin; - data["Royalty"] = task_data->Royalty; - data["ExchFixedMargin"] = task_data->ExchFixedMargin; - data["ExchMiniMargin"] = task_data->ExchMiniMargin; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryOptionInstrTradeCost(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryOptionInstrCommRate(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcOptionInstrCommRateField *task_data = (CThostFtdcOptionInstrCommRateField*)task->task_data; - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["InvestorRange"] = task_data->InvestorRange; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["OpenRatioByMoney"] = task_data->OpenRatioByMoney; - data["OpenRatioByVolume"] = task_data->OpenRatioByVolume; - data["CloseRatioByMoney"] = task_data->CloseRatioByMoney; - data["CloseRatioByVolume"] = task_data->CloseRatioByVolume; - data["CloseTodayRatioByMoney"] = task_data->CloseTodayRatioByMoney; - data["CloseTodayRatioByVolume"] = task_data->CloseTodayRatioByVolume; - data["StrikeRatioByMoney"] = task_data->StrikeRatioByMoney; - data["StrikeRatioByVolume"] = task_data->StrikeRatioByVolume; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryOptionInstrCommRate(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryExecOrder(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcExecOrderField *task_data = (CThostFtdcExecOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["ExecOrderRef"] = toUtf(task_data->ExecOrderRef); - data["UserID"] = toUtf(task_data->UserID); - data["Volume"] = task_data->Volume; - data["RequestID"] = task_data->RequestID; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["OffsetFlag"] = task_data->OffsetFlag; - data["HedgeFlag"] = task_data->HedgeFlag; - data["ActionType"] = task_data->ActionType; - data["PosiDirection"] = task_data->PosiDirection; - data["ReservePositionFlag"] = task_data->ReservePositionFlag; - data["CloseFlag"] = task_data->CloseFlag; - data["ExecOrderLocalID"] = toUtf(task_data->ExecOrderLocalID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["TraderID"] = toUtf(task_data->TraderID); - data["InstallID"] = task_data->InstallID; - data["OrderSubmitStatus"] = task_data->OrderSubmitStatus; - data["NotifySequence"] = task_data->NotifySequence; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["ExecOrderSysID"] = toUtf(task_data->ExecOrderSysID); - data["InsertDate"] = toUtf(task_data->InsertDate); - data["InsertTime"] = toUtf(task_data->InsertTime); - data["CancelTime"] = toUtf(task_data->CancelTime); - data["ExecResult"] = task_data->ExecResult; - data["ClearingPartID"] = toUtf(task_data->ClearingPartID); - data["SequenceNo"] = task_data->SequenceNo; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["UserProductInfo"] = toUtf(task_data->UserProductInfo); - data["StatusMsg"] = toUtf(task_data->StatusMsg); - data["ActiveUserID"] = toUtf(task_data->ActiveUserID); - data["BrokerExecOrderSeq"] = task_data->BrokerExecOrderSeq; - data["BranchID"] = toUtf(task_data->BranchID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryExecOrder(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryForQuote(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcForQuoteField *task_data = (CThostFtdcForQuoteField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["ForQuoteRef"] = toUtf(task_data->ForQuoteRef); - data["UserID"] = toUtf(task_data->UserID); - data["ForQuoteLocalID"] = toUtf(task_data->ForQuoteLocalID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["TraderID"] = toUtf(task_data->TraderID); - data["InstallID"] = task_data->InstallID; - data["InsertDate"] = toUtf(task_data->InsertDate); - data["InsertTime"] = toUtf(task_data->InsertTime); - data["ForQuoteStatus"] = task_data->ForQuoteStatus; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["StatusMsg"] = toUtf(task_data->StatusMsg); - data["ActiveUserID"] = toUtf(task_data->ActiveUserID); - data["BrokerForQutoSeq"] = task_data->BrokerForQutoSeq; - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryForQuote(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryQuote(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcQuoteField *task_data = (CThostFtdcQuoteField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["QuoteRef"] = toUtf(task_data->QuoteRef); - data["UserID"] = toUtf(task_data->UserID); - data["AskPrice"] = task_data->AskPrice; - data["BidPrice"] = task_data->BidPrice; - data["AskVolume"] = task_data->AskVolume; - data["BidVolume"] = task_data->BidVolume; - data["RequestID"] = task_data->RequestID; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["AskOffsetFlag"] = task_data->AskOffsetFlag; - data["BidOffsetFlag"] = task_data->BidOffsetFlag; - data["AskHedgeFlag"] = task_data->AskHedgeFlag; - data["BidHedgeFlag"] = task_data->BidHedgeFlag; - data["QuoteLocalID"] = toUtf(task_data->QuoteLocalID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["TraderID"] = toUtf(task_data->TraderID); - data["InstallID"] = task_data->InstallID; - data["NotifySequence"] = task_data->NotifySequence; - data["OrderSubmitStatus"] = task_data->OrderSubmitStatus; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["QuoteSysID"] = toUtf(task_data->QuoteSysID); - data["InsertDate"] = toUtf(task_data->InsertDate); - data["InsertTime"] = toUtf(task_data->InsertTime); - data["CancelTime"] = toUtf(task_data->CancelTime); - data["QuoteStatus"] = task_data->QuoteStatus; - data["ClearingPartID"] = toUtf(task_data->ClearingPartID); - data["SequenceNo"] = task_data->SequenceNo; - data["AskOrderSysID"] = toUtf(task_data->AskOrderSysID); - data["BidOrderSysID"] = toUtf(task_data->BidOrderSysID); - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["UserProductInfo"] = toUtf(task_data->UserProductInfo); - data["StatusMsg"] = toUtf(task_data->StatusMsg); - data["ActiveUserID"] = toUtf(task_data->ActiveUserID); - data["BrokerQuoteSeq"] = task_data->BrokerQuoteSeq; - data["AskOrderRef"] = toUtf(task_data->AskOrderRef); - data["BidOrderRef"] = toUtf(task_data->BidOrderRef); - data["ForQuoteSysID"] = toUtf(task_data->ForQuoteSysID); - data["BranchID"] = toUtf(task_data->BranchID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryQuote(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryOptionSelfClose(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcOptionSelfCloseField *task_data = (CThostFtdcOptionSelfCloseField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["OptionSelfCloseRef"] = toUtf(task_data->OptionSelfCloseRef); - data["UserID"] = toUtf(task_data->UserID); - data["Volume"] = task_data->Volume; - data["RequestID"] = task_data->RequestID; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["HedgeFlag"] = task_data->HedgeFlag; - data["OptSelfCloseFlag"] = task_data->OptSelfCloseFlag; - data["OptionSelfCloseLocalID"] = toUtf(task_data->OptionSelfCloseLocalID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["TraderID"] = toUtf(task_data->TraderID); - data["InstallID"] = task_data->InstallID; - data["OrderSubmitStatus"] = task_data->OrderSubmitStatus; - data["NotifySequence"] = task_data->NotifySequence; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["OptionSelfCloseSysID"] = toUtf(task_data->OptionSelfCloseSysID); - data["InsertDate"] = toUtf(task_data->InsertDate); - data["InsertTime"] = toUtf(task_data->InsertTime); - data["CancelTime"] = toUtf(task_data->CancelTime); - data["ExecResult"] = task_data->ExecResult; - data["ClearingPartID"] = toUtf(task_data->ClearingPartID); - data["SequenceNo"] = task_data->SequenceNo; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["UserProductInfo"] = toUtf(task_data->UserProductInfo); - data["StatusMsg"] = toUtf(task_data->StatusMsg); - data["ActiveUserID"] = toUtf(task_data->ActiveUserID); - data["BrokerOptionSelfCloseSeq"] = task_data->BrokerOptionSelfCloseSeq; - data["BranchID"] = toUtf(task_data->BranchID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryOptionSelfClose(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInvestUnit(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInvestUnitField *task_data = (CThostFtdcInvestUnitField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["InvestorUnitName"] = toUtf(task_data->InvestorUnitName); - data["InvestorGroupID"] = toUtf(task_data->InvestorGroupID); - data["CommModelID"] = toUtf(task_data->CommModelID); - data["MarginModelID"] = toUtf(task_data->MarginModelID); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryInvestUnit(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryCombInstrumentGuard(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcCombInstrumentGuardField *task_data = (CThostFtdcCombInstrumentGuardField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["GuarantRatio"] = task_data->GuarantRatio; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryCombInstrumentGuard(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryCombAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcCombActionField *task_data = (CThostFtdcCombActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["CombActionRef"] = toUtf(task_data->CombActionRef); - data["UserID"] = toUtf(task_data->UserID); - data["Direction"] = task_data->Direction; - data["Volume"] = task_data->Volume; - data["CombDirection"] = task_data->CombDirection; - data["HedgeFlag"] = task_data->HedgeFlag; - data["ActionLocalID"] = toUtf(task_data->ActionLocalID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["TraderID"] = toUtf(task_data->TraderID); - data["InstallID"] = task_data->InstallID; - data["ActionStatus"] = task_data->ActionStatus; - data["NotifySequence"] = task_data->NotifySequence; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["SequenceNo"] = task_data->SequenceNo; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["UserProductInfo"] = toUtf(task_data->UserProductInfo); - data["StatusMsg"] = toUtf(task_data->StatusMsg); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - data["ComTradeID"] = toUtf(task_data->ComTradeID); - data["BranchID"] = toUtf(task_data->BranchID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryCombAction(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryTransferSerial(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcTransferSerialField *task_data = (CThostFtdcTransferSerialField*)task->task_data; - data["PlateSerial"] = task_data->PlateSerial; - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["TradeCode"] = toUtf(task_data->TradeCode); - data["SessionID"] = task_data->SessionID; - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BankAccType"] = task_data->BankAccType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["FutureAccType"] = task_data->FutureAccType; - data["AccountID"] = toUtf(task_data->AccountID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["FutureSerial"] = task_data->FutureSerial; - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["TradeAmount"] = task_data->TradeAmount; - data["CustFee"] = task_data->CustFee; - data["BrokerFee"] = task_data->BrokerFee; - data["AvailabilityFlag"] = task_data->AvailabilityFlag; - data["OperatorCode"] = toUtf(task_data->OperatorCode); - data["BankNewAccount"] = toUtf(task_data->BankNewAccount); - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryTransferSerial(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryAccountregister(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcAccountregisterField *task_data = (CThostFtdcAccountregisterField*)task->task_data; - data["TradeDay"] = toUtf(task_data->TradeDay); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["AccountID"] = toUtf(task_data->AccountID); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustomerName"] = toUtf(task_data->CustomerName); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["OpenOrDestroy"] = task_data->OpenOrDestroy; - data["RegDate"] = toUtf(task_data->RegDate); - data["OutDate"] = toUtf(task_data->OutDate); - data["TID"] = task_data->TID; - data["CustType"] = task_data->CustType; - data["BankAccType"] = task_data->BankAccType; - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryAccountregister(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspError(Task *task) -{ - gil_scoped_acquire acquire; - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspError(error, task->task_id, task->task_last); -}; - -void TdApi::processRtnOrder(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcOrderField *task_data = (CThostFtdcOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["OrderRef"] = toUtf(task_data->OrderRef); - data["UserID"] = toUtf(task_data->UserID); - data["OrderPriceType"] = task_data->OrderPriceType; - data["Direction"] = task_data->Direction; - data["CombOffsetFlag"] = toUtf(task_data->CombOffsetFlag); - data["CombHedgeFlag"] = toUtf(task_data->CombHedgeFlag); - data["LimitPrice"] = task_data->LimitPrice; - data["VolumeTotalOriginal"] = task_data->VolumeTotalOriginal; - data["TimeCondition"] = task_data->TimeCondition; - data["GTDDate"] = toUtf(task_data->GTDDate); - data["VolumeCondition"] = task_data->VolumeCondition; - data["MinVolume"] = task_data->MinVolume; - data["ContingentCondition"] = task_data->ContingentCondition; - data["StopPrice"] = task_data->StopPrice; - data["ForceCloseReason"] = task_data->ForceCloseReason; - data["IsAutoSuspend"] = task_data->IsAutoSuspend; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["RequestID"] = task_data->RequestID; - data["OrderLocalID"] = toUtf(task_data->OrderLocalID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["TraderID"] = toUtf(task_data->TraderID); - data["InstallID"] = task_data->InstallID; - data["OrderSubmitStatus"] = task_data->OrderSubmitStatus; - data["NotifySequence"] = task_data->NotifySequence; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["OrderSource"] = task_data->OrderSource; - data["OrderStatus"] = task_data->OrderStatus; - data["OrderType"] = task_data->OrderType; - data["VolumeTraded"] = task_data->VolumeTraded; - data["VolumeTotal"] = task_data->VolumeTotal; - data["InsertDate"] = toUtf(task_data->InsertDate); - data["InsertTime"] = toUtf(task_data->InsertTime); - data["ActiveTime"] = toUtf(task_data->ActiveTime); - data["SuspendTime"] = toUtf(task_data->SuspendTime); - data["UpdateTime"] = toUtf(task_data->UpdateTime); - data["CancelTime"] = toUtf(task_data->CancelTime); - data["ActiveTraderID"] = toUtf(task_data->ActiveTraderID); - data["ClearingPartID"] = toUtf(task_data->ClearingPartID); - data["SequenceNo"] = task_data->SequenceNo; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["UserProductInfo"] = toUtf(task_data->UserProductInfo); - data["StatusMsg"] = toUtf(task_data->StatusMsg); - data["UserForceClose"] = task_data->UserForceClose; - data["ActiveUserID"] = toUtf(task_data->ActiveUserID); - data["BrokerOrderSeq"] = task_data->BrokerOrderSeq; - data["RelativeOrderSysID"] = toUtf(task_data->RelativeOrderSysID); - data["ZCETotalTradedVolume"] = task_data->ZCETotalTradedVolume; - data["IsSwapOrder"] = task_data->IsSwapOrder; - data["BranchID"] = toUtf(task_data->BranchID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - this->onRtnOrder(data); -}; - -void TdApi::processRtnTrade(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcTradeField *task_data = (CThostFtdcTradeField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["OrderRef"] = toUtf(task_data->OrderRef); - data["UserID"] = toUtf(task_data->UserID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["TradeID"] = toUtf(task_data->TradeID); - data["Direction"] = task_data->Direction; - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["TradingRole"] = task_data->TradingRole; - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["OffsetFlag"] = task_data->OffsetFlag; - data["HedgeFlag"] = task_data->HedgeFlag; - data["Price"] = task_data->Price; - data["Volume"] = task_data->Volume; - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["TradeType"] = task_data->TradeType; - data["PriceSource"] = task_data->PriceSource; - data["TraderID"] = toUtf(task_data->TraderID); - data["OrderLocalID"] = toUtf(task_data->OrderLocalID); - data["ClearingPartID"] = toUtf(task_data->ClearingPartID); - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["SequenceNo"] = task_data->SequenceNo; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["BrokerOrderSeq"] = task_data->BrokerOrderSeq; - data["TradeSource"] = task_data->TradeSource; - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - this->onRtnTrade(data); -}; - -void TdApi::processErrRtnOrderInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInputOrderField *task_data = (CThostFtdcInputOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["OrderRef"] = toUtf(task_data->OrderRef); - data["UserID"] = toUtf(task_data->UserID); - data["OrderPriceType"] = task_data->OrderPriceType; - data["Direction"] = task_data->Direction; - data["CombOffsetFlag"] = toUtf(task_data->CombOffsetFlag); - data["CombHedgeFlag"] = toUtf(task_data->CombHedgeFlag); - data["LimitPrice"] = task_data->LimitPrice; - data["VolumeTotalOriginal"] = task_data->VolumeTotalOriginal; - data["TimeCondition"] = task_data->TimeCondition; - data["GTDDate"] = toUtf(task_data->GTDDate); - data["VolumeCondition"] = task_data->VolumeCondition; - data["MinVolume"] = task_data->MinVolume; - data["ContingentCondition"] = task_data->ContingentCondition; - data["StopPrice"] = task_data->StopPrice; - data["ForceCloseReason"] = task_data->ForceCloseReason; - data["IsAutoSuspend"] = task_data->IsAutoSuspend; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["RequestID"] = task_data->RequestID; - data["UserForceClose"] = task_data->UserForceClose; - data["IsSwapOrder"] = task_data->IsSwapOrder; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["ClientID"] = toUtf(task_data->ClientID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onErrRtnOrderInsert(data, error); -}; - -void TdApi::processErrRtnOrderAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcOrderActionField *task_data = (CThostFtdcOrderActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["OrderActionRef"] = task_data->OrderActionRef; - data["OrderRef"] = toUtf(task_data->OrderRef); - data["RequestID"] = task_data->RequestID; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["ActionFlag"] = task_data->ActionFlag; - data["LimitPrice"] = task_data->LimitPrice; - data["VolumeChange"] = task_data->VolumeChange; - data["ActionDate"] = toUtf(task_data->ActionDate); - data["ActionTime"] = toUtf(task_data->ActionTime); - data["TraderID"] = toUtf(task_data->TraderID); - data["InstallID"] = task_data->InstallID; - data["OrderLocalID"] = toUtf(task_data->OrderLocalID); - data["ActionLocalID"] = toUtf(task_data->ActionLocalID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["OrderActionStatus"] = task_data->OrderActionStatus; - data["UserID"] = toUtf(task_data->UserID); - data["StatusMsg"] = toUtf(task_data->StatusMsg); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["BranchID"] = toUtf(task_data->BranchID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onErrRtnOrderAction(data, error); -}; - -void TdApi::processRtnInstrumentStatus(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInstrumentStatusField *task_data = (CThostFtdcInstrumentStatusField*)task->task_data; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["SettlementGroupID"] = toUtf(task_data->SettlementGroupID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["InstrumentStatus"] = task_data->InstrumentStatus; - data["TradingSegmentSN"] = task_data->TradingSegmentSN; - data["EnterTime"] = toUtf(task_data->EnterTime); - data["EnterReason"] = task_data->EnterReason; - delete task_data; - } - this->onRtnInstrumentStatus(data); -}; - -void TdApi::processRtnBulletin(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcBulletinField *task_data = (CThostFtdcBulletinField*)task->task_data; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["BulletinID"] = task_data->BulletinID; - data["SequenceNo"] = task_data->SequenceNo; - data["NewsType"] = toUtf(task_data->NewsType); - data["NewsUrgency"] = task_data->NewsUrgency; - data["SendTime"] = toUtf(task_data->SendTime); - data["Abstract"] = toUtf(task_data->Abstract); - data["ComeFrom"] = toUtf(task_data->ComeFrom); - data["Content"] = toUtf(task_data->Content); - data["URLLink"] = toUtf(task_data->URLLink); - data["MarketID"] = toUtf(task_data->MarketID); - delete task_data; - } - this->onRtnBulletin(data); -}; - -void TdApi::processRtnTradingNotice(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcTradingNoticeInfoField *task_data = (CThostFtdcTradingNoticeInfoField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["SendTime"] = toUtf(task_data->SendTime); - data["FieldContent"] = toUtf(task_data->FieldContent); - data["SequenceSeries"] = task_data->SequenceSeries; - data["SequenceNo"] = task_data->SequenceNo; - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - this->onRtnTradingNotice(data); -}; - -void TdApi::processRtnErrorConditionalOrder(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcErrorConditionalOrderField *task_data = (CThostFtdcErrorConditionalOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["OrderRef"] = toUtf(task_data->OrderRef); - data["UserID"] = toUtf(task_data->UserID); - data["OrderPriceType"] = task_data->OrderPriceType; - data["Direction"] = task_data->Direction; - data["CombOffsetFlag"] = toUtf(task_data->CombOffsetFlag); - data["CombHedgeFlag"] = toUtf(task_data->CombHedgeFlag); - data["LimitPrice"] = task_data->LimitPrice; - data["VolumeTotalOriginal"] = task_data->VolumeTotalOriginal; - data["TimeCondition"] = task_data->TimeCondition; - data["GTDDate"] = toUtf(task_data->GTDDate); - data["VolumeCondition"] = task_data->VolumeCondition; - data["MinVolume"] = task_data->MinVolume; - data["ContingentCondition"] = task_data->ContingentCondition; - data["StopPrice"] = task_data->StopPrice; - data["ForceCloseReason"] = task_data->ForceCloseReason; - data["IsAutoSuspend"] = task_data->IsAutoSuspend; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["RequestID"] = task_data->RequestID; - data["OrderLocalID"] = toUtf(task_data->OrderLocalID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["TraderID"] = toUtf(task_data->TraderID); - data["InstallID"] = task_data->InstallID; - data["OrderSubmitStatus"] = task_data->OrderSubmitStatus; - data["NotifySequence"] = task_data->NotifySequence; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["OrderSource"] = task_data->OrderSource; - data["OrderStatus"] = task_data->OrderStatus; - data["OrderType"] = task_data->OrderType; - data["VolumeTraded"] = task_data->VolumeTraded; - data["VolumeTotal"] = task_data->VolumeTotal; - data["InsertDate"] = toUtf(task_data->InsertDate); - data["InsertTime"] = toUtf(task_data->InsertTime); - data["ActiveTime"] = toUtf(task_data->ActiveTime); - data["SuspendTime"] = toUtf(task_data->SuspendTime); - data["UpdateTime"] = toUtf(task_data->UpdateTime); - data["CancelTime"] = toUtf(task_data->CancelTime); - data["ActiveTraderID"] = toUtf(task_data->ActiveTraderID); - data["ClearingPartID"] = toUtf(task_data->ClearingPartID); - data["SequenceNo"] = task_data->SequenceNo; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["UserProductInfo"] = toUtf(task_data->UserProductInfo); - data["StatusMsg"] = toUtf(task_data->StatusMsg); - data["UserForceClose"] = task_data->UserForceClose; - data["ActiveUserID"] = toUtf(task_data->ActiveUserID); - data["BrokerOrderSeq"] = task_data->BrokerOrderSeq; - data["RelativeOrderSysID"] = toUtf(task_data->RelativeOrderSysID); - data["ZCETotalTradedVolume"] = task_data->ZCETotalTradedVolume; - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["IsSwapOrder"] = task_data->IsSwapOrder; - data["BranchID"] = toUtf(task_data->BranchID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - this->onRtnErrorConditionalOrder(data); -}; - -void TdApi::processRtnExecOrder(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcExecOrderField *task_data = (CThostFtdcExecOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["ExecOrderRef"] = toUtf(task_data->ExecOrderRef); - data["UserID"] = toUtf(task_data->UserID); - data["Volume"] = task_data->Volume; - data["RequestID"] = task_data->RequestID; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["OffsetFlag"] = task_data->OffsetFlag; - data["HedgeFlag"] = task_data->HedgeFlag; - data["ActionType"] = task_data->ActionType; - data["PosiDirection"] = task_data->PosiDirection; - data["ReservePositionFlag"] = task_data->ReservePositionFlag; - data["CloseFlag"] = task_data->CloseFlag; - data["ExecOrderLocalID"] = toUtf(task_data->ExecOrderLocalID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["TraderID"] = toUtf(task_data->TraderID); - data["InstallID"] = task_data->InstallID; - data["OrderSubmitStatus"] = task_data->OrderSubmitStatus; - data["NotifySequence"] = task_data->NotifySequence; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["ExecOrderSysID"] = toUtf(task_data->ExecOrderSysID); - data["InsertDate"] = toUtf(task_data->InsertDate); - data["InsertTime"] = toUtf(task_data->InsertTime); - data["CancelTime"] = toUtf(task_data->CancelTime); - data["ExecResult"] = task_data->ExecResult; - data["ClearingPartID"] = toUtf(task_data->ClearingPartID); - data["SequenceNo"] = task_data->SequenceNo; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["UserProductInfo"] = toUtf(task_data->UserProductInfo); - data["StatusMsg"] = toUtf(task_data->StatusMsg); - data["ActiveUserID"] = toUtf(task_data->ActiveUserID); - data["BrokerExecOrderSeq"] = task_data->BrokerExecOrderSeq; - data["BranchID"] = toUtf(task_data->BranchID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - this->onRtnExecOrder(data); -}; - -void TdApi::processErrRtnExecOrderInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInputExecOrderField *task_data = (CThostFtdcInputExecOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["ExecOrderRef"] = toUtf(task_data->ExecOrderRef); - data["UserID"] = toUtf(task_data->UserID); - data["Volume"] = task_data->Volume; - data["RequestID"] = task_data->RequestID; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["OffsetFlag"] = task_data->OffsetFlag; - data["HedgeFlag"] = task_data->HedgeFlag; - data["ActionType"] = task_data->ActionType; - data["PosiDirection"] = task_data->PosiDirection; - data["ReservePositionFlag"] = task_data->ReservePositionFlag; - data["CloseFlag"] = task_data->CloseFlag; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["ClientID"] = toUtf(task_data->ClientID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onErrRtnExecOrderInsert(data, error); -}; - -void TdApi::processErrRtnExecOrderAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcExecOrderActionField *task_data = (CThostFtdcExecOrderActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["ExecOrderActionRef"] = task_data->ExecOrderActionRef; - data["ExecOrderRef"] = toUtf(task_data->ExecOrderRef); - data["RequestID"] = task_data->RequestID; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ExecOrderSysID"] = toUtf(task_data->ExecOrderSysID); - data["ActionFlag"] = task_data->ActionFlag; - data["ActionDate"] = toUtf(task_data->ActionDate); - data["ActionTime"] = toUtf(task_data->ActionTime); - data["TraderID"] = toUtf(task_data->TraderID); - data["InstallID"] = task_data->InstallID; - data["ExecOrderLocalID"] = toUtf(task_data->ExecOrderLocalID); - data["ActionLocalID"] = toUtf(task_data->ActionLocalID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["OrderActionStatus"] = task_data->OrderActionStatus; - data["UserID"] = toUtf(task_data->UserID); - data["ActionType"] = task_data->ActionType; - data["StatusMsg"] = toUtf(task_data->StatusMsg); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["BranchID"] = toUtf(task_data->BranchID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onErrRtnExecOrderAction(data, error); -}; - -void TdApi::processErrRtnForQuoteInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInputForQuoteField *task_data = (CThostFtdcInputForQuoteField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["ForQuoteRef"] = toUtf(task_data->ForQuoteRef); - data["UserID"] = toUtf(task_data->UserID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onErrRtnForQuoteInsert(data, error); -}; - -void TdApi::processRtnQuote(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcQuoteField *task_data = (CThostFtdcQuoteField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["QuoteRef"] = toUtf(task_data->QuoteRef); - data["UserID"] = toUtf(task_data->UserID); - data["AskPrice"] = task_data->AskPrice; - data["BidPrice"] = task_data->BidPrice; - data["AskVolume"] = task_data->AskVolume; - data["BidVolume"] = task_data->BidVolume; - data["RequestID"] = task_data->RequestID; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["AskOffsetFlag"] = task_data->AskOffsetFlag; - data["BidOffsetFlag"] = task_data->BidOffsetFlag; - data["AskHedgeFlag"] = task_data->AskHedgeFlag; - data["BidHedgeFlag"] = task_data->BidHedgeFlag; - data["QuoteLocalID"] = toUtf(task_data->QuoteLocalID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["TraderID"] = toUtf(task_data->TraderID); - data["InstallID"] = task_data->InstallID; - data["NotifySequence"] = task_data->NotifySequence; - data["OrderSubmitStatus"] = task_data->OrderSubmitStatus; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["QuoteSysID"] = toUtf(task_data->QuoteSysID); - data["InsertDate"] = toUtf(task_data->InsertDate); - data["InsertTime"] = toUtf(task_data->InsertTime); - data["CancelTime"] = toUtf(task_data->CancelTime); - data["QuoteStatus"] = task_data->QuoteStatus; - data["ClearingPartID"] = toUtf(task_data->ClearingPartID); - data["SequenceNo"] = task_data->SequenceNo; - data["AskOrderSysID"] = toUtf(task_data->AskOrderSysID); - data["BidOrderSysID"] = toUtf(task_data->BidOrderSysID); - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["UserProductInfo"] = toUtf(task_data->UserProductInfo); - data["StatusMsg"] = toUtf(task_data->StatusMsg); - data["ActiveUserID"] = toUtf(task_data->ActiveUserID); - data["BrokerQuoteSeq"] = task_data->BrokerQuoteSeq; - data["AskOrderRef"] = toUtf(task_data->AskOrderRef); - data["BidOrderRef"] = toUtf(task_data->BidOrderRef); - data["ForQuoteSysID"] = toUtf(task_data->ForQuoteSysID); - data["BranchID"] = toUtf(task_data->BranchID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - this->onRtnQuote(data); -}; - -void TdApi::processErrRtnQuoteInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInputQuoteField *task_data = (CThostFtdcInputQuoteField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["QuoteRef"] = toUtf(task_data->QuoteRef); - data["UserID"] = toUtf(task_data->UserID); - data["AskPrice"] = task_data->AskPrice; - data["BidPrice"] = task_data->BidPrice; - data["AskVolume"] = task_data->AskVolume; - data["BidVolume"] = task_data->BidVolume; - data["RequestID"] = task_data->RequestID; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["AskOffsetFlag"] = task_data->AskOffsetFlag; - data["BidOffsetFlag"] = task_data->BidOffsetFlag; - data["AskHedgeFlag"] = task_data->AskHedgeFlag; - data["BidHedgeFlag"] = task_data->BidHedgeFlag; - data["AskOrderRef"] = toUtf(task_data->AskOrderRef); - data["BidOrderRef"] = toUtf(task_data->BidOrderRef); - data["ForQuoteSysID"] = toUtf(task_data->ForQuoteSysID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["ClientID"] = toUtf(task_data->ClientID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onErrRtnQuoteInsert(data, error); -}; - -void TdApi::processErrRtnQuoteAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcQuoteActionField *task_data = (CThostFtdcQuoteActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["QuoteActionRef"] = task_data->QuoteActionRef; - data["QuoteRef"] = toUtf(task_data->QuoteRef); - data["RequestID"] = task_data->RequestID; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["QuoteSysID"] = toUtf(task_data->QuoteSysID); - data["ActionFlag"] = task_data->ActionFlag; - data["ActionDate"] = toUtf(task_data->ActionDate); - data["ActionTime"] = toUtf(task_data->ActionTime); - data["TraderID"] = toUtf(task_data->TraderID); - data["InstallID"] = task_data->InstallID; - data["QuoteLocalID"] = toUtf(task_data->QuoteLocalID); - data["ActionLocalID"] = toUtf(task_data->ActionLocalID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["OrderActionStatus"] = task_data->OrderActionStatus; - data["UserID"] = toUtf(task_data->UserID); - data["StatusMsg"] = toUtf(task_data->StatusMsg); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["BranchID"] = toUtf(task_data->BranchID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onErrRtnQuoteAction(data, error); -}; - -void TdApi::processRtnForQuoteRsp(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcForQuoteRspField *task_data = (CThostFtdcForQuoteRspField*)task->task_data; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["ForQuoteSysID"] = toUtf(task_data->ForQuoteSysID); - data["ForQuoteTime"] = toUtf(task_data->ForQuoteTime); - data["ActionDay"] = toUtf(task_data->ActionDay); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - delete task_data; - } - this->onRtnForQuoteRsp(data); -}; - -void TdApi::processRtnCFMMCTradingAccountToken(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcCFMMCTradingAccountTokenField *task_data = (CThostFtdcCFMMCTradingAccountTokenField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["AccountID"] = toUtf(task_data->AccountID); - data["KeyID"] = task_data->KeyID; - data["Token"] = toUtf(task_data->Token); - delete task_data; - } - this->onRtnCFMMCTradingAccountToken(data); -}; - -void TdApi::processErrRtnBatchOrderAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcBatchOrderActionField *task_data = (CThostFtdcBatchOrderActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["OrderActionRef"] = task_data->OrderActionRef; - data["RequestID"] = task_data->RequestID; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ActionDate"] = toUtf(task_data->ActionDate); - data["ActionTime"] = toUtf(task_data->ActionTime); - data["TraderID"] = toUtf(task_data->TraderID); - data["InstallID"] = task_data->InstallID; - data["ActionLocalID"] = toUtf(task_data->ActionLocalID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["OrderActionStatus"] = task_data->OrderActionStatus; - data["UserID"] = toUtf(task_data->UserID); - data["StatusMsg"] = toUtf(task_data->StatusMsg); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onErrRtnBatchOrderAction(data, error); -}; - -void TdApi::processRtnOptionSelfClose(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcOptionSelfCloseField *task_data = (CThostFtdcOptionSelfCloseField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["OptionSelfCloseRef"] = toUtf(task_data->OptionSelfCloseRef); - data["UserID"] = toUtf(task_data->UserID); - data["Volume"] = task_data->Volume; - data["RequestID"] = task_data->RequestID; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["HedgeFlag"] = task_data->HedgeFlag; - data["OptSelfCloseFlag"] = task_data->OptSelfCloseFlag; - data["OptionSelfCloseLocalID"] = toUtf(task_data->OptionSelfCloseLocalID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["TraderID"] = toUtf(task_data->TraderID); - data["InstallID"] = task_data->InstallID; - data["OrderSubmitStatus"] = task_data->OrderSubmitStatus; - data["NotifySequence"] = task_data->NotifySequence; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["OptionSelfCloseSysID"] = toUtf(task_data->OptionSelfCloseSysID); - data["InsertDate"] = toUtf(task_data->InsertDate); - data["InsertTime"] = toUtf(task_data->InsertTime); - data["CancelTime"] = toUtf(task_data->CancelTime); - data["ExecResult"] = task_data->ExecResult; - data["ClearingPartID"] = toUtf(task_data->ClearingPartID); - data["SequenceNo"] = task_data->SequenceNo; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["UserProductInfo"] = toUtf(task_data->UserProductInfo); - data["StatusMsg"] = toUtf(task_data->StatusMsg); - data["ActiveUserID"] = toUtf(task_data->ActiveUserID); - data["BrokerOptionSelfCloseSeq"] = task_data->BrokerOptionSelfCloseSeq; - data["BranchID"] = toUtf(task_data->BranchID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - this->onRtnOptionSelfClose(data); -}; - -void TdApi::processErrRtnOptionSelfCloseInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInputOptionSelfCloseField *task_data = (CThostFtdcInputOptionSelfCloseField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["OptionSelfCloseRef"] = toUtf(task_data->OptionSelfCloseRef); - data["UserID"] = toUtf(task_data->UserID); - data["Volume"] = task_data->Volume; - data["RequestID"] = task_data->RequestID; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["HedgeFlag"] = task_data->HedgeFlag; - data["OptSelfCloseFlag"] = task_data->OptSelfCloseFlag; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["ClientID"] = toUtf(task_data->ClientID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onErrRtnOptionSelfCloseInsert(data, error); -}; - -void TdApi::processErrRtnOptionSelfCloseAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcOptionSelfCloseActionField *task_data = (CThostFtdcOptionSelfCloseActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["OptionSelfCloseActionRef"] = task_data->OptionSelfCloseActionRef; - data["OptionSelfCloseRef"] = toUtf(task_data->OptionSelfCloseRef); - data["RequestID"] = task_data->RequestID; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["OptionSelfCloseSysID"] = toUtf(task_data->OptionSelfCloseSysID); - data["ActionFlag"] = task_data->ActionFlag; - data["ActionDate"] = toUtf(task_data->ActionDate); - data["ActionTime"] = toUtf(task_data->ActionTime); - data["TraderID"] = toUtf(task_data->TraderID); - data["InstallID"] = task_data->InstallID; - data["OptionSelfCloseLocalID"] = toUtf(task_data->OptionSelfCloseLocalID); - data["ActionLocalID"] = toUtf(task_data->ActionLocalID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["OrderActionStatus"] = task_data->OrderActionStatus; - data["UserID"] = toUtf(task_data->UserID); - data["StatusMsg"] = toUtf(task_data->StatusMsg); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["BranchID"] = toUtf(task_data->BranchID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onErrRtnOptionSelfCloseAction(data, error); -}; - -void TdApi::processRtnCombAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcCombActionField *task_data = (CThostFtdcCombActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["CombActionRef"] = toUtf(task_data->CombActionRef); - data["UserID"] = toUtf(task_data->UserID); - data["Direction"] = task_data->Direction; - data["Volume"] = task_data->Volume; - data["CombDirection"] = task_data->CombDirection; - data["HedgeFlag"] = task_data->HedgeFlag; - data["ActionLocalID"] = toUtf(task_data->ActionLocalID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["ExchangeInstID"] = toUtf(task_data->ExchangeInstID); - data["TraderID"] = toUtf(task_data->TraderID); - data["InstallID"] = task_data->InstallID; - data["ActionStatus"] = task_data->ActionStatus; - data["NotifySequence"] = task_data->NotifySequence; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["SettlementID"] = task_data->SettlementID; - data["SequenceNo"] = task_data->SequenceNo; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["UserProductInfo"] = toUtf(task_data->UserProductInfo); - data["StatusMsg"] = toUtf(task_data->StatusMsg); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - data["ComTradeID"] = toUtf(task_data->ComTradeID); - data["BranchID"] = toUtf(task_data->BranchID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - this->onRtnCombAction(data); -}; - -void TdApi::processErrRtnCombActionInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcInputCombActionField *task_data = (CThostFtdcInputCombActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["CombActionRef"] = toUtf(task_data->CombActionRef); - data["UserID"] = toUtf(task_data->UserID); - data["Direction"] = task_data->Direction; - data["Volume"] = task_data->Volume; - data["CombDirection"] = task_data->CombDirection; - data["HedgeFlag"] = task_data->HedgeFlag; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onErrRtnCombActionInsert(data, error); -}; - -void TdApi::processRspQryContractBank(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcContractBankField *task_data = (CThostFtdcContractBankField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BankID"] = toUtf(task_data->BankID); - data["BankBrchID"] = toUtf(task_data->BankBrchID); - data["BankName"] = toUtf(task_data->BankName); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryContractBank(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryParkedOrder(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcParkedOrderField *task_data = (CThostFtdcParkedOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["OrderRef"] = toUtf(task_data->OrderRef); - data["UserID"] = toUtf(task_data->UserID); - data["OrderPriceType"] = task_data->OrderPriceType; - data["Direction"] = task_data->Direction; - data["CombOffsetFlag"] = toUtf(task_data->CombOffsetFlag); - data["CombHedgeFlag"] = toUtf(task_data->CombHedgeFlag); - data["LimitPrice"] = task_data->LimitPrice; - data["VolumeTotalOriginal"] = task_data->VolumeTotalOriginal; - data["TimeCondition"] = task_data->TimeCondition; - data["GTDDate"] = toUtf(task_data->GTDDate); - data["VolumeCondition"] = task_data->VolumeCondition; - data["MinVolume"] = task_data->MinVolume; - data["ContingentCondition"] = task_data->ContingentCondition; - data["StopPrice"] = task_data->StopPrice; - data["ForceCloseReason"] = task_data->ForceCloseReason; - data["IsAutoSuspend"] = task_data->IsAutoSuspend; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["RequestID"] = task_data->RequestID; - data["UserForceClose"] = task_data->UserForceClose; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ParkedOrderID"] = toUtf(task_data->ParkedOrderID); - data["UserType"] = task_data->UserType; - data["Status"] = task_data->Status; - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["IsSwapOrder"] = task_data->IsSwapOrder; - data["AccountID"] = toUtf(task_data->AccountID); - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["ClientID"] = toUtf(task_data->ClientID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryParkedOrder(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryParkedOrderAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcParkedOrderActionField *task_data = (CThostFtdcParkedOrderActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["OrderActionRef"] = task_data->OrderActionRef; - data["OrderRef"] = toUtf(task_data->OrderRef); - data["RequestID"] = task_data->RequestID; - data["FrontID"] = task_data->FrontID; - data["SessionID"] = task_data->SessionID; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["ActionFlag"] = task_data->ActionFlag; - data["LimitPrice"] = task_data->LimitPrice; - data["VolumeChange"] = task_data->VolumeChange; - data["UserID"] = toUtf(task_data->UserID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["ParkedOrderActionID"] = toUtf(task_data->ParkedOrderActionID); - data["UserType"] = task_data->UserType; - data["Status"] = task_data->Status; - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - data["IPAddress"] = toUtf(task_data->IPAddress); - data["MacAddress"] = toUtf(task_data->MacAddress); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryParkedOrderAction(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryTradingNotice(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcTradingNoticeField *task_data = (CThostFtdcTradingNoticeField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorRange"] = task_data->InvestorRange; - data["InvestorID"] = toUtf(task_data->InvestorID); - data["SequenceSeries"] = task_data->SequenceSeries; - data["UserID"] = toUtf(task_data->UserID); - data["SendTime"] = toUtf(task_data->SendTime); - data["SequenceNo"] = task_data->SequenceNo; - data["FieldContent"] = toUtf(task_data->FieldContent); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryTradingNotice(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryBrokerTradingParams(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcBrokerTradingParamsField *task_data = (CThostFtdcBrokerTradingParamsField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["MarginPriceType"] = task_data->MarginPriceType; - data["Algorithm"] = task_data->Algorithm; - data["AvailIncludeCloseProfit"] = task_data->AvailIncludeCloseProfit; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["OptionRoyaltyPriceType"] = task_data->OptionRoyaltyPriceType; - data["AccountID"] = toUtf(task_data->AccountID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryBrokerTradingParams(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQryBrokerTradingAlgos(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcBrokerTradingAlgosField *task_data = (CThostFtdcBrokerTradingAlgosField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["HandlePositionAlgoID"] = task_data->HandlePositionAlgoID; - data["FindMarginRateAlgoID"] = task_data->FindMarginRateAlgoID; - data["HandleTradingAccountAlgoID"] = task_data->HandleTradingAccountAlgoID; - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQryBrokerTradingAlgos(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQueryCFMMCTradingAccountToken(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcQueryCFMMCTradingAccountTokenField *task_data = (CThostFtdcQueryCFMMCTradingAccountTokenField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["InvestUnitID"] = toUtf(task_data->InvestUnitID); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQueryCFMMCTradingAccountToken(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRtnFromBankToFutureByBank(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRspTransferField *task_data = (CThostFtdcRspTransferField*)task->task_data; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["FutureSerial"] = task_data->FutureSerial; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["TradeAmount"] = task_data->TradeAmount; - data["FutureFetchAmount"] = task_data->FutureFetchAmount; - data["FeePayFlag"] = task_data->FeePayFlag; - data["CustFee"] = task_data->CustFee; - data["BrokerFee"] = task_data->BrokerFee; - data["Message"] = toUtf(task_data->Message); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["TransferStatus"] = task_data->TransferStatus; - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - this->onRtnFromBankToFutureByBank(data); -}; - -void TdApi::processRtnFromFutureToBankByBank(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRspTransferField *task_data = (CThostFtdcRspTransferField*)task->task_data; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["FutureSerial"] = task_data->FutureSerial; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["TradeAmount"] = task_data->TradeAmount; - data["FutureFetchAmount"] = task_data->FutureFetchAmount; - data["FeePayFlag"] = task_data->FeePayFlag; - data["CustFee"] = task_data->CustFee; - data["BrokerFee"] = task_data->BrokerFee; - data["Message"] = toUtf(task_data->Message); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["TransferStatus"] = task_data->TransferStatus; - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - this->onRtnFromFutureToBankByBank(data); -}; - -void TdApi::processRtnRepealFromBankToFutureByBank(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRspRepealField *task_data = (CThostFtdcRspRepealField*)task->task_data; - data["RepealTimeInterval"] = task_data->RepealTimeInterval; - data["RepealedTimes"] = task_data->RepealedTimes; - data["BankRepealFlag"] = task_data->BankRepealFlag; - data["BrokerRepealFlag"] = task_data->BrokerRepealFlag; - data["PlateRepealSerial"] = task_data->PlateRepealSerial; - data["BankRepealSerial"] = toUtf(task_data->BankRepealSerial); - data["FutureRepealSerial"] = task_data->FutureRepealSerial; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["FutureSerial"] = task_data->FutureSerial; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["TradeAmount"] = task_data->TradeAmount; - data["FutureFetchAmount"] = task_data->FutureFetchAmount; - data["FeePayFlag"] = task_data->FeePayFlag; - data["CustFee"] = task_data->CustFee; - data["BrokerFee"] = task_data->BrokerFee; - data["Message"] = toUtf(task_data->Message); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["TransferStatus"] = task_data->TransferStatus; - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - this->onRtnRepealFromBankToFutureByBank(data); -}; - -void TdApi::processRtnRepealFromFutureToBankByBank(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRspRepealField *task_data = (CThostFtdcRspRepealField*)task->task_data; - data["RepealTimeInterval"] = task_data->RepealTimeInterval; - data["RepealedTimes"] = task_data->RepealedTimes; - data["BankRepealFlag"] = task_data->BankRepealFlag; - data["BrokerRepealFlag"] = task_data->BrokerRepealFlag; - data["PlateRepealSerial"] = task_data->PlateRepealSerial; - data["BankRepealSerial"] = toUtf(task_data->BankRepealSerial); - data["FutureRepealSerial"] = task_data->FutureRepealSerial; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["FutureSerial"] = task_data->FutureSerial; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["TradeAmount"] = task_data->TradeAmount; - data["FutureFetchAmount"] = task_data->FutureFetchAmount; - data["FeePayFlag"] = task_data->FeePayFlag; - data["CustFee"] = task_data->CustFee; - data["BrokerFee"] = task_data->BrokerFee; - data["Message"] = toUtf(task_data->Message); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["TransferStatus"] = task_data->TransferStatus; - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - this->onRtnRepealFromFutureToBankByBank(data); -}; - -void TdApi::processRtnFromBankToFutureByFuture(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRspTransferField *task_data = (CThostFtdcRspTransferField*)task->task_data; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["FutureSerial"] = task_data->FutureSerial; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["TradeAmount"] = task_data->TradeAmount; - data["FutureFetchAmount"] = task_data->FutureFetchAmount; - data["FeePayFlag"] = task_data->FeePayFlag; - data["CustFee"] = task_data->CustFee; - data["BrokerFee"] = task_data->BrokerFee; - data["Message"] = toUtf(task_data->Message); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["TransferStatus"] = task_data->TransferStatus; - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - this->onRtnFromBankToFutureByFuture(data); -}; - -void TdApi::processRtnFromFutureToBankByFuture(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRspTransferField *task_data = (CThostFtdcRspTransferField*)task->task_data; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["FutureSerial"] = task_data->FutureSerial; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["TradeAmount"] = task_data->TradeAmount; - data["FutureFetchAmount"] = task_data->FutureFetchAmount; - data["FeePayFlag"] = task_data->FeePayFlag; - data["CustFee"] = task_data->CustFee; - data["BrokerFee"] = task_data->BrokerFee; - data["Message"] = toUtf(task_data->Message); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["TransferStatus"] = task_data->TransferStatus; - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - this->onRtnFromFutureToBankByFuture(data); -}; - -void TdApi::processRtnRepealFromBankToFutureByFutureManual(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRspRepealField *task_data = (CThostFtdcRspRepealField*)task->task_data; - data["RepealTimeInterval"] = task_data->RepealTimeInterval; - data["RepealedTimes"] = task_data->RepealedTimes; - data["BankRepealFlag"] = task_data->BankRepealFlag; - data["BrokerRepealFlag"] = task_data->BrokerRepealFlag; - data["PlateRepealSerial"] = task_data->PlateRepealSerial; - data["BankRepealSerial"] = toUtf(task_data->BankRepealSerial); - data["FutureRepealSerial"] = task_data->FutureRepealSerial; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["FutureSerial"] = task_data->FutureSerial; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["TradeAmount"] = task_data->TradeAmount; - data["FutureFetchAmount"] = task_data->FutureFetchAmount; - data["FeePayFlag"] = task_data->FeePayFlag; - data["CustFee"] = task_data->CustFee; - data["BrokerFee"] = task_data->BrokerFee; - data["Message"] = toUtf(task_data->Message); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["TransferStatus"] = task_data->TransferStatus; - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - this->onRtnRepealFromBankToFutureByFutureManual(data); -}; - -void TdApi::processRtnRepealFromFutureToBankByFutureManual(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRspRepealField *task_data = (CThostFtdcRspRepealField*)task->task_data; - data["RepealTimeInterval"] = task_data->RepealTimeInterval; - data["RepealedTimes"] = task_data->RepealedTimes; - data["BankRepealFlag"] = task_data->BankRepealFlag; - data["BrokerRepealFlag"] = task_data->BrokerRepealFlag; - data["PlateRepealSerial"] = task_data->PlateRepealSerial; - data["BankRepealSerial"] = toUtf(task_data->BankRepealSerial); - data["FutureRepealSerial"] = task_data->FutureRepealSerial; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["FutureSerial"] = task_data->FutureSerial; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["TradeAmount"] = task_data->TradeAmount; - data["FutureFetchAmount"] = task_data->FutureFetchAmount; - data["FeePayFlag"] = task_data->FeePayFlag; - data["CustFee"] = task_data->CustFee; - data["BrokerFee"] = task_data->BrokerFee; - data["Message"] = toUtf(task_data->Message); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["TransferStatus"] = task_data->TransferStatus; - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - this->onRtnRepealFromFutureToBankByFutureManual(data); -}; - -void TdApi::processRtnQueryBankBalanceByFuture(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcNotifyQueryAccountField *task_data = (CThostFtdcNotifyQueryAccountField*)task->task_data; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["FutureSerial"] = task_data->FutureSerial; - data["InstallID"] = task_data->InstallID; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["BankUseAmount"] = task_data->BankUseAmount; - data["BankFetchAmount"] = task_data->BankFetchAmount; - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - this->onRtnQueryBankBalanceByFuture(data); -}; - -void TdApi::processErrRtnBankToFutureByFuture(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcReqTransferField *task_data = (CThostFtdcReqTransferField*)task->task_data; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["FutureSerial"] = task_data->FutureSerial; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["TradeAmount"] = task_data->TradeAmount; - data["FutureFetchAmount"] = task_data->FutureFetchAmount; - data["FeePayFlag"] = task_data->FeePayFlag; - data["CustFee"] = task_data->CustFee; - data["BrokerFee"] = task_data->BrokerFee; - data["Message"] = toUtf(task_data->Message); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["TransferStatus"] = task_data->TransferStatus; - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onErrRtnBankToFutureByFuture(data, error); -}; - -void TdApi::processErrRtnFutureToBankByFuture(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcReqTransferField *task_data = (CThostFtdcReqTransferField*)task->task_data; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["FutureSerial"] = task_data->FutureSerial; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["TradeAmount"] = task_data->TradeAmount; - data["FutureFetchAmount"] = task_data->FutureFetchAmount; - data["FeePayFlag"] = task_data->FeePayFlag; - data["CustFee"] = task_data->CustFee; - data["BrokerFee"] = task_data->BrokerFee; - data["Message"] = toUtf(task_data->Message); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["TransferStatus"] = task_data->TransferStatus; - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onErrRtnFutureToBankByFuture(data, error); -}; - -void TdApi::processErrRtnRepealBankToFutureByFutureManual(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcReqRepealField *task_data = (CThostFtdcReqRepealField*)task->task_data; - data["RepealTimeInterval"] = task_data->RepealTimeInterval; - data["RepealedTimes"] = task_data->RepealedTimes; - data["BankRepealFlag"] = task_data->BankRepealFlag; - data["BrokerRepealFlag"] = task_data->BrokerRepealFlag; - data["PlateRepealSerial"] = task_data->PlateRepealSerial; - data["BankRepealSerial"] = toUtf(task_data->BankRepealSerial); - data["FutureRepealSerial"] = task_data->FutureRepealSerial; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["FutureSerial"] = task_data->FutureSerial; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["TradeAmount"] = task_data->TradeAmount; - data["FutureFetchAmount"] = task_data->FutureFetchAmount; - data["FeePayFlag"] = task_data->FeePayFlag; - data["CustFee"] = task_data->CustFee; - data["BrokerFee"] = task_data->BrokerFee; - data["Message"] = toUtf(task_data->Message); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["TransferStatus"] = task_data->TransferStatus; - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onErrRtnRepealBankToFutureByFutureManual(data, error); -}; - -void TdApi::processErrRtnRepealFutureToBankByFutureManual(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcReqRepealField *task_data = (CThostFtdcReqRepealField*)task->task_data; - data["RepealTimeInterval"] = task_data->RepealTimeInterval; - data["RepealedTimes"] = task_data->RepealedTimes; - data["BankRepealFlag"] = task_data->BankRepealFlag; - data["BrokerRepealFlag"] = task_data->BrokerRepealFlag; - data["PlateRepealSerial"] = task_data->PlateRepealSerial; - data["BankRepealSerial"] = toUtf(task_data->BankRepealSerial); - data["FutureRepealSerial"] = task_data->FutureRepealSerial; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["FutureSerial"] = task_data->FutureSerial; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["TradeAmount"] = task_data->TradeAmount; - data["FutureFetchAmount"] = task_data->FutureFetchAmount; - data["FeePayFlag"] = task_data->FeePayFlag; - data["CustFee"] = task_data->CustFee; - data["BrokerFee"] = task_data->BrokerFee; - data["Message"] = toUtf(task_data->Message); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["TransferStatus"] = task_data->TransferStatus; - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onErrRtnRepealFutureToBankByFutureManual(data, error); -}; - -void TdApi::processErrRtnQueryBankBalanceByFuture(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcReqQueryAccountField *task_data = (CThostFtdcReqQueryAccountField*)task->task_data; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["FutureSerial"] = task_data->FutureSerial; - data["InstallID"] = task_data->InstallID; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onErrRtnQueryBankBalanceByFuture(data, error); -}; - -void TdApi::processRtnRepealFromBankToFutureByFuture(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRspRepealField *task_data = (CThostFtdcRspRepealField*)task->task_data; - data["RepealTimeInterval"] = task_data->RepealTimeInterval; - data["RepealedTimes"] = task_data->RepealedTimes; - data["BankRepealFlag"] = task_data->BankRepealFlag; - data["BrokerRepealFlag"] = task_data->BrokerRepealFlag; - data["PlateRepealSerial"] = task_data->PlateRepealSerial; - data["BankRepealSerial"] = toUtf(task_data->BankRepealSerial); - data["FutureRepealSerial"] = task_data->FutureRepealSerial; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["FutureSerial"] = task_data->FutureSerial; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["TradeAmount"] = task_data->TradeAmount; - data["FutureFetchAmount"] = task_data->FutureFetchAmount; - data["FeePayFlag"] = task_data->FeePayFlag; - data["CustFee"] = task_data->CustFee; - data["BrokerFee"] = task_data->BrokerFee; - data["Message"] = toUtf(task_data->Message); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["TransferStatus"] = task_data->TransferStatus; - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - this->onRtnRepealFromBankToFutureByFuture(data); -}; - -void TdApi::processRtnRepealFromFutureToBankByFuture(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcRspRepealField *task_data = (CThostFtdcRspRepealField*)task->task_data; - data["RepealTimeInterval"] = task_data->RepealTimeInterval; - data["RepealedTimes"] = task_data->RepealedTimes; - data["BankRepealFlag"] = task_data->BankRepealFlag; - data["BrokerRepealFlag"] = task_data->BrokerRepealFlag; - data["PlateRepealSerial"] = task_data->PlateRepealSerial; - data["BankRepealSerial"] = toUtf(task_data->BankRepealSerial); - data["FutureRepealSerial"] = task_data->FutureRepealSerial; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["FutureSerial"] = task_data->FutureSerial; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["TradeAmount"] = task_data->TradeAmount; - data["FutureFetchAmount"] = task_data->FutureFetchAmount; - data["FeePayFlag"] = task_data->FeePayFlag; - data["CustFee"] = task_data->CustFee; - data["BrokerFee"] = task_data->BrokerFee; - data["Message"] = toUtf(task_data->Message); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["TransferStatus"] = task_data->TransferStatus; - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - this->onRtnRepealFromFutureToBankByFuture(data); -}; - -void TdApi::processRspFromBankToFutureByFuture(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcReqTransferField *task_data = (CThostFtdcReqTransferField*)task->task_data; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["FutureSerial"] = task_data->FutureSerial; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["TradeAmount"] = task_data->TradeAmount; - data["FutureFetchAmount"] = task_data->FutureFetchAmount; - data["FeePayFlag"] = task_data->FeePayFlag; - data["CustFee"] = task_data->CustFee; - data["BrokerFee"] = task_data->BrokerFee; - data["Message"] = toUtf(task_data->Message); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["TransferStatus"] = task_data->TransferStatus; - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspFromBankToFutureByFuture(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspFromFutureToBankByFuture(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcReqTransferField *task_data = (CThostFtdcReqTransferField*)task->task_data; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["FutureSerial"] = task_data->FutureSerial; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["TradeAmount"] = task_data->TradeAmount; - data["FutureFetchAmount"] = task_data->FutureFetchAmount; - data["FeePayFlag"] = task_data->FeePayFlag; - data["CustFee"] = task_data->CustFee; - data["BrokerFee"] = task_data->BrokerFee; - data["Message"] = toUtf(task_data->Message); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["TransferStatus"] = task_data->TransferStatus; - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspFromFutureToBankByFuture(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRspQueryBankAccountMoneyByFuture(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcReqQueryAccountField *task_data = (CThostFtdcReqQueryAccountField*)task->task_data; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["CustType"] = task_data->CustType; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["FutureSerial"] = task_data->FutureSerial; - data["InstallID"] = task_data->InstallID; - data["UserID"] = toUtf(task_data->UserID); - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["RequestID"] = task_data->RequestID; - data["TID"] = task_data->TID; - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - dict error; - if (task->task_error) - { - CThostFtdcRspInfoField *task_error = (CThostFtdcRspInfoField*)task->task_error; - error["ErrorID"] = task_error->ErrorID; - error["ErrorMsg"] = toUtf(task_error->ErrorMsg); - delete task_error; - } - this->onRspQueryBankAccountMoneyByFuture(data, error, task->task_id, task->task_last); -}; - -void TdApi::processRtnOpenAccountByBank(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcOpenAccountField *task_data = (CThostFtdcOpenAccountField*)task->task_data; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["Gender"] = task_data->Gender; - data["CountryCode"] = toUtf(task_data->CountryCode); - data["CustType"] = task_data->CustType; - data["Address"] = toUtf(task_data->Address); - data["ZipCode"] = toUtf(task_data->ZipCode); - data["Telephone"] = toUtf(task_data->Telephone); - data["MobilePhone"] = toUtf(task_data->MobilePhone); - data["Fax"] = toUtf(task_data->Fax); - data["EMail"] = toUtf(task_data->EMail); - data["MoneyAccountStatus"] = task_data->MoneyAccountStatus; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["CashExchangeCode"] = task_data->CashExchangeCode; - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["TID"] = task_data->TID; - data["UserID"] = toUtf(task_data->UserID); - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - this->onRtnOpenAccountByBank(data); -}; - -void TdApi::processRtnCancelAccountByBank(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcCancelAccountField *task_data = (CThostFtdcCancelAccountField*)task->task_data; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["Gender"] = task_data->Gender; - data["CountryCode"] = toUtf(task_data->CountryCode); - data["CustType"] = task_data->CustType; - data["Address"] = toUtf(task_data->Address); - data["ZipCode"] = toUtf(task_data->ZipCode); - data["Telephone"] = toUtf(task_data->Telephone); - data["MobilePhone"] = toUtf(task_data->MobilePhone); - data["Fax"] = toUtf(task_data->Fax); - data["EMail"] = toUtf(task_data->EMail); - data["MoneyAccountStatus"] = task_data->MoneyAccountStatus; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["InstallID"] = task_data->InstallID; - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["CashExchangeCode"] = task_data->CashExchangeCode; - data["Digest"] = toUtf(task_data->Digest); - data["BankAccType"] = task_data->BankAccType; - data["DeviceID"] = toUtf(task_data->DeviceID); - data["BankSecuAccType"] = task_data->BankSecuAccType; - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankSecuAcc"] = toUtf(task_data->BankSecuAcc); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["OperNo"] = toUtf(task_data->OperNo); - data["TID"] = task_data->TID; - data["UserID"] = toUtf(task_data->UserID); - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - this->onRtnCancelAccountByBank(data); -}; - -void TdApi::processRtnChangeAccountByBank(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CThostFtdcChangeAccountField *task_data = (CThostFtdcChangeAccountField*)task->task_data; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["BankID"] = toUtf(task_data->BankID); - data["BankBranchID"] = toUtf(task_data->BankBranchID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["BrokerBranchID"] = toUtf(task_data->BrokerBranchID); - data["TradeDate"] = toUtf(task_data->TradeDate); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["BankSerial"] = toUtf(task_data->BankSerial); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["PlateSerial"] = task_data->PlateSerial; - data["LastFragment"] = task_data->LastFragment; - data["SessionID"] = task_data->SessionID; - data["CustomerName"] = toUtf(task_data->CustomerName); - data["IdCardType"] = task_data->IdCardType; - data["IdentifiedCardNo"] = toUtf(task_data->IdentifiedCardNo); - data["Gender"] = task_data->Gender; - data["CountryCode"] = toUtf(task_data->CountryCode); - data["CustType"] = task_data->CustType; - data["Address"] = toUtf(task_data->Address); - data["ZipCode"] = toUtf(task_data->ZipCode); - data["Telephone"] = toUtf(task_data->Telephone); - data["MobilePhone"] = toUtf(task_data->MobilePhone); - data["Fax"] = toUtf(task_data->Fax); - data["EMail"] = toUtf(task_data->EMail); - data["MoneyAccountStatus"] = task_data->MoneyAccountStatus; - data["BankAccount"] = toUtf(task_data->BankAccount); - data["BankPassWord"] = toUtf(task_data->BankPassWord); - data["NewBankAccount"] = toUtf(task_data->NewBankAccount); - data["NewBankPassWord"] = toUtf(task_data->NewBankPassWord); - data["AccountID"] = toUtf(task_data->AccountID); - data["Password"] = toUtf(task_data->Password); - data["BankAccType"] = task_data->BankAccType; - data["InstallID"] = task_data->InstallID; - data["VerifyCertNoFlag"] = task_data->VerifyCertNoFlag; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["BrokerIDByBank"] = toUtf(task_data->BrokerIDByBank); - data["BankPwdFlag"] = task_data->BankPwdFlag; - data["SecuPwdFlag"] = task_data->SecuPwdFlag; - data["TID"] = task_data->TID; - data["Digest"] = toUtf(task_data->Digest); - data["ErrorID"] = task_data->ErrorID; - data["ErrorMsg"] = toUtf(task_data->ErrorMsg); - data["LongCustomerName"] = toUtf(task_data->LongCustomerName); - delete task_data; - } - this->onRtnChangeAccountByBank(data); -}; - - -///------------------------------------------------------------------------------------- -///主动函数 -///------------------------------------------------------------------------------------- - -void TdApi::createFtdcTraderApi(string pszFlowPath) -{ - this->api = CThostFtdcTraderApi::CreateFtdcTraderApi(pszFlowPath.c_str()); - this->api->RegisterSpi(this); -}; - -void TdApi::release() -{ - this->api->Release(); -}; - -void TdApi::init() -{ - this->active = true; - this->task_thread = thread(&TdApi::processTask, this); - - this->api->Init(); -}; - -int TdApi::join() -{ - int i = this->api->Join(); - return i; -}; - -int TdApi::exit() -{ - this->active = false; - this->task_queue.terminate(); - this->task_thread.join(); - - this->api->RegisterSpi(NULL); - this->api->Release(); - this->api = NULL; - return 1; -}; - -string TdApi::getTradingDay() -{ - string day = this->api->GetTradingDay(); - return day; -}; - -void TdApi::registerFront(string pszFrontAddress) -{ - this->api->RegisterFront((char*)pszFrontAddress.c_str()); -}; - -void TdApi::subscribePrivateTopic(int nType) -{ - this->api->SubscribePrivateTopic((THOST_TE_RESUME_TYPE) nType); -}; - -void TdApi::subscribePublicTopic(int nType) -{ - this->api->SubscribePublicTopic((THOST_TE_RESUME_TYPE)nType); -}; - -int TdApi::reqAuthenticate(const dict &req, int reqid) -{ - CThostFtdcReqAuthenticateField myreq = CThostFtdcReqAuthenticateField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "UserID", myreq.UserID); - getString(req, "UserProductInfo", myreq.UserProductInfo); - getString(req, "AuthCode", myreq.AuthCode); - getString(req, "AppID", myreq.AppID); - int i = this->api->ReqAuthenticate(&myreq, reqid); - return i; -}; - -int TdApi::reqUserLogin(const dict &req, int reqid) -{ - CThostFtdcReqUserLoginField myreq = CThostFtdcReqUserLoginField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "TradingDay", myreq.TradingDay); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "UserID", myreq.UserID); - getString(req, "Password", myreq.Password); - getString(req, "UserProductInfo", myreq.UserProductInfo); - getString(req, "InterfaceProductInfo", myreq.InterfaceProductInfo); - getString(req, "ProtocolInfo", myreq.ProtocolInfo); - getString(req, "MacAddress", myreq.MacAddress); - getString(req, "OneTimePassword", myreq.OneTimePassword); - getString(req, "ClientIPAddress", myreq.ClientIPAddress); - getString(req, "LoginRemark", myreq.LoginRemark); - getInt(req, "ClientIPPort", &myreq.ClientIPPort); - int i = this->api->ReqUserLogin(&myreq, reqid); - return i; -}; - -int TdApi::reqUserLogout(const dict &req, int reqid) -{ - CThostFtdcUserLogoutField myreq = CThostFtdcUserLogoutField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "UserID", myreq.UserID); - int i = this->api->ReqUserLogout(&myreq, reqid); - return i; -}; - -int TdApi::reqUserPasswordUpdate(const dict &req, int reqid) -{ - CThostFtdcUserPasswordUpdateField myreq = CThostFtdcUserPasswordUpdateField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "UserID", myreq.UserID); - getString(req, "OldPassword", myreq.OldPassword); - getString(req, "NewPassword", myreq.NewPassword); - int i = this->api->ReqUserPasswordUpdate(&myreq, reqid); - return i; -}; - -int TdApi::reqTradingAccountPasswordUpdate(const dict &req, int reqid) -{ - CThostFtdcTradingAccountPasswordUpdateField myreq = CThostFtdcTradingAccountPasswordUpdateField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "AccountID", myreq.AccountID); - getString(req, "OldPassword", myreq.OldPassword); - getString(req, "NewPassword", myreq.NewPassword); - getString(req, "CurrencyID", myreq.CurrencyID); - int i = this->api->ReqTradingAccountPasswordUpdate(&myreq, reqid); - return i; -}; - -int TdApi::reqUserAuthMethod(const dict &req, int reqid) -{ - CThostFtdcReqUserAuthMethodField myreq = CThostFtdcReqUserAuthMethodField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "TradingDay", myreq.TradingDay); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "UserID", myreq.UserID); - int i = this->api->ReqUserAuthMethod(&myreq, reqid); - return i; -}; - -int TdApi::reqGenUserCaptcha(const dict &req, int reqid) -{ - CThostFtdcReqGenUserCaptchaField myreq = CThostFtdcReqGenUserCaptchaField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "TradingDay", myreq.TradingDay); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "UserID", myreq.UserID); - int i = this->api->ReqGenUserCaptcha(&myreq, reqid); - return i; -}; - -int TdApi::reqGenUserText(const dict &req, int reqid) -{ - CThostFtdcReqGenUserTextField myreq = CThostFtdcReqGenUserTextField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "TradingDay", myreq.TradingDay); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "UserID", myreq.UserID); - int i = this->api->ReqGenUserText(&myreq, reqid); - return i; -}; - -int TdApi::reqUserLoginWithCaptcha(const dict &req, int reqid) -{ - CThostFtdcReqUserLoginWithCaptchaField myreq = CThostFtdcReqUserLoginWithCaptchaField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "TradingDay", myreq.TradingDay); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "UserID", myreq.UserID); - getString(req, "Password", myreq.Password); - getString(req, "UserProductInfo", myreq.UserProductInfo); - getString(req, "InterfaceProductInfo", myreq.InterfaceProductInfo); - getString(req, "ProtocolInfo", myreq.ProtocolInfo); - getString(req, "MacAddress", myreq.MacAddress); - getString(req, "ClientIPAddress", myreq.ClientIPAddress); - getString(req, "LoginRemark", myreq.LoginRemark); - getString(req, "Captcha", myreq.Captcha); - getInt(req, "ClientIPPort", &myreq.ClientIPPort); - int i = this->api->ReqUserLoginWithCaptcha(&myreq, reqid); - return i; -}; - -int TdApi::reqUserLoginWithText(const dict &req, int reqid) -{ - CThostFtdcReqUserLoginWithTextField myreq = CThostFtdcReqUserLoginWithTextField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "TradingDay", myreq.TradingDay); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "UserID", myreq.UserID); - getString(req, "Password", myreq.Password); - getString(req, "UserProductInfo", myreq.UserProductInfo); - getString(req, "InterfaceProductInfo", myreq.InterfaceProductInfo); - getString(req, "ProtocolInfo", myreq.ProtocolInfo); - getString(req, "MacAddress", myreq.MacAddress); - getString(req, "ClientIPAddress", myreq.ClientIPAddress); - getString(req, "LoginRemark", myreq.LoginRemark); - getString(req, "Text", myreq.Text); - getInt(req, "ClientIPPort", &myreq.ClientIPPort); - int i = this->api->ReqUserLoginWithText(&myreq, reqid); - return i; -}; - -int TdApi::reqUserLoginWithOTP(const dict &req, int reqid) -{ - CThostFtdcReqUserLoginWithOTPField myreq = CThostFtdcReqUserLoginWithOTPField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "TradingDay", myreq.TradingDay); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "UserID", myreq.UserID); - getString(req, "Password", myreq.Password); - getString(req, "UserProductInfo", myreq.UserProductInfo); - getString(req, "InterfaceProductInfo", myreq.InterfaceProductInfo); - getString(req, "ProtocolInfo", myreq.ProtocolInfo); - getString(req, "MacAddress", myreq.MacAddress); - getString(req, "ClientIPAddress", myreq.ClientIPAddress); - getString(req, "LoginRemark", myreq.LoginRemark); - getString(req, "OTPPassword", myreq.OTPPassword); - getInt(req, "ClientIPPort", &myreq.ClientIPPort); - int i = this->api->ReqUserLoginWithOTP(&myreq, reqid); - return i; -}; - -int TdApi::reqOrderInsert(const dict &req, int reqid) -{ - CThostFtdcInputOrderField myreq = CThostFtdcInputOrderField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "OrderRef", myreq.OrderRef); - getString(req, "UserID", myreq.UserID); - getChar(req, "OrderPriceType", &myreq.OrderPriceType); - getChar(req, "Direction", &myreq.Direction); - getString(req, "CombOffsetFlag", myreq.CombOffsetFlag); - getString(req, "CombHedgeFlag", myreq.CombHedgeFlag); - getDouble(req, "LimitPrice", &myreq.LimitPrice); - getInt(req, "VolumeTotalOriginal", &myreq.VolumeTotalOriginal); - getChar(req, "TimeCondition", &myreq.TimeCondition); - getString(req, "GTDDate", myreq.GTDDate); - getChar(req, "VolumeCondition", &myreq.VolumeCondition); - getInt(req, "MinVolume", &myreq.MinVolume); - getChar(req, "ContingentCondition", &myreq.ContingentCondition); - getDouble(req, "StopPrice", &myreq.StopPrice); - getChar(req, "ForceCloseReason", &myreq.ForceCloseReason); - getInt(req, "IsAutoSuspend", &myreq.IsAutoSuspend); - getString(req, "BusinessUnit", myreq.BusinessUnit); - getInt(req, "RequestID", &myreq.RequestID); - getInt(req, "UserForceClose", &myreq.UserForceClose); - getInt(req, "IsSwapOrder", &myreq.IsSwapOrder); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - getString(req, "AccountID", myreq.AccountID); - getString(req, "CurrencyID", myreq.CurrencyID); - getString(req, "ClientID", myreq.ClientID); - getString(req, "IPAddress", myreq.IPAddress); - getString(req, "MacAddress", myreq.MacAddress); - int i = this->api->ReqOrderInsert(&myreq, reqid); - return i; -}; - -int TdApi::reqParkedOrderInsert(const dict &req, int reqid) -{ - CThostFtdcParkedOrderField myreq = CThostFtdcParkedOrderField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "OrderRef", myreq.OrderRef); - getString(req, "UserID", myreq.UserID); - getChar(req, "OrderPriceType", &myreq.OrderPriceType); - getChar(req, "Direction", &myreq.Direction); - getString(req, "CombOffsetFlag", myreq.CombOffsetFlag); - getString(req, "CombHedgeFlag", myreq.CombHedgeFlag); - getDouble(req, "LimitPrice", &myreq.LimitPrice); - getInt(req, "VolumeTotalOriginal", &myreq.VolumeTotalOriginal); - getChar(req, "TimeCondition", &myreq.TimeCondition); - getString(req, "GTDDate", myreq.GTDDate); - getChar(req, "VolumeCondition", &myreq.VolumeCondition); - getInt(req, "MinVolume", &myreq.MinVolume); - getChar(req, "ContingentCondition", &myreq.ContingentCondition); - getDouble(req, "StopPrice", &myreq.StopPrice); - getChar(req, "ForceCloseReason", &myreq.ForceCloseReason); - getInt(req, "IsAutoSuspend", &myreq.IsAutoSuspend); - getString(req, "BusinessUnit", myreq.BusinessUnit); - getInt(req, "RequestID", &myreq.RequestID); - getInt(req, "UserForceClose", &myreq.UserForceClose); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "ParkedOrderID", myreq.ParkedOrderID); - getChar(req, "UserType", &myreq.UserType); - getChar(req, "Status", &myreq.Status); - getInt(req, "ErrorID", &myreq.ErrorID); - getString(req, "ErrorMsg", myreq.ErrorMsg); - getInt(req, "IsSwapOrder", &myreq.IsSwapOrder); - getString(req, "AccountID", myreq.AccountID); - getString(req, "CurrencyID", myreq.CurrencyID); - getString(req, "ClientID", myreq.ClientID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - getString(req, "IPAddress", myreq.IPAddress); - getString(req, "MacAddress", myreq.MacAddress); - int i = this->api->ReqParkedOrderInsert(&myreq, reqid); - return i; -}; - -int TdApi::reqParkedOrderAction(const dict &req, int reqid) -{ - CThostFtdcParkedOrderActionField myreq = CThostFtdcParkedOrderActionField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getInt(req, "OrderActionRef", &myreq.OrderActionRef); - getString(req, "OrderRef", myreq.OrderRef); - getInt(req, "RequestID", &myreq.RequestID); - getInt(req, "FrontID", &myreq.FrontID); - getInt(req, "SessionID", &myreq.SessionID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "OrderSysID", myreq.OrderSysID); - getChar(req, "ActionFlag", &myreq.ActionFlag); - getDouble(req, "LimitPrice", &myreq.LimitPrice); - getInt(req, "VolumeChange", &myreq.VolumeChange); - getString(req, "UserID", myreq.UserID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ParkedOrderActionID", myreq.ParkedOrderActionID); - getChar(req, "UserType", &myreq.UserType); - getChar(req, "Status", &myreq.Status); - getInt(req, "ErrorID", &myreq.ErrorID); - getString(req, "ErrorMsg", myreq.ErrorMsg); - getString(req, "InvestUnitID", myreq.InvestUnitID); - getString(req, "IPAddress", myreq.IPAddress); - getString(req, "MacAddress", myreq.MacAddress); - int i = this->api->ReqParkedOrderAction(&myreq, reqid); - return i; -}; - -int TdApi::reqOrderAction(const dict &req, int reqid) -{ - CThostFtdcInputOrderActionField myreq = CThostFtdcInputOrderActionField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getInt(req, "OrderActionRef", &myreq.OrderActionRef); - getString(req, "OrderRef", myreq.OrderRef); - getInt(req, "RequestID", &myreq.RequestID); - getInt(req, "FrontID", &myreq.FrontID); - getInt(req, "SessionID", &myreq.SessionID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "OrderSysID", myreq.OrderSysID); - getChar(req, "ActionFlag", &myreq.ActionFlag); - getDouble(req, "LimitPrice", &myreq.LimitPrice); - getInt(req, "VolumeChange", &myreq.VolumeChange); - getString(req, "UserID", myreq.UserID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - getString(req, "IPAddress", myreq.IPAddress); - getString(req, "MacAddress", myreq.MacAddress); - int i = this->api->ReqOrderAction(&myreq, reqid); - return i; -}; - -int TdApi::reqQueryMaxOrderVolume(const dict &req, int reqid) -{ - CThostFtdcQueryMaxOrderVolumeField myreq = CThostFtdcQueryMaxOrderVolumeField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getChar(req, "Direction", &myreq.Direction); - getChar(req, "OffsetFlag", &myreq.OffsetFlag); - getChar(req, "HedgeFlag", &myreq.HedgeFlag); - getInt(req, "MaxVolume", &myreq.MaxVolume); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQueryMaxOrderVolume(&myreq, reqid); - return i; -}; - -int TdApi::reqSettlementInfoConfirm(const dict &req, int reqid) -{ - CThostFtdcSettlementInfoConfirmField myreq = CThostFtdcSettlementInfoConfirmField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "ConfirmDate", myreq.ConfirmDate); - getString(req, "ConfirmTime", myreq.ConfirmTime); - getInt(req, "SettlementID", &myreq.SettlementID); - getString(req, "AccountID", myreq.AccountID); - getString(req, "CurrencyID", myreq.CurrencyID); - int i = this->api->ReqSettlementInfoConfirm(&myreq, reqid); - return i; -}; - -int TdApi::reqRemoveParkedOrder(const dict &req, int reqid) -{ - CThostFtdcRemoveParkedOrderField myreq = CThostFtdcRemoveParkedOrderField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "ParkedOrderID", myreq.ParkedOrderID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqRemoveParkedOrder(&myreq, reqid); - return i; -}; - -int TdApi::reqRemoveParkedOrderAction(const dict &req, int reqid) -{ - CThostFtdcRemoveParkedOrderActionField myreq = CThostFtdcRemoveParkedOrderActionField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "ParkedOrderActionID", myreq.ParkedOrderActionID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqRemoveParkedOrderAction(&myreq, reqid); - return i; -}; - -int TdApi::reqExecOrderInsert(const dict &req, int reqid) -{ - CThostFtdcInputExecOrderField myreq = CThostFtdcInputExecOrderField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ExecOrderRef", myreq.ExecOrderRef); - getString(req, "UserID", myreq.UserID); - getInt(req, "Volume", &myreq.Volume); - getInt(req, "RequestID", &myreq.RequestID); - getString(req, "BusinessUnit", myreq.BusinessUnit); - getChar(req, "OffsetFlag", &myreq.OffsetFlag); - getChar(req, "HedgeFlag", &myreq.HedgeFlag); - getChar(req, "ActionType", &myreq.ActionType); - getChar(req, "PosiDirection", &myreq.PosiDirection); - getChar(req, "ReservePositionFlag", &myreq.ReservePositionFlag); - getChar(req, "CloseFlag", &myreq.CloseFlag); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - getString(req, "AccountID", myreq.AccountID); - getString(req, "CurrencyID", myreq.CurrencyID); - getString(req, "ClientID", myreq.ClientID); - getString(req, "IPAddress", myreq.IPAddress); - getString(req, "MacAddress", myreq.MacAddress); - int i = this->api->ReqExecOrderInsert(&myreq, reqid); - return i; -}; - -int TdApi::reqExecOrderAction(const dict &req, int reqid) -{ - CThostFtdcInputExecOrderActionField myreq = CThostFtdcInputExecOrderActionField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getInt(req, "ExecOrderActionRef", &myreq.ExecOrderActionRef); - getString(req, "ExecOrderRef", myreq.ExecOrderRef); - getInt(req, "RequestID", &myreq.RequestID); - getInt(req, "FrontID", &myreq.FrontID); - getInt(req, "SessionID", &myreq.SessionID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "ExecOrderSysID", myreq.ExecOrderSysID); - getChar(req, "ActionFlag", &myreq.ActionFlag); - getString(req, "UserID", myreq.UserID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - getString(req, "IPAddress", myreq.IPAddress); - getString(req, "MacAddress", myreq.MacAddress); - int i = this->api->ReqExecOrderAction(&myreq, reqid); - return i; -}; - -int TdApi::reqForQuoteInsert(const dict &req, int reqid) -{ - CThostFtdcInputForQuoteField myreq = CThostFtdcInputForQuoteField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ForQuoteRef", myreq.ForQuoteRef); - getString(req, "UserID", myreq.UserID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - getString(req, "IPAddress", myreq.IPAddress); - getString(req, "MacAddress", myreq.MacAddress); - int i = this->api->ReqForQuoteInsert(&myreq, reqid); - return i; -}; - -int TdApi::reqQuoteInsert(const dict &req, int reqid) -{ - CThostFtdcInputQuoteField myreq = CThostFtdcInputQuoteField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "QuoteRef", myreq.QuoteRef); - getString(req, "UserID", myreq.UserID); - getDouble(req, "AskPrice", &myreq.AskPrice); - getDouble(req, "BidPrice", &myreq.BidPrice); - getInt(req, "AskVolume", &myreq.AskVolume); - getInt(req, "BidVolume", &myreq.BidVolume); - getInt(req, "RequestID", &myreq.RequestID); - getString(req, "BusinessUnit", myreq.BusinessUnit); - getChar(req, "AskOffsetFlag", &myreq.AskOffsetFlag); - getChar(req, "BidOffsetFlag", &myreq.BidOffsetFlag); - getChar(req, "AskHedgeFlag", &myreq.AskHedgeFlag); - getChar(req, "BidHedgeFlag", &myreq.BidHedgeFlag); - getString(req, "AskOrderRef", myreq.AskOrderRef); - getString(req, "BidOrderRef", myreq.BidOrderRef); - getString(req, "ForQuoteSysID", myreq.ForQuoteSysID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - getString(req, "ClientID", myreq.ClientID); - getString(req, "IPAddress", myreq.IPAddress); - getString(req, "MacAddress", myreq.MacAddress); - int i = this->api->ReqQuoteInsert(&myreq, reqid); - return i; -}; - -int TdApi::reqQuoteAction(const dict &req, int reqid) -{ - CThostFtdcInputQuoteActionField myreq = CThostFtdcInputQuoteActionField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getInt(req, "QuoteActionRef", &myreq.QuoteActionRef); - getString(req, "QuoteRef", myreq.QuoteRef); - getInt(req, "RequestID", &myreq.RequestID); - getInt(req, "FrontID", &myreq.FrontID); - getInt(req, "SessionID", &myreq.SessionID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "QuoteSysID", myreq.QuoteSysID); - getChar(req, "ActionFlag", &myreq.ActionFlag); - getString(req, "UserID", myreq.UserID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - getString(req, "ClientID", myreq.ClientID); - getString(req, "IPAddress", myreq.IPAddress); - getString(req, "MacAddress", myreq.MacAddress); - int i = this->api->ReqQuoteAction(&myreq, reqid); - return i; -}; - -int TdApi::reqBatchOrderAction(const dict &req, int reqid) -{ - CThostFtdcInputBatchOrderActionField myreq = CThostFtdcInputBatchOrderActionField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getInt(req, "OrderActionRef", &myreq.OrderActionRef); - getInt(req, "RequestID", &myreq.RequestID); - getInt(req, "FrontID", &myreq.FrontID); - getInt(req, "SessionID", &myreq.SessionID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "UserID", myreq.UserID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - getString(req, "IPAddress", myreq.IPAddress); - getString(req, "MacAddress", myreq.MacAddress); - int i = this->api->ReqBatchOrderAction(&myreq, reqid); - return i; -}; - -int TdApi::reqOptionSelfCloseInsert(const dict &req, int reqid) -{ - CThostFtdcInputOptionSelfCloseField myreq = CThostFtdcInputOptionSelfCloseField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "OptionSelfCloseRef", myreq.OptionSelfCloseRef); - getString(req, "UserID", myreq.UserID); - getInt(req, "Volume", &myreq.Volume); - getInt(req, "RequestID", &myreq.RequestID); - getString(req, "BusinessUnit", myreq.BusinessUnit); - getChar(req, "HedgeFlag", &myreq.HedgeFlag); - getChar(req, "OptSelfCloseFlag", &myreq.OptSelfCloseFlag); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - getString(req, "AccountID", myreq.AccountID); - getString(req, "CurrencyID", myreq.CurrencyID); - getString(req, "ClientID", myreq.ClientID); - getString(req, "IPAddress", myreq.IPAddress); - getString(req, "MacAddress", myreq.MacAddress); - int i = this->api->ReqOptionSelfCloseInsert(&myreq, reqid); - return i; -}; - -int TdApi::reqOptionSelfCloseAction(const dict &req, int reqid) -{ - CThostFtdcInputOptionSelfCloseActionField myreq = CThostFtdcInputOptionSelfCloseActionField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getInt(req, "OptionSelfCloseActionRef", &myreq.OptionSelfCloseActionRef); - getString(req, "OptionSelfCloseRef", myreq.OptionSelfCloseRef); - getInt(req, "RequestID", &myreq.RequestID); - getInt(req, "FrontID", &myreq.FrontID); - getInt(req, "SessionID", &myreq.SessionID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "OptionSelfCloseSysID", myreq.OptionSelfCloseSysID); - getChar(req, "ActionFlag", &myreq.ActionFlag); - getString(req, "UserID", myreq.UserID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - getString(req, "IPAddress", myreq.IPAddress); - getString(req, "MacAddress", myreq.MacAddress); - int i = this->api->ReqOptionSelfCloseAction(&myreq, reqid); - return i; -}; - -int TdApi::reqCombActionInsert(const dict &req, int reqid) -{ - CThostFtdcInputCombActionField myreq = CThostFtdcInputCombActionField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "CombActionRef", myreq.CombActionRef); - getString(req, "UserID", myreq.UserID); - getChar(req, "Direction", &myreq.Direction); - getInt(req, "Volume", &myreq.Volume); - getChar(req, "CombDirection", &myreq.CombDirection); - getChar(req, "HedgeFlag", &myreq.HedgeFlag); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "IPAddress", myreq.IPAddress); - getString(req, "MacAddress", myreq.MacAddress); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqCombActionInsert(&myreq, reqid); - return i; -}; - -int TdApi::reqQryOrder(const dict &req, int reqid) -{ - CThostFtdcQryOrderField myreq = CThostFtdcQryOrderField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "OrderSysID", myreq.OrderSysID); - getString(req, "InsertTimeStart", myreq.InsertTimeStart); - getString(req, "InsertTimeEnd", myreq.InsertTimeEnd); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryOrder(&myreq, reqid); - return i; -}; - -int TdApi::reqQryTrade(const dict &req, int reqid) -{ - CThostFtdcQryTradeField myreq = CThostFtdcQryTradeField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "TradeID", myreq.TradeID); - getString(req, "TradeTimeStart", myreq.TradeTimeStart); - getString(req, "TradeTimeEnd", myreq.TradeTimeEnd); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryTrade(&myreq, reqid); - return i; -}; - -int TdApi::reqQryInvestorPosition(const dict &req, int reqid) -{ - CThostFtdcQryInvestorPositionField myreq = CThostFtdcQryInvestorPositionField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryInvestorPosition(&myreq, reqid); - return i; -}; - -int TdApi::reqQryTradingAccount(const dict &req, int reqid) -{ - CThostFtdcQryTradingAccountField myreq = CThostFtdcQryTradingAccountField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "CurrencyID", myreq.CurrencyID); - getChar(req, "BizType", &myreq.BizType); - getString(req, "AccountID", myreq.AccountID); - int i = this->api->ReqQryTradingAccount(&myreq, reqid); - return i; -}; - -int TdApi::reqQryInvestor(const dict &req, int reqid) -{ - CThostFtdcQryInvestorField myreq = CThostFtdcQryInvestorField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - int i = this->api->ReqQryInvestor(&myreq, reqid); - return i; -}; - -int TdApi::reqQryTradingCode(const dict &req, int reqid) -{ - CThostFtdcQryTradingCodeField myreq = CThostFtdcQryTradingCodeField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "ClientID", myreq.ClientID); - getChar(req, "ClientIDType", &myreq.ClientIDType); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryTradingCode(&myreq, reqid); - return i; -}; - -int TdApi::reqQryInstrumentMarginRate(const dict &req, int reqid) -{ - CThostFtdcQryInstrumentMarginRateField myreq = CThostFtdcQryInstrumentMarginRateField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getChar(req, "HedgeFlag", &myreq.HedgeFlag); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryInstrumentMarginRate(&myreq, reqid); - return i; -}; - -int TdApi::reqQryInstrumentCommissionRate(const dict &req, int reqid) -{ - CThostFtdcQryInstrumentCommissionRateField myreq = CThostFtdcQryInstrumentCommissionRateField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryInstrumentCommissionRate(&myreq, reqid); - return i; -}; - -int TdApi::reqQryExchange(const dict &req, int reqid) -{ - CThostFtdcQryExchangeField myreq = CThostFtdcQryExchangeField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "ExchangeID", myreq.ExchangeID); - int i = this->api->ReqQryExchange(&myreq, reqid); - return i; -}; - -int TdApi::reqQryProduct(const dict &req, int reqid) -{ - CThostFtdcQryProductField myreq = CThostFtdcQryProductField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "ProductID", myreq.ProductID); - getChar(req, "ProductClass", &myreq.ProductClass); - getString(req, "ExchangeID", myreq.ExchangeID); - int i = this->api->ReqQryProduct(&myreq, reqid); - return i; -}; - -int TdApi::reqQryInstrument(const dict &req, int reqid) -{ - CThostFtdcQryInstrumentField myreq = CThostFtdcQryInstrumentField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "ExchangeInstID", myreq.ExchangeInstID); - getString(req, "ProductID", myreq.ProductID); - int i = this->api->ReqQryInstrument(&myreq, reqid); - return i; -}; - -int TdApi::reqQryDepthMarketData(const dict &req, int reqid) -{ - CThostFtdcQryDepthMarketDataField myreq = CThostFtdcQryDepthMarketDataField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ExchangeID", myreq.ExchangeID); - int i = this->api->ReqQryDepthMarketData(&myreq, reqid); - return i; -}; - -int TdApi::reqQrySettlementInfo(const dict &req, int reqid) -{ - CThostFtdcQrySettlementInfoField myreq = CThostFtdcQrySettlementInfoField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "TradingDay", myreq.TradingDay); - getString(req, "AccountID", myreq.AccountID); - getString(req, "CurrencyID", myreq.CurrencyID); - int i = this->api->ReqQrySettlementInfo(&myreq, reqid); - return i; -}; - -int TdApi::reqQryTransferBank(const dict &req, int reqid) -{ - CThostFtdcQryTransferBankField myreq = CThostFtdcQryTransferBankField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BankID", myreq.BankID); - getString(req, "BankBrchID", myreq.BankBrchID); - int i = this->api->ReqQryTransferBank(&myreq, reqid); - return i; -}; - -int TdApi::reqQryInvestorPositionDetail(const dict &req, int reqid) -{ - CThostFtdcQryInvestorPositionDetailField myreq = CThostFtdcQryInvestorPositionDetailField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryInvestorPositionDetail(&myreq, reqid); - return i; -}; - -int TdApi::reqQryNotice(const dict &req, int reqid) -{ - CThostFtdcQryNoticeField myreq = CThostFtdcQryNoticeField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - int i = this->api->ReqQryNotice(&myreq, reqid); - return i; -}; - -int TdApi::reqQrySettlementInfoConfirm(const dict &req, int reqid) -{ - CThostFtdcQrySettlementInfoConfirmField myreq = CThostFtdcQrySettlementInfoConfirmField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "AccountID", myreq.AccountID); - getString(req, "CurrencyID", myreq.CurrencyID); - int i = this->api->ReqQrySettlementInfoConfirm(&myreq, reqid); - return i; -}; - -int TdApi::reqQryInvestorPositionCombineDetail(const dict &req, int reqid) -{ - CThostFtdcQryInvestorPositionCombineDetailField myreq = CThostFtdcQryInvestorPositionCombineDetailField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "CombInstrumentID", myreq.CombInstrumentID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryInvestorPositionCombineDetail(&myreq, reqid); - return i; -}; - -int TdApi::reqQryCFMMCTradingAccountKey(const dict &req, int reqid) -{ - CThostFtdcQryCFMMCTradingAccountKeyField myreq = CThostFtdcQryCFMMCTradingAccountKeyField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - int i = this->api->ReqQryCFMMCTradingAccountKey(&myreq, reqid); - return i; -}; - -int TdApi::reqQryEWarrantOffset(const dict &req, int reqid) -{ - CThostFtdcQryEWarrantOffsetField myreq = CThostFtdcQryEWarrantOffsetField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryEWarrantOffset(&myreq, reqid); - return i; -}; - -int TdApi::reqQryInvestorProductGroupMargin(const dict &req, int reqid) -{ - CThostFtdcQryInvestorProductGroupMarginField myreq = CThostFtdcQryInvestorProductGroupMarginField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "ProductGroupID", myreq.ProductGroupID); - getChar(req, "HedgeFlag", &myreq.HedgeFlag); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryInvestorProductGroupMargin(&myreq, reqid); - return i; -}; - -int TdApi::reqQryExchangeMarginRate(const dict &req, int reqid) -{ - CThostFtdcQryExchangeMarginRateField myreq = CThostFtdcQryExchangeMarginRateField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InstrumentID", myreq.InstrumentID); - getChar(req, "HedgeFlag", &myreq.HedgeFlag); - getString(req, "ExchangeID", myreq.ExchangeID); - int i = this->api->ReqQryExchangeMarginRate(&myreq, reqid); - return i; -}; - -int TdApi::reqQryExchangeMarginRateAdjust(const dict &req, int reqid) -{ - CThostFtdcQryExchangeMarginRateAdjustField myreq = CThostFtdcQryExchangeMarginRateAdjustField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InstrumentID", myreq.InstrumentID); - getChar(req, "HedgeFlag", &myreq.HedgeFlag); - int i = this->api->ReqQryExchangeMarginRateAdjust(&myreq, reqid); - return i; -}; - -int TdApi::reqQryExchangeRate(const dict &req, int reqid) -{ - CThostFtdcQryExchangeRateField myreq = CThostFtdcQryExchangeRateField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "FromCurrencyID", myreq.FromCurrencyID); - getString(req, "ToCurrencyID", myreq.ToCurrencyID); - int i = this->api->ReqQryExchangeRate(&myreq, reqid); - return i; -}; - -int TdApi::reqQrySecAgentACIDMap(const dict &req, int reqid) -{ - CThostFtdcQrySecAgentACIDMapField myreq = CThostFtdcQrySecAgentACIDMapField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "UserID", myreq.UserID); - getString(req, "AccountID", myreq.AccountID); - getString(req, "CurrencyID", myreq.CurrencyID); - int i = this->api->ReqQrySecAgentACIDMap(&myreq, reqid); - return i; -}; - -int TdApi::reqQryProductExchRate(const dict &req, int reqid) -{ - CThostFtdcQryProductExchRateField myreq = CThostFtdcQryProductExchRateField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "ProductID", myreq.ProductID); - getString(req, "ExchangeID", myreq.ExchangeID); - int i = this->api->ReqQryProductExchRate(&myreq, reqid); - return i; -}; - -int TdApi::reqQryProductGroup(const dict &req, int reqid) -{ - CThostFtdcQryProductGroupField myreq = CThostFtdcQryProductGroupField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "ProductID", myreq.ProductID); - getString(req, "ExchangeID", myreq.ExchangeID); - int i = this->api->ReqQryProductGroup(&myreq, reqid); - return i; -}; - -int TdApi::reqQryMMInstrumentCommissionRate(const dict &req, int reqid) -{ - CThostFtdcQryMMInstrumentCommissionRateField myreq = CThostFtdcQryMMInstrumentCommissionRateField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - int i = this->api->ReqQryMMInstrumentCommissionRate(&myreq, reqid); - return i; -}; - -int TdApi::reqQryMMOptionInstrCommRate(const dict &req, int reqid) -{ - CThostFtdcQryMMOptionInstrCommRateField myreq = CThostFtdcQryMMOptionInstrCommRateField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - int i = this->api->ReqQryMMOptionInstrCommRate(&myreq, reqid); - return i; -}; - -int TdApi::reqQryInstrumentOrderCommRate(const dict &req, int reqid) -{ - CThostFtdcQryInstrumentOrderCommRateField myreq = CThostFtdcQryInstrumentOrderCommRateField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - int i = this->api->ReqQryInstrumentOrderCommRate(&myreq, reqid); - return i; -}; - -int TdApi::reqQrySecAgentTradingAccount(const dict &req, int reqid) -{ - CThostFtdcQryTradingAccountField myreq = CThostFtdcQryTradingAccountField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "CurrencyID", myreq.CurrencyID); - getChar(req, "BizType", &myreq.BizType); - getString(req, "AccountID", myreq.AccountID); - int i = this->api->ReqQrySecAgentTradingAccount(&myreq, reqid); - return i; -}; - -int TdApi::reqQrySecAgentCheckMode(const dict &req, int reqid) -{ - CThostFtdcQrySecAgentCheckModeField myreq = CThostFtdcQrySecAgentCheckModeField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - int i = this->api->ReqQrySecAgentCheckMode(&myreq, reqid); - return i; -}; - -int TdApi::reqQrySecAgentTradeInfo(const dict &req, int reqid) -{ - CThostFtdcQrySecAgentTradeInfoField myreq = CThostFtdcQrySecAgentTradeInfoField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "BrokerSecAgentID", myreq.BrokerSecAgentID); - int i = this->api->ReqQrySecAgentTradeInfo(&myreq, reqid); - return i; -}; - -int TdApi::reqQryOptionInstrTradeCost(const dict &req, int reqid) -{ - CThostFtdcQryOptionInstrTradeCostField myreq = CThostFtdcQryOptionInstrTradeCostField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getChar(req, "HedgeFlag", &myreq.HedgeFlag); - getDouble(req, "InputPrice", &myreq.InputPrice); - getDouble(req, "UnderlyingPrice", &myreq.UnderlyingPrice); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryOptionInstrTradeCost(&myreq, reqid); - return i; -}; - -int TdApi::reqQryOptionInstrCommRate(const dict &req, int reqid) -{ - CThostFtdcQryOptionInstrCommRateField myreq = CThostFtdcQryOptionInstrCommRateField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryOptionInstrCommRate(&myreq, reqid); - return i; -}; - -int TdApi::reqQryExecOrder(const dict &req, int reqid) -{ - CThostFtdcQryExecOrderField myreq = CThostFtdcQryExecOrderField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "ExecOrderSysID", myreq.ExecOrderSysID); - getString(req, "InsertTimeStart", myreq.InsertTimeStart); - getString(req, "InsertTimeEnd", myreq.InsertTimeEnd); - int i = this->api->ReqQryExecOrder(&myreq, reqid); - return i; -}; - -int TdApi::reqQryForQuote(const dict &req, int reqid) -{ - CThostFtdcQryForQuoteField myreq = CThostFtdcQryForQuoteField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InsertTimeStart", myreq.InsertTimeStart); - getString(req, "InsertTimeEnd", myreq.InsertTimeEnd); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryForQuote(&myreq, reqid); - return i; -}; - -int TdApi::reqQryQuote(const dict &req, int reqid) -{ - CThostFtdcQryQuoteField myreq = CThostFtdcQryQuoteField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "QuoteSysID", myreq.QuoteSysID); - getString(req, "InsertTimeStart", myreq.InsertTimeStart); - getString(req, "InsertTimeEnd", myreq.InsertTimeEnd); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryQuote(&myreq, reqid); - return i; -}; - -int TdApi::reqQryOptionSelfClose(const dict &req, int reqid) -{ - CThostFtdcQryOptionSelfCloseField myreq = CThostFtdcQryOptionSelfCloseField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "OptionSelfCloseSysID", myreq.OptionSelfCloseSysID); - getString(req, "InsertTimeStart", myreq.InsertTimeStart); - getString(req, "InsertTimeEnd", myreq.InsertTimeEnd); - int i = this->api->ReqQryOptionSelfClose(&myreq, reqid); - return i; -}; - -int TdApi::reqQryInvestUnit(const dict &req, int reqid) -{ - CThostFtdcQryInvestUnitField myreq = CThostFtdcQryInvestUnitField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryInvestUnit(&myreq, reqid); - return i; -}; - -int TdApi::reqQryCombInstrumentGuard(const dict &req, int reqid) -{ - CThostFtdcQryCombInstrumentGuardField myreq = CThostFtdcQryCombInstrumentGuardField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ExchangeID", myreq.ExchangeID); - int i = this->api->ReqQryCombInstrumentGuard(&myreq, reqid); - return i; -}; - -int TdApi::reqQryCombAction(const dict &req, int reqid) -{ - CThostFtdcQryCombActionField myreq = CThostFtdcQryCombActionField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryCombAction(&myreq, reqid); - return i; -}; - -int TdApi::reqQryTransferSerial(const dict &req, int reqid) -{ - CThostFtdcQryTransferSerialField myreq = CThostFtdcQryTransferSerialField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "AccountID", myreq.AccountID); - getString(req, "BankID", myreq.BankID); - getString(req, "CurrencyID", myreq.CurrencyID); - int i = this->api->ReqQryTransferSerial(&myreq, reqid); - return i; -}; - -int TdApi::reqQryAccountregister(const dict &req, int reqid) -{ - CThostFtdcQryAccountregisterField myreq = CThostFtdcQryAccountregisterField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "AccountID", myreq.AccountID); - getString(req, "BankID", myreq.BankID); - getString(req, "BankBranchID", myreq.BankBranchID); - getString(req, "CurrencyID", myreq.CurrencyID); - int i = this->api->ReqQryAccountregister(&myreq, reqid); - return i; -}; - -int TdApi::reqQryContractBank(const dict &req, int reqid) -{ - CThostFtdcQryContractBankField myreq = CThostFtdcQryContractBankField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "BankID", myreq.BankID); - getString(req, "BankBrchID", myreq.BankBrchID); - int i = this->api->ReqQryContractBank(&myreq, reqid); - return i; -}; - -int TdApi::reqQryParkedOrder(const dict &req, int reqid) -{ - CThostFtdcQryParkedOrderField myreq = CThostFtdcQryParkedOrderField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryParkedOrder(&myreq, reqid); - return i; -}; - -int TdApi::reqQryParkedOrderAction(const dict &req, int reqid) -{ - CThostFtdcQryParkedOrderActionField myreq = CThostFtdcQryParkedOrderActionField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InstrumentID", myreq.InstrumentID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryParkedOrderAction(&myreq, reqid); - return i; -}; - -int TdApi::reqQryTradingNotice(const dict &req, int reqid) -{ - CThostFtdcQryTradingNoticeField myreq = CThostFtdcQryTradingNoticeField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQryTradingNotice(&myreq, reqid); - return i; -}; - -int TdApi::reqQryBrokerTradingParams(const dict &req, int reqid) -{ - CThostFtdcQryBrokerTradingParamsField myreq = CThostFtdcQryBrokerTradingParamsField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "CurrencyID", myreq.CurrencyID); - getString(req, "AccountID", myreq.AccountID); - int i = this->api->ReqQryBrokerTradingParams(&myreq, reqid); - return i; -}; - -int TdApi::reqQryBrokerTradingAlgos(const dict &req, int reqid) -{ - CThostFtdcQryBrokerTradingAlgosField myreq = CThostFtdcQryBrokerTradingAlgosField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "ExchangeID", myreq.ExchangeID); - getString(req, "InstrumentID", myreq.InstrumentID); - int i = this->api->ReqQryBrokerTradingAlgos(&myreq, reqid); - return i; -}; - -int TdApi::reqQueryCFMMCTradingAccountToken(const dict &req, int reqid) -{ - CThostFtdcQueryCFMMCTradingAccountTokenField myreq = CThostFtdcQueryCFMMCTradingAccountTokenField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "InvestorID", myreq.InvestorID); - getString(req, "InvestUnitID", myreq.InvestUnitID); - int i = this->api->ReqQueryCFMMCTradingAccountToken(&myreq, reqid); - return i; -}; - -int TdApi::reqFromBankToFutureByFuture(const dict &req, int reqid) -{ - CThostFtdcReqTransferField myreq = CThostFtdcReqTransferField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "TradeCode", myreq.TradeCode); - getString(req, "BankID", myreq.BankID); - getString(req, "BankBranchID", myreq.BankBranchID); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "BrokerBranchID", myreq.BrokerBranchID); - getString(req, "TradeDate", myreq.TradeDate); - getString(req, "TradeTime", myreq.TradeTime); - getString(req, "BankSerial", myreq.BankSerial); - getString(req, "TradingDay", myreq.TradingDay); - getInt(req, "PlateSerial", &myreq.PlateSerial); - getChar(req, "LastFragment", &myreq.LastFragment); - getInt(req, "SessionID", &myreq.SessionID); - getString(req, "CustomerName", myreq.CustomerName); - getChar(req, "IdCardType", &myreq.IdCardType); - getString(req, "IdentifiedCardNo", myreq.IdentifiedCardNo); - getChar(req, "CustType", &myreq.CustType); - getString(req, "BankAccount", myreq.BankAccount); - getString(req, "BankPassWord", myreq.BankPassWord); - getString(req, "AccountID", myreq.AccountID); - getString(req, "Password", myreq.Password); - getInt(req, "InstallID", &myreq.InstallID); - getInt(req, "FutureSerial", &myreq.FutureSerial); - getString(req, "UserID", myreq.UserID); - getChar(req, "VerifyCertNoFlag", &myreq.VerifyCertNoFlag); - getString(req, "CurrencyID", myreq.CurrencyID); - getDouble(req, "TradeAmount", &myreq.TradeAmount); - getDouble(req, "FutureFetchAmount", &myreq.FutureFetchAmount); - getChar(req, "FeePayFlag", &myreq.FeePayFlag); - getDouble(req, "CustFee", &myreq.CustFee); - getDouble(req, "BrokerFee", &myreq.BrokerFee); - getString(req, "Message", myreq.Message); - getString(req, "Digest", myreq.Digest); - getChar(req, "BankAccType", &myreq.BankAccType); - getString(req, "DeviceID", myreq.DeviceID); - getChar(req, "BankSecuAccType", &myreq.BankSecuAccType); - getString(req, "BrokerIDByBank", myreq.BrokerIDByBank); - getString(req, "BankSecuAcc", myreq.BankSecuAcc); - getChar(req, "BankPwdFlag", &myreq.BankPwdFlag); - getChar(req, "SecuPwdFlag", &myreq.SecuPwdFlag); - getString(req, "OperNo", myreq.OperNo); - getInt(req, "RequestID", &myreq.RequestID); - getInt(req, "TID", &myreq.TID); - getChar(req, "TransferStatus", &myreq.TransferStatus); - getString(req, "LongCustomerName", myreq.LongCustomerName); - int i = this->api->ReqFromBankToFutureByFuture(&myreq, reqid); - return i; -}; - -int TdApi::reqFromFutureToBankByFuture(const dict &req, int reqid) -{ - CThostFtdcReqTransferField myreq = CThostFtdcReqTransferField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "TradeCode", myreq.TradeCode); - getString(req, "BankID", myreq.BankID); - getString(req, "BankBranchID", myreq.BankBranchID); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "BrokerBranchID", myreq.BrokerBranchID); - getString(req, "TradeDate", myreq.TradeDate); - getString(req, "TradeTime", myreq.TradeTime); - getString(req, "BankSerial", myreq.BankSerial); - getString(req, "TradingDay", myreq.TradingDay); - getInt(req, "PlateSerial", &myreq.PlateSerial); - getChar(req, "LastFragment", &myreq.LastFragment); - getInt(req, "SessionID", &myreq.SessionID); - getString(req, "CustomerName", myreq.CustomerName); - getChar(req, "IdCardType", &myreq.IdCardType); - getString(req, "IdentifiedCardNo", myreq.IdentifiedCardNo); - getChar(req, "CustType", &myreq.CustType); - getString(req, "BankAccount", myreq.BankAccount); - getString(req, "BankPassWord", myreq.BankPassWord); - getString(req, "AccountID", myreq.AccountID); - getString(req, "Password", myreq.Password); - getInt(req, "InstallID", &myreq.InstallID); - getInt(req, "FutureSerial", &myreq.FutureSerial); - getString(req, "UserID", myreq.UserID); - getChar(req, "VerifyCertNoFlag", &myreq.VerifyCertNoFlag); - getString(req, "CurrencyID", myreq.CurrencyID); - getDouble(req, "TradeAmount", &myreq.TradeAmount); - getDouble(req, "FutureFetchAmount", &myreq.FutureFetchAmount); - getChar(req, "FeePayFlag", &myreq.FeePayFlag); - getDouble(req, "CustFee", &myreq.CustFee); - getDouble(req, "BrokerFee", &myreq.BrokerFee); - getString(req, "Message", myreq.Message); - getString(req, "Digest", myreq.Digest); - getChar(req, "BankAccType", &myreq.BankAccType); - getString(req, "DeviceID", myreq.DeviceID); - getChar(req, "BankSecuAccType", &myreq.BankSecuAccType); - getString(req, "BrokerIDByBank", myreq.BrokerIDByBank); - getString(req, "BankSecuAcc", myreq.BankSecuAcc); - getChar(req, "BankPwdFlag", &myreq.BankPwdFlag); - getChar(req, "SecuPwdFlag", &myreq.SecuPwdFlag); - getString(req, "OperNo", myreq.OperNo); - getInt(req, "RequestID", &myreq.RequestID); - getInt(req, "TID", &myreq.TID); - getChar(req, "TransferStatus", &myreq.TransferStatus); - getString(req, "LongCustomerName", myreq.LongCustomerName); - int i = this->api->ReqFromFutureToBankByFuture(&myreq, reqid); - return i; -}; - -int TdApi::reqQueryBankAccountMoneyByFuture(const dict &req, int reqid) -{ - CThostFtdcReqQueryAccountField myreq = CThostFtdcReqQueryAccountField(); - memset(&myreq, 0, sizeof(myreq)); - getString(req, "TradeCode", myreq.TradeCode); - getString(req, "BankID", myreq.BankID); - getString(req, "BankBranchID", myreq.BankBranchID); - getString(req, "BrokerID", myreq.BrokerID); - getString(req, "BrokerBranchID", myreq.BrokerBranchID); - getString(req, "TradeDate", myreq.TradeDate); - getString(req, "TradeTime", myreq.TradeTime); - getString(req, "BankSerial", myreq.BankSerial); - getString(req, "TradingDay", myreq.TradingDay); - getInt(req, "PlateSerial", &myreq.PlateSerial); - getChar(req, "LastFragment", &myreq.LastFragment); - getInt(req, "SessionID", &myreq.SessionID); - getString(req, "CustomerName", myreq.CustomerName); - getChar(req, "IdCardType", &myreq.IdCardType); - getString(req, "IdentifiedCardNo", myreq.IdentifiedCardNo); - getChar(req, "CustType", &myreq.CustType); - getString(req, "BankAccount", myreq.BankAccount); - getString(req, "BankPassWord", myreq.BankPassWord); - getString(req, "AccountID", myreq.AccountID); - getString(req, "Password", myreq.Password); - getInt(req, "FutureSerial", &myreq.FutureSerial); - getInt(req, "InstallID", &myreq.InstallID); - getString(req, "UserID", myreq.UserID); - getChar(req, "VerifyCertNoFlag", &myreq.VerifyCertNoFlag); - getString(req, "CurrencyID", myreq.CurrencyID); - getString(req, "Digest", myreq.Digest); - getChar(req, "BankAccType", &myreq.BankAccType); - getString(req, "DeviceID", myreq.DeviceID); - getChar(req, "BankSecuAccType", &myreq.BankSecuAccType); - getString(req, "BrokerIDByBank", myreq.BrokerIDByBank); - getString(req, "BankSecuAcc", myreq.BankSecuAcc); - getChar(req, "BankPwdFlag", &myreq.BankPwdFlag); - getChar(req, "SecuPwdFlag", &myreq.SecuPwdFlag); - getString(req, "OperNo", myreq.OperNo); - getInt(req, "RequestID", &myreq.RequestID); - getInt(req, "TID", &myreq.TID); - getString(req, "LongCustomerName", myreq.LongCustomerName); - int i = this->api->ReqQueryBankAccountMoneyByFuture(&myreq, reqid); - return i; -}; - - -///------------------------------------------------------------------------------------- -///Boost.Python封装 -///------------------------------------------------------------------------------------- - -class PyTdApi : public TdApi -{ -public: - using TdApi::TdApi; - - void onFrontConnected() override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onFrontConnected); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onFrontDisconnected(int reqid) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onFrontDisconnected, reqid); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onHeartBeatWarning(int reqid) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onHeartBeatWarning, reqid); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspAuthenticate(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspAuthenticate, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspUserLogin(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspUserLogin, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspUserLogout(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspUserLogout, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspUserPasswordUpdate(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspUserPasswordUpdate, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspTradingAccountPasswordUpdate(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspTradingAccountPasswordUpdate, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspUserAuthMethod(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspUserAuthMethod, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspGenUserCaptcha(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspGenUserCaptcha, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspGenUserText(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspGenUserText, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspOrderInsert(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspOrderInsert, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspParkedOrderInsert(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspParkedOrderInsert, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspParkedOrderAction(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspParkedOrderAction, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspOrderAction(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspOrderAction, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQueryMaxOrderVolume(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQueryMaxOrderVolume, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspSettlementInfoConfirm(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspSettlementInfoConfirm, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspRemoveParkedOrder(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspRemoveParkedOrder, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspRemoveParkedOrderAction(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspRemoveParkedOrderAction, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspExecOrderInsert(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspExecOrderInsert, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspExecOrderAction(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspExecOrderAction, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspForQuoteInsert(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspForQuoteInsert, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQuoteInsert(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQuoteInsert, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQuoteAction(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQuoteAction, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspBatchOrderAction(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspBatchOrderAction, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspOptionSelfCloseInsert(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspOptionSelfCloseInsert, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspOptionSelfCloseAction(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspOptionSelfCloseAction, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspCombActionInsert(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspCombActionInsert, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryOrder(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryOrder, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryTrade(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryTrade, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryInvestorPosition(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryInvestorPosition, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryTradingAccount(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryTradingAccount, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryInvestor(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryInvestor, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryTradingCode(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryTradingCode, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryInstrumentMarginRate(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryInstrumentMarginRate, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryInstrumentCommissionRate(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryInstrumentCommissionRate, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryExchange(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryExchange, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryProduct(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryProduct, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryInstrument(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryInstrument, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryDepthMarketData(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryDepthMarketData, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQrySettlementInfo(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQrySettlementInfo, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryTransferBank(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryTransferBank, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryInvestorPositionDetail(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryInvestorPositionDetail, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryNotice(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryNotice, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQrySettlementInfoConfirm(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQrySettlementInfoConfirm, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryInvestorPositionCombineDetail(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryInvestorPositionCombineDetail, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryCFMMCTradingAccountKey(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryCFMMCTradingAccountKey, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryEWarrantOffset(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryEWarrantOffset, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryInvestorProductGroupMargin(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryInvestorProductGroupMargin, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryExchangeMarginRate(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryExchangeMarginRate, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryExchangeMarginRateAdjust(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryExchangeMarginRateAdjust, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryExchangeRate(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryExchangeRate, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQrySecAgentACIDMap(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQrySecAgentACIDMap, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryProductExchRate(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryProductExchRate, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryProductGroup(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryProductGroup, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryMMInstrumentCommissionRate(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryMMInstrumentCommissionRate, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryMMOptionInstrCommRate(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryMMOptionInstrCommRate, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryInstrumentOrderCommRate(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryInstrumentOrderCommRate, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQrySecAgentTradingAccount(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQrySecAgentTradingAccount, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQrySecAgentCheckMode(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQrySecAgentCheckMode, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQrySecAgentTradeInfo(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQrySecAgentTradeInfo, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryOptionInstrTradeCost(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryOptionInstrTradeCost, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryOptionInstrCommRate(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryOptionInstrCommRate, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryExecOrder(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryExecOrder, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryForQuote(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryForQuote, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryQuote(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryQuote, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryOptionSelfClose(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryOptionSelfClose, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryInvestUnit(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryInvestUnit, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryCombInstrumentGuard(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryCombInstrumentGuard, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryCombAction(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryCombAction, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryTransferSerial(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryTransferSerial, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryAccountregister(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryAccountregister, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspError(const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspError, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnOrder(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnOrder, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnTrade(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnTrade, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onErrRtnOrderInsert(const dict &data, const dict &error) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onErrRtnOrderInsert, data, error); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onErrRtnOrderAction(const dict &data, const dict &error) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onErrRtnOrderAction, data, error); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnInstrumentStatus(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnInstrumentStatus, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnBulletin(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnBulletin, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnTradingNotice(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnTradingNotice, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnErrorConditionalOrder(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnErrorConditionalOrder, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnExecOrder(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnExecOrder, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onErrRtnExecOrderInsert(const dict &data, const dict &error) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onErrRtnExecOrderInsert, data, error); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onErrRtnExecOrderAction(const dict &data, const dict &error) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onErrRtnExecOrderAction, data, error); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onErrRtnForQuoteInsert(const dict &data, const dict &error) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onErrRtnForQuoteInsert, data, error); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnQuote(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnQuote, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onErrRtnQuoteInsert(const dict &data, const dict &error) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onErrRtnQuoteInsert, data, error); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onErrRtnQuoteAction(const dict &data, const dict &error) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onErrRtnQuoteAction, data, error); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnForQuoteRsp(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnForQuoteRsp, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnCFMMCTradingAccountToken(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnCFMMCTradingAccountToken, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onErrRtnBatchOrderAction(const dict &data, const dict &error) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onErrRtnBatchOrderAction, data, error); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnOptionSelfClose(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnOptionSelfClose, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onErrRtnOptionSelfCloseInsert(const dict &data, const dict &error) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onErrRtnOptionSelfCloseInsert, data, error); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onErrRtnOptionSelfCloseAction(const dict &data, const dict &error) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onErrRtnOptionSelfCloseAction, data, error); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnCombAction(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnCombAction, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onErrRtnCombActionInsert(const dict &data, const dict &error) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onErrRtnCombActionInsert, data, error); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryContractBank(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryContractBank, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryParkedOrder(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryParkedOrder, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryParkedOrderAction(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryParkedOrderAction, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryTradingNotice(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryTradingNotice, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryBrokerTradingParams(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryBrokerTradingParams, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQryBrokerTradingAlgos(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQryBrokerTradingAlgos, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQueryCFMMCTradingAccountToken(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQueryCFMMCTradingAccountToken, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnFromBankToFutureByBank(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnFromBankToFutureByBank, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnFromFutureToBankByBank(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnFromFutureToBankByBank, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnRepealFromBankToFutureByBank(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnRepealFromBankToFutureByBank, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnRepealFromFutureToBankByBank(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnRepealFromFutureToBankByBank, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnFromBankToFutureByFuture(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnFromBankToFutureByFuture, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnFromFutureToBankByFuture(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnFromFutureToBankByFuture, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnRepealFromBankToFutureByFutureManual(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnRepealFromBankToFutureByFutureManual, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnRepealFromFutureToBankByFutureManual(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnRepealFromFutureToBankByFutureManual, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnQueryBankBalanceByFuture(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnQueryBankBalanceByFuture, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onErrRtnBankToFutureByFuture(const dict &data, const dict &error) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onErrRtnBankToFutureByFuture, data, error); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onErrRtnFutureToBankByFuture(const dict &data, const dict &error) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onErrRtnFutureToBankByFuture, data, error); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onErrRtnRepealBankToFutureByFutureManual(const dict &data, const dict &error) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onErrRtnRepealBankToFutureByFutureManual, data, error); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onErrRtnRepealFutureToBankByFutureManual(const dict &data, const dict &error) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onErrRtnRepealFutureToBankByFutureManual, data, error); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onErrRtnQueryBankBalanceByFuture(const dict &data, const dict &error) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onErrRtnQueryBankBalanceByFuture, data, error); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnRepealFromBankToFutureByFuture(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnRepealFromBankToFutureByFuture, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnRepealFromFutureToBankByFuture(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnRepealFromFutureToBankByFuture, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspFromBankToFutureByFuture(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspFromBankToFutureByFuture, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspFromFutureToBankByFuture(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspFromFutureToBankByFuture, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRspQueryBankAccountMoneyByFuture(const dict &data, const dict &error, int reqid, bool last) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRspQueryBankAccountMoneyByFuture, data, error, reqid, last); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnOpenAccountByBank(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnOpenAccountByBank, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnCancelAccountByBank(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnCancelAccountByBank, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - void onRtnChangeAccountByBank(const dict &data) override - { - try - { - PYBIND11_OVERLOAD(void, TdApi, onRtnChangeAccountByBank, data); - } - catch (const error_already_set &e) - { - cout << e.what() << endl; - } - }; - - -}; - - -PYBIND11_MODULE(vnctptd, m) -{ - class_ TdApi(m, "TdApi", module_local()); - TdApi - .def(init<>()) - .def("createFtdcTraderApi", &TdApi::createFtdcTraderApi) - .def("release", &TdApi::release) - .def("init", &TdApi::init) - .def("join", &TdApi::join) - .def("exit", &TdApi::exit) - .def("getTradingDay", &TdApi::getTradingDay) - .def("registerFront", &TdApi::registerFront) - .def("subscribePublicTopic", &TdApi::subscribePublicTopic) - .def("subscribePrivateTopic", &TdApi::subscribePrivateTopic) - - .def("reqAuthenticate", &TdApi::reqAuthenticate) - .def("reqUserLogin", &TdApi::reqUserLogin) - .def("reqUserLogout", &TdApi::reqUserLogout) - .def("reqUserPasswordUpdate", &TdApi::reqUserPasswordUpdate) - .def("reqTradingAccountPasswordUpdate", &TdApi::reqTradingAccountPasswordUpdate) - .def("reqUserAuthMethod", &TdApi::reqUserAuthMethod) - .def("reqGenUserCaptcha", &TdApi::reqGenUserCaptcha) - .def("reqGenUserText", &TdApi::reqGenUserText) - .def("reqUserLoginWithCaptcha", &TdApi::reqUserLoginWithCaptcha) - .def("reqUserLoginWithText", &TdApi::reqUserLoginWithText) - .def("reqUserLoginWithOTP", &TdApi::reqUserLoginWithOTP) - .def("reqOrderInsert", &TdApi::reqOrderInsert) - .def("reqParkedOrderInsert", &TdApi::reqParkedOrderInsert) - .def("reqParkedOrderAction", &TdApi::reqParkedOrderAction) - .def("reqOrderAction", &TdApi::reqOrderAction) - .def("reqQueryMaxOrderVolume", &TdApi::reqQueryMaxOrderVolume) - .def("reqSettlementInfoConfirm", &TdApi::reqSettlementInfoConfirm) - .def("reqRemoveParkedOrder", &TdApi::reqRemoveParkedOrder) - .def("reqRemoveParkedOrderAction", &TdApi::reqRemoveParkedOrderAction) - .def("reqExecOrderInsert", &TdApi::reqExecOrderInsert) - .def("reqExecOrderAction", &TdApi::reqExecOrderAction) - .def("reqForQuoteInsert", &TdApi::reqForQuoteInsert) - .def("reqQuoteInsert", &TdApi::reqQuoteInsert) - .def("reqQuoteAction", &TdApi::reqQuoteAction) - .def("reqBatchOrderAction", &TdApi::reqBatchOrderAction) - .def("reqOptionSelfCloseInsert", &TdApi::reqOptionSelfCloseInsert) - .def("reqOptionSelfCloseAction", &TdApi::reqOptionSelfCloseAction) - .def("reqCombActionInsert", &TdApi::reqCombActionInsert) - .def("reqQryOrder", &TdApi::reqQryOrder) - .def("reqQryTrade", &TdApi::reqQryTrade) - .def("reqQryInvestorPosition", &TdApi::reqQryInvestorPosition) - .def("reqQryTradingAccount", &TdApi::reqQryTradingAccount) - .def("reqQryInvestor", &TdApi::reqQryInvestor) - .def("reqQryTradingCode", &TdApi::reqQryTradingCode) - .def("reqQryInstrumentMarginRate", &TdApi::reqQryInstrumentMarginRate) - .def("reqQryInstrumentCommissionRate", &TdApi::reqQryInstrumentCommissionRate) - .def("reqQryExchange", &TdApi::reqQryExchange) - .def("reqQryProduct", &TdApi::reqQryProduct) - .def("reqQryInstrument", &TdApi::reqQryInstrument) - .def("reqQryDepthMarketData", &TdApi::reqQryDepthMarketData) - .def("reqQrySettlementInfo", &TdApi::reqQrySettlementInfo) - .def("reqQryTransferBank", &TdApi::reqQryTransferBank) - .def("reqQryInvestorPositionDetail", &TdApi::reqQryInvestorPositionDetail) - .def("reqQryNotice", &TdApi::reqQryNotice) - .def("reqQrySettlementInfoConfirm", &TdApi::reqQrySettlementInfoConfirm) - .def("reqQryInvestorPositionCombineDetail", &TdApi::reqQryInvestorPositionCombineDetail) - .def("reqQryCFMMCTradingAccountKey", &TdApi::reqQryCFMMCTradingAccountKey) - .def("reqQryEWarrantOffset", &TdApi::reqQryEWarrantOffset) - .def("reqQryInvestorProductGroupMargin", &TdApi::reqQryInvestorProductGroupMargin) - .def("reqQryExchangeMarginRate", &TdApi::reqQryExchangeMarginRate) - .def("reqQryExchangeMarginRateAdjust", &TdApi::reqQryExchangeMarginRateAdjust) - .def("reqQryExchangeRate", &TdApi::reqQryExchangeRate) - .def("reqQrySecAgentACIDMap", &TdApi::reqQrySecAgentACIDMap) - .def("reqQryProductExchRate", &TdApi::reqQryProductExchRate) - .def("reqQryProductGroup", &TdApi::reqQryProductGroup) - .def("reqQryMMInstrumentCommissionRate", &TdApi::reqQryMMInstrumentCommissionRate) - .def("reqQryMMOptionInstrCommRate", &TdApi::reqQryMMOptionInstrCommRate) - .def("reqQryInstrumentOrderCommRate", &TdApi::reqQryInstrumentOrderCommRate) - .def("reqQrySecAgentTradingAccount", &TdApi::reqQrySecAgentTradingAccount) - .def("reqQrySecAgentCheckMode", &TdApi::reqQrySecAgentCheckMode) - .def("reqQrySecAgentTradeInfo", &TdApi::reqQrySecAgentTradeInfo) - .def("reqQryOptionInstrTradeCost", &TdApi::reqQryOptionInstrTradeCost) - .def("reqQryOptionInstrCommRate", &TdApi::reqQryOptionInstrCommRate) - .def("reqQryExecOrder", &TdApi::reqQryExecOrder) - .def("reqQryForQuote", &TdApi::reqQryForQuote) - .def("reqQryQuote", &TdApi::reqQryQuote) - .def("reqQryOptionSelfClose", &TdApi::reqQryOptionSelfClose) - .def("reqQryInvestUnit", &TdApi::reqQryInvestUnit) - .def("reqQryCombInstrumentGuard", &TdApi::reqQryCombInstrumentGuard) - .def("reqQryCombAction", &TdApi::reqQryCombAction) - .def("reqQryTransferSerial", &TdApi::reqQryTransferSerial) - .def("reqQryAccountregister", &TdApi::reqQryAccountregister) - .def("reqQryContractBank", &TdApi::reqQryContractBank) - .def("reqQryParkedOrder", &TdApi::reqQryParkedOrder) - .def("reqQryParkedOrderAction", &TdApi::reqQryParkedOrderAction) - .def("reqQryTradingNotice", &TdApi::reqQryTradingNotice) - .def("reqQryBrokerTradingParams", &TdApi::reqQryBrokerTradingParams) - .def("reqQryBrokerTradingAlgos", &TdApi::reqQryBrokerTradingAlgos) - .def("reqQueryCFMMCTradingAccountToken", &TdApi::reqQueryCFMMCTradingAccountToken) - .def("reqFromBankToFutureByFuture", &TdApi::reqFromBankToFutureByFuture) - .def("reqFromFutureToBankByFuture", &TdApi::reqFromFutureToBankByFuture) - .def("reqQueryBankAccountMoneyByFuture", &TdApi::reqQueryBankAccountMoneyByFuture) - - .def("onFrontConnected", &TdApi::onFrontConnected) - .def("onFrontDisconnected", &TdApi::onFrontDisconnected) - .def("onHeartBeatWarning", &TdApi::onHeartBeatWarning) - .def("onRspAuthenticate", &TdApi::onRspAuthenticate) - .def("onRspUserLogin", &TdApi::onRspUserLogin) - .def("onRspUserLogout", &TdApi::onRspUserLogout) - .def("onRspUserPasswordUpdate", &TdApi::onRspUserPasswordUpdate) - .def("onRspTradingAccountPasswordUpdate", &TdApi::onRspTradingAccountPasswordUpdate) - .def("onRspUserAuthMethod", &TdApi::onRspUserAuthMethod) - .def("onRspGenUserCaptcha", &TdApi::onRspGenUserCaptcha) - .def("onRspGenUserText", &TdApi::onRspGenUserText) - .def("onRspOrderInsert", &TdApi::onRspOrderInsert) - .def("onRspParkedOrderInsert", &TdApi::onRspParkedOrderInsert) - .def("onRspParkedOrderAction", &TdApi::onRspParkedOrderAction) - .def("onRspOrderAction", &TdApi::onRspOrderAction) - .def("onRspQueryMaxOrderVolume", &TdApi::onRspQueryMaxOrderVolume) - .def("onRspSettlementInfoConfirm", &TdApi::onRspSettlementInfoConfirm) - .def("onRspRemoveParkedOrder", &TdApi::onRspRemoveParkedOrder) - .def("onRspRemoveParkedOrderAction", &TdApi::onRspRemoveParkedOrderAction) - .def("onRspExecOrderInsert", &TdApi::onRspExecOrderInsert) - .def("onRspExecOrderAction", &TdApi::onRspExecOrderAction) - .def("onRspForQuoteInsert", &TdApi::onRspForQuoteInsert) - .def("onRspQuoteInsert", &TdApi::onRspQuoteInsert) - .def("onRspQuoteAction", &TdApi::onRspQuoteAction) - .def("onRspBatchOrderAction", &TdApi::onRspBatchOrderAction) - .def("onRspOptionSelfCloseInsert", &TdApi::onRspOptionSelfCloseInsert) - .def("onRspOptionSelfCloseAction", &TdApi::onRspOptionSelfCloseAction) - .def("onRspCombActionInsert", &TdApi::onRspCombActionInsert) - .def("onRspQryOrder", &TdApi::onRspQryOrder) - .def("onRspQryTrade", &TdApi::onRspQryTrade) - .def("onRspQryInvestorPosition", &TdApi::onRspQryInvestorPosition) - .def("onRspQryTradingAccount", &TdApi::onRspQryTradingAccount) - .def("onRspQryInvestor", &TdApi::onRspQryInvestor) - .def("onRspQryTradingCode", &TdApi::onRspQryTradingCode) - .def("onRspQryInstrumentMarginRate", &TdApi::onRspQryInstrumentMarginRate) - .def("onRspQryInstrumentCommissionRate", &TdApi::onRspQryInstrumentCommissionRate) - .def("onRspQryExchange", &TdApi::onRspQryExchange) - .def("onRspQryProduct", &TdApi::onRspQryProduct) - .def("onRspQryInstrument", &TdApi::onRspQryInstrument) - .def("onRspQryDepthMarketData", &TdApi::onRspQryDepthMarketData) - .def("onRspQrySettlementInfo", &TdApi::onRspQrySettlementInfo) - .def("onRspQryTransferBank", &TdApi::onRspQryTransferBank) - .def("onRspQryInvestorPositionDetail", &TdApi::onRspQryInvestorPositionDetail) - .def("onRspQryNotice", &TdApi::onRspQryNotice) - .def("onRspQrySettlementInfoConfirm", &TdApi::onRspQrySettlementInfoConfirm) - .def("onRspQryInvestorPositionCombineDetail", &TdApi::onRspQryInvestorPositionCombineDetail) - .def("onRspQryCFMMCTradingAccountKey", &TdApi::onRspQryCFMMCTradingAccountKey) - .def("onRspQryEWarrantOffset", &TdApi::onRspQryEWarrantOffset) - .def("onRspQryInvestorProductGroupMargin", &TdApi::onRspQryInvestorProductGroupMargin) - .def("onRspQryExchangeMarginRate", &TdApi::onRspQryExchangeMarginRate) - .def("onRspQryExchangeMarginRateAdjust", &TdApi::onRspQryExchangeMarginRateAdjust) - .def("onRspQryExchangeRate", &TdApi::onRspQryExchangeRate) - .def("onRspQrySecAgentACIDMap", &TdApi::onRspQrySecAgentACIDMap) - .def("onRspQryProductExchRate", &TdApi::onRspQryProductExchRate) - .def("onRspQryProductGroup", &TdApi::onRspQryProductGroup) - .def("onRspQryMMInstrumentCommissionRate", &TdApi::onRspQryMMInstrumentCommissionRate) - .def("onRspQryMMOptionInstrCommRate", &TdApi::onRspQryMMOptionInstrCommRate) - .def("onRspQryInstrumentOrderCommRate", &TdApi::onRspQryInstrumentOrderCommRate) - .def("onRspQrySecAgentTradingAccount", &TdApi::onRspQrySecAgentTradingAccount) - .def("onRspQrySecAgentCheckMode", &TdApi::onRspQrySecAgentCheckMode) - .def("onRspQrySecAgentTradeInfo", &TdApi::onRspQrySecAgentTradeInfo) - .def("onRspQryOptionInstrTradeCost", &TdApi::onRspQryOptionInstrTradeCost) - .def("onRspQryOptionInstrCommRate", &TdApi::onRspQryOptionInstrCommRate) - .def("onRspQryExecOrder", &TdApi::onRspQryExecOrder) - .def("onRspQryForQuote", &TdApi::onRspQryForQuote) - .def("onRspQryQuote", &TdApi::onRspQryQuote) - .def("onRspQryOptionSelfClose", &TdApi::onRspQryOptionSelfClose) - .def("onRspQryInvestUnit", &TdApi::onRspQryInvestUnit) - .def("onRspQryCombInstrumentGuard", &TdApi::onRspQryCombInstrumentGuard) - .def("onRspQryCombAction", &TdApi::onRspQryCombAction) - .def("onRspQryTransferSerial", &TdApi::onRspQryTransferSerial) - .def("onRspQryAccountregister", &TdApi::onRspQryAccountregister) - .def("onRspError", &TdApi::onRspError) - .def("onRtnOrder", &TdApi::onRtnOrder) - .def("onRtnTrade", &TdApi::onRtnTrade) - .def("onErrRtnOrderInsert", &TdApi::onErrRtnOrderInsert) - .def("onErrRtnOrderAction", &TdApi::onErrRtnOrderAction) - .def("onRtnInstrumentStatus", &TdApi::onRtnInstrumentStatus) - .def("onRtnBulletin", &TdApi::onRtnBulletin) - .def("onRtnTradingNotice", &TdApi::onRtnTradingNotice) - .def("onRtnErrorConditionalOrder", &TdApi::onRtnErrorConditionalOrder) - .def("onRtnExecOrder", &TdApi::onRtnExecOrder) - .def("onErrRtnExecOrderInsert", &TdApi::onErrRtnExecOrderInsert) - .def("onErrRtnExecOrderAction", &TdApi::onErrRtnExecOrderAction) - .def("onErrRtnForQuoteInsert", &TdApi::onErrRtnForQuoteInsert) - .def("onRtnQuote", &TdApi::onRtnQuote) - .def("onErrRtnQuoteInsert", &TdApi::onErrRtnQuoteInsert) - .def("onErrRtnQuoteAction", &TdApi::onErrRtnQuoteAction) - .def("onRtnForQuoteRsp", &TdApi::onRtnForQuoteRsp) - .def("onRtnCFMMCTradingAccountToken", &TdApi::onRtnCFMMCTradingAccountToken) - .def("onErrRtnBatchOrderAction", &TdApi::onErrRtnBatchOrderAction) - .def("onRtnOptionSelfClose", &TdApi::onRtnOptionSelfClose) - .def("onErrRtnOptionSelfCloseInsert", &TdApi::onErrRtnOptionSelfCloseInsert) - .def("onErrRtnOptionSelfCloseAction", &TdApi::onErrRtnOptionSelfCloseAction) - .def("onRtnCombAction", &TdApi::onRtnCombAction) - .def("onErrRtnCombActionInsert", &TdApi::onErrRtnCombActionInsert) - .def("onRspQryContractBank", &TdApi::onRspQryContractBank) - .def("onRspQryParkedOrder", &TdApi::onRspQryParkedOrder) - .def("onRspQryParkedOrderAction", &TdApi::onRspQryParkedOrderAction) - .def("onRspQryTradingNotice", &TdApi::onRspQryTradingNotice) - .def("onRspQryBrokerTradingParams", &TdApi::onRspQryBrokerTradingParams) - .def("onRspQryBrokerTradingAlgos", &TdApi::onRspQryBrokerTradingAlgos) - .def("onRspQueryCFMMCTradingAccountToken", &TdApi::onRspQueryCFMMCTradingAccountToken) - .def("onRtnFromBankToFutureByBank", &TdApi::onRtnFromBankToFutureByBank) - .def("onRtnFromFutureToBankByBank", &TdApi::onRtnFromFutureToBankByBank) - .def("onRtnRepealFromBankToFutureByBank", &TdApi::onRtnRepealFromBankToFutureByBank) - .def("onRtnRepealFromFutureToBankByBank", &TdApi::onRtnRepealFromFutureToBankByBank) - .def("onRtnFromBankToFutureByFuture", &TdApi::onRtnFromBankToFutureByFuture) - .def("onRtnFromFutureToBankByFuture", &TdApi::onRtnFromFutureToBankByFuture) - .def("onRtnRepealFromBankToFutureByFutureManual", &TdApi::onRtnRepealFromBankToFutureByFutureManual) - .def("onRtnRepealFromFutureToBankByFutureManual", &TdApi::onRtnRepealFromFutureToBankByFutureManual) - .def("onRtnQueryBankBalanceByFuture", &TdApi::onRtnQueryBankBalanceByFuture) - .def("onErrRtnBankToFutureByFuture", &TdApi::onErrRtnBankToFutureByFuture) - .def("onErrRtnFutureToBankByFuture", &TdApi::onErrRtnFutureToBankByFuture) - .def("onErrRtnRepealBankToFutureByFutureManual", &TdApi::onErrRtnRepealBankToFutureByFutureManual) - .def("onErrRtnRepealFutureToBankByFutureManual", &TdApi::onErrRtnRepealFutureToBankByFutureManual) - .def("onErrRtnQueryBankBalanceByFuture", &TdApi::onErrRtnQueryBankBalanceByFuture) - .def("onRtnRepealFromBankToFutureByFuture", &TdApi::onRtnRepealFromBankToFutureByFuture) - .def("onRtnRepealFromFutureToBankByFuture", &TdApi::onRtnRepealFromFutureToBankByFuture) - .def("onRspFromBankToFutureByFuture", &TdApi::onRspFromBankToFutureByFuture) - .def("onRspFromFutureToBankByFuture", &TdApi::onRspFromFutureToBankByFuture) - .def("onRspQueryBankAccountMoneyByFuture", &TdApi::onRspQueryBankAccountMoneyByFuture) - .def("onRtnOpenAccountByBank", &TdApi::onRtnOpenAccountByBank) - .def("onRtnCancelAccountByBank", &TdApi::onRtnCancelAccountByBank) - .def("onRtnChangeAccountByBank", &TdApi::onRtnChangeAccountByBank) - ; -} diff --git a/vnpy/api/mini/vnctp/vnctptd/vnctptd.h b/vnpy/api/mini/vnctp/vnctptd/vnctptd.h deleted file mode 100644 index dbfb3c8d..00000000 --- a/vnpy/api/mini/vnctp/vnctptd/vnctptd.h +++ /dev/null @@ -1,1252 +0,0 @@ -//系统 -#ifdef WIN32 -#include "stdafx.h" -#endif - -#include "vnctp.h" -#include "pybind11/pybind11.h" -#include "ctp/ThostFtdcTraderApi.h" - - -using namespace pybind11; - -//常量 -#define ONFRONTCONNECTED 0 -#define ONFRONTDISCONNECTED 1 -#define ONHEARTBEATWARNING 2 -#define ONRSPAUTHENTICATE 3 -#define ONRSPUSERLOGIN 4 -#define ONRSPUSERLOGOUT 5 -#define ONRSPUSERPASSWORDUPDATE 6 -#define ONRSPTRADINGACCOUNTPASSWORDUPDATE 7 -#define ONRSPUSERAUTHMETHOD 8 -#define ONRSPGENUSERCAPTCHA 9 -#define ONRSPGENUSERTEXT 10 -#define ONRSPORDERINSERT 11 -#define ONRSPPARKEDORDERINSERT 12 -#define ONRSPPARKEDORDERACTION 13 -#define ONRSPORDERACTION 14 -#define ONRSPQUERYMAXORDERVOLUME 15 -#define ONRSPSETTLEMENTINFOCONFIRM 16 -#define ONRSPREMOVEPARKEDORDER 17 -#define ONRSPREMOVEPARKEDORDERACTION 18 -#define ONRSPEXECORDERINSERT 19 -#define ONRSPEXECORDERACTION 20 -#define ONRSPFORQUOTEINSERT 21 -#define ONRSPQUOTEINSERT 22 -#define ONRSPQUOTEACTION 23 -#define ONRSPBATCHORDERACTION 24 -#define ONRSPOPTIONSELFCLOSEINSERT 25 -#define ONRSPOPTIONSELFCLOSEACTION 26 -#define ONRSPCOMBACTIONINSERT 27 -#define ONRSPQRYORDER 28 -#define ONRSPQRYTRADE 29 -#define ONRSPQRYINVESTORPOSITION 30 -#define ONRSPQRYTRADINGACCOUNT 31 -#define ONRSPQRYINVESTOR 32 -#define ONRSPQRYTRADINGCODE 33 -#define ONRSPQRYINSTRUMENTMARGINRATE 34 -#define ONRSPQRYINSTRUMENTCOMMISSIONRATE 35 -#define ONRSPQRYEXCHANGE 36 -#define ONRSPQRYPRODUCT 37 -#define ONRSPQRYINSTRUMENT 38 -#define ONRSPQRYDEPTHMARKETDATA 39 -#define ONRSPQRYSETTLEMENTINFO 40 -#define ONRSPQRYTRANSFERBANK 41 -#define ONRSPQRYINVESTORPOSITIONDETAIL 42 -#define ONRSPQRYNOTICE 43 -#define ONRSPQRYSETTLEMENTINFOCONFIRM 44 -#define ONRSPQRYINVESTORPOSITIONCOMBINEDETAIL 45 -#define ONRSPQRYCFMMCTRADINGACCOUNTKEY 46 -#define ONRSPQRYEWARRANTOFFSET 47 -#define ONRSPQRYINVESTORPRODUCTGROUPMARGIN 48 -#define ONRSPQRYEXCHANGEMARGINRATE 49 -#define ONRSPQRYEXCHANGEMARGINRATEADJUST 50 -#define ONRSPQRYEXCHANGERATE 51 -#define ONRSPQRYSECAGENTACIDMAP 52 -#define ONRSPQRYPRODUCTEXCHRATE 53 -#define ONRSPQRYPRODUCTGROUP 54 -#define ONRSPQRYMMINSTRUMENTCOMMISSIONRATE 55 -#define ONRSPQRYMMOPTIONINSTRCOMMRATE 56 -#define ONRSPQRYINSTRUMENTORDERCOMMRATE 57 -#define ONRSPQRYSECAGENTTRADINGACCOUNT 58 -#define ONRSPQRYSECAGENTCHECKMODE 59 -#define ONRSPQRYSECAGENTTRADEINFO 60 -#define ONRSPQRYOPTIONINSTRTRADECOST 61 -#define ONRSPQRYOPTIONINSTRCOMMRATE 62 -#define ONRSPQRYEXECORDER 63 -#define ONRSPQRYFORQUOTE 64 -#define ONRSPQRYQUOTE 65 -#define ONRSPQRYOPTIONSELFCLOSE 66 -#define ONRSPQRYINVESTUNIT 67 -#define ONRSPQRYCOMBINSTRUMENTGUARD 68 -#define ONRSPQRYCOMBACTION 69 -#define ONRSPQRYTRANSFERSERIAL 70 -#define ONRSPQRYACCOUNTREGISTER 71 -#define ONRSPERROR 72 -#define ONRTNORDER 73 -#define ONRTNTRADE 74 -#define ONERRRTNORDERINSERT 75 -#define ONERRRTNORDERACTION 76 -#define ONRTNINSTRUMENTSTATUS 77 -#define ONRTNBULLETIN 78 -#define ONRTNTRADINGNOTICE 79 -#define ONRTNERRORCONDITIONALORDER 80 -#define ONRTNEXECORDER 81 -#define ONERRRTNEXECORDERINSERT 82 -#define ONERRRTNEXECORDERACTION 83 -#define ONERRRTNFORQUOTEINSERT 84 -#define ONRTNQUOTE 85 -#define ONERRRTNQUOTEINSERT 86 -#define ONERRRTNQUOTEACTION 87 -#define ONRTNFORQUOTERSP 88 -#define ONRTNCFMMCTRADINGACCOUNTTOKEN 89 -#define ONERRRTNBATCHORDERACTION 90 -#define ONRTNOPTIONSELFCLOSE 91 -#define ONERRRTNOPTIONSELFCLOSEINSERT 92 -#define ONERRRTNOPTIONSELFCLOSEACTION 93 -#define ONRTNCOMBACTION 94 -#define ONERRRTNCOMBACTIONINSERT 95 -#define ONRSPQRYCONTRACTBANK 96 -#define ONRSPQRYPARKEDORDER 97 -#define ONRSPQRYPARKEDORDERACTION 98 -#define ONRSPQRYTRADINGNOTICE 99 -#define ONRSPQRYBROKERTRADINGPARAMS 100 -#define ONRSPQRYBROKERTRADINGALGOS 101 -#define ONRSPQUERYCFMMCTRADINGACCOUNTTOKEN 102 -#define ONRTNFROMBANKTOFUTUREBYBANK 103 -#define ONRTNFROMFUTURETOBANKBYBANK 104 -#define ONRTNREPEALFROMBANKTOFUTUREBYBANK 105 -#define ONRTNREPEALFROMFUTURETOBANKBYBANK 106 -#define ONRTNFROMBANKTOFUTUREBYFUTURE 107 -#define ONRTNFROMFUTURETOBANKBYFUTURE 108 -#define ONRTNREPEALFROMBANKTOFUTUREBYFUTUREMANUAL 109 -#define ONRTNREPEALFROMFUTURETOBANKBYFUTUREMANUAL 110 -#define ONRTNQUERYBANKBALANCEBYFUTURE 111 -#define ONERRRTNBANKTOFUTUREBYFUTURE 112 -#define ONERRRTNFUTURETOBANKBYFUTURE 113 -#define ONERRRTNREPEALBANKTOFUTUREBYFUTUREMANUAL 114 -#define ONERRRTNREPEALFUTURETOBANKBYFUTUREMANUAL 115 -#define ONERRRTNQUERYBANKBALANCEBYFUTURE 116 -#define ONRTNREPEALFROMBANKTOFUTUREBYFUTURE 117 -#define ONRTNREPEALFROMFUTURETOBANKBYFUTURE 118 -#define ONRSPFROMBANKTOFUTUREBYFUTURE 119 -#define ONRSPFROMFUTURETOBANKBYFUTURE 120 -#define ONRSPQUERYBANKACCOUNTMONEYBYFUTURE 121 -#define ONRTNOPENACCOUNTBYBANK 122 -#define ONRTNCANCELACCOUNTBYBANK 123 -#define ONRTNCHANGEACCOUNTBYBANK 124 - - -///------------------------------------------------------------------------------------- -///C++ SPI的回调函数方法实现 -///------------------------------------------------------------------------------------- - -//API的继承实现 -class TdApi : public CThostFtdcTraderSpi -{ -private: - CThostFtdcTraderApi* api; //API对象 - thread task_thread; //工作线程指针(向python中推送数据) - TaskQueue task_queue; //任务队列 - bool active = false; //工作状态 - -public: - TdApi() - { - }; - - ~TdApi() - { - if (this->active) - { - this->exit(); - } - }; - - //------------------------------------------------------------------------------------- - //API回调函数 - //------------------------------------------------------------------------------------- - - ///当客户端与交易后台建立起通信连接时(还未登录前),该方法被调用。 - virtual void OnFrontConnected(); - - ///当客户端与交易后台通信连接断开时,该方法被调用。当发生这个情况后,API会自动重新连接,客户端可不做处理。 - ///@param nReason 错误原因 - /// 0x1001 网络读失败 - /// 0x1002 网络写失败 - /// 0x2001 接收心跳超时 - /// 0x2002 发送心跳失败 - /// 0x2003 收到错误报文 - virtual void OnFrontDisconnected(int nReason); - - ///心跳超时警告。当长时间未收到报文时,该方法被调用。 - ///@param nTimeLapse 距离上次接收报文的时间 - virtual void OnHeartBeatWarning(int nTimeLapse); - - ///客户端认证响应 - virtual void OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthenticateField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - - ///登录请求响应 - virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///登出请求响应 - virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///用户口令更新请求响应 - virtual void OnRspUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///资金账户口令更新请求响应 - virtual void OnRspTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///查询用户当前支持的认证模式的回复 - virtual void OnRspUserAuthMethod(CThostFtdcRspUserAuthMethodField *pRspUserAuthMethod, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///获取图形验证码请求的回复 - virtual void OnRspGenUserCaptcha(CThostFtdcRspGenUserCaptchaField *pRspGenUserCaptcha, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///获取短信验证码请求的回复 - virtual void OnRspGenUserText(CThostFtdcRspGenUserTextField *pRspGenUserText, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///报单录入请求响应 - virtual void OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///预埋单录入请求响应 - virtual void OnRspParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///预埋撤单录入请求响应 - virtual void OnRspParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///报单操作请求响应 - virtual void OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///查询最大报单数量响应 - virtual void OnRspQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///投资者结算结果确认响应 - virtual void OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///删除预埋单响应 - virtual void OnRspRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///删除预埋撤单响应 - virtual void OnRspRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///执行宣告录入请求响应 - virtual void OnRspExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///执行宣告操作请求响应 - virtual void OnRspExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///询价录入请求响应 - virtual void OnRspForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///报价录入请求响应 - virtual void OnRspQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///报价操作请求响应 - virtual void OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///批量报单操作请求响应 - virtual void OnRspBatchOrderAction(CThostFtdcInputBatchOrderActionField *pInputBatchOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///期权自对冲录入请求响应 - virtual void OnRspOptionSelfCloseInsert(CThostFtdcInputOptionSelfCloseField *pInputOptionSelfClose, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///期权自对冲操作请求响应 - virtual void OnRspOptionSelfCloseAction(CThostFtdcInputOptionSelfCloseActionField *pInputOptionSelfCloseAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///申请组合录入请求响应 - virtual void OnRspCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询报单响应 - virtual void OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询成交响应 - virtual void OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询投资者持仓响应 - virtual void OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询资金账户响应 - virtual void OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询投资者响应 - virtual void OnRspQryInvestor(CThostFtdcInvestorField *pInvestor, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询交易编码响应 - virtual void OnRspQryTradingCode(CThostFtdcTradingCodeField *pTradingCode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询合约保证金率响应 - virtual void OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询合约手续费率响应 - virtual void OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询交易所响应 - virtual void OnRspQryExchange(CThostFtdcExchangeField *pExchange, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询产品响应 - virtual void OnRspQryProduct(CThostFtdcProductField *pProduct, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询合约响应 - virtual void OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询行情响应 - virtual void OnRspQryDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询投资者结算结果响应 - virtual void OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询转帐银行响应 - virtual void OnRspQryTransferBank(CThostFtdcTransferBankField *pTransferBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询投资者持仓明细响应 - virtual void OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询客户通知响应 - virtual void OnRspQryNotice(CThostFtdcNoticeField *pNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询结算信息确认响应 - virtual void OnRspQrySettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询投资者持仓明细响应 - virtual void OnRspQryInvestorPositionCombineDetail(CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///查询保证金监管系统经纪公司资金账户密钥响应 - virtual void OnRspQryCFMMCTradingAccountKey(CThostFtdcCFMMCTradingAccountKeyField *pCFMMCTradingAccountKey, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询仓单折抵信息响应 - virtual void OnRspQryEWarrantOffset(CThostFtdcEWarrantOffsetField *pEWarrantOffset, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询投资者品种/跨品种保证金响应 - virtual void OnRspQryInvestorProductGroupMargin(CThostFtdcInvestorProductGroupMarginField *pInvestorProductGroupMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询交易所保证金率响应 - virtual void OnRspQryExchangeMarginRate(CThostFtdcExchangeMarginRateField *pExchangeMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询交易所调整保证金率响应 - virtual void OnRspQryExchangeMarginRateAdjust(CThostFtdcExchangeMarginRateAdjustField *pExchangeMarginRateAdjust, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询汇率响应 - virtual void OnRspQryExchangeRate(CThostFtdcExchangeRateField *pExchangeRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询二级代理操作员银期权限响应 - virtual void OnRspQrySecAgentACIDMap(CThostFtdcSecAgentACIDMapField *pSecAgentACIDMap, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询产品报价汇率 - virtual void OnRspQryProductExchRate(CThostFtdcProductExchRateField *pProductExchRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询产品组 - virtual void OnRspQryProductGroup(CThostFtdcProductGroupField *pProductGroup, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询做市商合约手续费率响应 - virtual void OnRspQryMMInstrumentCommissionRate(CThostFtdcMMInstrumentCommissionRateField *pMMInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询做市商期权合约手续费响应 - virtual void OnRspQryMMOptionInstrCommRate(CThostFtdcMMOptionInstrCommRateField *pMMOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询报单手续费响应 - virtual void OnRspQryInstrumentOrderCommRate(CThostFtdcInstrumentOrderCommRateField *pInstrumentOrderCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询资金账户响应 - virtual void OnRspQrySecAgentTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询二级代理商资金校验模式响应 - virtual void OnRspQrySecAgentCheckMode(CThostFtdcSecAgentCheckModeField *pSecAgentCheckMode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询二级代理商信息响应 - virtual void OnRspQrySecAgentTradeInfo(CThostFtdcSecAgentTradeInfoField *pSecAgentTradeInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询期权交易成本响应 - virtual void OnRspQryOptionInstrTradeCost(CThostFtdcOptionInstrTradeCostField *pOptionInstrTradeCost, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询期权合约手续费响应 - virtual void OnRspQryOptionInstrCommRate(CThostFtdcOptionInstrCommRateField *pOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询执行宣告响应 - virtual void OnRspQryExecOrder(CThostFtdcExecOrderField *pExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询询价响应 - virtual void OnRspQryForQuote(CThostFtdcForQuoteField *pForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询报价响应 - virtual void OnRspQryQuote(CThostFtdcQuoteField *pQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询期权自对冲响应 - virtual void OnRspQryOptionSelfClose(CThostFtdcOptionSelfCloseField *pOptionSelfClose, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询投资单元响应 - virtual void OnRspQryInvestUnit(CThostFtdcInvestUnitField *pInvestUnit, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询组合合约安全系数响应 - virtual void OnRspQryCombInstrumentGuard(CThostFtdcCombInstrumentGuardField *pCombInstrumentGuard, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询申请组合响应 - virtual void OnRspQryCombAction(CThostFtdcCombActionField *pCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询转帐流水响应 - virtual void OnRspQryTransferSerial(CThostFtdcTransferSerialField *pTransferSerial, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询银期签约关系响应 - virtual void OnRspQryAccountregister(CThostFtdcAccountregisterField *pAccountregister, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///错误应答 - virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///报单通知 - virtual void OnRtnOrder(CThostFtdcOrderField *pOrder); - - ///成交通知 - virtual void OnRtnTrade(CThostFtdcTradeField *pTrade); - - ///报单录入错误回报 - virtual void OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo); - - ///报单操作错误回报 - virtual void OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, CThostFtdcRspInfoField *pRspInfo); - - ///合约交易状态通知 - virtual void OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus); - - ///交易所公告通知 - virtual void OnRtnBulletin(CThostFtdcBulletinField *pBulletin); - - ///交易通知 - virtual void OnRtnTradingNotice(CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo); - - ///提示条件单校验错误 - virtual void OnRtnErrorConditionalOrder(CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder); - - ///执行宣告通知 - virtual void OnRtnExecOrder(CThostFtdcExecOrderField *pExecOrder); - - ///执行宣告录入错误回报 - virtual void OnErrRtnExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo); - - ///执行宣告操作错误回报 - virtual void OnErrRtnExecOrderAction(CThostFtdcExecOrderActionField *pExecOrderAction, CThostFtdcRspInfoField *pRspInfo); - - ///询价录入错误回报 - virtual void OnErrRtnForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo); - - ///报价通知 - virtual void OnRtnQuote(CThostFtdcQuoteField *pQuote); - - ///报价录入错误回报 - virtual void OnErrRtnQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo); - - ///报价操作错误回报 - virtual void OnErrRtnQuoteAction(CThostFtdcQuoteActionField *pQuoteAction, CThostFtdcRspInfoField *pRspInfo); - - ///询价通知 - virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp); - - ///保证金监控中心用户令牌 - virtual void OnRtnCFMMCTradingAccountToken(CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken); - - ///批量报单操作错误回报 - virtual void OnErrRtnBatchOrderAction(CThostFtdcBatchOrderActionField *pBatchOrderAction, CThostFtdcRspInfoField *pRspInfo); - - ///期权自对冲通知 - virtual void OnRtnOptionSelfClose(CThostFtdcOptionSelfCloseField *pOptionSelfClose); - - ///期权自对冲录入错误回报 - virtual void OnErrRtnOptionSelfCloseInsert(CThostFtdcInputOptionSelfCloseField *pInputOptionSelfClose, CThostFtdcRspInfoField *pRspInfo); - - ///期权自对冲操作错误回报 - virtual void OnErrRtnOptionSelfCloseAction(CThostFtdcOptionSelfCloseActionField *pOptionSelfCloseAction, CThostFtdcRspInfoField *pRspInfo); - - ///申请组合通知 - virtual void OnRtnCombAction(CThostFtdcCombActionField *pCombAction); - - ///申请组合录入错误回报 - virtual void OnErrRtnCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo); - - ///请求查询签约银行响应 - virtual void OnRspQryContractBank(CThostFtdcContractBankField *pContractBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询预埋单响应 - virtual void OnRspQryParkedOrder(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询预埋撤单响应 - virtual void OnRspQryParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询交易通知响应 - virtual void OnRspQryTradingNotice(CThostFtdcTradingNoticeField *pTradingNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询经纪公司交易参数响应 - virtual void OnRspQryBrokerTradingParams(CThostFtdcBrokerTradingParamsField *pBrokerTradingParams, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询经纪公司交易算法响应 - virtual void OnRspQryBrokerTradingAlgos(CThostFtdcBrokerTradingAlgosField *pBrokerTradingAlgos, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///请求查询监控中心用户令牌 - virtual void OnRspQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///银行发起银行资金转期货通知 - virtual void OnRtnFromBankToFutureByBank(CThostFtdcRspTransferField *pRspTransfer); - - ///银行发起期货资金转银行通知 - virtual void OnRtnFromFutureToBankByBank(CThostFtdcRspTransferField *pRspTransfer); - - ///银行发起冲正银行转期货通知 - virtual void OnRtnRepealFromBankToFutureByBank(CThostFtdcRspRepealField *pRspRepeal); - - ///银行发起冲正期货转银行通知 - virtual void OnRtnRepealFromFutureToBankByBank(CThostFtdcRspRepealField *pRspRepeal); - - ///期货发起银行资金转期货通知 - virtual void OnRtnFromBankToFutureByFuture(CThostFtdcRspTransferField *pRspTransfer); - - ///期货发起期货资金转银行通知 - virtual void OnRtnFromFutureToBankByFuture(CThostFtdcRspTransferField *pRspTransfer); - - ///系统运行时期货端手工发起冲正银行转期货请求,银行处理完毕后报盘发回的通知 - virtual void OnRtnRepealFromBankToFutureByFutureManual(CThostFtdcRspRepealField *pRspRepeal); - - ///系统运行时期货端手工发起冲正期货转银行请求,银行处理完毕后报盘发回的通知 - virtual void OnRtnRepealFromFutureToBankByFutureManual(CThostFtdcRspRepealField *pRspRepeal); - - ///期货发起查询银行余额通知 - virtual void OnRtnQueryBankBalanceByFuture(CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount); - - ///期货发起银行资金转期货错误回报 - virtual void OnErrRtnBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo); - - ///期货发起期货资金转银行错误回报 - virtual void OnErrRtnFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo); - - ///系统运行时期货端手工发起冲正银行转期货错误回报 - virtual void OnErrRtnRepealBankToFutureByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo); - - ///系统运行时期货端手工发起冲正期货转银行错误回报 - virtual void OnErrRtnRepealFutureToBankByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo); - - ///期货发起查询银行余额错误回报 - virtual void OnErrRtnQueryBankBalanceByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo); - - ///期货发起冲正银行转期货请求,银行处理完毕后报盘发回的通知 - virtual void OnRtnRepealFromBankToFutureByFuture(CThostFtdcRspRepealField *pRspRepeal); - - ///期货发起冲正期货转银行请求,银行处理完毕后报盘发回的通知 - virtual void OnRtnRepealFromFutureToBankByFuture(CThostFtdcRspRepealField *pRspRepeal); - - ///期货发起银行资金转期货应答 - virtual void OnRspFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///期货发起期货资金转银行应答 - virtual void OnRspFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///期货发起查询银行余额应答 - virtual void OnRspQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); - - ///银行发起银期开户通知 - virtual void OnRtnOpenAccountByBank(CThostFtdcOpenAccountField *pOpenAccount); - - ///银行发起银期销户通知 - virtual void OnRtnCancelAccountByBank(CThostFtdcCancelAccountField *pCancelAccount); - - ///银行发起变更银行账号通知 - virtual void OnRtnChangeAccountByBank(CThostFtdcChangeAccountField *pChangeAccount); - - //------------------------------------------------------------------------------------- - //task:任务 - //------------------------------------------------------------------------------------- - void processTask(); - - void processFrontConnected(Task *task); - - void processFrontDisconnected(Task *task); - - void processHeartBeatWarning(Task *task); - - void processRspAuthenticate(Task *task); - - void processRspUserLogin(Task *task); - - void processRspUserLogout(Task *task); - - void processRspUserPasswordUpdate(Task *task); - - void processRspTradingAccountPasswordUpdate(Task *task); - - void processRspUserAuthMethod(Task *task); - - void processRspGenUserCaptcha(Task *task); - - void processRspGenUserText(Task *task); - - void processRspOrderInsert(Task *task); - - void processRspParkedOrderInsert(Task *task); - - void processRspParkedOrderAction(Task *task); - - void processRspOrderAction(Task *task); - - void processRspQueryMaxOrderVolume(Task *task); - - void processRspSettlementInfoConfirm(Task *task); - - void processRspRemoveParkedOrder(Task *task); - - void processRspRemoveParkedOrderAction(Task *task); - - void processRspExecOrderInsert(Task *task); - - void processRspExecOrderAction(Task *task); - - void processRspForQuoteInsert(Task *task); - - void processRspQuoteInsert(Task *task); - - void processRspQuoteAction(Task *task); - - void processRspBatchOrderAction(Task *task); - - void processRspOptionSelfCloseInsert(Task *task); - - void processRspOptionSelfCloseAction(Task *task); - - void processRspCombActionInsert(Task *task); - - void processRspQryOrder(Task *task); - - void processRspQryTrade(Task *task); - - void processRspQryInvestorPosition(Task *task); - - void processRspQryTradingAccount(Task *task); - - void processRspQryInvestor(Task *task); - - void processRspQryTradingCode(Task *task); - - void processRspQryInstrumentMarginRate(Task *task); - - void processRspQryInstrumentCommissionRate(Task *task); - - void processRspQryExchange(Task *task); - - void processRspQryProduct(Task *task); - - void processRspQryInstrument(Task *task); - - void processRspQryDepthMarketData(Task *task); - - void processRspQrySettlementInfo(Task *task); - - void processRspQryTransferBank(Task *task); - - void processRspQryInvestorPositionDetail(Task *task); - - void processRspQryNotice(Task *task); - - void processRspQrySettlementInfoConfirm(Task *task); - - void processRspQryInvestorPositionCombineDetail(Task *task); - - void processRspQryCFMMCTradingAccountKey(Task *task); - - void processRspQryEWarrantOffset(Task *task); - - void processRspQryInvestorProductGroupMargin(Task *task); - - void processRspQryExchangeMarginRate(Task *task); - - void processRspQryExchangeMarginRateAdjust(Task *task); - - void processRspQryExchangeRate(Task *task); - - void processRspQrySecAgentACIDMap(Task *task); - - void processRspQryProductExchRate(Task *task); - - void processRspQryProductGroup(Task *task); - - void processRspQryMMInstrumentCommissionRate(Task *task); - - void processRspQryMMOptionInstrCommRate(Task *task); - - void processRspQryInstrumentOrderCommRate(Task *task); - - void processRspQrySecAgentTradingAccount(Task *task); - - void processRspQrySecAgentCheckMode(Task *task); - - void processRspQrySecAgentTradeInfo(Task *task); - - void processRspQryOptionInstrTradeCost(Task *task); - - void processRspQryOptionInstrCommRate(Task *task); - - void processRspQryExecOrder(Task *task); - - void processRspQryForQuote(Task *task); - - void processRspQryQuote(Task *task); - - void processRspQryOptionSelfClose(Task *task); - - void processRspQryInvestUnit(Task *task); - - void processRspQryCombInstrumentGuard(Task *task); - - void processRspQryCombAction(Task *task); - - void processRspQryTransferSerial(Task *task); - - void processRspQryAccountregister(Task *task); - - void processRspError(Task *task); - - void processRtnOrder(Task *task); - - void processRtnTrade(Task *task); - - void processErrRtnOrderInsert(Task *task); - - void processErrRtnOrderAction(Task *task); - - void processRtnInstrumentStatus(Task *task); - - void processRtnBulletin(Task *task); - - void processRtnTradingNotice(Task *task); - - void processRtnErrorConditionalOrder(Task *task); - - void processRtnExecOrder(Task *task); - - void processErrRtnExecOrderInsert(Task *task); - - void processErrRtnExecOrderAction(Task *task); - - void processErrRtnForQuoteInsert(Task *task); - - void processRtnQuote(Task *task); - - void processErrRtnQuoteInsert(Task *task); - - void processErrRtnQuoteAction(Task *task); - - void processRtnForQuoteRsp(Task *task); - - void processRtnCFMMCTradingAccountToken(Task *task); - - void processErrRtnBatchOrderAction(Task *task); - - void processRtnOptionSelfClose(Task *task); - - void processErrRtnOptionSelfCloseInsert(Task *task); - - void processErrRtnOptionSelfCloseAction(Task *task); - - void processRtnCombAction(Task *task); - - void processErrRtnCombActionInsert(Task *task); - - void processRspQryContractBank(Task *task); - - void processRspQryParkedOrder(Task *task); - - void processRspQryParkedOrderAction(Task *task); - - void processRspQryTradingNotice(Task *task); - - void processRspQryBrokerTradingParams(Task *task); - - void processRspQryBrokerTradingAlgos(Task *task); - - void processRspQueryCFMMCTradingAccountToken(Task *task); - - void processRtnFromBankToFutureByBank(Task *task); - - void processRtnFromFutureToBankByBank(Task *task); - - void processRtnRepealFromBankToFutureByBank(Task *task); - - void processRtnRepealFromFutureToBankByBank(Task *task); - - void processRtnFromBankToFutureByFuture(Task *task); - - void processRtnFromFutureToBankByFuture(Task *task); - - void processRtnRepealFromBankToFutureByFutureManual(Task *task); - - void processRtnRepealFromFutureToBankByFutureManual(Task *task); - - void processRtnQueryBankBalanceByFuture(Task *task); - - void processErrRtnBankToFutureByFuture(Task *task); - - void processErrRtnFutureToBankByFuture(Task *task); - - void processErrRtnRepealBankToFutureByFutureManual(Task *task); - - void processErrRtnRepealFutureToBankByFutureManual(Task *task); - - void processErrRtnQueryBankBalanceByFuture(Task *task); - - void processRtnRepealFromBankToFutureByFuture(Task *task); - - void processRtnRepealFromFutureToBankByFuture(Task *task); - - void processRspFromBankToFutureByFuture(Task *task); - - void processRspFromFutureToBankByFuture(Task *task); - - void processRspQueryBankAccountMoneyByFuture(Task *task); - - void processRtnOpenAccountByBank(Task *task); - - void processRtnCancelAccountByBank(Task *task); - - void processRtnChangeAccountByBank(Task *task); - - //------------------------------------------------------------------------------------- - //data:回调函数的数据字典 - //error:回调函数的错误字典 - //id:请求id - //last:是否为最后返回 - //i:整数 - //------------------------------------------------------------------------------------- - - virtual void onFrontConnected() {}; - - virtual void onFrontDisconnected(int reqid) {}; - - virtual void onHeartBeatWarning(int reqid) {}; - - virtual void onRspAuthenticate(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspUserLogin(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspUserLogout(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspUserPasswordUpdate(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspTradingAccountPasswordUpdate(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspUserAuthMethod(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspGenUserCaptcha(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspGenUserText(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspOrderInsert(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspParkedOrderInsert(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspParkedOrderAction(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspOrderAction(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQueryMaxOrderVolume(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspSettlementInfoConfirm(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspRemoveParkedOrder(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspRemoveParkedOrderAction(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspExecOrderInsert(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspExecOrderAction(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspForQuoteInsert(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQuoteInsert(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQuoteAction(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspBatchOrderAction(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspOptionSelfCloseInsert(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspOptionSelfCloseAction(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspCombActionInsert(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryOrder(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryTrade(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryInvestorPosition(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryTradingAccount(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryInvestor(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryTradingCode(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryInstrumentMarginRate(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryInstrumentCommissionRate(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryExchange(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryProduct(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryInstrument(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryDepthMarketData(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQrySettlementInfo(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryTransferBank(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryInvestorPositionDetail(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryNotice(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQrySettlementInfoConfirm(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryInvestorPositionCombineDetail(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryCFMMCTradingAccountKey(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryEWarrantOffset(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryInvestorProductGroupMargin(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryExchangeMarginRate(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryExchangeMarginRateAdjust(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryExchangeRate(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQrySecAgentACIDMap(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryProductExchRate(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryProductGroup(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryMMInstrumentCommissionRate(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryMMOptionInstrCommRate(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryInstrumentOrderCommRate(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQrySecAgentTradingAccount(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQrySecAgentCheckMode(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQrySecAgentTradeInfo(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryOptionInstrTradeCost(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryOptionInstrCommRate(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryExecOrder(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryForQuote(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryQuote(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryOptionSelfClose(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryInvestUnit(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryCombInstrumentGuard(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryCombAction(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryTransferSerial(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryAccountregister(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspError(const dict &error, int reqid, bool last) {}; - - virtual void onRtnOrder(const dict &data) {}; - - virtual void onRtnTrade(const dict &data) {}; - - virtual void onErrRtnOrderInsert(const dict &data, const dict &error) {}; - - virtual void onErrRtnOrderAction(const dict &data, const dict &error) {}; - - virtual void onRtnInstrumentStatus(const dict &data) {}; - - virtual void onRtnBulletin(const dict &data) {}; - - virtual void onRtnTradingNotice(const dict &data) {}; - - virtual void onRtnErrorConditionalOrder(const dict &data) {}; - - virtual void onRtnExecOrder(const dict &data) {}; - - virtual void onErrRtnExecOrderInsert(const dict &data, const dict &error) {}; - - virtual void onErrRtnExecOrderAction(const dict &data, const dict &error) {}; - - virtual void onErrRtnForQuoteInsert(const dict &data, const dict &error) {}; - - virtual void onRtnQuote(const dict &data) {}; - - virtual void onErrRtnQuoteInsert(const dict &data, const dict &error) {}; - - virtual void onErrRtnQuoteAction(const dict &data, const dict &error) {}; - - virtual void onRtnForQuoteRsp(const dict &data) {}; - - virtual void onRtnCFMMCTradingAccountToken(const dict &data) {}; - - virtual void onErrRtnBatchOrderAction(const dict &data, const dict &error) {}; - - virtual void onRtnOptionSelfClose(const dict &data) {}; - - virtual void onErrRtnOptionSelfCloseInsert(const dict &data, const dict &error) {}; - - virtual void onErrRtnOptionSelfCloseAction(const dict &data, const dict &error) {}; - - virtual void onRtnCombAction(const dict &data) {}; - - virtual void onErrRtnCombActionInsert(const dict &data, const dict &error) {}; - - virtual void onRspQryContractBank(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryParkedOrder(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryParkedOrderAction(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryTradingNotice(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryBrokerTradingParams(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQryBrokerTradingAlgos(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQueryCFMMCTradingAccountToken(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRtnFromBankToFutureByBank(const dict &data) {}; - - virtual void onRtnFromFutureToBankByBank(const dict &data) {}; - - virtual void onRtnRepealFromBankToFutureByBank(const dict &data) {}; - - virtual void onRtnRepealFromFutureToBankByBank(const dict &data) {}; - - virtual void onRtnFromBankToFutureByFuture(const dict &data) {}; - - virtual void onRtnFromFutureToBankByFuture(const dict &data) {}; - - virtual void onRtnRepealFromBankToFutureByFutureManual(const dict &data) {}; - - virtual void onRtnRepealFromFutureToBankByFutureManual(const dict &data) {}; - - virtual void onRtnQueryBankBalanceByFuture(const dict &data) {}; - - virtual void onErrRtnBankToFutureByFuture(const dict &data, const dict &error) {}; - - virtual void onErrRtnFutureToBankByFuture(const dict &data, const dict &error) {}; - - virtual void onErrRtnRepealBankToFutureByFutureManual(const dict &data, const dict &error) {}; - - virtual void onErrRtnRepealFutureToBankByFutureManual(const dict &data, const dict &error) {}; - - virtual void onErrRtnQueryBankBalanceByFuture(const dict &data, const dict &error) {}; - - virtual void onRtnRepealFromBankToFutureByFuture(const dict &data) {}; - - virtual void onRtnRepealFromFutureToBankByFuture(const dict &data) {}; - - virtual void onRspFromBankToFutureByFuture(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspFromFutureToBankByFuture(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRspQueryBankAccountMoneyByFuture(const dict &data, const dict &error, int reqid, bool last) {}; - - virtual void onRtnOpenAccountByBank(const dict &data) {}; - - virtual void onRtnCancelAccountByBank(const dict &data) {}; - - virtual void onRtnChangeAccountByBank(const dict &data) {}; - - //------------------------------------------------------------------------------------- - //req:主动函数的请求字典 - //------------------------------------------------------------------------------------- - - void createFtdcTraderApi(string pszFlowPath = ""); - - void release(); - - void init(); - - int join(); - - int exit(); - - string getTradingDay(); - - void registerFront(string pszFrontAddress); - - void subscribePrivateTopic(int nType); - - void subscribePublicTopic(int nType); - - int reqAuthenticate(const dict &req, int reqid); - - int reqUserLogin(const dict &req, int reqid); - - int reqUserLogout(const dict &req, int reqid); - - int reqUserPasswordUpdate(const dict &req, int reqid); - - int reqTradingAccountPasswordUpdate(const dict &req, int reqid); - - int reqUserAuthMethod(const dict &req, int reqid); - - int reqGenUserCaptcha(const dict &req, int reqid); - - int reqGenUserText(const dict &req, int reqid); - - int reqUserLoginWithCaptcha(const dict &req, int reqid); - - int reqUserLoginWithText(const dict &req, int reqid); - - int reqUserLoginWithOTP(const dict &req, int reqid); - - int reqOrderInsert(const dict &req, int reqid); - - int reqParkedOrderInsert(const dict &req, int reqid); - - int reqParkedOrderAction(const dict &req, int reqid); - - int reqOrderAction(const dict &req, int reqid); - - int reqQueryMaxOrderVolume(const dict &req, int reqid); - - int reqSettlementInfoConfirm(const dict &req, int reqid); - - int reqRemoveParkedOrder(const dict &req, int reqid); - - int reqRemoveParkedOrderAction(const dict &req, int reqid); - - int reqExecOrderInsert(const dict &req, int reqid); - - int reqExecOrderAction(const dict &req, int reqid); - - int reqForQuoteInsert(const dict &req, int reqid); - - int reqQuoteInsert(const dict &req, int reqid); - - int reqQuoteAction(const dict &req, int reqid); - - int reqBatchOrderAction(const dict &req, int reqid); - - int reqOptionSelfCloseInsert(const dict &req, int reqid); - - int reqOptionSelfCloseAction(const dict &req, int reqid); - - int reqCombActionInsert(const dict &req, int reqid); - - int reqQryOrder(const dict &req, int reqid); - - int reqQryTrade(const dict &req, int reqid); - - int reqQryInvestorPosition(const dict &req, int reqid); - - int reqQryTradingAccount(const dict &req, int reqid); - - int reqQryInvestor(const dict &req, int reqid); - - int reqQryTradingCode(const dict &req, int reqid); - - int reqQryInstrumentMarginRate(const dict &req, int reqid); - - int reqQryInstrumentCommissionRate(const dict &req, int reqid); - - int reqQryExchange(const dict &req, int reqid); - - int reqQryProduct(const dict &req, int reqid); - - int reqQryInstrument(const dict &req, int reqid); - - int reqQryDepthMarketData(const dict &req, int reqid); - - int reqQrySettlementInfo(const dict &req, int reqid); - - int reqQryTransferBank(const dict &req, int reqid); - - int reqQryInvestorPositionDetail(const dict &req, int reqid); - - int reqQryNotice(const dict &req, int reqid); - - int reqQrySettlementInfoConfirm(const dict &req, int reqid); - - int reqQryInvestorPositionCombineDetail(const dict &req, int reqid); - - int reqQryCFMMCTradingAccountKey(const dict &req, int reqid); - - int reqQryEWarrantOffset(const dict &req, int reqid); - - int reqQryInvestorProductGroupMargin(const dict &req, int reqid); - - int reqQryExchangeMarginRate(const dict &req, int reqid); - - int reqQryExchangeMarginRateAdjust(const dict &req, int reqid); - - int reqQryExchangeRate(const dict &req, int reqid); - - int reqQrySecAgentACIDMap(const dict &req, int reqid); - - int reqQryProductExchRate(const dict &req, int reqid); - - int reqQryProductGroup(const dict &req, int reqid); - - int reqQryMMInstrumentCommissionRate(const dict &req, int reqid); - - int reqQryMMOptionInstrCommRate(const dict &req, int reqid); - - int reqQryInstrumentOrderCommRate(const dict &req, int reqid); - - int reqQrySecAgentTradingAccount(const dict &req, int reqid); - - int reqQrySecAgentCheckMode(const dict &req, int reqid); - - int reqQrySecAgentTradeInfo(const dict &req, int reqid); - - int reqQryOptionInstrTradeCost(const dict &req, int reqid); - - int reqQryOptionInstrCommRate(const dict &req, int reqid); - - int reqQryExecOrder(const dict &req, int reqid); - - int reqQryForQuote(const dict &req, int reqid); - - int reqQryQuote(const dict &req, int reqid); - - int reqQryOptionSelfClose(const dict &req, int reqid); - - int reqQryInvestUnit(const dict &req, int reqid); - - int reqQryCombInstrumentGuard(const dict &req, int reqid); - - int reqQryCombAction(const dict &req, int reqid); - - int reqQryTransferSerial(const dict &req, int reqid); - - int reqQryAccountregister(const dict &req, int reqid); - - int reqQryContractBank(const dict &req, int reqid); - - int reqQryParkedOrder(const dict &req, int reqid); - - int reqQryParkedOrderAction(const dict &req, int reqid); - - int reqQryTradingNotice(const dict &req, int reqid); - - int reqQryBrokerTradingParams(const dict &req, int reqid); - - int reqQryBrokerTradingAlgos(const dict &req, int reqid); - - int reqQueryCFMMCTradingAccountToken(const dict &req, int reqid); - - int reqFromBankToFutureByFuture(const dict &req, int reqid); - - int reqFromFutureToBankByFuture(const dict &req, int reqid); - - int reqQueryBankAccountMoneyByFuture(const dict &req, int reqid); -}; diff --git a/vnpy/api/mini/vnctp/vnctptd/vnctptd.vcxproj b/vnpy/api/mini/vnctp/vnctptd/vnctptd.vcxproj deleted file mode 100644 index 883d8068..00000000 --- a/vnpy/api/mini/vnctp/vnctptd/vnctptd.vcxproj +++ /dev/null @@ -1,198 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {016732E6-5789-4F7C-9A1C-C46A249080CF} - Win32Proj - vnctptd - 10.0.17134.0 - - - - DynamicLibrary - true - v141 - Unicode - - - DynamicLibrary - false - v141 - true - Unicode - - - DynamicLibrary - true - v141 - Unicode - - - DynamicLibrary - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - 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:\Miniconda3\include;$(SolutionDir);$(SolutionDir)..\include;$(SolutionDir)..\include\ctp;$(IncludePath) - C:\Miniconda3\libs;$(SolutionDir)..\libs;$(LibraryPath) - $(SolutionDir)..\ - - - - Use - Level3 - Disabled - true - NOMINMAX;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;VNCTPTD_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - stdafx.h - - - Console - true - - - - - Use - Level3 - Disabled - true - NOMINMAX;_CRT_SECURE_NO_WARNINGS;_DEBUG;VNCTPTD_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - stdafx.h - - - Console - true - - - - - Use - Level3 - MaxSpeed - true - true - true - NOMINMAX;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;VNCTPTD_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - stdafx.h - MultiThreaded - - - Console - true - true - true - - - - - Use - Level3 - MaxSpeed - true - true - true - NOMINMAX;_CRT_SECURE_NO_WARNINGS;NDEBUG;VNCTPTD_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - - - stdafx.h - MultiThreaded - - - Console - true - true - true - C:\Miniconda3\libs;C:\GitHub\vnpy\vnpy\api\ctp\libs;%(AdditionalLibraryDirectories) - thostmduserapi_se.lib;thosttraderapi_se.lib;%(AdditionalDependencies) - - - - - - - - - - - - - - - - Create - Create - Create - Create - - - - - - - \ No newline at end of file diff --git a/vnpy/api/mini/vnctp/vnctptd/vnctptd.vcxproj.filters b/vnpy/api/mini/vnctp/vnctptd/vnctptd.vcxproj.filters deleted file mode 100644 index c17ce754..00000000 --- a/vnpy/api/mini/vnctp/vnctptd/vnctptd.vcxproj.filters +++ /dev/null @@ -1,54 +0,0 @@ -锘 - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - 澶存枃浠 - - - 澶存枃浠 - - - 澶存枃浠 - - - 澶存枃浠 - - - 澶存枃浠 - - - 澶存枃浠 - - - 澶存枃浠 - - - 澶存枃浠 - - - - - 婧愭枃浠 - - - 婧愭枃浠 - - - 婧愭枃浠 - - - \ No newline at end of file diff --git a/vnpy/api/mini/vnctp/vnctptd/vnctptd.vcxproj.user b/vnpy/api/mini/vnctp/vnctptd/vnctptd.vcxproj.user deleted file mode 100644 index be250787..00000000 --- a/vnpy/api/mini/vnctp/vnctptd/vnctptd.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ -锘 - - - \ No newline at end of file