[Del] 去除生成脚本的中间文件

This commit is contained in:
nanoric 2019-04-23 04:20:53 -04:00
parent d2053bd1df
commit 9484161caf
23 changed files with 0 additions and 6697 deletions

View File

@ -1,147 +0,0 @@
USTP_FTDC_VC_AV = '1'
USTP_FTDC_VC_MV = '2'
USTP_FTDC_VC_CV = '3'
USTP_FTDC_FCR_NotForceClose = '0'
USTP_FTDC_FCR_LackDeposit = '1'
USTP_FTDC_FCR_ClientOverPositionLimit = '2'
USTP_FTDC_FCR_MemberOverPositionLimit = '3'
USTP_FTDC_FCR_NotMultiple = '4'
USTP_FTDC_FCR_Violation = '5'
USTP_FTDC_FCR_Other = '6'
USTP_FTDC_FCR_PersonDeliv = '7'
USTP_FTDC_FCR_HedgeOverPositionLimit = '8'
USTP_FTDC_IS_BeforeTrading = '0'
USTP_FTDC_IS_NoTrading = '1'
USTP_FTDC_IS_Continous = '2'
USTP_FTDC_IS_AuctionOrdering = '3'
USTP_FTDC_IS_AuctionBalance = '4'
USTP_FTDC_IS_AuctionMatch = '5'
USTP_FTDC_IS_Closed = '6'
USTP_FTDC_OF_Open = '0'
USTP_FTDC_OF_Close = '1'
USTP_FTDC_OF_ForceClose = '2'
USTP_FTDC_OF_CloseToday = '3'
USTP_FTDC_OF_CloseYesterday = '4'
USTP_FTDC_OF_ALL = '9'
USTP_FTDC_OPT_AnyPrice = '1'
USTP_FTDC_OPT_LimitPrice = '2'
USTP_FTDC_OPT_BestPrice = '3'
USTP_FTDC_OPT_FiveLevelPrice = '4'
USTP_FTDC_OPT_StopLosPrice = '5'
USTP_FTDC_OPT_StopProfitPrice = '6'
USTP_FTDC_OPT_LimitStopLosPrice = '7'
USTP_FTDC_OPT_LimitStopProfitPrice = '8'
USTP_FTDC_OS_AllTraded = '0'
USTP_FTDC_OS_PartTradedQueueing = '1'
USTP_FTDC_OS_PartTradedNotQueueing = '2'
USTP_FTDC_OS_NoTradeQueueing = '3'
USTP_FTDC_OS_NoTradeNotQueueing = '4'
USTP_FTDC_OS_Canceled = '5'
USTP_FTDC_OS_AcceptedNoReply = '6'
USTP_FTDC_UT_Person = '1'
USTP_FTDC_UT_Product = '2'
USTP_FTDC_UT_Manager = '3'
USTP_FTDC_UT_Seat = '4'
USTP_FTDC_TR_Allow = '0'
USTP_FTDC_TR_CloseOnly = '1'
USTP_FTDC_TR_Forbidden = '2'
USTP_FTDC_TC_IOC = '1'
USTP_FTDC_TC_GFS = '2'
USTP_FTDC_TC_GFD = '3'
USTP_FTDC_TC_GTD = '4'
USTP_FTDC_TC_GTC = '5'
USTP_FTDC_TC_GFA = '6'
USTP_FTDC_OS_Participant = '0'
USTP_FTDC_OS_Administrator = '1'
USTP_FTDC_OS_QuoteSplit = '2'
USTP_FTDC_OS_ForceLower = '3'
USTP_FTDC_D_Buy = '0'
USTP_FTDC_D_Sell = '1'
USTP_FTDC_D_ALL = '9'
USTP_FTDC_C_RMB = '1'
USTP_FTDC_C_UDOLLAR = '2'
USTP_FTDC_AD_In = '1'
USTP_FTDC_AD_Out = '2'
USTP_FTDC_AD_In = '1'
USTP_FTDC_AD_Out = '2'
USTP_FTDC_AD_InReserval = '3'
USTP_FTDC_AD_OutReserval = '4'
USTP_FTDC_AD_PreOut = '5'
USTP_FTDC_AD_PreOutSuccess = '6'
USTP_FTDC_AD_PreOutFailed = '7'
USTP_FTDC_TSS_Terminal = '1'
USTP_FTDC_TSS_Terminal_Second = '2'
USTP_FTDC_TSS_Bank = '3'
USTP_FTDC_TSS_Settle = '4'
USTP_FTDC_CHF_Speculation = '1'
USTP_FTDC_CHF_Arbitrage = '2'
USTP_FTDC_CHF_Hedge = '3'
USTP_FTDC_CHF_MarketMaker = '4'
USTP_FTDC_CHF_SpecHedge = '5'
USTP_FTDC_CHF_HedgeSpec = '6'
USTP_FTDC_CHF_AllValue = '9'
USTP_FTDC_AF_Delete = '0'
USTP_FTDC_AF_Suspend = '1'
USTP_FTDC_AF_Active = '2'
USTP_FTDC_AF_Modify = '3'
USTP_FTDC_PT_Net = '1'
USTP_FTDC_PT_Gross = '2'
USTP_FTDC_OT_NotOptions = '0'
USTP_FTDC_OT_CallOptions = '1'
USTP_FTDC_OT_PutOptions = '2'
USTP_FTDC_OT_ALL = '9'
USTP_FTDC_UIA_NoActive = '0'
USTP_FTDC_UIA_Active = '1'
USTP_FTDC_MCT_SingleLeg = '0'
USTP_FTDC_MCT_BigLeg = '1'
USTP_FTDC_MCT_StrategyManual = '2'
USTP_FTDC_MCT_StrategyAuto = '3'
USTP_FTDC_MCT_StrategyBigLegManual = '4'
USTP_FTDC_MCT_StrategyBigLegAuto = '5'
USTP_FTDC_FUNC_Trading = '0'
USTP_FTDC_FUNC_CloseOnly = '1'
USTP_FTDC_FUNC_CanotTrade = '2'
USTP_FTDC_QS_Inited_InFEMAS = '0'
USTP_FTDC_QS_Accepted_InTradingSystem = '1'
USTP_FTDC_QS_Canceled_SingleLeg = '2'
USTP_FTDC_QS_Canceled_All = '3'
USTP_FTDC_QS_Traded_SingleLeg = '4'
USTP_FTDC_QS_Traded_All = '5'
USTP_FTDC_QS_Error_QuoteAction = '6'
USTP_FTDC_CA_Combine = '0'
USTP_FTDC_CA_UnCombine = '1'
USTP_FTDC_AT_Basic = '0'
USTP_FTDC_AT_SP = '1'
USTP_FTDC_AT_SPC = '2'
USTP_FTDC_AT_SPX = '3'
USTP_FTDC_AT_Combo = '4'
USTP_FTDC_AT_Strip = '5'
USTP_FTDC_AT_Exec = '6'
USTP_FTDC_AT_Both = '7'
USTP_FTDC_AT_Swap = '8'
USTP_FTDC_AT_Other = '9'
USTP_FTDC_AT_BUL = 'a'
USTP_FTDC_AT_BER = 'b'
USTP_FTDC_AT_BLT = 'c'
USTP_FTDC_AT_BRT = 'd'
USTP_FTDC_AT_STD = 'e'
USTP_FTDC_AT_STG = 'f'
USTP_FTDC_AT_PRT = 'g'
USTP_FTDC_AT_LOC = 'h'
USTP_FTDC_OT_Common = '0'
USTP_FTDC_OT_OptExec = '1'
USTP_FTDC_OT_OptAbandon = '2'
USTP_FTDC_OT_OTCDerived = '3'
USTP_FTDC_OT_EFPDerived = '4'
USTP_FTDC_DF_ExecOpen = '0'
USTP_FTDC_DF_Delivery = '1'
USTP_FTDC_DF_OptDelivery = '2'
USTP_FTDC_DF_OptHold = '3'
USTP_FTDC_DF_SellDelivery = '4'
USTP_FTDC_CAS_Submitted = '1'
USTP_FTDC_CAS_Accepted = '2'
USTP_FTDC_CAS_Rejected = '3'
USTP_FTDC_A2T_Blank = '0'
USTP_FTDC_A2T_ShortMessage = '1'
USTP_FTDC_A2T_DynamicToken = '2'
USTP_FTDC_A2T_GraphicVerificationCode = '3'

File diff suppressed because it is too large Load Diff

View File

@ -1,56 +0,0 @@
#define ONFRONTCONNECTED 0
#define ONQRYFRONTCONNECTED 1
#define ONFRONTDISCONNECTED 2
#define ONQRYFRONTDISCONNECTED 3
#define ONHEARTBEATWARNING 4
#define ONPACKAGESTART 5
#define ONPACKAGEEND 6
#define ONRSPERROR 7
#define ONRSPUSERLOGIN 8
#define ONRSPUSERLOGOUT 9
#define ONRSPUSERPASSWORDUPDATE 10
#define ONRSPORDERINSERT 11
#define ONRSPORDERACTION 12
#define ONRSPQUOTEINSERT 13
#define ONRSPQUOTEACTION 14
#define ONRSPFORQUOTE 15
#define ONRSPMARGINCOMBACTION 16
#define ONRSPUSERDEPOSIT 17
#define ONRSPTRANSFERMONEY 18
#define ONRTNFLOWMESSAGECANCEL 19
#define ONRTNTRADE 20
#define ONRTNORDER 21
#define ONERRRTNORDERINSERT 22
#define ONERRRTNORDERACTION 23
#define ONRTNINSTRUMENTSTATUS 24
#define ONRTNINVESTORACCOUNTDEPOSIT 25
#define ONRTNQUOTE 26
#define ONERRRTNQUOTEINSERT 27
#define ONERRRTNQUOTEACTION 28
#define ONRTNFORQUOTE 29
#define ONRTNMARGINCOMBINATIONLEG 30
#define ONRTNMARGINCOMBACTION 31
#define ONRTNUSERDEPOSIT 32
#define ONRSPQUERYUSERLOGIN 33
#define ONRSPQRYORDER 34
#define ONRSPQRYTRADE 35
#define ONRSPQRYUSERINVESTOR 36
#define ONRSPQRYTRADINGCODE 37
#define ONRSPQRYINVESTORACCOUNT 38
#define ONRSPQRYINSTRUMENT 39
#define ONRSPQRYEXCHANGE 40
#define ONRSPQRYINVESTORPOSITION 41
#define ONRSPQRYCOMPLIANCEPARAM 42
#define ONRSPQRYINVESTORFEE 43
#define ONRSPQRYINVESTORMARGIN 44
#define ONRSPQRYINVESTORCOMBPOSITION 45
#define ONRSPQRYINVESTORLEGPOSITION 46
#define ONRSPQRYINSTRUMENTGROUP 47
#define ONRSPQRYCLIENTMARGINCOMBTYPE 48
#define ONRSPEXECORDERINSERT 49
#define ONRSPEXECORDERACTION 50
#define ONRTNEXECORDER 51
#define ONERRRTNEXECORDERINSERT 52
#define ONERRRTNEXECORDERACTION 53
#define ONRTNTRANSFERMONEY 54
#define ONRSPQRYSYSTEMTIME 55

View File

@ -1,58 +0,0 @@
int reqUserLogin(const dict &req, int reqid);
int reqUserLogout(const dict &req, int reqid);
int reqUserPasswordUpdate(const dict &req, int reqid);
int reqOrderInsert(const dict &req, int reqid);
int reqOrderAction(const dict &req, int reqid);
int reqQuoteInsert(const dict &req, int reqid);
int reqQuoteAction(const dict &req, int reqid);
int reqForQuote(const dict &req, int reqid);
int reqMarginCombAction(const dict &req, int reqid);
int reqUserDeposit(const dict &req, int reqid);
int reqTransferMoney(const dict &req, int reqid);
int reqQryOrder(const dict &req, int reqid);
int reqQryTrade(const dict &req, int reqid);
int reqQryUserInvestor(const dict &req, int reqid);
int reqQryTradingCode(const dict &req, int reqid);
int reqQryInvestorAccount(const dict &req, int reqid);
int reqQryInstrument(const dict &req, int reqid);
int reqQryExchange(const dict &req, int reqid);
int reqQryInvestorPosition(const dict &req, int reqid);
int reqQryComplianceParam(const dict &req, int reqid);
int reqQryInvestorFee(const dict &req, int reqid);
int reqQryInvestorMargin(const dict &req, int reqid);
int reqQryInvestorCombPosition(const dict &req, int reqid);
int reqQryInvestorLegPosition(const dict &req, int reqid);
int reqQryInstrumentGroup(const dict &req, int reqid);
int reqQryClientMarginCombType(const dict &req, int reqid);
int reqExecOrderInsert(const dict &req, int reqid);
int reqExecOrderAction(const dict &req, int reqid);
int reqQrySystemTime(const dict &req, int reqid);

View File

@ -1,112 +0,0 @@
virtual void onFrontConnected() {};
virtual void onQryFrontConnected() {};
virtual void onFrontDisconnected(int reqid) {};
virtual void onQryFrontDisconnected(int reqid) {};
virtual void onHeartBeatWarning(int reqid) {};
virtual void onPackageStart(int reqid, int reqid) {};
virtual void onPackageEnd(int reqid, int reqid) {};
virtual void onRspError(const dict &data, int reqid, bool last) {};
virtual void onRspUserLogin(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspUserLogout(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspUserPasswordUpdate(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspOrderInsert(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspOrderAction(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspQuoteInsert(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspQuoteAction(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspForQuote(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspMarginCombAction(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspUserDeposit(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspTransferMoney(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRtnFlowMessageCancel(const dict &data) {};
virtual void onRtnTrade(const dict &data) {};
virtual void onRtnOrder(const dict &data) {};
virtual void onErrRtnOrderInsert(const dict &data, const dict &data) {};
virtual void onErrRtnOrderAction(const dict &data, const dict &data) {};
virtual void onRtnInstrumentStatus(const dict &data) {};
virtual void onRtnInvestorAccountDeposit(const dict &data) {};
virtual void onRtnQuote(const dict &data) {};
virtual void onErrRtnQuoteInsert(const dict &data, const dict &data) {};
virtual void onErrRtnQuoteAction(const dict &data, const dict &data) {};
virtual void onRtnForQuote(const dict &data) {};
virtual void onRtnMarginCombinationLeg(const dict &data) {};
virtual void onRtnMarginCombAction(const dict &data) {};
virtual void onRtnUserDeposit(const dict &data) {};
virtual void onRspQueryUserLogin(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspQryOrder(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspQryTrade(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspQryUserInvestor(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspQryTradingCode(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspQryInvestorAccount(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspQryInstrument(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspQryExchange(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspQryInvestorPosition(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspQryComplianceParam(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspQryInvestorFee(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspQryInvestorMargin(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspQryInvestorCombPosition(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspQryInvestorLegPosition(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspQryInstrumentGroup(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspQryClientMarginCombType(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspExecOrderInsert(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspExecOrderAction(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRtnExecOrder(const dict &data) {};
virtual void onErrRtnExecOrderInsert(const dict &data, const dict &data) {};
virtual void onErrRtnExecOrderAction(const dict &data, const dict &data) {};
virtual void onRtnTransferMoney(const dict &data) {};
virtual void onRspQrySystemTime(const dict &data, const dict &data, int reqid, bool last) {};

View File

@ -1,112 +0,0 @@
void processFrontConnected(Task *task);
void processQryFrontConnected(Task *task);
void processFrontDisconnected(Task *task);
void processQryFrontDisconnected(Task *task);
void processHeartBeatWarning(Task *task);
void processPackageStart(Task *task);
void processPackageEnd(Task *task);
void processRspError(Task *task);
void processRspUserLogin(Task *task);
void processRspUserLogout(Task *task);
void processRspUserPasswordUpdate(Task *task);
void processRspOrderInsert(Task *task);
void processRspOrderAction(Task *task);
void processRspQuoteInsert(Task *task);
void processRspQuoteAction(Task *task);
void processRspForQuote(Task *task);
void processRspMarginCombAction(Task *task);
void processRspUserDeposit(Task *task);
void processRspTransferMoney(Task *task);
void processRtnFlowMessageCancel(Task *task);
void processRtnTrade(Task *task);
void processRtnOrder(Task *task);
void processErrRtnOrderInsert(Task *task);
void processErrRtnOrderAction(Task *task);
void processRtnInstrumentStatus(Task *task);
void processRtnInvestorAccountDeposit(Task *task);
void processRtnQuote(Task *task);
void processErrRtnQuoteInsert(Task *task);
void processErrRtnQuoteAction(Task *task);
void processRtnForQuote(Task *task);
void processRtnMarginCombinationLeg(Task *task);
void processRtnMarginCombAction(Task *task);
void processRtnUserDeposit(Task *task);
void processRspQueryUserLogin(Task *task);
void processRspQryOrder(Task *task);
void processRspQryTrade(Task *task);
void processRspQryUserInvestor(Task *task);
void processRspQryTradingCode(Task *task);
void processRspQryInvestorAccount(Task *task);
void processRspQryInstrument(Task *task);
void processRspQryExchange(Task *task);
void processRspQryInvestorPosition(Task *task);
void processRspQryComplianceParam(Task *task);
void processRspQryInvestorFee(Task *task);
void processRspQryInvestorMargin(Task *task);
void processRspQryInvestorCombPosition(Task *task);
void processRspQryInvestorLegPosition(Task *task);
void processRspQryInstrumentGroup(Task *task);
void processRspQryClientMarginCombType(Task *task);
void processRspExecOrderInsert(Task *task);
void processRspExecOrderAction(Task *task);
void processRtnExecOrder(Task *task);
void processErrRtnExecOrderInsert(Task *task);
void processErrRtnExecOrderAction(Task *task);
void processRtnTransferMoney(Task *task);
void processRspQrySystemTime(Task *task);

View File

@ -1,466 +0,0 @@
int TdApi::reqUserLogin(const dict &req, int reqid)
{
CUstpFtdcReqUserLoginField myreq = CUstpFtdcReqUserLoginField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "TradingDay", myreq.TradingDay);
getString(req, "UserID", myreq.UserID);
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "Password", myreq.Password);
getString(req, "UserProductInfo", myreq.UserProductInfo);
getString(req, "InterfaceProductInfo", myreq.InterfaceProductInfo);
getString(req, "ProtocolInfo", myreq.ProtocolInfo);
getString(req, "IPAddress", myreq.IPAddress);
getString(req, "MacAddress", myreq.MacAddress);
getInt(req, "DataCenterID", &myreq.DataCenterID);
getInt(req, "UserProductFileSize", &myreq.UserProductFileSize);
getChar(req, "Authenticate2Type", &myreq.Authenticate2Type);
getString(req, "Authenticate2Password", myreq.Authenticate2Password);
getString(req, "TerminalCode", myreq.TerminalCode);
int i = this->api->ReqUserLogin(&myreq, reqid);
return i;
};
int TdApi::reqUserLogout(const dict &req, int reqid)
{
CUstpFtdcReqUserLogoutField myreq = CUstpFtdcReqUserLogoutField();
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)
{
CUstpFtdcUserPasswordUpdateField myreq = CUstpFtdcUserPasswordUpdateField();
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::reqOrderInsert(const dict &req, int reqid)
{
CUstpFtdcInputOrderField myreq = CUstpFtdcInputOrderField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "OrderSysID", myreq.OrderSysID);
getString(req, "InvestorID", myreq.InvestorID);
getString(req, "UserID", myreq.UserID);
getInt(req, "SeatNo", &myreq.SeatNo);
getString(req, "InstrumentID", myreq.InstrumentID);
getString(req, "UserOrderLocalID", myreq.UserOrderLocalID);
getChar(req, "OrderPriceType", &myreq.OrderPriceType);
getChar(req, "Direction", &myreq.Direction);
getChar(req, "OffsetFlag", &myreq.OffsetFlag);
getChar(req, "HedgeFlag", &myreq.HedgeFlag);
getDouble(req, "LimitPrice", &myreq.LimitPrice);
getInt(req, "Volume", &myreq.Volume);
getChar(req, "TimeCondition", &myreq.TimeCondition);
getString(req, "GTDDate", myreq.GTDDate);
getChar(req, "VolumeCondition", &myreq.VolumeCondition);
getInt(req, "MinVolume", &myreq.MinVolume);
getDouble(req, "StopPrice", &myreq.StopPrice);
getChar(req, "ForceCloseReason", &myreq.ForceCloseReason);
getInt(req, "IsAutoSuspend", &myreq.IsAutoSuspend);
getString(req, "BusinessUnit", myreq.BusinessUnit);
getString(req, "UserCustom", myreq.UserCustom);
getInt(req, "BusinessLocalID", &myreq.BusinessLocalID);
getString(req, "ActionDay", myreq.ActionDay);
getChar(req, "ArbiType", &myreq.ArbiType);
getString(req, "ClientID", myreq.ClientID);
int i = this->api->ReqOrderInsert(&myreq, reqid);
return i;
};
int TdApi::reqOrderAction(const dict &req, int reqid)
{
CUstpFtdcOrderActionField myreq = CUstpFtdcOrderActionField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "OrderSysID", myreq.OrderSysID);
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "InvestorID", myreq.InvestorID);
getString(req, "UserID", myreq.UserID);
getString(req, "UserOrderActionLocalID", myreq.UserOrderActionLocalID);
getString(req, "UserOrderLocalID", myreq.UserOrderLocalID);
getChar(req, "ActionFlag", &myreq.ActionFlag);
getDouble(req, "LimitPrice", &myreq.LimitPrice);
getInt(req, "VolumeChange", &myreq.VolumeChange);
getInt(req, "BusinessLocalID", &myreq.BusinessLocalID);
getString(req, "ClientID", myreq.ClientID);
int i = this->api->ReqOrderAction(&myreq, reqid);
return i;
};
int TdApi::reqQuoteInsert(const dict &req, int reqid)
{
CUstpFtdcInputQuoteField myreq = CUstpFtdcInputQuoteField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "InvestorID", myreq.InvestorID);
getString(req, "UserID", myreq.UserID);
getString(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "Direction", &myreq.Direction);
getString(req, "QuoteSysID", myreq.QuoteSysID);
getString(req, "UserQuoteLocalID", myreq.UserQuoteLocalID);
getString(req, "QuoteLocalID", myreq.QuoteLocalID);
getInt(req, "BidVolume", &myreq.BidVolume);
getChar(req, "BidOffsetFlag", &myreq.BidOffsetFlag);
getChar(req, "BidHedgeFlag", &myreq.BidHedgeFlag);
getDouble(req, "BidPrice", &myreq.BidPrice);
getInt(req, "AskVolume", &myreq.AskVolume);
getChar(req, "AskOffsetFlag", &myreq.AskOffsetFlag);
getChar(req, "AskHedgeFlag", &myreq.AskHedgeFlag);
getDouble(req, "AskPrice", &myreq.AskPrice);
getString(req, "BusinessUnit", myreq.BusinessUnit);
getString(req, "UserCustom", myreq.UserCustom);
getString(req, "BidUserOrderLocalID", myreq.BidUserOrderLocalID);
getString(req, "AskUserOrderLocalID", myreq.AskUserOrderLocalID);
getString(req, "BidOrderLocalID", myreq.BidOrderLocalID);
getString(req, "AskOrderLocalID", myreq.AskOrderLocalID);
getString(req, "ReqForQuoteID", myreq.ReqForQuoteID);
getInt(req, "StandByTime", &myreq.StandByTime);
getString(req, "ClientID", myreq.ClientID);
int i = this->api->ReqQuoteInsert(&myreq, reqid);
return i;
};
int TdApi::reqQuoteAction(const dict &req, int reqid)
{
CUstpFtdcQuoteActionField myreq = CUstpFtdcQuoteActionField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "InvestorID", myreq.InvestorID);
getString(req, "UserID", myreq.UserID);
getString(req, "QuoteSysID", myreq.QuoteSysID);
getString(req, "UserQuoteLocalID", myreq.UserQuoteLocalID);
getString(req, "UserQuoteActionLocalID", myreq.UserQuoteActionLocalID);
getChar(req, "ActionFlag", &myreq.ActionFlag);
getString(req, "BusinessUnit", myreq.BusinessUnit);
getString(req, "UserCustom", myreq.UserCustom);
getChar(req, "Direction", &myreq.Direction);
getString(req, "ClientID", myreq.ClientID);
int i = this->api->ReqQuoteAction(&myreq, reqid);
return i;
};
int TdApi::reqForQuote(const dict &req, int reqid)
{
CUstpFtdcReqForQuoteField myreq = CUstpFtdcReqForQuoteField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "ReqForQuoteID", myreq.ReqForQuoteID);
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "InvestorID", myreq.InvestorID);
getString(req, "UserID", myreq.UserID);
getString(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "Direction", &myreq.Direction);
getString(req, "TradingDay", myreq.TradingDay);
getString(req, "ReqForQuoteTime", myreq.ReqForQuoteTime);
getString(req, "ClientID", myreq.ClientID);
int i = this->api->ReqForQuote(&myreq, reqid);
return i;
};
int TdApi::reqMarginCombAction(const dict &req, int reqid)
{
CUstpFtdcInputMarginCombActionField myreq = CUstpFtdcInputMarginCombActionField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "UserID", myreq.UserID);
getString(req, "InvestorID", myreq.InvestorID);
getChar(req, "HedgeFlag", &myreq.HedgeFlag);
getString(req, "UserActionLocalID", myreq.UserActionLocalID);
getString(req, "CombInstrumentID", myreq.CombInstrumentID);
getInt(req, "CombVolume", &myreq.CombVolume);
getChar(req, "CombDirection", &myreq.CombDirection);
getString(req, "ActionLocalID", myreq.ActionLocalID);
getChar(req, "Direction", &myreq.Direction);
getString(req, "OrderSysID", myreq.OrderSysID);
getChar(req, "CombActionStatus", &myreq.CombActionStatus);
int i = this->api->ReqMarginCombAction(&myreq, reqid);
return i;
};
int TdApi::reqUserDeposit(const dict &req, int reqid)
{
CUstpFtdcstpUserDepositField myreq = CUstpFtdcstpUserDepositField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "UserID", myreq.UserID);
getString(req, "InvestorID", myreq.InvestorID);
getDouble(req, "Amount", &myreq.Amount);
getChar(req, "AmountDirection", &myreq.AmountDirection);
getString(req, "UserOrderLocalID", myreq.UserOrderLocalID);
int i = this->api->ReqUserDeposit(&myreq, reqid);
return i;
};
int TdApi::reqTransferMoney(const dict &req, int reqid)
{
CUstpFtdcstpTransferMoneyField myreq = CUstpFtdcstpTransferMoneyField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "UserID", myreq.UserID);
getString(req, "InvestorID", myreq.InvestorID);
getDouble(req, "Amount", &myreq.Amount);
getChar(req, "AmountDirection", &myreq.AmountDirection);
getString(req, "UserOrderLocalID", myreq.UserOrderLocalID);
getString(req, "BankID", myreq.BankID);
getString(req, "BankPasswd", myreq.BankPasswd);
getString(req, "AccountPasswd", myreq.AccountPasswd);
getString(req, "Currency", myreq.Currency);
getString(req, "SerialNo", myreq.SerialNo);
int i = this->api->ReqTransferMoney(&myreq, reqid);
return i;
};
int TdApi::reqQryOrder(const dict &req, int reqid)
{
CUstpFtdcQryOrderField myreq = CUstpFtdcQryOrderField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "UserID", myreq.UserID);
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "InvestorID", myreq.InvestorID);
getString(req, "OrderSysID", myreq.OrderSysID);
getString(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "OrderStatus", &myreq.OrderStatus);
getChar(req, "OrderType", &myreq.OrderType);
getString(req, "ClientID", myreq.ClientID);
int i = this->api->ReqQryOrder(&myreq, reqid);
return i;
};
int TdApi::reqQryTrade(const dict &req, int reqid)
{
CUstpFtdcQryTradeField myreq = CUstpFtdcQryTradeField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "UserID", myreq.UserID);
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "InvestorID", myreq.InvestorID);
getString(req, "TradeID", myreq.TradeID);
getString(req, "InstrumentID", myreq.InstrumentID);
getString(req, "ClientID", myreq.ClientID);
int i = this->api->ReqQryTrade(&myreq, reqid);
return i;
};
int TdApi::reqQryUserInvestor(const dict &req, int reqid)
{
CUstpFtdcQryUserInvestorField myreq = CUstpFtdcQryUserInvestorField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "UserID", myreq.UserID);
int i = this->api->ReqQryUserInvestor(&myreq, reqid);
return i;
};
int TdApi::reqQryTradingCode(const dict &req, int reqid)
{
CUstpFtdcQryTradingCodeField myreq = CUstpFtdcQryTradingCodeField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "UserID", myreq.UserID);
getString(req, "InvestorID", myreq.InvestorID);
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "ClientID", myreq.ClientID);
int i = this->api->ReqQryTradingCode(&myreq, reqid);
return i;
};
int TdApi::reqQryInvestorAccount(const dict &req, int reqid)
{
CUstpFtdcQryInvestorAccountField myreq = CUstpFtdcQryInvestorAccountField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "UserID", myreq.UserID);
getString(req, "InvestorID", myreq.InvestorID);
int i = this->api->ReqQryInvestorAccount(&myreq, reqid);
return i;
};
int TdApi::reqQryInstrument(const dict &req, int reqid)
{
CUstpFtdcQryInstrumentField myreq = CUstpFtdcQryInstrumentField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "ProductID", myreq.ProductID);
getString(req, "InstrumentID", myreq.InstrumentID);
int i = this->api->ReqQryInstrument(&myreq, reqid);
return i;
};
int TdApi::reqQryExchange(const dict &req, int reqid)
{
CUstpFtdcQryExchangeField myreq = CUstpFtdcQryExchangeField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "ExchangeID", myreq.ExchangeID);
int i = this->api->ReqQryExchange(&myreq, reqid);
return i;
};
int TdApi::reqQryInvestorPosition(const dict &req, int reqid)
{
CUstpFtdcQryInvestorPositionField myreq = CUstpFtdcQryInvestorPositionField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "UserID", myreq.UserID);
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "InvestorID", myreq.InvestorID);
getString(req, "InstrumentID", myreq.InstrumentID);
int i = this->api->ReqQryInvestorPosition(&myreq, reqid);
return i;
};
int TdApi::reqQryComplianceParam(const dict &req, int reqid)
{
CUstpFtdcQryComplianceParamField myreq = CUstpFtdcQryComplianceParamField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "UserID", myreq.UserID);
getString(req, "InvestorID", myreq.InvestorID);
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "ClientID", myreq.ClientID);
int i = this->api->ReqQryComplianceParam(&myreq, reqid);
return i;
};
int TdApi::reqQryInvestorFee(const dict &req, int reqid)
{
CUstpFtdcQryInvestorFeeField myreq = CUstpFtdcQryInvestorFeeField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "UserID", myreq.UserID);
getString(req, "InvestorID", myreq.InvestorID);
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "InstrumentID", myreq.InstrumentID);
getString(req, "ClientID", myreq.ClientID);
int i = this->api->ReqQryInvestorFee(&myreq, reqid);
return i;
};
int TdApi::reqQryInvestorMargin(const dict &req, int reqid)
{
CUstpFtdcQryInvestorMarginField myreq = CUstpFtdcQryInvestorMarginField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "UserID", myreq.UserID);
getString(req, "InvestorID", myreq.InvestorID);
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "InstrumentID", myreq.InstrumentID);
getString(req, "ClientID", myreq.ClientID);
int i = this->api->ReqQryInvestorMargin(&myreq, reqid);
return i;
};
int TdApi::reqQryInvestorCombPosition(const dict &req, int reqid)
{
CUstpFtdcQryInvestorCombPositionField myreq = CUstpFtdcQryInvestorCombPositionField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "InvestorID", myreq.InvestorID);
getChar(req, "HedgeFlag", &myreq.HedgeFlag);
getString(req, "CombInstrumentID", myreq.CombInstrumentID);
int i = this->api->ReqQryInvestorCombPosition(&myreq, reqid);
return i;
};
int TdApi::reqQryInvestorLegPosition(const dict &req, int reqid)
{
CUstpFtdcQryInvestorLegPositionField myreq = CUstpFtdcQryInvestorLegPositionField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "InvestorID", myreq.InvestorID);
getChar(req, "HedgeFlag", &myreq.HedgeFlag);
getString(req, "LegInstrumentID", myreq.LegInstrumentID);
int i = this->api->ReqQryInvestorLegPosition(&myreq, reqid);
return i;
};
int TdApi::reqQryInstrumentGroup(const dict &req, int reqid)
{
CUstpFtdcQryUstpInstrumentGroupField myreq = CUstpFtdcQryUstpInstrumentGroupField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "InstrumentID", myreq.InstrumentID);
int i = this->api->ReqQryInstrumentGroup(&myreq, reqid);
return i;
};
int TdApi::reqQryClientMarginCombType(const dict &req, int reqid)
{
CUstpFtdcQryClientMarginCombTypeField myreq = CUstpFtdcQryClientMarginCombTypeField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "InvestorID", myreq.InvestorID);
getChar(req, "HedgeFlag", &myreq.HedgeFlag);
getString(req, "InstrumentGroupID", myreq.InstrumentGroupID);
int i = this->api->ReqQryClientMarginCombType(&myreq, reqid);
return i;
};
int TdApi::reqExecOrderInsert(const dict &req, int reqid)
{
CUstpFtdcInputExecOrderField myreq = CUstpFtdcInputExecOrderField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "OrderSysID", myreq.OrderSysID);
getString(req, "InvestorID", myreq.InvestorID);
getString(req, "UserID", myreq.UserID);
getString(req, "InstrumentID", myreq.InstrumentID);
getString(req, "UserOrderLocalID", myreq.UserOrderLocalID);
getChar(req, "OrderType", &myreq.OrderType);
getChar(req, "DeliveryFlag", &myreq.DeliveryFlag);
getChar(req, "HedgeFlag", &myreq.HedgeFlag);
getInt(req, "Volume", &myreq.Volume);
getString(req, "UserCustom", myreq.UserCustom);
getString(req, "ActionDay", myreq.ActionDay);
getInt(req, "BusinessLocalID", &myreq.BusinessLocalID);
getString(req, "BusinessUnit", myreq.BusinessUnit);
int i = this->api->ReqExecOrderInsert(&myreq, reqid);
return i;
};
int TdApi::reqExecOrderAction(const dict &req, int reqid)
{
CUstpFtdcInputExecOrderActionField myreq = CUstpFtdcInputExecOrderActionField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "ExchangeID", myreq.ExchangeID);
getString(req, "OrderSysID", myreq.OrderSysID);
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "InvestorID", myreq.InvestorID);
getString(req, "UserID", myreq.UserID);
getString(req, "UserOrderActionLocalID", myreq.UserOrderActionLocalID);
getString(req, "UserOrderLocalID", myreq.UserOrderLocalID);
getChar(req, "ActionFlag", &myreq.ActionFlag);
getInt(req, "VolumeChange", &myreq.VolumeChange);
getInt(req, "BusinessLocalID", &myreq.BusinessLocalID);
getChar(req, "OrderType", &myreq.OrderType);
int i = this->api->ReqExecOrderAction(&myreq, reqid);
return i;
};
int TdApi::reqQrySystemTime(const dict &req, int reqid)
{
CUstpFtdcReqQrySystemTimeField myreq = CUstpFtdcReqQrySystemTimeField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "ExchangeID", myreq.ExchangeID);
int i = this->api->ReqQrySystemTime(&myreq, reqid);
return i;
};

View File

@ -1,87 +0,0 @@
.def("reqUserLogin", &TdApi::reqUserLogin)
.def("reqUserLogout", &TdApi::reqUserLogout)
.def("reqUserPasswordUpdate", &TdApi::reqUserPasswordUpdate)
.def("reqOrderInsert", &TdApi::reqOrderInsert)
.def("reqOrderAction", &TdApi::reqOrderAction)
.def("reqQuoteInsert", &TdApi::reqQuoteInsert)
.def("reqQuoteAction", &TdApi::reqQuoteAction)
.def("reqForQuote", &TdApi::reqForQuote)
.def("reqMarginCombAction", &TdApi::reqMarginCombAction)
.def("reqUserDeposit", &TdApi::reqUserDeposit)
.def("reqTransferMoney", &TdApi::reqTransferMoney)
.def("reqQryOrder", &TdApi::reqQryOrder)
.def("reqQryTrade", &TdApi::reqQryTrade)
.def("reqQryUserInvestor", &TdApi::reqQryUserInvestor)
.def("reqQryTradingCode", &TdApi::reqQryTradingCode)
.def("reqQryInvestorAccount", &TdApi::reqQryInvestorAccount)
.def("reqQryInstrument", &TdApi::reqQryInstrument)
.def("reqQryExchange", &TdApi::reqQryExchange)
.def("reqQryInvestorPosition", &TdApi::reqQryInvestorPosition)
.def("reqQryComplianceParam", &TdApi::reqQryComplianceParam)
.def("reqQryInvestorFee", &TdApi::reqQryInvestorFee)
.def("reqQryInvestorMargin", &TdApi::reqQryInvestorMargin)
.def("reqQryInvestorCombPosition", &TdApi::reqQryInvestorCombPosition)
.def("reqQryInvestorLegPosition", &TdApi::reqQryInvestorLegPosition)
.def("reqQryInstrumentGroup", &TdApi::reqQryInstrumentGroup)
.def("reqQryClientMarginCombType", &TdApi::reqQryClientMarginCombType)
.def("reqExecOrderInsert", &TdApi::reqExecOrderInsert)
.def("reqExecOrderAction", &TdApi::reqExecOrderAction)
.def("reqQrySystemTime", &TdApi::reqQrySystemTime)
.def("onFrontConnected", &TdApi::onFrontConnected)
.def("onQryFrontConnected", &TdApi::onQryFrontConnected)
.def("onFrontDisconnected", &TdApi::onFrontDisconnected)
.def("onQryFrontDisconnected", &TdApi::onQryFrontDisconnected)
.def("onHeartBeatWarning", &TdApi::onHeartBeatWarning)
.def("onPackageStart", &TdApi::onPackageStart)
.def("onPackageEnd", &TdApi::onPackageEnd)
.def("onRspError", &TdApi::onRspError)
.def("onRspUserLogin", &TdApi::onRspUserLogin)
.def("onRspUserLogout", &TdApi::onRspUserLogout)
.def("onRspUserPasswordUpdate", &TdApi::onRspUserPasswordUpdate)
.def("onRspOrderInsert", &TdApi::onRspOrderInsert)
.def("onRspOrderAction", &TdApi::onRspOrderAction)
.def("onRspQuoteInsert", &TdApi::onRspQuoteInsert)
.def("onRspQuoteAction", &TdApi::onRspQuoteAction)
.def("onRspForQuote", &TdApi::onRspForQuote)
.def("onRspMarginCombAction", &TdApi::onRspMarginCombAction)
.def("onRspUserDeposit", &TdApi::onRspUserDeposit)
.def("onRspTransferMoney", &TdApi::onRspTransferMoney)
.def("onRtnFlowMessageCancel", &TdApi::onRtnFlowMessageCancel)
.def("onRtnTrade", &TdApi::onRtnTrade)
.def("onRtnOrder", &TdApi::onRtnOrder)
.def("onErrRtnOrderInsert", &TdApi::onErrRtnOrderInsert)
.def("onErrRtnOrderAction", &TdApi::onErrRtnOrderAction)
.def("onRtnInstrumentStatus", &TdApi::onRtnInstrumentStatus)
.def("onRtnInvestorAccountDeposit", &TdApi::onRtnInvestorAccountDeposit)
.def("onRtnQuote", &TdApi::onRtnQuote)
.def("onErrRtnQuoteInsert", &TdApi::onErrRtnQuoteInsert)
.def("onErrRtnQuoteAction", &TdApi::onErrRtnQuoteAction)
.def("onRtnForQuote", &TdApi::onRtnForQuote)
.def("onRtnMarginCombinationLeg", &TdApi::onRtnMarginCombinationLeg)
.def("onRtnMarginCombAction", &TdApi::onRtnMarginCombAction)
.def("onRtnUserDeposit", &TdApi::onRtnUserDeposit)
.def("onRspQueryUserLogin", &TdApi::onRspQueryUserLogin)
.def("onRspQryOrder", &TdApi::onRspQryOrder)
.def("onRspQryTrade", &TdApi::onRspQryTrade)
.def("onRspQryUserInvestor", &TdApi::onRspQryUserInvestor)
.def("onRspQryTradingCode", &TdApi::onRspQryTradingCode)
.def("onRspQryInvestorAccount", &TdApi::onRspQryInvestorAccount)
.def("onRspQryInstrument", &TdApi::onRspQryInstrument)
.def("onRspQryExchange", &TdApi::onRspQryExchange)
.def("onRspQryInvestorPosition", &TdApi::onRspQryInvestorPosition)
.def("onRspQryComplianceParam", &TdApi::onRspQryComplianceParam)
.def("onRspQryInvestorFee", &TdApi::onRspQryInvestorFee)
.def("onRspQryInvestorMargin", &TdApi::onRspQryInvestorMargin)
.def("onRspQryInvestorCombPosition", &TdApi::onRspQryInvestorCombPosition)
.def("onRspQryInvestorLegPosition", &TdApi::onRspQryInvestorLegPosition)
.def("onRspQryInstrumentGroup", &TdApi::onRspQryInstrumentGroup)
.def("onRspQryClientMarginCombType", &TdApi::onRspQryClientMarginCombType)
.def("onRspExecOrderInsert", &TdApi::onRspExecOrderInsert)
.def("onRspExecOrderAction", &TdApi::onRspExecOrderAction)
.def("onRtnExecOrder", &TdApi::onRtnExecOrder)
.def("onErrRtnExecOrderInsert", &TdApi::onErrRtnExecOrderInsert)
.def("onErrRtnExecOrderAction", &TdApi::onErrRtnExecOrderAction)
.def("onRtnTransferMoney", &TdApi::onRtnTransferMoney)
.def("onRspQrySystemTime", &TdApi::onRspQrySystemTime)
;

View File

@ -1,672 +0,0 @@
void onFrontConnected() override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onFrontConnected);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQryFrontConnected() override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQryFrontConnected);
}
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 onQryFrontDisconnected(int reqid) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQryFrontDisconnected, 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 onPackageStart(int reqid, int reqid) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onPackageStart, reqid, reqid);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onPackageEnd(int reqid, int reqid) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onPackageEnd, reqid, reqid);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspError(const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspError, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspUserLogin(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspUserLogin, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspUserLogout(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspUserLogout, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspUserPasswordUpdate(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspUserPasswordUpdate, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspOrderInsert(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspOrderInsert, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspOrderAction(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspOrderAction, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQuoteInsert(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQuoteInsert, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQuoteAction(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQuoteAction, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspForQuote(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspForQuote, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspMarginCombAction(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspMarginCombAction, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspUserDeposit(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspUserDeposit, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspTransferMoney(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspTransferMoney, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRtnFlowMessageCancel(const dict &data) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRtnFlowMessageCancel, 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 onRtnOrder(const dict &data) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRtnOrder, data);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onErrRtnOrderInsert(const dict &data, const dict &data) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onErrRtnOrderInsert, data, data);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onErrRtnOrderAction(const dict &data, const dict &data) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onErrRtnOrderAction, data, data);
}
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 onRtnInvestorAccountDeposit(const dict &data) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRtnInvestorAccountDeposit, data);
}
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 &data) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onErrRtnQuoteInsert, data, data);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onErrRtnQuoteAction(const dict &data, const dict &data) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onErrRtnQuoteAction, data, data);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRtnForQuote(const dict &data) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRtnForQuote, data);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRtnMarginCombinationLeg(const dict &data) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRtnMarginCombinationLeg, data);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRtnMarginCombAction(const dict &data) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRtnMarginCombAction, data);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRtnUserDeposit(const dict &data) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRtnUserDeposit, data);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQueryUserLogin(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQueryUserLogin, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQryOrder(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQryOrder, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQryTrade(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQryTrade, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQryUserInvestor(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQryUserInvestor, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQryTradingCode(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQryTradingCode, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQryInvestorAccount(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQryInvestorAccount, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQryInstrument(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQryInstrument, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQryExchange(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQryExchange, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQryInvestorPosition(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQryInvestorPosition, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQryComplianceParam(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQryComplianceParam, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQryInvestorFee(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQryInvestorFee, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQryInvestorMargin(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQryInvestorMargin, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQryInvestorCombPosition(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQryInvestorCombPosition, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQryInvestorLegPosition(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQryInvestorLegPosition, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQryInstrumentGroup(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQryInstrumentGroup, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQryClientMarginCombType(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQryClientMarginCombType, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspExecOrderInsert(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspExecOrderInsert, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspExecOrderAction(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspExecOrderAction, data, data, reqid, last);
}
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 &data) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onErrRtnExecOrderInsert, data, data);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onErrRtnExecOrderAction(const dict &data, const dict &data) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onErrRtnExecOrderAction, data, data);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRtnTransferMoney(const dict &data) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRtnTransferMoney, data);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspQrySystemTime(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onRspQrySystemTime, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};

File diff suppressed because it is too large Load Diff

View File

@ -1,336 +0,0 @@
case ONFRONTCONNECTED:
{
this->processFrontConnected(&task);
break;
}
case ONQRYFRONTCONNECTED:
{
this->processQryFrontConnected(&task);
break;
}
case ONFRONTDISCONNECTED:
{
this->processFrontDisconnected(&task);
break;
}
case ONQRYFRONTDISCONNECTED:
{
this->processQryFrontDisconnected(&task);
break;
}
case ONHEARTBEATWARNING:
{
this->processHeartBeatWarning(&task);
break;
}
case ONPACKAGESTART:
{
this->processPackageStart(&task);
break;
}
case ONPACKAGEEND:
{
this->processPackageEnd(&task);
break;
}
case ONRSPERROR:
{
this->processRspError(&task);
break;
}
case ONRSPUSERLOGIN:
{
this->processRspUserLogin(&task);
break;
}
case ONRSPUSERLOGOUT:
{
this->processRspUserLogout(&task);
break;
}
case ONRSPUSERPASSWORDUPDATE:
{
this->processRspUserPasswordUpdate(&task);
break;
}
case ONRSPORDERINSERT:
{
this->processRspOrderInsert(&task);
break;
}
case ONRSPORDERACTION:
{
this->processRspOrderAction(&task);
break;
}
case ONRSPQUOTEINSERT:
{
this->processRspQuoteInsert(&task);
break;
}
case ONRSPQUOTEACTION:
{
this->processRspQuoteAction(&task);
break;
}
case ONRSPFORQUOTE:
{
this->processRspForQuote(&task);
break;
}
case ONRSPMARGINCOMBACTION:
{
this->processRspMarginCombAction(&task);
break;
}
case ONRSPUSERDEPOSIT:
{
this->processRspUserDeposit(&task);
break;
}
case ONRSPTRANSFERMONEY:
{
this->processRspTransferMoney(&task);
break;
}
case ONRTNFLOWMESSAGECANCEL:
{
this->processRtnFlowMessageCancel(&task);
break;
}
case ONRTNTRADE:
{
this->processRtnTrade(&task);
break;
}
case ONRTNORDER:
{
this->processRtnOrder(&task);
break;
}
case ONERRRTNORDERINSERT:
{
this->processErrRtnOrderInsert(&task);
break;
}
case ONERRRTNORDERACTION:
{
this->processErrRtnOrderAction(&task);
break;
}
case ONRTNINSTRUMENTSTATUS:
{
this->processRtnInstrumentStatus(&task);
break;
}
case ONRTNINVESTORACCOUNTDEPOSIT:
{
this->processRtnInvestorAccountDeposit(&task);
break;
}
case ONRTNQUOTE:
{
this->processRtnQuote(&task);
break;
}
case ONERRRTNQUOTEINSERT:
{
this->processErrRtnQuoteInsert(&task);
break;
}
case ONERRRTNQUOTEACTION:
{
this->processErrRtnQuoteAction(&task);
break;
}
case ONRTNFORQUOTE:
{
this->processRtnForQuote(&task);
break;
}
case ONRTNMARGINCOMBINATIONLEG:
{
this->processRtnMarginCombinationLeg(&task);
break;
}
case ONRTNMARGINCOMBACTION:
{
this->processRtnMarginCombAction(&task);
break;
}
case ONRTNUSERDEPOSIT:
{
this->processRtnUserDeposit(&task);
break;
}
case ONRSPQUERYUSERLOGIN:
{
this->processRspQueryUserLogin(&task);
break;
}
case ONRSPQRYORDER:
{
this->processRspQryOrder(&task);
break;
}
case ONRSPQRYTRADE:
{
this->processRspQryTrade(&task);
break;
}
case ONRSPQRYUSERINVESTOR:
{
this->processRspQryUserInvestor(&task);
break;
}
case ONRSPQRYTRADINGCODE:
{
this->processRspQryTradingCode(&task);
break;
}
case ONRSPQRYINVESTORACCOUNT:
{
this->processRspQryInvestorAccount(&task);
break;
}
case ONRSPQRYINSTRUMENT:
{
this->processRspQryInstrument(&task);
break;
}
case ONRSPQRYEXCHANGE:
{
this->processRspQryExchange(&task);
break;
}
case ONRSPQRYINVESTORPOSITION:
{
this->processRspQryInvestorPosition(&task);
break;
}
case ONRSPQRYCOMPLIANCEPARAM:
{
this->processRspQryComplianceParam(&task);
break;
}
case ONRSPQRYINVESTORFEE:
{
this->processRspQryInvestorFee(&task);
break;
}
case ONRSPQRYINVESTORMARGIN:
{
this->processRspQryInvestorMargin(&task);
break;
}
case ONRSPQRYINVESTORCOMBPOSITION:
{
this->processRspQryInvestorCombPosition(&task);
break;
}
case ONRSPQRYINVESTORLEGPOSITION:
{
this->processRspQryInvestorLegPosition(&task);
break;
}
case ONRSPQRYINSTRUMENTGROUP:
{
this->processRspQryInstrumentGroup(&task);
break;
}
case ONRSPQRYCLIENTMARGINCOMBTYPE:
{
this->processRspQryClientMarginCombType(&task);
break;
}
case ONRSPEXECORDERINSERT:
{
this->processRspExecOrderInsert(&task);
break;
}
case ONRSPEXECORDERACTION:
{
this->processRspExecOrderAction(&task);
break;
}
case ONRTNEXECORDER:
{
this->processRtnExecOrder(&task);
break;
}
case ONERRRTNEXECORDERINSERT:
{
this->processErrRtnExecOrderInsert(&task);
break;
}
case ONERRRTNEXECORDERACTION:
{
this->processErrRtnExecOrderAction(&task);
break;
}
case ONRTNTRANSFERMONEY:
{
this->processRtnTransferMoney(&task);
break;
}
case ONRSPQRYSYSTEMTIME:
{
this->processRspQrySystemTime(&task);
break;
}

View File

@ -1,971 +0,0 @@
void TdApi::OnFrontConnected()
{
Task task = Task();
task.task_name = ONFRONTCONNECTED;
this->task_queue.push(task);
};
void TdApi::OnQryFrontConnected()
{
Task task = Task();
task.task_name = ONQRYFRONTCONNECTED;
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::OnQryFrontDisconnected(int nReason)
{
Task task = Task();
task.task_name = ONQRYFRONTDISCONNECTED;
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::OnPackageStart(int nTopicID, int nSequenceNo)
{
Task task = Task();
task.task_name = ONPACKAGESTART;
task.task_id = nTopicID;
task.task_id = nSequenceNo;
this->task_queue.push(task);
};
void TdApi::OnPackageEnd(int nTopicID, int nSequenceNo)
{
Task task = Task();
task.task_name = ONPACKAGEEND;
task.task_id = nTopicID;
task.task_id = nSequenceNo;
this->task_queue.push(task);
};
void TdApi::OnRspError(CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPERROR;
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspUserLogin(CUstpFtdcRspUserLoginField *pRspUserLogin, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPUSERLOGIN;
if (pRspUserLogin)
{
CUstpFtdcRspUserLoginField *task_data = new CUstpFtdcRspUserLoginField();
*task_data = *pRspUserLogin;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspUserLogout(CUstpFtdcRspUserLogoutField *pRspUserLogout, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPUSERLOGOUT;
if (pRspUserLogout)
{
CUstpFtdcRspUserLogoutField *task_data = new CUstpFtdcRspUserLogoutField();
*task_data = *pRspUserLogout;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspUserPasswordUpdate(CUstpFtdcUserPasswordUpdateField *pUserPasswordUpdate, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPUSERPASSWORDUPDATE;
if (pUserPasswordUpdate)
{
CUstpFtdcUserPasswordUpdateField *task_data = new CUstpFtdcUserPasswordUpdateField();
*task_data = *pUserPasswordUpdate;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspOrderInsert(CUstpFtdcInputOrderField *pInputOrder, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPORDERINSERT;
if (pInputOrder)
{
CUstpFtdcInputOrderField *task_data = new CUstpFtdcInputOrderField();
*task_data = *pInputOrder;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspOrderAction(CUstpFtdcOrderActionField *pOrderAction, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPORDERACTION;
if (pOrderAction)
{
CUstpFtdcOrderActionField *task_data = new CUstpFtdcOrderActionField();
*task_data = *pOrderAction;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspQuoteInsert(CUstpFtdcInputQuoteField *pInputQuote, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQUOTEINSERT;
if (pInputQuote)
{
CUstpFtdcInputQuoteField *task_data = new CUstpFtdcInputQuoteField();
*task_data = *pInputQuote;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspQuoteAction(CUstpFtdcQuoteActionField *pQuoteAction, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQUOTEACTION;
if (pQuoteAction)
{
CUstpFtdcQuoteActionField *task_data = new CUstpFtdcQuoteActionField();
*task_data = *pQuoteAction;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspForQuote(CUstpFtdcReqForQuoteField *pReqForQuote, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPFORQUOTE;
if (pReqForQuote)
{
CUstpFtdcReqForQuoteField *task_data = new CUstpFtdcReqForQuoteField();
*task_data = *pReqForQuote;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspMarginCombAction(CUstpFtdcInputMarginCombActionField *pInputMarginCombAction, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPMARGINCOMBACTION;
if (pInputMarginCombAction)
{
CUstpFtdcInputMarginCombActionField *task_data = new CUstpFtdcInputMarginCombActionField();
*task_data = *pInputMarginCombAction;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspUserDeposit(CUstpFtdcstpUserDepositField *pstpUserDeposit, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPUSERDEPOSIT;
if (pstpUserDeposit)
{
CUstpFtdcstpUserDepositField *task_data = new CUstpFtdcstpUserDepositField();
*task_data = *pstpUserDeposit;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspTransferMoney(CUstpFtdcstpTransferMoneyField *pstpTransferMoney, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPTRANSFERMONEY;
if (pstpTransferMoney)
{
CUstpFtdcstpTransferMoneyField *task_data = new CUstpFtdcstpTransferMoneyField();
*task_data = *pstpTransferMoney;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRtnFlowMessageCancel(CUstpFtdcFlowMessageCancelField *pFlowMessageCancel)
{
Task task = Task();
task.task_name = ONRTNFLOWMESSAGECANCEL;
if (pFlowMessageCancel)
{
CUstpFtdcFlowMessageCancelField *task_data = new CUstpFtdcFlowMessageCancelField();
*task_data = *pFlowMessageCancel;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnRtnTrade(CUstpFtdcTradeField *pTrade)
{
Task task = Task();
task.task_name = ONRTNTRADE;
if (pTrade)
{
CUstpFtdcTradeField *task_data = new CUstpFtdcTradeField();
*task_data = *pTrade;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnRtnOrder(CUstpFtdcOrderField *pOrder)
{
Task task = Task();
task.task_name = ONRTNORDER;
if (pOrder)
{
CUstpFtdcOrderField *task_data = new CUstpFtdcOrderField();
*task_data = *pOrder;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnErrRtnOrderInsert(CUstpFtdcInputOrderField *pInputOrder, CUstpFtdcRspInfoField *pRspInfo)
{
Task task = Task();
task.task_name = ONERRRTNORDERINSERT;
if (pInputOrder)
{
CUstpFtdcInputOrderField *task_data = new CUstpFtdcInputOrderField();
*task_data = *pInputOrder;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnErrRtnOrderAction(CUstpFtdcOrderActionField *pOrderAction, CUstpFtdcRspInfoField *pRspInfo)
{
Task task = Task();
task.task_name = ONERRRTNORDERACTION;
if (pOrderAction)
{
CUstpFtdcOrderActionField *task_data = new CUstpFtdcOrderActionField();
*task_data = *pOrderAction;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnRtnInstrumentStatus(CUstpFtdcInstrumentStatusField *pInstrumentStatus)
{
Task task = Task();
task.task_name = ONRTNINSTRUMENTSTATUS;
if (pInstrumentStatus)
{
CUstpFtdcInstrumentStatusField *task_data = new CUstpFtdcInstrumentStatusField();
*task_data = *pInstrumentStatus;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnRtnInvestorAccountDeposit(CUstpFtdcInvestorAccountDepositResField *pInvestorAccountDepositRes)
{
Task task = Task();
task.task_name = ONRTNINVESTORACCOUNTDEPOSIT;
if (pInvestorAccountDepositRes)
{
CUstpFtdcInvestorAccountDepositResField *task_data = new CUstpFtdcInvestorAccountDepositResField();
*task_data = *pInvestorAccountDepositRes;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnRtnQuote(CUstpFtdcRtnQuoteField *pRtnQuote)
{
Task task = Task();
task.task_name = ONRTNQUOTE;
if (pRtnQuote)
{
CUstpFtdcRtnQuoteField *task_data = new CUstpFtdcRtnQuoteField();
*task_data = *pRtnQuote;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnErrRtnQuoteInsert(CUstpFtdcInputQuoteField *pInputQuote, CUstpFtdcRspInfoField *pRspInfo)
{
Task task = Task();
task.task_name = ONERRRTNQUOTEINSERT;
if (pInputQuote)
{
CUstpFtdcInputQuoteField *task_data = new CUstpFtdcInputQuoteField();
*task_data = *pInputQuote;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnErrRtnQuoteAction(CUstpFtdcQuoteActionField *pQuoteAction, CUstpFtdcRspInfoField *pRspInfo)
{
Task task = Task();
task.task_name = ONERRRTNQUOTEACTION;
if (pQuoteAction)
{
CUstpFtdcQuoteActionField *task_data = new CUstpFtdcQuoteActionField();
*task_data = *pQuoteAction;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnRtnForQuote(CUstpFtdcReqForQuoteField *pReqForQuote)
{
Task task = Task();
task.task_name = ONRTNFORQUOTE;
if (pReqForQuote)
{
CUstpFtdcReqForQuoteField *task_data = new CUstpFtdcReqForQuoteField();
*task_data = *pReqForQuote;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnRtnMarginCombinationLeg(CUstpFtdcMarginCombinationLegField *pMarginCombinationLeg)
{
Task task = Task();
task.task_name = ONRTNMARGINCOMBINATIONLEG;
if (pMarginCombinationLeg)
{
CUstpFtdcMarginCombinationLegField *task_data = new CUstpFtdcMarginCombinationLegField();
*task_data = *pMarginCombinationLeg;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnRtnMarginCombAction(CUstpFtdcInputMarginCombActionField *pInputMarginCombAction)
{
Task task = Task();
task.task_name = ONRTNMARGINCOMBACTION;
if (pInputMarginCombAction)
{
CUstpFtdcInputMarginCombActionField *task_data = new CUstpFtdcInputMarginCombActionField();
*task_data = *pInputMarginCombAction;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnRtnUserDeposit(CUstpFtdcstpUserDepositField *pstpUserDeposit)
{
Task task = Task();
task.task_name = ONRTNUSERDEPOSIT;
if (pstpUserDeposit)
{
CUstpFtdcstpUserDepositField *task_data = new CUstpFtdcstpUserDepositField();
*task_data = *pstpUserDeposit;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnRspQueryUserLogin(CUstpFtdcRspUserLoginField *pRspUserLogin, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQUERYUSERLOGIN;
if (pRspUserLogin)
{
CUstpFtdcRspUserLoginField *task_data = new CUstpFtdcRspUserLoginField();
*task_data = *pRspUserLogin;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspQryOrder(CUstpFtdcOrderField *pOrder, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQRYORDER;
if (pOrder)
{
CUstpFtdcOrderField *task_data = new CUstpFtdcOrderField();
*task_data = *pOrder;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspQryTrade(CUstpFtdcTradeField *pTrade, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQRYTRADE;
if (pTrade)
{
CUstpFtdcTradeField *task_data = new CUstpFtdcTradeField();
*task_data = *pTrade;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspQryUserInvestor(CUstpFtdcRspUserInvestorField *pRspUserInvestor, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQRYUSERINVESTOR;
if (pRspUserInvestor)
{
CUstpFtdcRspUserInvestorField *task_data = new CUstpFtdcRspUserInvestorField();
*task_data = *pRspUserInvestor;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspQryTradingCode(CUstpFtdcRspTradingCodeField *pRspTradingCode, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQRYTRADINGCODE;
if (pRspTradingCode)
{
CUstpFtdcRspTradingCodeField *task_data = new CUstpFtdcRspTradingCodeField();
*task_data = *pRspTradingCode;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspQryInvestorAccount(CUstpFtdcRspInvestorAccountField *pRspInvestorAccount, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQRYINVESTORACCOUNT;
if (pRspInvestorAccount)
{
CUstpFtdcRspInvestorAccountField *task_data = new CUstpFtdcRspInvestorAccountField();
*task_data = *pRspInvestorAccount;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspQryInstrument(CUstpFtdcRspInstrumentField *pRspInstrument, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQRYINSTRUMENT;
if (pRspInstrument)
{
CUstpFtdcRspInstrumentField *task_data = new CUstpFtdcRspInstrumentField();
*task_data = *pRspInstrument;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspQryExchange(CUstpFtdcRspExchangeField *pRspExchange, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQRYEXCHANGE;
if (pRspExchange)
{
CUstpFtdcRspExchangeField *task_data = new CUstpFtdcRspExchangeField();
*task_data = *pRspExchange;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspQryInvestorPosition(CUstpFtdcRspInvestorPositionField *pRspInvestorPosition, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQRYINVESTORPOSITION;
if (pRspInvestorPosition)
{
CUstpFtdcRspInvestorPositionField *task_data = new CUstpFtdcRspInvestorPositionField();
*task_data = *pRspInvestorPosition;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspQryComplianceParam(CUstpFtdcRspComplianceParamField *pRspComplianceParam, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQRYCOMPLIANCEPARAM;
if (pRspComplianceParam)
{
CUstpFtdcRspComplianceParamField *task_data = new CUstpFtdcRspComplianceParamField();
*task_data = *pRspComplianceParam;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspQryInvestorFee(CUstpFtdcInvestorFeeField *pInvestorFee, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQRYINVESTORFEE;
if (pInvestorFee)
{
CUstpFtdcInvestorFeeField *task_data = new CUstpFtdcInvestorFeeField();
*task_data = *pInvestorFee;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspQryInvestorMargin(CUstpFtdcInvestorMarginField *pInvestorMargin, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQRYINVESTORMARGIN;
if (pInvestorMargin)
{
CUstpFtdcInvestorMarginField *task_data = new CUstpFtdcInvestorMarginField();
*task_data = *pInvestorMargin;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspQryInvestorCombPosition(CUstpFtdcRspInvestorCombPositionField *pRspInvestorCombPosition, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQRYINVESTORCOMBPOSITION;
if (pRspInvestorCombPosition)
{
CUstpFtdcRspInvestorCombPositionField *task_data = new CUstpFtdcRspInvestorCombPositionField();
*task_data = *pRspInvestorCombPosition;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspQryInvestorLegPosition(CUstpFtdcRspInvestorLegPositionField *pRspInvestorLegPosition, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQRYINVESTORLEGPOSITION;
if (pRspInvestorLegPosition)
{
CUstpFtdcRspInvestorLegPositionField *task_data = new CUstpFtdcRspInvestorLegPositionField();
*task_data = *pRspInvestorLegPosition;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspQryInstrumentGroup(CUstpFtdcRspInstrumentGroupField *pRspInstrumentGroup, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQRYINSTRUMENTGROUP;
if (pRspInstrumentGroup)
{
CUstpFtdcRspInstrumentGroupField *task_data = new CUstpFtdcRspInstrumentGroupField();
*task_data = *pRspInstrumentGroup;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspQryClientMarginCombType(CUstpFtdcRspClientMarginCombTypeField *pRspClientMarginCombType, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQRYCLIENTMARGINCOMBTYPE;
if (pRspClientMarginCombType)
{
CUstpFtdcRspClientMarginCombTypeField *task_data = new CUstpFtdcRspClientMarginCombTypeField();
*task_data = *pRspClientMarginCombType;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspExecOrderInsert(CUstpFtdcInputExecOrderField *pInputExecOrder, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPEXECORDERINSERT;
if (pInputExecOrder)
{
CUstpFtdcInputExecOrderField *task_data = new CUstpFtdcInputExecOrderField();
*task_data = *pInputExecOrder;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRspExecOrderAction(CUstpFtdcInputExecOrderActionField *pInputExecOrderAction, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPEXECORDERACTION;
if (pInputExecOrderAction)
{
CUstpFtdcInputExecOrderActionField *task_data = new CUstpFtdcInputExecOrderActionField();
*task_data = *pInputExecOrderAction;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void TdApi::OnRtnExecOrder(CUstpFtdcExecOrderField *pExecOrder)
{
Task task = Task();
task.task_name = ONRTNEXECORDER;
if (pExecOrder)
{
CUstpFtdcExecOrderField *task_data = new CUstpFtdcExecOrderField();
*task_data = *pExecOrder;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnErrRtnExecOrderInsert(CUstpFtdcInputExecOrderField *pInputExecOrder, CUstpFtdcRspInfoField *pRspInfo)
{
Task task = Task();
task.task_name = ONERRRTNEXECORDERINSERT;
if (pInputExecOrder)
{
CUstpFtdcInputExecOrderField *task_data = new CUstpFtdcInputExecOrderField();
*task_data = *pInputExecOrder;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnErrRtnExecOrderAction(CUstpFtdcInputExecOrderActionField *pInputExecOrderAction, CUstpFtdcRspInfoField *pRspInfo)
{
Task task = Task();
task.task_name = ONERRRTNEXECORDERACTION;
if (pInputExecOrderAction)
{
CUstpFtdcInputExecOrderActionField *task_data = new CUstpFtdcInputExecOrderActionField();
*task_data = *pInputExecOrderAction;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnRtnTransferMoney(CUstpFtdcSyncMoneyTransferField *pSyncMoneyTransfer)
{
Task task = Task();
task.task_name = ONRTNTRANSFERMONEY;
if (pSyncMoneyTransfer)
{
CUstpFtdcSyncMoneyTransferField *task_data = new CUstpFtdcSyncMoneyTransferField();
*task_data = *pSyncMoneyTransfer;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void TdApi::OnRspQrySystemTime(CUstpFtdcRspQrySystemTimeField *pRspQrySystemTime, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPQRYSYSTEMTIME;
if (pRspQrySystemTime)
{
CUstpFtdcRspQrySystemTimeField *task_data = new CUstpFtdcRspQrySystemTimeField();
*task_data = *pRspQrySystemTime;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};

View File

@ -1,103 +0,0 @@
TUstpFtdcPriceTickType = "double"
TUstpFtdcPriceType = "double"
TUstpFtdcRatioType = "double"
TUstpFtdcMoneyType = "double"
TUstpFtdcLargeVolumeType = "double"
TUstpFtdcSequenceNoType = "int"
TUstpFtdcMillisecType = "int"
TUstpFtdcVolumeType = "int"
TUstpFtdcUnderlyingMultipleType = "int"
TUstpFtdcVolumeMultipleType = "int"
TUstpFtdcSequenceSeriesType = "int"
TUstpFtdcErrorIDType = "int"
TUstpFtdcDataCenterIDType = "int"
TUstpFtdcSettlementIDType = "int"
TUstpFtdcBusinessLocalIDType = "int"
TUstpFtdcMeasureSecType = "int"
TUstpFtdcSeatNoType = "int"
TUstpFtdcFileSizeType = "int"
TUstpFtdcFemasLifeCycleType = "int"
TUstpFtdcMonthType = "int"
TUstpFtdcBoolType = "int"
TUstpFtdcYearType = "int"
TUstpFtdcPriorityType = "int"
TUstpFtdcMemTableNameType = "string"
TUstpFtdcOrderSysIDType = "string"
TUstpFtdcTradeIDType = "string"
TUstpFtdcUserIDType = "string"
TUstpFtdcParticipantIDType = "string"
TUstpFtdcIPAddressType = "string"
TUstpFtdcMacAddressType = "string"
TUstpFtdcInstrumentNameType = "string"
TUstpFtdcInstrumentIDType = "string"
TUstpFtdcExchangeNameType = "string"
TUstpFtdcExchangeIDType = "string"
TUstpFtdcDateType = "string"
TUstpFtdcTimeType = "string"
TUstpFtdcClientIDType = "string"
TUstpFtdcAccountIDType = "string"
TUstpFtdcSeatIDType = "string"
TUstpFtdcProductNameType = "string"
TUstpFtdcUserOrderLocalIDType = "string"
TUstpFtdcOrderLocalIDType = "string"
TUstpFtdcInvestorIDType = "string"
TUstpFtdcUserNameType = "string"
TUstpFtdcPasswordType = "string"
TUstpFtdcProductInfoType = "string"
TUstpFtdcProtocolInfoType = "string"
TUstpFtdcBusinessUnitType = "string"
TUstpFtdcTradingSystemNameType = "string"
TUstpFtdcBrokerIDType = "string"
TUstpFtdcCustomType = "string"
TUstpFtdcTradingDayType = "string"
TUstpFtdcDepartmentType = "string"
TUstpFtdcProductIDType = "string"
TUstpFtdcAccountSeqNoType = "string"
TUstpFtdcSettlementGroupIDType = "string"
TUstpFtdcFemasVersionType = "string"
TUstpFtdcBankIDType = "string"
TUstpFtdcBankPasswdType = "string"
TUstpFtdcAccountPasswdType = "string"
TUstpFtdcTransBankIDType = "string"
TUstpFtdcTransSerialType = "string"
TUstpFtdcTransBankAccountType = "string"
TUstpFtdcTransTradeCodeType = "string"
TUstpFtdcErrorMsgType = "string"
TUstpFtdcAuthenticate2PasswordType = "string"
TUstpFtdcTerminalCodeType = "string"
TUstpFtdcVolumeConditionType = "char"
TUstpFtdcForceCloseReasonType = "char"
TUstpFtdcInstrumentStatusType = "char"
TUstpFtdcOffsetFlagType = "char"
TUstpFtdcOrderPriceTypeType = "char"
TUstpFtdcOrderStatusType = "char"
TUstpFtdcUserTypeType = "char"
TUstpFtdcTradingRightType = "char"
TUstpFtdcTimeConditionType = "char"
TUstpFtdcOrderSourceType = "char"
TUstpFtdcDirectionType = "char"
TUstpFtdcCurrencyType = "char"
TUstpFtdcAccountDirectionType = "char"
TUstpFtdcSyncDirectionType = "char"
TUstpFtdcTradeSyncSourceType = "char"
TUstpFtdcHedgeFlagType = "char"
TUstpFtdcActionFlagType = "char"
TUstpFtdcPositionTypeType = "char"
TUstpFtdcOptionsTypeType = "char"
TUstpFtdcIsActiveType = "char"
TUstpFtdcCurrencyIDType = "string"
TUstpFtdcClientMarginCombTypeType = "char"
TUstpFtdcInstrumentGroupIDType = "string"
TUstpFtdcQuoteSysIDType = "string"
TUstpFtdcUserQuoteLocalIDType = "string"
TUstpFtdcQuoteLocalIDType = "string"
TUstpFtdcGrantFuncSetType = "char"
TUstpFtdcQuoteStatusType = "char"
TUstpFtdcLegMultipleType = "int"
TUstpFtdcLegIDType = "int"
TUstpFtdcCombDirectionType = "char"
TUstpFtdcArbiTypeType = "char"
TUstpFtdcOrderTypeType = "char"
TUstpFtdcDeliveryFlagType = "char"
TUstpFtdcCombActionStatusType = "char"
TUstpFtdcAuthenticate2TypeType = "char"

View File

@ -1,13 +0,0 @@
#define ONFRONTCONNECTED 0
#define ONFRONTDISCONNECTED 1
#define ONHEARTBEATWARNING 2
#define ONPACKAGESTART 3
#define ONPACKAGEEND 4
#define ONRSPERROR 5
#define ONRSPUSERLOGIN 6
#define ONRSPUSERLOGOUT 7
#define ONRTNDEPTHMARKETDATA 8
#define ONRSPSUBMARKETDATA 9
#define ONRSPUNSUBMARKETDATA 10
#define ONRSPGETMARKETTOPIC 11
#define ONRSPGETMARKETDATA 12

View File

@ -1,4 +0,0 @@
int reqUserLogin(const dict &req, int reqid);
int reqUserLogout(const dict &req, int reqid);

View File

@ -1,26 +0,0 @@
virtual void onFrontConnected() {};
virtual void onFrontDisconnected(int reqid) {};
virtual void onHeartBeatWarning(int reqid) {};
virtual void onPackageStart(int reqid, int reqid) {};
virtual void onPackageEnd(int reqid, int reqid) {};
virtual void onRspError(const dict &data, int reqid, bool last) {};
virtual void onRspUserLogin(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspUserLogout(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRtnDepthMarketData(const dict &data) {};
virtual void onRspSubMarketData(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspUnSubMarketData(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspGetMarketTopic(const dict &data, const dict &data, int reqid, bool last) {};
virtual void onRspGetMarketData(const dict &data, const dict &data, int reqid, bool last) {};

View File

@ -1,26 +0,0 @@
void processFrontConnected(Task *task);
void processFrontDisconnected(Task *task);
void processHeartBeatWarning(Task *task);
void processPackageStart(Task *task);
void processPackageEnd(Task *task);
void processRspError(Task *task);
void processRspUserLogin(Task *task);
void processRspUserLogout(Task *task);
void processRtnDepthMarketData(Task *task);
void processRspSubMarketData(Task *task);
void processRspUnSubMarketData(Task *task);
void processRspGetMarketTopic(Task *task);
void processRspGetMarketData(Task *task);

View File

@ -1,32 +0,0 @@
int MdApi::reqUserLogin(const dict &req, int reqid)
{
CUstpFtdcReqUserLoginField myreq = CUstpFtdcReqUserLoginField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "TradingDay", myreq.TradingDay);
getString(req, "UserID", myreq.UserID);
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "Password", myreq.Password);
getString(req, "UserProductInfo", myreq.UserProductInfo);
getString(req, "InterfaceProductInfo", myreq.InterfaceProductInfo);
getString(req, "ProtocolInfo", myreq.ProtocolInfo);
getString(req, "IPAddress", myreq.IPAddress);
getString(req, "MacAddress", myreq.MacAddress);
getInt(req, "DataCenterID", &myreq.DataCenterID);
getInt(req, "UserProductFileSize", &myreq.UserProductFileSize);
getChar(req, "Authenticate2Type", &myreq.Authenticate2Type);
getString(req, "Authenticate2Password", myreq.Authenticate2Password);
getString(req, "TerminalCode", myreq.TerminalCode);
int i = this->api->ReqUserLogin(&myreq, reqid);
return i;
};
int MdApi::reqUserLogout(const dict &req, int reqid)
{
CUstpFtdcReqUserLogoutField myreq = CUstpFtdcReqUserLogoutField();
memset(&myreq, 0, sizeof(myreq));
getString(req, "BrokerID", myreq.BrokerID);
getString(req, "UserID", myreq.UserID);
int i = this->api->ReqUserLogout(&myreq, reqid);
return i;
};

View File

@ -1,17 +0,0 @@
.def("reqUserLogin", &MdApi::reqUserLogin)
.def("reqUserLogout", &MdApi::reqUserLogout)
.def("onFrontConnected", &MdApi::onFrontConnected)
.def("onFrontDisconnected", &MdApi::onFrontDisconnected)
.def("onHeartBeatWarning", &MdApi::onHeartBeatWarning)
.def("onPackageStart", &MdApi::onPackageStart)
.def("onPackageEnd", &MdApi::onPackageEnd)
.def("onRspError", &MdApi::onRspError)
.def("onRspUserLogin", &MdApi::onRspUserLogin)
.def("onRspUserLogout", &MdApi::onRspUserLogout)
.def("onRtnDepthMarketData", &MdApi::onRtnDepthMarketData)
.def("onRspSubMarketData", &MdApi::onRspSubMarketData)
.def("onRspUnSubMarketData", &MdApi::onRspUnSubMarketData)
.def("onRspGetMarketTopic", &MdApi::onRspGetMarketTopic)
.def("onRspGetMarketData", &MdApi::onRspGetMarketData)
;

View File

@ -1,156 +0,0 @@
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 onPackageStart(int reqid, int reqid) override
{
try
{
PYBIND11_OVERLOAD(void, MdApi, onPackageStart, reqid, reqid);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onPackageEnd(int reqid, int reqid) override
{
try
{
PYBIND11_OVERLOAD(void, MdApi, onPackageEnd, reqid, reqid);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspError(const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, MdApi, onRspError, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspUserLogin(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, MdApi, onRspUserLogin, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspUserLogout(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, MdApi, onRspUserLogout, data, data, 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 onRspSubMarketData(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, MdApi, onRspSubMarketData, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspUnSubMarketData(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, MdApi, onRspUnSubMarketData, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspGetMarketTopic(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, MdApi, onRspGetMarketTopic, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onRspGetMarketData(const dict &data, const dict &data, int reqid, bool last) override
{
try
{
PYBIND11_OVERLOAD(void, MdApi, onRspGetMarketData, data, data, reqid, last);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};

View File

@ -1,309 +0,0 @@
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::processPackageStart(Task *task)
{
gil_scoped_acquire acquire;
this->onPackageStart(task->task_id, task->task_id);
};
void MdApi::processPackageEnd(Task *task)
{
gil_scoped_acquire acquire;
this->onPackageEnd(task->task_id, task->task_id);
};
void MdApi::processRspError(Task *task)
{
gil_scoped_acquire acquire;
dict data;
if (task->task_data)
{
CUstpFtdcRspInfoField *task_data = (CUstpFtdcRspInfoField*)task->task_data;
data["ErrorID"] = task_data->ErrorID;
data["ErrorMsg"] = toUtf(task_data->ErrorMsg);
delete task->task_data;
}
this->onRspError(data, task->task_id, task->task_last);
};
void MdApi::processRspUserLogin(Task *task)
{
gil_scoped_acquire acquire;
dict data;
if (task->task_data)
{
CUstpFtdcRspUserLoginField *task_data = (CUstpFtdcRspUserLoginField*)task->task_data;
data["TradingDay"] = toUtf(task_data->TradingDay);
data["BrokerID"] = toUtf(task_data->BrokerID);
data["UserID"] = toUtf(task_data->UserID);
data["LoginTime"] = toUtf(task_data->LoginTime);
data["ExchangeTime"] = toUtf(task_data->ExchangeTime);
data["MaxOrderLocalID"] = toUtf(task_data->MaxOrderLocalID);
data["TradingSystemName"] = toUtf(task_data->TradingSystemName);
data["DataCenterID"] = task_data->DataCenterID;
data["PrivateFlowSize"] = task_data->PrivateFlowSize;
data["UserFlowSize"] = task_data->UserFlowSize;
data["ActionDay"] = toUtf(task_data->ActionDay);
data["FemasVersion"] = toUtf(task_data->FemasVersion);
data["FemasLifeCycle"] = task_data->FemasLifeCycle;
delete task->task_data;
}
dict data;
if (task->task_data)
{
CUstpFtdcRspInfoField *task_data = (CUstpFtdcRspInfoField*)task->task_data;
data["ErrorID"] = task_data->ErrorID;
data["ErrorMsg"] = toUtf(task_data->ErrorMsg);
delete task->task_data;
}
this->onRspUserLogin(data, data, task->task_id, task->task_last);
};
void MdApi::processRspUserLogout(Task *task)
{
gil_scoped_acquire acquire;
dict data;
if (task->task_data)
{
CUstpFtdcRspUserLogoutField *task_data = (CUstpFtdcRspUserLogoutField*)task->task_data;
data["BrokerID"] = toUtf(task_data->BrokerID);
data["UserID"] = toUtf(task_data->UserID);
delete task->task_data;
}
dict data;
if (task->task_data)
{
CUstpFtdcRspInfoField *task_data = (CUstpFtdcRspInfoField*)task->task_data;
data["ErrorID"] = task_data->ErrorID;
data["ErrorMsg"] = toUtf(task_data->ErrorMsg);
delete task->task_data;
}
this->onRspUserLogout(data, data, task->task_id, task->task_last);
};
void MdApi::processRtnDepthMarketData(Task *task)
{
gil_scoped_acquire acquire;
dict data;
if (task->task_data)
{
CUstpFtdcDepthMarketDataField *task_data = (CUstpFtdcDepthMarketDataField*)task->task_data;
data["TradingDay"] = toUtf(task_data->TradingDay);
data["SettlementGroupID"] = toUtf(task_data->SettlementGroupID);
data["SettlementID"] = task_data->SettlementID;
data["PreSettlementPrice"] = task_data->PreSettlementPrice;
data["PreClosePrice"] = task_data->PreClosePrice;
data["PreOpenInterest"] = task_data->PreOpenInterest;
data["PreDelta"] = task_data->PreDelta;
data["OpenPrice"] = task_data->OpenPrice;
data["HighestPrice"] = task_data->HighestPrice;
data["LowestPrice"] = task_data->LowestPrice;
data["ClosePrice"] = task_data->ClosePrice;
data["UpperLimitPrice"] = task_data->UpperLimitPrice;
data["LowerLimitPrice"] = task_data->LowerLimitPrice;
data["SettlementPrice"] = task_data->SettlementPrice;
data["CurrDelta"] = task_data->CurrDelta;
data["LastPrice"] = task_data->LastPrice;
data["Volume"] = task_data->Volume;
data["Turnover"] = task_data->Turnover;
data["OpenInterest"] = task_data->OpenInterest;
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["BidPrice3"] = task_data->BidPrice3;
data["BidVolume3"] = task_data->BidVolume3;
data["AskPrice2"] = task_data->AskPrice2;
data["AskVolume2"] = task_data->AskVolume2;
data["AskPrice3"] = task_data->AskPrice3;
data["AskVolume3"] = task_data->AskVolume3;
data["BidPrice4"] = task_data->BidPrice4;
data["BidVolume4"] = task_data->BidVolume4;
data["BidPrice5"] = task_data->BidPrice5;
data["BidVolume5"] = task_data->BidVolume5;
data["AskPrice4"] = task_data->AskPrice4;
data["AskVolume4"] = task_data->AskVolume4;
data["AskPrice5"] = task_data->AskPrice5;
data["AskVolume5"] = task_data->AskVolume5;
data["InstrumentID"] = toUtf(task_data->InstrumentID);
data["UpdateTime"] = toUtf(task_data->UpdateTime);
data["UpdateMillisec"] = task_data->UpdateMillisec;
data["ActionDay"] = toUtf(task_data->ActionDay);
data["HisHighestPrice"] = task_data->HisHighestPrice;
data["HisLowestPrice"] = task_data->HisLowestPrice;
data["LatestVolume"] = task_data->LatestVolume;
data["InitVolume"] = task_data->InitVolume;
data["ChangeVolume"] = task_data->ChangeVolume;
data["BidImplyVolume"] = task_data->BidImplyVolume;
data["AskImplyVolume"] = task_data->AskImplyVolume;
data["AvgPrice"] = task_data->AvgPrice;
data["ArbiType"] = task_data->ArbiType;
data["InstrumentID_1"] = toUtf(task_data->InstrumentID_1);
data["InstrumentID_2"] = toUtf(task_data->InstrumentID_2);
data["InstrumentName"] = toUtf(task_data->InstrumentName);
data["TotalBidVolume"] = task_data->TotalBidVolume;
data["TotalAskVolume"] = task_data->TotalAskVolume;
delete task->task_data;
}
this->onRtnDepthMarketData(data);
};
void MdApi::processRspSubMarketData(Task *task)
{
gil_scoped_acquire acquire;
dict data;
if (task->task_data)
{
CUstpFtdcSpecificInstrumentField *task_data = (CUstpFtdcSpecificInstrumentField*)task->task_data;
data["InstrumentID"] = toUtf(task_data->InstrumentID);
delete task->task_data;
}
dict data;
if (task->task_data)
{
CUstpFtdcRspInfoField *task_data = (CUstpFtdcRspInfoField*)task->task_data;
data["ErrorID"] = task_data->ErrorID;
data["ErrorMsg"] = toUtf(task_data->ErrorMsg);
delete task->task_data;
}
this->onRspSubMarketData(data, data, task->task_id, task->task_last);
};
void MdApi::processRspUnSubMarketData(Task *task)
{
gil_scoped_acquire acquire;
dict data;
if (task->task_data)
{
CUstpFtdcSpecificInstrumentField *task_data = (CUstpFtdcSpecificInstrumentField*)task->task_data;
data["InstrumentID"] = toUtf(task_data->InstrumentID);
delete task->task_data;
}
dict data;
if (task->task_data)
{
CUstpFtdcRspInfoField *task_data = (CUstpFtdcRspInfoField*)task->task_data;
data["ErrorID"] = task_data->ErrorID;
data["ErrorMsg"] = toUtf(task_data->ErrorMsg);
delete task->task_data;
}
this->onRspUnSubMarketData(data, data, task->task_id, task->task_last);
};
void MdApi::processRspGetMarketTopic(Task *task)
{
gil_scoped_acquire acquire;
dict data;
if (task->task_data)
{
CUstpFtdcRspMarketTopicField *task_data = (CUstpFtdcRspMarketTopicField*)task->task_data;
data["ExchangeID"] = toUtf(task_data->ExchangeID);
data["TopicID"] = task_data->TopicID;
delete task->task_data;
}
dict data;
if (task->task_data)
{
CUstpFtdcRspInfoField *task_data = (CUstpFtdcRspInfoField*)task->task_data;
data["ErrorID"] = task_data->ErrorID;
data["ErrorMsg"] = toUtf(task_data->ErrorMsg);
delete task->task_data;
}
this->onRspGetMarketTopic(data, data, task->task_id, task->task_last);
};
void MdApi::processRspGetMarketData(Task *task)
{
gil_scoped_acquire acquire;
dict data;
if (task->task_data)
{
CUstpFtdcRspDepthMarketDataField *task_data = (CUstpFtdcRspDepthMarketDataField*)task->task_data;
data["TradingDay"] = toUtf(task_data->TradingDay);
data["SettlementGroupID"] = toUtf(task_data->SettlementGroupID);
data["SettlementID"] = task_data->SettlementID;
data["PreSettlementPrice"] = task_data->PreSettlementPrice;
data["PreClosePrice"] = task_data->PreClosePrice;
data["PreOpenInterest"] = task_data->PreOpenInterest;
data["PreDelta"] = task_data->PreDelta;
data["OpenPrice"] = task_data->OpenPrice;
data["HighestPrice"] = task_data->HighestPrice;
data["LowestPrice"] = task_data->LowestPrice;
data["ClosePrice"] = task_data->ClosePrice;
data["UpperLimitPrice"] = task_data->UpperLimitPrice;
data["LowerLimitPrice"] = task_data->LowerLimitPrice;
data["SettlementPrice"] = task_data->SettlementPrice;
data["CurrDelta"] = task_data->CurrDelta;
data["LastPrice"] = task_data->LastPrice;
data["Volume"] = task_data->Volume;
data["Turnover"] = task_data->Turnover;
data["OpenInterest"] = task_data->OpenInterest;
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["BidPrice3"] = task_data->BidPrice3;
data["BidVolume3"] = task_data->BidVolume3;
data["AskPrice2"] = task_data->AskPrice2;
data["AskVolume2"] = task_data->AskVolume2;
data["AskPrice3"] = task_data->AskPrice3;
data["AskVolume3"] = task_data->AskVolume3;
data["BidPrice4"] = task_data->BidPrice4;
data["BidVolume4"] = task_data->BidVolume4;
data["BidPrice5"] = task_data->BidPrice5;
data["BidVolume5"] = task_data->BidVolume5;
data["AskPrice4"] = task_data->AskPrice4;
data["AskVolume4"] = task_data->AskVolume4;
data["AskPrice5"] = task_data->AskPrice5;
data["AskVolume5"] = task_data->AskVolume5;
data["InstrumentID"] = toUtf(task_data->InstrumentID);
data["UpdateTime"] = toUtf(task_data->UpdateTime);
data["UpdateMillisec"] = task_data->UpdateMillisec;
data["ActionDay"] = toUtf(task_data->ActionDay);
data["HisHighestPrice"] = task_data->HisHighestPrice;
data["HisLowestPrice"] = task_data->HisLowestPrice;
data["LatestVolume"] = task_data->LatestVolume;
data["InitVolume"] = task_data->InitVolume;
data["ChangeVolume"] = task_data->ChangeVolume;
data["BidImplyVolume"] = task_data->BidImplyVolume;
data["AskImplyVolume"] = task_data->AskImplyVolume;
data["AvgPrice"] = task_data->AvgPrice;
data["ArbiType"] = task_data->ArbiType;
data["InstrumentID_1"] = toUtf(task_data->InstrumentID_1);
data["InstrumentID_2"] = toUtf(task_data->InstrumentID_2);
data["InstrumentName"] = toUtf(task_data->InstrumentName);
data["TotalBidVolume"] = task_data->TotalBidVolume;
data["TotalAskVolume"] = task_data->TotalAskVolume;
delete task->task_data;
}
dict data;
if (task->task_data)
{
CUstpFtdcRspInfoField *task_data = (CUstpFtdcRspInfoField*)task->task_data;
data["ErrorID"] = task_data->ErrorID;
data["ErrorMsg"] = toUtf(task_data->ErrorMsg);
delete task->task_data;
}
this->onRspGetMarketData(data, data, task->task_id, task->task_last);
};

View File

@ -1,78 +0,0 @@
case ONFRONTCONNECTED:
{
this->processFrontConnected(&task);
break;
}
case ONFRONTDISCONNECTED:
{
this->processFrontDisconnected(&task);
break;
}
case ONHEARTBEATWARNING:
{
this->processHeartBeatWarning(&task);
break;
}
case ONPACKAGESTART:
{
this->processPackageStart(&task);
break;
}
case ONPACKAGEEND:
{
this->processPackageEnd(&task);
break;
}
case ONRSPERROR:
{
this->processRspError(&task);
break;
}
case ONRSPUSERLOGIN:
{
this->processRspUserLogin(&task);
break;
}
case ONRSPUSERLOGOUT:
{
this->processRspUserLogout(&task);
break;
}
case ONRTNDEPTHMARKETDATA:
{
this->processRtnDepthMarketData(&task);
break;
}
case ONRSPSUBMARKETDATA:
{
this->processRspSubMarketData(&task);
break;
}
case ONRSPUNSUBMARKETDATA:
{
this->processRspUnSubMarketData(&task);
break;
}
case ONRSPGETMARKETTOPIC:
{
this->processRspGetMarketTopic(&task);
break;
}
case ONRSPGETMARKETDATA:
{
this->processRspGetMarketData(&task);
break;
}

View File

@ -1,195 +0,0 @@
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::OnPackageStart(int nTopicID, int nSequenceNo)
{
Task task = Task();
task.task_name = ONPACKAGESTART;
task.task_id = nTopicID;
task.task_id = nSequenceNo;
this->task_queue.push(task);
};
void MdApi::OnPackageEnd(int nTopicID, int nSequenceNo)
{
Task task = Task();
task.task_name = ONPACKAGEEND;
task.task_id = nTopicID;
task.task_id = nSequenceNo;
this->task_queue.push(task);
};
void MdApi::OnRspError(CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPERROR;
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void MdApi::OnRspUserLogin(CUstpFtdcRspUserLoginField *pRspUserLogin, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPUSERLOGIN;
if (pRspUserLogin)
{
CUstpFtdcRspUserLoginField *task_data = new CUstpFtdcRspUserLoginField();
*task_data = *pRspUserLogin;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void MdApi::OnRspUserLogout(CUstpFtdcRspUserLogoutField *pRspUserLogout, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPUSERLOGOUT;
if (pRspUserLogout)
{
CUstpFtdcRspUserLogoutField *task_data = new CUstpFtdcRspUserLogoutField();
*task_data = *pRspUserLogout;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void MdApi::OnRtnDepthMarketData(CUstpFtdcDepthMarketDataField *pDepthMarketData)
{
Task task = Task();
task.task_name = ONRTNDEPTHMARKETDATA;
if (pDepthMarketData)
{
CUstpFtdcDepthMarketDataField *task_data = new CUstpFtdcDepthMarketDataField();
*task_data = *pDepthMarketData;
task.task_data = task_data;
}
this->task_queue.push(task);
};
void MdApi::OnRspSubMarketData(CUstpFtdcSpecificInstrumentField *pSpecificInstrument, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPSUBMARKETDATA;
if (pSpecificInstrument)
{
CUstpFtdcSpecificInstrumentField *task_data = new CUstpFtdcSpecificInstrumentField();
*task_data = *pSpecificInstrument;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void MdApi::OnRspUnSubMarketData(CUstpFtdcSpecificInstrumentField *pSpecificInstrument, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPUNSUBMARKETDATA;
if (pSpecificInstrument)
{
CUstpFtdcSpecificInstrumentField *task_data = new CUstpFtdcSpecificInstrumentField();
*task_data = *pSpecificInstrument;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void MdApi::OnRspGetMarketTopic(CUstpFtdcRspMarketTopicField *pRspMarketTopic, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPGETMARKETTOPIC;
if (pRspMarketTopic)
{
CUstpFtdcRspMarketTopicField *task_data = new CUstpFtdcRspMarketTopicField();
*task_data = *pRspMarketTopic;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};
void MdApi::OnRspGetMarketData(CUstpFtdcRspDepthMarketDataField *pRspDepthMarketData, CUstpFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
Task task = Task();
task.task_name = ONRSPGETMARKETDATA;
if (pRspDepthMarketData)
{
CUstpFtdcRspDepthMarketDataField *task_data = new CUstpFtdcRspDepthMarketDataField();
*task_data = *pRspDepthMarketData;
task.task_data = task_data;
}
if (pRspInfo)
{
CUstpFtdcRspInfoField *task_data = new CUstpFtdcRspInfoField();
*task_data = *pRspInfo;
task.task_data = task_data;
}
task.task_id = nRequestID;
task.task_last = bIsLast;
this->task_queue.push(task);
};