diff --git a/vnpy/api/femas/generatefemas/femas_constant.py b/vnpy/api/femas/generatefemas/femas_constant.py deleted file mode 100644 index fe9d09a7..00000000 --- a/vnpy/api/femas/generatefemas/femas_constant.py +++ /dev/null @@ -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' diff --git a/vnpy/api/femas/generatefemas/femas_struct.py b/vnpy/api/femas/generatefemas/femas_struct.py deleted file mode 100644 index 3a9f2cb4..00000000 --- a/vnpy/api/femas/generatefemas/femas_struct.py +++ /dev/null @@ -1,1041 +0,0 @@ -CUstpFtdcReqUserLoginField = { - "TradingDay": "string", - "UserID": "string", - "BrokerID": "string", - "Password": "string", - "UserProductInfo": "string", - "InterfaceProductInfo": "string", - "ProtocolInfo": "string", - "IPAddress": "string", - "MacAddress": "string", - "DataCenterID": "int", - "UserProductFileSize": "int", - "Authenticate2Type": "char", - "Authenticate2Password": "string", - "TerminalCode": "string", -} - -CUstpFtdcRspUserLoginField = { - "TradingDay": "string", - "BrokerID": "string", - "UserID": "string", - "LoginTime": "string", - "ExchangeTime": "string", - "MaxOrderLocalID": "string", - "TradingSystemName": "string", - "DataCenterID": "int", - "PrivateFlowSize": "int", - "UserFlowSize": "int", - "ActionDay": "string", - "FemasVersion": "string", - "FemasLifeCycle": "int", -} - -CUstpFtdcReqUserLogoutField = { - "BrokerID": "string", - "UserID": "string", -} - -CUstpFtdcRspUserLogoutField = { - "BrokerID": "string", - "UserID": "string", -} - -CUstpFtdcForceUserExitField = { - "BrokerID": "string", - "UserID": "string", -} - -CUstpFtdcUserPasswordUpdateField = { - "BrokerID": "string", - "UserID": "string", - "OldPassword": "string", - "NewPassword": "string", -} - -CUstpFtdcInputOrderField = { - "BrokerID": "string", - "ExchangeID": "string", - "OrderSysID": "string", - "InvestorID": "string", - "UserID": "string", - "SeatNo": "int", - "InstrumentID": "string", - "UserOrderLocalID": "string", - "OrderPriceType": "char", - "Direction": "char", - "OffsetFlag": "char", - "HedgeFlag": "char", - "LimitPrice": "double", - "Volume": "int", - "TimeCondition": "char", - "GTDDate": "string", - "VolumeCondition": "char", - "MinVolume": "int", - "StopPrice": "double", - "ForceCloseReason": "char", - "IsAutoSuspend": "int", - "BusinessUnit": "string", - "UserCustom": "string", - "BusinessLocalID": "int", - "ActionDay": "string", - "ArbiType": "char", - "ClientID": "string", -} - -CUstpFtdcOrderActionField = { - "ExchangeID": "string", - "OrderSysID": "string", - "BrokerID": "string", - "InvestorID": "string", - "UserID": "string", - "UserOrderActionLocalID": "string", - "UserOrderLocalID": "string", - "ActionFlag": "char", - "LimitPrice": "double", - "VolumeChange": "int", - "BusinessLocalID": "int", - "ClientID": "string", -} - -CUstpFtdcMemDbField = { - "MemTableName": "string", -} - -CUstpFtdcstpUserDepositField = { - "BrokerID": "string", - "UserID": "string", - "InvestorID": "string", - "Amount": "double", - "AmountDirection": "char", - "UserOrderLocalID": "string", -} - -CUstpFtdcstpTransferMoneyField = { - "BrokerID": "string", - "UserID": "string", - "InvestorID": "string", - "Amount": "double", - "AmountDirection": "char", - "UserOrderLocalID": "string", - "BankID": "string", - "BankPasswd": "string", - "AccountPasswd": "string", - "Currency": "string", - "SerialNo": "string", -} - -CUstpFtdcRspInfoField = { - "ErrorID": "int", - "ErrorMsg": "string", -} - -CUstpFtdcQryOrderField = { - "BrokerID": "string", - "UserID": "string", - "ExchangeID": "string", - "InvestorID": "string", - "OrderSysID": "string", - "InstrumentID": "string", - "OrderStatus": "char", - "OrderType": "char", - "ClientID": "string", -} - -CUstpFtdcQryTradeField = { - "BrokerID": "string", - "UserID": "string", - "ExchangeID": "string", - "InvestorID": "string", - "TradeID": "string", - "InstrumentID": "string", - "ClientID": "string", -} - -CUstpFtdcQryInstrumentField = { - "ExchangeID": "string", - "ProductID": "string", - "InstrumentID": "string", -} - -CUstpFtdcRspInstrumentField = { - "ExchangeID": "string", - "ProductID": "string", - "ProductName": "string", - "InstrumentID": "string", - "InstrumentName": "string", - "DeliveryYear": "int", - "DeliveryMonth": "int", - "MaxLimitOrderVolume": "int", - "MinLimitOrderVolume": "int", - "MaxMarketOrderVolume": "int", - "MinMarketOrderVolume": "int", - "VolumeMultiple": "int", - "PriceTick": "double", - "Currency": "char", - "LongPosLimit": "int", - "ShortPosLimit": "int", - "LowerLimitPrice": "double", - "UpperLimitPrice": "double", - "PreSettlementPrice": "double", - "InstrumentStatus": "char", - "CreateDate": "string", - "OpenDate": "string", - "ExpireDate": "string", - "StartDelivDate": "string", - "EndDelivDate": "string", - "BasisPrice": "double", - "IsTrading": "int", - "UnderlyingInstrID": "string", - "UnderlyingMultiple": "int", - "PositionType": "char", - "StrikePrice": "double", - "OptionsType": "char", - "CurrencyID": "string", - "ArbiType": "char", - "InstrumentID_1": "string", - "Direction_1": "char", - "Ratio_1": "double", - "InstrumentID_2": "string", - "Direction_2": "char", - "Ratio_2": "double", -} - -CUstpFtdcInstrumentStatusField = { - "ExchangeID": "string", - "ProductID": "string", - "ProductName": "string", - "InstrumentID": "string", - "InstrumentName": "string", - "DeliveryYear": "int", - "DeliveryMonth": "int", - "MaxLimitOrderVolume": "int", - "MinLimitOrderVolume": "int", - "MaxMarketOrderVolume": "int", - "MinMarketOrderVolume": "int", - "VolumeMultiple": "int", - "PriceTick": "double", - "Currency": "char", - "LongPosLimit": "int", - "ShortPosLimit": "int", - "LowerLimitPrice": "double", - "UpperLimitPrice": "double", - "PreSettlementPrice": "double", - "InstrumentStatus": "char", - "CreateDate": "string", - "OpenDate": "string", - "ExpireDate": "string", - "StartDelivDate": "string", - "EndDelivDate": "string", - "BasisPrice": "double", - "IsTrading": "int", - "UnderlyingInstrID": "string", - "UnderlyingMultiple": "int", - "PositionType": "char", - "StrikePrice": "double", - "OptionsType": "char", - "CurrencyID": "string", - "ArbiType": "char", - "InstrumentID_1": "string", - "Direction_1": "char", - "Ratio_1": "double", - "InstrumentID_2": "string", - "Direction_2": "char", - "Ratio_2": "double", - "EnterDate": "string", -} - -CUstpFtdcQryInvestorAccountField = { - "BrokerID": "string", - "UserID": "string", - "InvestorID": "string", -} - -CUstpFtdcRspInvestorAccountField = { - "BrokerID": "string", - "InvestorID": "string", - "AccountID": "string", - "PreBalance": "double", - "Deposit": "double", - "Withdraw": "double", - "FrozenMargin": "double", - "FrozenFee": "double", - "FrozenPremium": "double", - "Fee": "double", - "CloseProfit": "double", - "PositionProfit": "double", - "Available": "double", - "LongFrozenMargin": "double", - "ShortFrozenMargin": "double", - "LongMargin": "double", - "ShortMargin": "double", - "ReleaseMargin": "double", - "DynamicRights": "double", - "TodayInOut": "double", - "Margin": "double", - "Premium": "double", - "Risk": "double", -} - -CUstpFtdcQryUserInvestorField = { - "BrokerID": "string", - "UserID": "string", -} - -CUstpFtdcRspUserInvestorField = { - "BrokerID": "string", - "UserID": "string", - "InvestorID": "string", -} - -CUstpFtdcQryTradingCodeField = { - "BrokerID": "string", - "UserID": "string", - "InvestorID": "string", - "ExchangeID": "string", - "ClientID": "string", -} - -CUstpFtdcRspTradingCodeField = { - "BrokerID": "string", - "ExchangeID": "string", - "InvestorID": "string", - "ClientID": "string", - "ClientRight": "char", - "ClientHedgeFlag": "char", - "IsActive": "char", -} - -CUstpFtdcQryExchangeField = { - "ExchangeID": "string", -} - -CUstpFtdcRspExchangeField = { - "ExchangeID": "string", - "ExchangeName": "string", -} - -CUstpFtdcQryInvestorPositionField = { - "BrokerID": "string", - "UserID": "string", - "ExchangeID": "string", - "InvestorID": "string", - "InstrumentID": "string", -} - -CUstpFtdcRspInvestorPositionField = { - "InvestorID": "string", - "BrokerID": "string", - "ExchangeID": "string", - "ClientID": "string", - "InstrumentID": "string", - "Direction": "char", - "HedgeFlag": "char", - "UsedMargin": "double", - "Position": "int", - "PositionCost": "double", - "YdPosition": "int", - "YdPositionCost": "double", - "FrozenMargin": "double", - "FrozenPosition": "int", - "FrozenClosing": "int", - "YdFrozenClosing": "int", - "FrozenPremium": "double", - "LastTradeID": "string", - "LastOrderLocalID": "string", - "SpeculationPosition": "int", - "ArbitragePosition": "int", - "HedgePosition": "int", - "SpecFrozenClosing": "int", - "HedgeFrozenClosing": "int", - "Currency": "string", -} - -CUstpFtdcQryComplianceParamField = { - "BrokerID": "string", - "UserID": "string", - "InvestorID": "string", - "ExchangeID": "string", - "ClientID": "string", -} - -CUstpFtdcRspComplianceParamField = { - "BrokerID": "string", - "InvestorID": "string", - "ExchangeID": "string", - "ClientID": "string", - "DailyMaxOrder": "int", - "DailyMaxOrderAction": "int", - "DailyMaxErrorOrder": "int", - "DailyMaxOrderVolume": "int", - "DailyMaxOrderActionVolume": "int", -} - -CUstpFtdcQryUserField = { - "StartUserID": "string", - "EndUserID": "string", -} - -CUstpFtdcUserField = { - "BrokerID": "string", - "UserID": "string", - "Password": "string", - "IsActive": "char", - "UserName": "string", - "UserType": "char", - "Department": "string", - "GrantFuncSet": "char", - "SetUserID": "string", - "CommandDate": "string", - "CommandTime": "string", -} - -CUstpFtdcQryInvestorFeeField = { - "BrokerID": "string", - "UserID": "string", - "InvestorID": "string", - "ExchangeID": "string", - "InstrumentID": "string", - "ClientID": "string", -} - -CUstpFtdcInvestorFeeField = { - "BrokerID": "string", - "ClientID": "string", - "ExchangeID": "string", - "InstrumentID": "string", - "ProductID": "string", - "OpenFeeRate": "double", - "OpenFeeAmt": "double", - "OffsetFeeRate": "double", - "OffsetFeeAmt": "double", - "OTFeeRate": "double", - "OTFeeAmt": "double", - "ExecFeeRate": "double", - "ExecFeeAmt": "double", - "PerOrderAmt": "double", - "PerCancelAmt": "double", - "HedgeFlag": "char", -} - -CUstpFtdcQryInvestorMarginField = { - "BrokerID": "string", - "UserID": "string", - "InvestorID": "string", - "ExchangeID": "string", - "InstrumentID": "string", - "ClientID": "string", -} - -CUstpFtdcInvestorMarginField = { - "BrokerID": "string", - "ClientID": "string", - "ExchangeID": "string", - "InstrumentID": "string", - "ProductID": "string", - "LongMarginRate": "double", - "LongMarginAmt": "double", - "ShortMarginRate": "double", - "ShortMarginAmt": "double", - "HedgeFlag": "char", -} - -CUstpFtdcTradeField = { - "BrokerID": "string", - "ExchangeID": "string", - "TradingDay": "string", - "ParticipantID": "string", - "SeatID": "string", - "InvestorID": "string", - "ClientID": "string", - "UserID": "string", - "OrderUserID": "string", - "TradeID": "string", - "OrderSysID": "string", - "UserOrderLocalID": "string", - "InstrumentID": "string", - "Direction": "char", - "OffsetFlag": "char", - "HedgeFlag": "char", - "TradePrice": "double", - "TradeVolume": "int", - "TradeTime": "string", - "ClearingPartID": "string", - "UsedFee": "double", - "UsedMargin": "double", - "Premium": "double", - "Position": "int", - "PositionCost": "double", - "Available": "double", - "Margin": "double", - "FrozenMargin": "double", - "BusinessLocalID": "int", - "ActionDay": "string", - "ArbiType": "char", - "ArbiInstrumentID": "string", -} - -CUstpFtdcOrderField = { - "BrokerID": "string", - "ExchangeID": "string", - "OrderSysID": "string", - "InvestorID": "string", - "UserID": "string", - "SeatNo": "int", - "InstrumentID": "string", - "UserOrderLocalID": "string", - "OrderPriceType": "char", - "Direction": "char", - "OffsetFlag": "char", - "HedgeFlag": "char", - "LimitPrice": "double", - "Volume": "int", - "TimeCondition": "char", - "GTDDate": "string", - "VolumeCondition": "char", - "MinVolume": "int", - "StopPrice": "double", - "ForceCloseReason": "char", - "IsAutoSuspend": "int", - "BusinessUnit": "string", - "UserCustom": "string", - "BusinessLocalID": "int", - "ActionDay": "string", - "ArbiType": "char", - "TradingDay": "string", - "ParticipantID": "string", - "OrderUserID": "string", - "ClientID": "string", - "SeatID": "string", - "InsertTime": "string", - "OrderLocalID": "string", - "OrderSource": "char", - "OrderStatus": "char", - "CancelTime": "string", - "CancelUserID": "string", - "VolumeTraded": "int", - "VolumeRemain": "int", - "OrderType": "char", - "DeliveryFlag": "char", -} - -CUstpFtdcFlowMessageCancelField = { - "SequenceSeries": "int", - "TradingDay": "string", - "DataCenterID": "int", - "StartSequenceNo": "int", - "EndSequenceNo": "int", -} - -CUstpFtdcDisseminationField = { - "SequenceSeries": "int", - "SequenceNo": "int", -} - -CUstpFtdcInvestorAccountDepositResField = { - "BrokerID": "string", - "UserID": "string", - "InvestorID": "string", - "AccountID": "string", - "AccountSeqNo": "string", - "Amount": "double", - "AmountDirection": "char", - "Available": "double", - "Balance": "double", -} - -CUstpFtdcInputQuoteField = { - "BrokerID": "string", - "ExchangeID": "string", - "InvestorID": "string", - "UserID": "string", - "InstrumentID": "string", - "Direction": "char", - "QuoteSysID": "string", - "UserQuoteLocalID": "string", - "QuoteLocalID": "string", - "BidVolume": "int", - "BidOffsetFlag": "char", - "BidHedgeFlag": "char", - "BidPrice": "double", - "AskVolume": "int", - "AskOffsetFlag": "char", - "AskHedgeFlag": "char", - "AskPrice": "double", - "BusinessUnit": "string", - "UserCustom": "string", - "BidUserOrderLocalID": "string", - "AskUserOrderLocalID": "string", - "BidOrderLocalID": "string", - "AskOrderLocalID": "string", - "ReqForQuoteID": "string", - "StandByTime": "int", - "ClientID": "string", -} - -CUstpFtdcRtnQuoteField = { - "BrokerID": "string", - "ExchangeID": "string", - "InvestorID": "string", - "UserID": "string", - "InstrumentID": "string", - "Direction": "char", - "QuoteSysID": "string", - "UserQuoteLocalID": "string", - "QuoteLocalID": "string", - "BidVolume": "int", - "BidOffsetFlag": "char", - "BidHedgeFlag": "char", - "BidPrice": "double", - "AskVolume": "int", - "AskOffsetFlag": "char", - "AskHedgeFlag": "char", - "AskPrice": "double", - "BusinessUnit": "string", - "UserCustom": "string", - "BidUserOrderLocalID": "string", - "AskUserOrderLocalID": "string", - "BidOrderLocalID": "string", - "AskOrderLocalID": "string", - "ReqForQuoteID": "string", - "StandByTime": "int", - "BidOrderSysID": "string", - "AskOrderSysID": "string", - "QuoteStatus": "char", - "InsertTime": "string", - "CancelTime": "string", - "TradeTime": "string", - "ClientID": "string", -} - -CUstpFtdcQuoteActionField = { - "BrokerID": "string", - "ExchangeID": "string", - "InvestorID": "string", - "UserID": "string", - "QuoteSysID": "string", - "UserQuoteLocalID": "string", - "UserQuoteActionLocalID": "string", - "ActionFlag": "char", - "BusinessUnit": "string", - "UserCustom": "string", - "Direction": "char", - "ClientID": "string", -} - -CUstpFtdcReqForQuoteField = { - "ReqForQuoteID": "string", - "BrokerID": "string", - "ExchangeID": "string", - "InvestorID": "string", - "UserID": "string", - "InstrumentID": "string", - "Direction": "char", - "TradingDay": "string", - "ReqForQuoteTime": "string", - "ClientID": "string", -} - -CUstpFtdcSyncMoneyTransferField = { - "BrokerID": "string", - "AccountID": "string", - "BankID": "string", - "BankAccount": "string", - "Currency": "string", - "Amount": "double", - "SyncTransMoneyEvent": "char", - "TradeCode": "string", - "TradeSource": "char", - "TransSerialNo": "string", - "SerialNo": "string", - "UserID": "string", - "CommandDate": "string", - "CommandTime": "string", -} - -CUstpFtdcMarketDataBaseField = { - "TradingDay": "string", - "SettlementGroupID": "string", - "SettlementID": "int", - "PreSettlementPrice": "double", - "PreClosePrice": "double", - "PreOpenInterest": "double", - "PreDelta": "double", -} - -CUstpFtdcMarketDataStaticField = { - "OpenPrice": "double", - "HighestPrice": "double", - "LowestPrice": "double", - "ClosePrice": "double", - "UpperLimitPrice": "double", - "LowerLimitPrice": "double", - "SettlementPrice": "double", - "CurrDelta": "double", -} - -CUstpFtdcMarketDataLastMatchField = { - "LastPrice": "double", - "Volume": "int", - "Turnover": "double", - "OpenInterest": "double", -} - -CUstpFtdcMarketDataBestPriceField = { - "BidPrice1": "double", - "BidVolume1": "int", - "AskPrice1": "double", - "AskVolume1": "int", -} - -CUstpFtdcMarketDataBid23Field = { - "BidPrice2": "double", - "BidVolume2": "int", - "BidPrice3": "double", - "BidVolume3": "int", -} - -CUstpFtdcMarketDataAsk23Field = { - "AskPrice2": "double", - "AskVolume2": "int", - "AskPrice3": "double", - "AskVolume3": "int", -} - -CUstpFtdcMarketDataBid45Field = { - "BidPrice4": "double", - "BidVolume4": "int", - "BidPrice5": "double", - "BidVolume5": "int", -} - -CUstpFtdcMarketDataAsk45Field = { - "AskPrice4": "double", - "AskVolume4": "int", - "AskPrice5": "double", - "AskVolume5": "int", -} - -CUstpFtdcMarketDataUpdateTimeField = { - "InstrumentID": "string", - "UpdateTime": "string", - "UpdateMillisec": "int", - "ActionDay": "string", -} - -CUstpFtdcDepthMarketDataField = { - "TradingDay": "string", - "SettlementGroupID": "string", - "SettlementID": "int", - "PreSettlementPrice": "double", - "PreClosePrice": "double", - "PreOpenInterest": "double", - "PreDelta": "double", - "OpenPrice": "double", - "HighestPrice": "double", - "LowestPrice": "double", - "ClosePrice": "double", - "UpperLimitPrice": "double", - "LowerLimitPrice": "double", - "SettlementPrice": "double", - "CurrDelta": "double", - "LastPrice": "double", - "Volume": "int", - "Turnover": "double", - "OpenInterest": "double", - "BidPrice1": "double", - "BidVolume1": "int", - "AskPrice1": "double", - "AskVolume1": "int", - "BidPrice2": "double", - "BidVolume2": "int", - "BidPrice3": "double", - "BidVolume3": "int", - "AskPrice2": "double", - "AskVolume2": "int", - "AskPrice3": "double", - "AskVolume3": "int", - "BidPrice4": "double", - "BidVolume4": "int", - "BidPrice5": "double", - "BidVolume5": "int", - "AskPrice4": "double", - "AskVolume4": "int", - "AskPrice5": "double", - "AskVolume5": "int", - "InstrumentID": "string", - "UpdateTime": "string", - "UpdateMillisec": "int", - "ActionDay": "string", - "HisHighestPrice": "double", - "HisLowestPrice": "double", - "LatestVolume": "int", - "InitVolume": "int", - "ChangeVolume": "int", - "BidImplyVolume": "int", - "AskImplyVolume": "int", - "AvgPrice": "double", - "ArbiType": "char", - "InstrumentID_1": "string", - "InstrumentID_2": "string", - "InstrumentName": "string", - "TotalBidVolume": "int", - "TotalAskVolume": "int", -} - -CUstpFtdcSpecificInstrumentField = { - "InstrumentID": "string", -} - -CUstpFtdcMultiChannelHeartBeatField = { - "UstpMultiChannelHeartBeatTimeOut": "int", -} - -CUstpFtdcReqMarketTopicField = { - "ExchangeID": "string", -} - -CUstpFtdcRspMarketTopicField = { - "ExchangeID": "string", - "TopicID": "int", -} - -CUstpFtdcInputMarginCombActionField = { - "BrokerID": "string", - "ExchangeID": "string", - "UserID": "string", - "InvestorID": "string", - "HedgeFlag": "char", - "UserActionLocalID": "string", - "CombInstrumentID": "string", - "CombVolume": "int", - "CombDirection": "char", - "ActionLocalID": "string", - "Direction": "char", - "OrderSysID": "string", - "CombActionStatus": "char", -} - -CUstpFtdcQryInvestorCombPositionField = { - "BrokerID": "string", - "ExchangeID": "string", - "InvestorID": "string", - "HedgeFlag": "char", - "CombInstrumentID": "string", -} - -CUstpFtdcRspInvestorCombPositionField = { - "BrokerID": "string", - "ExchangeID": "string", - "Direction": "char", - "InvestorID": "string", - "HedgeFlag": "char", - "ClientID": "string", - "CombInstrumentID": "string", - "Leg1InstrumentID": "string", - "Leg2InstrumentID": "string", - "CombPosition": "int", - "CombFrozenPosition": "int", - "CombFreeMargin": "double", -} - -CUstpFtdcMarginCombinationLegField = { - "ExchangeID": "string", - "CombInstrumentID": "string", - "LegID": "int", - "LegInstrumentID": "string", - "Direction": "char", - "LegMultiple": "int", - "Priority": "int", -} - -CUstpFtdcQryInvestorLegPositionField = { - "BrokerID": "string", - "ExchangeID": "string", - "InvestorID": "string", - "HedgeFlag": "char", - "LegInstrumentID": "string", -} - -CUstpFtdcRspInvestorLegPositionField = { - "BrokerID": "string", - "ExchangeID": "string", - "InvestorID": "string", - "HedgeFlag": "char", - "ClientID": "string", - "InstrumentID": "string", - "LongPosition": "int", - "ShortPosition": "int", - "LongMargin": "double", - "ShortMargin": "double", - "LongFrozenPosition": "int", - "ShortFrozenPosition": "int", - "LongFrozenMargin": "double", - "ShortFrozenMargin": "double", -} - -CUstpFtdcQryUstpInstrumentGroupField = { - "ExchangeID": "string", - "BrokerID": "string", - "InstrumentID": "string", -} - -CUstpFtdcRspInstrumentGroupField = { - "ExchangeID": "string", - "BrokerID": "string", - "InstrumentID": "string", - "InstrumentGroupID": "string", -} - -CUstpFtdcQryClientMarginCombTypeField = { - "ExchangeID": "string", - "BrokerID": "string", - "InvestorID": "string", - "HedgeFlag": "char", - "InstrumentGroupID": "string", -} - -CUstpFtdcRspClientMarginCombTypeField = { - "ExchangeID": "string", - "BrokerID": "string", - "ParticipantID": "string", - "ClientID": "string", - "InstrumentGroupID": "string", - "MarginCombType": "char", -} - -CUstpFtdcReqQrySystemTimeField = { - "ExchangeID": "string", -} - -CUstpFtdcRspQrySystemTimeField = { - "ExchangeID": "string", - "SystemTime": "string", -} - -CUstpFtdcInputExecOrderField = { - "BrokerID": "string", - "ExchangeID": "string", - "OrderSysID": "string", - "InvestorID": "string", - "UserID": "string", - "InstrumentID": "string", - "UserOrderLocalID": "string", - "OrderType": "char", - "DeliveryFlag": "char", - "HedgeFlag": "char", - "Volume": "int", - "UserCustom": "string", - "ActionDay": "string", - "BusinessLocalID": "int", - "BusinessUnit": "string", -} - -CUstpFtdcInputExecOrderActionField = { - "ExchangeID": "string", - "OrderSysID": "string", - "BrokerID": "string", - "InvestorID": "string", - "UserID": "string", - "UserOrderActionLocalID": "string", - "UserOrderLocalID": "string", - "ActionFlag": "char", - "VolumeChange": "int", - "BusinessLocalID": "int", - "OrderType": "char", -} - -CUstpFtdcExecOrderField = { - "BrokerID": "string", - "ExchangeID": "string", - "OrderSysID": "string", - "InvestorID": "string", - "UserID": "string", - "InstrumentID": "string", - "UserOrderLocalID": "string", - "OrderType": "char", - "DeliveryFlag": "char", - "HedgeFlag": "char", - "Volume": "int", - "UserCustom": "string", - "ActionDay": "string", - "BusinessLocalID": "int", - "BusinessUnit": "string", - "TradingDay": "string", - "ParticipantID": "string", - "OrderUserID": "string", - "ClientID": "string", - "SeatID": "string", - "InsertTime": "string", - "OrderLocalID": "string", - "OrderSource": "char", - "OrderStatus": "char", - "CancelTime": "string", - "CancelUserID": "string", -} - -CUstpFtdcReqQryMarketDataField = { - "ExchangeID": "string", - "InstrumentID": "string", -} - -CUstpFtdcRspDepthMarketDataField = { - "TradingDay": "string", - "SettlementGroupID": "string", - "SettlementID": "int", - "PreSettlementPrice": "double", - "PreClosePrice": "double", - "PreOpenInterest": "double", - "PreDelta": "double", - "OpenPrice": "double", - "HighestPrice": "double", - "LowestPrice": "double", - "ClosePrice": "double", - "UpperLimitPrice": "double", - "LowerLimitPrice": "double", - "SettlementPrice": "double", - "CurrDelta": "double", - "LastPrice": "double", - "Volume": "int", - "Turnover": "double", - "OpenInterest": "double", - "BidPrice1": "double", - "BidVolume1": "int", - "AskPrice1": "double", - "AskVolume1": "int", - "BidPrice2": "double", - "BidVolume2": "int", - "BidPrice3": "double", - "BidVolume3": "int", - "AskPrice2": "double", - "AskVolume2": "int", - "AskPrice3": "double", - "AskVolume3": "int", - "BidPrice4": "double", - "BidVolume4": "int", - "BidPrice5": "double", - "BidVolume5": "int", - "AskPrice4": "double", - "AskVolume4": "int", - "AskPrice5": "double", - "AskVolume5": "int", - "InstrumentID": "string", - "UpdateTime": "string", - "UpdateMillisec": "int", - "ActionDay": "string", - "HisHighestPrice": "double", - "HisLowestPrice": "double", - "LatestVolume": "int", - "InitVolume": "int", - "ChangeVolume": "int", - "BidImplyVolume": "int", - "AskImplyVolume": "int", - "AvgPrice": "double", - "ArbiType": "char", - "InstrumentID_1": "string", - "InstrumentID_2": "string", - "InstrumentName": "string", - "TotalBidVolume": "int", - "TotalAskVolume": "int", -} - diff --git a/vnpy/api/femas/generatefemas/femas_td_header_define.h b/vnpy/api/femas/generatefemas/femas_td_header_define.h deleted file mode 100644 index 6676e06f..00000000 --- a/vnpy/api/femas/generatefemas/femas_td_header_define.h +++ /dev/null @@ -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 diff --git a/vnpy/api/femas/generatefemas/femas_td_header_function.h b/vnpy/api/femas/generatefemas/femas_td_header_function.h deleted file mode 100644 index c8cac665..00000000 --- a/vnpy/api/femas/generatefemas/femas_td_header_function.h +++ /dev/null @@ -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); - diff --git a/vnpy/api/femas/generatefemas/femas_td_header_on.h b/vnpy/api/femas/generatefemas/femas_td_header_on.h deleted file mode 100644 index 301cb2df..00000000 --- a/vnpy/api/femas/generatefemas/femas_td_header_on.h +++ /dev/null @@ -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) {}; - diff --git a/vnpy/api/femas/generatefemas/femas_td_header_process.h b/vnpy/api/femas/generatefemas/femas_td_header_process.h deleted file mode 100644 index 5c861e7b..00000000 --- a/vnpy/api/femas/generatefemas/femas_td_header_process.h +++ /dev/null @@ -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); - diff --git a/vnpy/api/femas/generatefemas/femas_td_source_function.cpp b/vnpy/api/femas/generatefemas/femas_td_source_function.cpp deleted file mode 100644 index d666ff95..00000000 --- a/vnpy/api/femas/generatefemas/femas_td_source_function.cpp +++ /dev/null @@ -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; -}; - diff --git a/vnpy/api/femas/generatefemas/femas_td_source_module.cpp b/vnpy/api/femas/generatefemas/femas_td_source_module.cpp deleted file mode 100644 index 6fbb6a16..00000000 --- a/vnpy/api/femas/generatefemas/femas_td_source_module.cpp +++ /dev/null @@ -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) -; diff --git a/vnpy/api/femas/generatefemas/femas_td_source_on.cpp b/vnpy/api/femas/generatefemas/femas_td_source_on.cpp deleted file mode 100644 index 7e3f8537..00000000 --- a/vnpy/api/femas/generatefemas/femas_td_source_on.cpp +++ /dev/null @@ -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; - } -}; - diff --git a/vnpy/api/femas/generatefemas/femas_td_source_process.cpp b/vnpy/api/femas/generatefemas/femas_td_source_process.cpp deleted file mode 100644 index 90b85e6c..00000000 --- a/vnpy/api/femas/generatefemas/femas_td_source_process.cpp +++ /dev/null @@ -1,1680 +0,0 @@ -void TdApi::processFrontConnected(Task *task) -{ - gil_scoped_acquire acquire; - this->onFrontConnected(); -}; - -void TdApi::processQryFrontConnected(Task *task) -{ - gil_scoped_acquire acquire; - this->onQryFrontConnected(); -}; - -void TdApi::processFrontDisconnected(Task *task) -{ - gil_scoped_acquire acquire; - this->onFrontDisconnected(task->task_id); -}; - -void TdApi::processQryFrontDisconnected(Task *task) -{ - gil_scoped_acquire acquire; - this->onQryFrontDisconnected(task->task_id); -}; - -void TdApi::processHeartBeatWarning(Task *task) -{ - gil_scoped_acquire acquire; - this->onHeartBeatWarning(task->task_id); -}; - -void TdApi::processPackageStart(Task *task) -{ - gil_scoped_acquire acquire; - this->onPackageStart(task->task_id, task->task_id); -}; - -void TdApi::processPackageEnd(Task *task) -{ - gil_scoped_acquire acquire; - this->onPackageEnd(task->task_id, task->task_id); -}; - -void TdApi::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 TdApi::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 TdApi::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 TdApi::processRspUserPasswordUpdate(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcUserPasswordUpdateField *task_data = (CUstpFtdcUserPasswordUpdateField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["UserID"] = toUtf(task_data->UserID); - data["OldPassword"] = toUtf(task_data->OldPassword); - data["NewPassword"] = toUtf(task_data->NewPassword); - delete task->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->onRspUserPasswordUpdate(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspOrderInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcInputOrderField *task_data = (CUstpFtdcInputOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["SeatNo"] = task_data->SeatNo; - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["UserOrderLocalID"] = toUtf(task_data->UserOrderLocalID); - data["OrderPriceType"] = task_data->OrderPriceType; - data["Direction"] = task_data->Direction; - data["OffsetFlag"] = task_data->OffsetFlag; - data["HedgeFlag"] = task_data->HedgeFlag; - data["LimitPrice"] = task_data->LimitPrice; - data["Volume"] = task_data->Volume; - data["TimeCondition"] = task_data->TimeCondition; - data["GTDDate"] = toUtf(task_data->GTDDate); - data["VolumeCondition"] = task_data->VolumeCondition; - data["MinVolume"] = task_data->MinVolume; - data["StopPrice"] = task_data->StopPrice; - data["ForceCloseReason"] = task_data->ForceCloseReason; - data["IsAutoSuspend"] = task_data->IsAutoSuspend; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["UserCustom"] = toUtf(task_data->UserCustom); - data["BusinessLocalID"] = task_data->BusinessLocalID; - data["ActionDay"] = toUtf(task_data->ActionDay); - data["ArbiType"] = task_data->ArbiType; - data["ClientID"] = toUtf(task_data->ClientID); - 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->onRspOrderInsert(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspOrderAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcOrderActionField *task_data = (CUstpFtdcOrderActionField*)task->task_data; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["UserOrderActionLocalID"] = toUtf(task_data->UserOrderActionLocalID); - data["UserOrderLocalID"] = toUtf(task_data->UserOrderLocalID); - data["ActionFlag"] = task_data->ActionFlag; - data["LimitPrice"] = task_data->LimitPrice; - data["VolumeChange"] = task_data->VolumeChange; - data["BusinessLocalID"] = task_data->BusinessLocalID; - data["ClientID"] = toUtf(task_data->ClientID); - 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->onRspOrderAction(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspQuoteInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcInputQuoteField *task_data = (CUstpFtdcInputQuoteField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["Direction"] = task_data->Direction; - data["QuoteSysID"] = toUtf(task_data->QuoteSysID); - data["UserQuoteLocalID"] = toUtf(task_data->UserQuoteLocalID); - data["QuoteLocalID"] = toUtf(task_data->QuoteLocalID); - data["BidVolume"] = task_data->BidVolume; - data["BidOffsetFlag"] = task_data->BidOffsetFlag; - data["BidHedgeFlag"] = task_data->BidHedgeFlag; - data["BidPrice"] = task_data->BidPrice; - data["AskVolume"] = task_data->AskVolume; - data["AskOffsetFlag"] = task_data->AskOffsetFlag; - data["AskHedgeFlag"] = task_data->AskHedgeFlag; - data["AskPrice"] = task_data->AskPrice; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["UserCustom"] = toUtf(task_data->UserCustom); - data["BidUserOrderLocalID"] = toUtf(task_data->BidUserOrderLocalID); - data["AskUserOrderLocalID"] = toUtf(task_data->AskUserOrderLocalID); - data["BidOrderLocalID"] = toUtf(task_data->BidOrderLocalID); - data["AskOrderLocalID"] = toUtf(task_data->AskOrderLocalID); - data["ReqForQuoteID"] = toUtf(task_data->ReqForQuoteID); - data["StandByTime"] = task_data->StandByTime; - data["ClientID"] = toUtf(task_data->ClientID); - 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->onRspQuoteInsert(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspQuoteAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcQuoteActionField *task_data = (CUstpFtdcQuoteActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["QuoteSysID"] = toUtf(task_data->QuoteSysID); - data["UserQuoteLocalID"] = toUtf(task_data->UserQuoteLocalID); - data["UserQuoteActionLocalID"] = toUtf(task_data->UserQuoteActionLocalID); - data["ActionFlag"] = task_data->ActionFlag; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["UserCustom"] = toUtf(task_data->UserCustom); - data["Direction"] = task_data->Direction; - data["ClientID"] = toUtf(task_data->ClientID); - 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->onRspQuoteAction(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspForQuote(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcReqForQuoteField *task_data = (CUstpFtdcReqForQuoteField*)task->task_data; - data["ReqForQuoteID"] = toUtf(task_data->ReqForQuoteID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["Direction"] = task_data->Direction; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["ReqForQuoteTime"] = toUtf(task_data->ReqForQuoteTime); - data["ClientID"] = toUtf(task_data->ClientID); - 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->onRspForQuote(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspMarginCombAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcInputMarginCombActionField *task_data = (CUstpFtdcInputMarginCombActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["UserID"] = toUtf(task_data->UserID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["HedgeFlag"] = task_data->HedgeFlag; - data["UserActionLocalID"] = toUtf(task_data->UserActionLocalID); - data["CombInstrumentID"] = toUtf(task_data->CombInstrumentID); - data["CombVolume"] = task_data->CombVolume; - data["CombDirection"] = task_data->CombDirection; - data["ActionLocalID"] = toUtf(task_data->ActionLocalID); - data["Direction"] = task_data->Direction; - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["CombActionStatus"] = task_data->CombActionStatus; - 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->onRspMarginCombAction(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspUserDeposit(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcstpUserDepositField *task_data = (CUstpFtdcstpUserDepositField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["UserID"] = toUtf(task_data->UserID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["Amount"] = task_data->Amount; - data["AmountDirection"] = task_data->AmountDirection; - data["UserOrderLocalID"] = toUtf(task_data->UserOrderLocalID); - 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->onRspUserDeposit(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspTransferMoney(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcstpTransferMoneyField *task_data = (CUstpFtdcstpTransferMoneyField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["UserID"] = toUtf(task_data->UserID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["Amount"] = task_data->Amount; - data["AmountDirection"] = task_data->AmountDirection; - data["UserOrderLocalID"] = toUtf(task_data->UserOrderLocalID); - data["BankID"] = toUtf(task_data->BankID); - data["BankPasswd"] = toUtf(task_data->BankPasswd); - data["AccountPasswd"] = toUtf(task_data->AccountPasswd); - data["Currency"] = toUtf(task_data->Currency); - data["SerialNo"] = toUtf(task_data->SerialNo); - 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->onRspTransferMoney(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRtnFlowMessageCancel(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcFlowMessageCancelField *task_data = (CUstpFtdcFlowMessageCancelField*)task->task_data; - data["SequenceSeries"] = task_data->SequenceSeries; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["DataCenterID"] = task_data->DataCenterID; - data["StartSequenceNo"] = task_data->StartSequenceNo; - data["EndSequenceNo"] = task_data->EndSequenceNo; - delete task->task_data; - } - this->onRtnFlowMessageCancel(data); -}; - -void TdApi::processRtnTrade(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcTradeField *task_data = (CUstpFtdcTradeField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["SeatID"] = toUtf(task_data->SeatID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["ClientID"] = toUtf(task_data->ClientID); - data["UserID"] = toUtf(task_data->UserID); - data["OrderUserID"] = toUtf(task_data->OrderUserID); - data["TradeID"] = toUtf(task_data->TradeID); - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["UserOrderLocalID"] = toUtf(task_data->UserOrderLocalID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["Direction"] = task_data->Direction; - data["OffsetFlag"] = task_data->OffsetFlag; - data["HedgeFlag"] = task_data->HedgeFlag; - data["TradePrice"] = task_data->TradePrice; - data["TradeVolume"] = task_data->TradeVolume; - data["TradeTime"] = toUtf(task_data->TradeTime); - data["ClearingPartID"] = toUtf(task_data->ClearingPartID); - data["UsedFee"] = task_data->UsedFee; - data["UsedMargin"] = task_data->UsedMargin; - data["Premium"] = task_data->Premium; - data["Position"] = task_data->Position; - data["PositionCost"] = task_data->PositionCost; - data["Available"] = task_data->Available; - data["Margin"] = task_data->Margin; - data["FrozenMargin"] = task_data->FrozenMargin; - data["BusinessLocalID"] = task_data->BusinessLocalID; - data["ActionDay"] = toUtf(task_data->ActionDay); - data["ArbiType"] = task_data->ArbiType; - data["ArbiInstrumentID"] = toUtf(task_data->ArbiInstrumentID); - delete task->task_data; - } - this->onRtnTrade(data); -}; - -void TdApi::processRtnOrder(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcOrderField *task_data = (CUstpFtdcOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["SeatNo"] = task_data->SeatNo; - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["UserOrderLocalID"] = toUtf(task_data->UserOrderLocalID); - data["OrderPriceType"] = task_data->OrderPriceType; - data["Direction"] = task_data->Direction; - data["OffsetFlag"] = task_data->OffsetFlag; - data["HedgeFlag"] = task_data->HedgeFlag; - data["LimitPrice"] = task_data->LimitPrice; - data["Volume"] = task_data->Volume; - data["TimeCondition"] = task_data->TimeCondition; - data["GTDDate"] = toUtf(task_data->GTDDate); - data["VolumeCondition"] = task_data->VolumeCondition; - data["MinVolume"] = task_data->MinVolume; - data["StopPrice"] = task_data->StopPrice; - data["ForceCloseReason"] = task_data->ForceCloseReason; - data["IsAutoSuspend"] = task_data->IsAutoSuspend; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["UserCustom"] = toUtf(task_data->UserCustom); - data["BusinessLocalID"] = task_data->BusinessLocalID; - data["ActionDay"] = toUtf(task_data->ActionDay); - data["ArbiType"] = task_data->ArbiType; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["OrderUserID"] = toUtf(task_data->OrderUserID); - data["ClientID"] = toUtf(task_data->ClientID); - data["SeatID"] = toUtf(task_data->SeatID); - data["InsertTime"] = toUtf(task_data->InsertTime); - data["OrderLocalID"] = toUtf(task_data->OrderLocalID); - data["OrderSource"] = task_data->OrderSource; - data["OrderStatus"] = task_data->OrderStatus; - data["CancelTime"] = toUtf(task_data->CancelTime); - data["CancelUserID"] = toUtf(task_data->CancelUserID); - data["VolumeTraded"] = task_data->VolumeTraded; - data["VolumeRemain"] = task_data->VolumeRemain; - data["OrderType"] = task_data->OrderType; - data["DeliveryFlag"] = task_data->DeliveryFlag; - delete task->task_data; - } - this->onRtnOrder(data); -}; - -void TdApi::processErrRtnOrderInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcInputOrderField *task_data = (CUstpFtdcInputOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["SeatNo"] = task_data->SeatNo; - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["UserOrderLocalID"] = toUtf(task_data->UserOrderLocalID); - data["OrderPriceType"] = task_data->OrderPriceType; - data["Direction"] = task_data->Direction; - data["OffsetFlag"] = task_data->OffsetFlag; - data["HedgeFlag"] = task_data->HedgeFlag; - data["LimitPrice"] = task_data->LimitPrice; - data["Volume"] = task_data->Volume; - data["TimeCondition"] = task_data->TimeCondition; - data["GTDDate"] = toUtf(task_data->GTDDate); - data["VolumeCondition"] = task_data->VolumeCondition; - data["MinVolume"] = task_data->MinVolume; - data["StopPrice"] = task_data->StopPrice; - data["ForceCloseReason"] = task_data->ForceCloseReason; - data["IsAutoSuspend"] = task_data->IsAutoSuspend; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["UserCustom"] = toUtf(task_data->UserCustom); - data["BusinessLocalID"] = task_data->BusinessLocalID; - data["ActionDay"] = toUtf(task_data->ActionDay); - data["ArbiType"] = task_data->ArbiType; - data["ClientID"] = toUtf(task_data->ClientID); - 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->onErrRtnOrderInsert(data, data); -}; - -void TdApi::processErrRtnOrderAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcOrderActionField *task_data = (CUstpFtdcOrderActionField*)task->task_data; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["UserOrderActionLocalID"] = toUtf(task_data->UserOrderActionLocalID); - data["UserOrderLocalID"] = toUtf(task_data->UserOrderLocalID); - data["ActionFlag"] = task_data->ActionFlag; - data["LimitPrice"] = task_data->LimitPrice; - data["VolumeChange"] = task_data->VolumeChange; - data["BusinessLocalID"] = task_data->BusinessLocalID; - data["ClientID"] = toUtf(task_data->ClientID); - 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->onErrRtnOrderAction(data, data); -}; - -void TdApi::processRtnInstrumentStatus(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcInstrumentStatusField *task_data = (CUstpFtdcInstrumentStatusField*)task->task_data; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ProductID"] = toUtf(task_data->ProductID); - data["ProductName"] = toUtf(task_data->ProductName); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["InstrumentName"] = toUtf(task_data->InstrumentName); - data["DeliveryYear"] = task_data->DeliveryYear; - data["DeliveryMonth"] = task_data->DeliveryMonth; - data["MaxLimitOrderVolume"] = task_data->MaxLimitOrderVolume; - data["MinLimitOrderVolume"] = task_data->MinLimitOrderVolume; - data["MaxMarketOrderVolume"] = task_data->MaxMarketOrderVolume; - data["MinMarketOrderVolume"] = task_data->MinMarketOrderVolume; - data["VolumeMultiple"] = task_data->VolumeMultiple; - data["PriceTick"] = task_data->PriceTick; - data["Currency"] = task_data->Currency; - data["LongPosLimit"] = task_data->LongPosLimit; - data["ShortPosLimit"] = task_data->ShortPosLimit; - data["LowerLimitPrice"] = task_data->LowerLimitPrice; - data["UpperLimitPrice"] = task_data->UpperLimitPrice; - data["PreSettlementPrice"] = task_data->PreSettlementPrice; - data["InstrumentStatus"] = task_data->InstrumentStatus; - data["CreateDate"] = toUtf(task_data->CreateDate); - data["OpenDate"] = toUtf(task_data->OpenDate); - data["ExpireDate"] = toUtf(task_data->ExpireDate); - data["StartDelivDate"] = toUtf(task_data->StartDelivDate); - data["EndDelivDate"] = toUtf(task_data->EndDelivDate); - data["BasisPrice"] = task_data->BasisPrice; - data["IsTrading"] = task_data->IsTrading; - data["UnderlyingInstrID"] = toUtf(task_data->UnderlyingInstrID); - data["UnderlyingMultiple"] = task_data->UnderlyingMultiple; - data["PositionType"] = task_data->PositionType; - data["StrikePrice"] = task_data->StrikePrice; - data["OptionsType"] = task_data->OptionsType; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["ArbiType"] = task_data->ArbiType; - data["InstrumentID_1"] = toUtf(task_data->InstrumentID_1); - data["Direction_1"] = task_data->Direction_1; - data["Ratio_1"] = task_data->Ratio_1; - data["InstrumentID_2"] = toUtf(task_data->InstrumentID_2); - data["Direction_2"] = task_data->Direction_2; - data["Ratio_2"] = task_data->Ratio_2; - data["EnterDate"] = toUtf(task_data->EnterDate); - delete task->task_data; - } - this->onRtnInstrumentStatus(data); -}; - -void TdApi::processRtnInvestorAccountDeposit(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcInvestorAccountDepositResField *task_data = (CUstpFtdcInvestorAccountDepositResField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["UserID"] = toUtf(task_data->UserID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["AccountID"] = toUtf(task_data->AccountID); - data["AccountSeqNo"] = toUtf(task_data->AccountSeqNo); - data["Amount"] = task_data->Amount; - data["AmountDirection"] = task_data->AmountDirection; - data["Available"] = task_data->Available; - data["Balance"] = task_data->Balance; - delete task->task_data; - } - this->onRtnInvestorAccountDeposit(data); -}; - -void TdApi::processRtnQuote(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcRtnQuoteField *task_data = (CUstpFtdcRtnQuoteField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["Direction"] = task_data->Direction; - data["QuoteSysID"] = toUtf(task_data->QuoteSysID); - data["UserQuoteLocalID"] = toUtf(task_data->UserQuoteLocalID); - data["QuoteLocalID"] = toUtf(task_data->QuoteLocalID); - data["BidVolume"] = task_data->BidVolume; - data["BidOffsetFlag"] = task_data->BidOffsetFlag; - data["BidHedgeFlag"] = task_data->BidHedgeFlag; - data["BidPrice"] = task_data->BidPrice; - data["AskVolume"] = task_data->AskVolume; - data["AskOffsetFlag"] = task_data->AskOffsetFlag; - data["AskHedgeFlag"] = task_data->AskHedgeFlag; - data["AskPrice"] = task_data->AskPrice; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["UserCustom"] = toUtf(task_data->UserCustom); - data["BidUserOrderLocalID"] = toUtf(task_data->BidUserOrderLocalID); - data["AskUserOrderLocalID"] = toUtf(task_data->AskUserOrderLocalID); - data["BidOrderLocalID"] = toUtf(task_data->BidOrderLocalID); - data["AskOrderLocalID"] = toUtf(task_data->AskOrderLocalID); - data["ReqForQuoteID"] = toUtf(task_data->ReqForQuoteID); - data["StandByTime"] = task_data->StandByTime; - data["BidOrderSysID"] = toUtf(task_data->BidOrderSysID); - data["AskOrderSysID"] = toUtf(task_data->AskOrderSysID); - data["QuoteStatus"] = task_data->QuoteStatus; - data["InsertTime"] = toUtf(task_data->InsertTime); - data["CancelTime"] = toUtf(task_data->CancelTime); - data["TradeTime"] = toUtf(task_data->TradeTime); - data["ClientID"] = toUtf(task_data->ClientID); - delete task->task_data; - } - this->onRtnQuote(data); -}; - -void TdApi::processErrRtnQuoteInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcInputQuoteField *task_data = (CUstpFtdcInputQuoteField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["Direction"] = task_data->Direction; - data["QuoteSysID"] = toUtf(task_data->QuoteSysID); - data["UserQuoteLocalID"] = toUtf(task_data->UserQuoteLocalID); - data["QuoteLocalID"] = toUtf(task_data->QuoteLocalID); - data["BidVolume"] = task_data->BidVolume; - data["BidOffsetFlag"] = task_data->BidOffsetFlag; - data["BidHedgeFlag"] = task_data->BidHedgeFlag; - data["BidPrice"] = task_data->BidPrice; - data["AskVolume"] = task_data->AskVolume; - data["AskOffsetFlag"] = task_data->AskOffsetFlag; - data["AskHedgeFlag"] = task_data->AskHedgeFlag; - data["AskPrice"] = task_data->AskPrice; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["UserCustom"] = toUtf(task_data->UserCustom); - data["BidUserOrderLocalID"] = toUtf(task_data->BidUserOrderLocalID); - data["AskUserOrderLocalID"] = toUtf(task_data->AskUserOrderLocalID); - data["BidOrderLocalID"] = toUtf(task_data->BidOrderLocalID); - data["AskOrderLocalID"] = toUtf(task_data->AskOrderLocalID); - data["ReqForQuoteID"] = toUtf(task_data->ReqForQuoteID); - data["StandByTime"] = task_data->StandByTime; - data["ClientID"] = toUtf(task_data->ClientID); - 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->onErrRtnQuoteInsert(data, data); -}; - -void TdApi::processErrRtnQuoteAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcQuoteActionField *task_data = (CUstpFtdcQuoteActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["QuoteSysID"] = toUtf(task_data->QuoteSysID); - data["UserQuoteLocalID"] = toUtf(task_data->UserQuoteLocalID); - data["UserQuoteActionLocalID"] = toUtf(task_data->UserQuoteActionLocalID); - data["ActionFlag"] = task_data->ActionFlag; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["UserCustom"] = toUtf(task_data->UserCustom); - data["Direction"] = task_data->Direction; - data["ClientID"] = toUtf(task_data->ClientID); - 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->onErrRtnQuoteAction(data, data); -}; - -void TdApi::processRtnForQuote(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcReqForQuoteField *task_data = (CUstpFtdcReqForQuoteField*)task->task_data; - data["ReqForQuoteID"] = toUtf(task_data->ReqForQuoteID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["Direction"] = task_data->Direction; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["ReqForQuoteTime"] = toUtf(task_data->ReqForQuoteTime); - data["ClientID"] = toUtf(task_data->ClientID); - delete task->task_data; - } - this->onRtnForQuote(data); -}; - -void TdApi::processRtnMarginCombinationLeg(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcMarginCombinationLegField *task_data = (CUstpFtdcMarginCombinationLegField*)task->task_data; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["CombInstrumentID"] = toUtf(task_data->CombInstrumentID); - data["LegID"] = task_data->LegID; - data["LegInstrumentID"] = toUtf(task_data->LegInstrumentID); - data["Direction"] = task_data->Direction; - data["LegMultiple"] = task_data->LegMultiple; - data["Priority"] = task_data->Priority; - delete task->task_data; - } - this->onRtnMarginCombinationLeg(data); -}; - -void TdApi::processRtnMarginCombAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcInputMarginCombActionField *task_data = (CUstpFtdcInputMarginCombActionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["UserID"] = toUtf(task_data->UserID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["HedgeFlag"] = task_data->HedgeFlag; - data["UserActionLocalID"] = toUtf(task_data->UserActionLocalID); - data["CombInstrumentID"] = toUtf(task_data->CombInstrumentID); - data["CombVolume"] = task_data->CombVolume; - data["CombDirection"] = task_data->CombDirection; - data["ActionLocalID"] = toUtf(task_data->ActionLocalID); - data["Direction"] = task_data->Direction; - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["CombActionStatus"] = task_data->CombActionStatus; - delete task->task_data; - } - this->onRtnMarginCombAction(data); -}; - -void TdApi::processRtnUserDeposit(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcstpUserDepositField *task_data = (CUstpFtdcstpUserDepositField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["UserID"] = toUtf(task_data->UserID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["Amount"] = task_data->Amount; - data["AmountDirection"] = task_data->AmountDirection; - data["UserOrderLocalID"] = toUtf(task_data->UserOrderLocalID); - delete task->task_data; - } - this->onRtnUserDeposit(data); -}; - -void TdApi::processRspQueryUserLogin(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->onRspQueryUserLogin(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspQryOrder(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcOrderField *task_data = (CUstpFtdcOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["SeatNo"] = task_data->SeatNo; - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["UserOrderLocalID"] = toUtf(task_data->UserOrderLocalID); - data["OrderPriceType"] = task_data->OrderPriceType; - data["Direction"] = task_data->Direction; - data["OffsetFlag"] = task_data->OffsetFlag; - data["HedgeFlag"] = task_data->HedgeFlag; - data["LimitPrice"] = task_data->LimitPrice; - data["Volume"] = task_data->Volume; - data["TimeCondition"] = task_data->TimeCondition; - data["GTDDate"] = toUtf(task_data->GTDDate); - data["VolumeCondition"] = task_data->VolumeCondition; - data["MinVolume"] = task_data->MinVolume; - data["StopPrice"] = task_data->StopPrice; - data["ForceCloseReason"] = task_data->ForceCloseReason; - data["IsAutoSuspend"] = task_data->IsAutoSuspend; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["UserCustom"] = toUtf(task_data->UserCustom); - data["BusinessLocalID"] = task_data->BusinessLocalID; - data["ActionDay"] = toUtf(task_data->ActionDay); - data["ArbiType"] = task_data->ArbiType; - data["TradingDay"] = toUtf(task_data->TradingDay); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["OrderUserID"] = toUtf(task_data->OrderUserID); - data["ClientID"] = toUtf(task_data->ClientID); - data["SeatID"] = toUtf(task_data->SeatID); - data["InsertTime"] = toUtf(task_data->InsertTime); - data["OrderLocalID"] = toUtf(task_data->OrderLocalID); - data["OrderSource"] = task_data->OrderSource; - data["OrderStatus"] = task_data->OrderStatus; - data["CancelTime"] = toUtf(task_data->CancelTime); - data["CancelUserID"] = toUtf(task_data->CancelUserID); - data["VolumeTraded"] = task_data->VolumeTraded; - data["VolumeRemain"] = task_data->VolumeRemain; - data["OrderType"] = task_data->OrderType; - data["DeliveryFlag"] = task_data->DeliveryFlag; - 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->onRspQryOrder(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspQryTrade(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcTradeField *task_data = (CUstpFtdcTradeField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["SeatID"] = toUtf(task_data->SeatID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["ClientID"] = toUtf(task_data->ClientID); - data["UserID"] = toUtf(task_data->UserID); - data["OrderUserID"] = toUtf(task_data->OrderUserID); - data["TradeID"] = toUtf(task_data->TradeID); - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["UserOrderLocalID"] = toUtf(task_data->UserOrderLocalID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["Direction"] = task_data->Direction; - data["OffsetFlag"] = task_data->OffsetFlag; - data["HedgeFlag"] = task_data->HedgeFlag; - data["TradePrice"] = task_data->TradePrice; - data["TradeVolume"] = task_data->TradeVolume; - data["TradeTime"] = toUtf(task_data->TradeTime); - data["ClearingPartID"] = toUtf(task_data->ClearingPartID); - data["UsedFee"] = task_data->UsedFee; - data["UsedMargin"] = task_data->UsedMargin; - data["Premium"] = task_data->Premium; - data["Position"] = task_data->Position; - data["PositionCost"] = task_data->PositionCost; - data["Available"] = task_data->Available; - data["Margin"] = task_data->Margin; - data["FrozenMargin"] = task_data->FrozenMargin; - data["BusinessLocalID"] = task_data->BusinessLocalID; - data["ActionDay"] = toUtf(task_data->ActionDay); - data["ArbiType"] = task_data->ArbiType; - data["ArbiInstrumentID"] = toUtf(task_data->ArbiInstrumentID); - 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->onRspQryTrade(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspQryUserInvestor(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcRspUserInvestorField *task_data = (CUstpFtdcRspUserInvestorField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["UserID"] = toUtf(task_data->UserID); - data["InvestorID"] = toUtf(task_data->InvestorID); - 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->onRspQryUserInvestor(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspQryTradingCode(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcRspTradingCodeField *task_data = (CUstpFtdcRspTradingCodeField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["ClientID"] = toUtf(task_data->ClientID); - data["ClientRight"] = task_data->ClientRight; - data["ClientHedgeFlag"] = task_data->ClientHedgeFlag; - data["IsActive"] = task_data->IsActive; - 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->onRspQryTradingCode(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInvestorAccount(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcRspInvestorAccountField *task_data = (CUstpFtdcRspInvestorAccountField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["AccountID"] = toUtf(task_data->AccountID); - data["PreBalance"] = task_data->PreBalance; - data["Deposit"] = task_data->Deposit; - data["Withdraw"] = task_data->Withdraw; - data["FrozenMargin"] = task_data->FrozenMargin; - data["FrozenFee"] = task_data->FrozenFee; - data["FrozenPremium"] = task_data->FrozenPremium; - data["Fee"] = task_data->Fee; - data["CloseProfit"] = task_data->CloseProfit; - data["PositionProfit"] = task_data->PositionProfit; - data["Available"] = task_data->Available; - data["LongFrozenMargin"] = task_data->LongFrozenMargin; - data["ShortFrozenMargin"] = task_data->ShortFrozenMargin; - data["LongMargin"] = task_data->LongMargin; - data["ShortMargin"] = task_data->ShortMargin; - data["ReleaseMargin"] = task_data->ReleaseMargin; - data["DynamicRights"] = task_data->DynamicRights; - data["TodayInOut"] = task_data->TodayInOut; - data["Margin"] = task_data->Margin; - data["Premium"] = task_data->Premium; - data["Risk"] = task_data->Risk; - 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->onRspQryInvestorAccount(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInstrument(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcRspInstrumentField *task_data = (CUstpFtdcRspInstrumentField*)task->task_data; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ProductID"] = toUtf(task_data->ProductID); - data["ProductName"] = toUtf(task_data->ProductName); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["InstrumentName"] = toUtf(task_data->InstrumentName); - data["DeliveryYear"] = task_data->DeliveryYear; - data["DeliveryMonth"] = task_data->DeliveryMonth; - data["MaxLimitOrderVolume"] = task_data->MaxLimitOrderVolume; - data["MinLimitOrderVolume"] = task_data->MinLimitOrderVolume; - data["MaxMarketOrderVolume"] = task_data->MaxMarketOrderVolume; - data["MinMarketOrderVolume"] = task_data->MinMarketOrderVolume; - data["VolumeMultiple"] = task_data->VolumeMultiple; - data["PriceTick"] = task_data->PriceTick; - data["Currency"] = task_data->Currency; - data["LongPosLimit"] = task_data->LongPosLimit; - data["ShortPosLimit"] = task_data->ShortPosLimit; - data["LowerLimitPrice"] = task_data->LowerLimitPrice; - data["UpperLimitPrice"] = task_data->UpperLimitPrice; - data["PreSettlementPrice"] = task_data->PreSettlementPrice; - data["InstrumentStatus"] = task_data->InstrumentStatus; - data["CreateDate"] = toUtf(task_data->CreateDate); - data["OpenDate"] = toUtf(task_data->OpenDate); - data["ExpireDate"] = toUtf(task_data->ExpireDate); - data["StartDelivDate"] = toUtf(task_data->StartDelivDate); - data["EndDelivDate"] = toUtf(task_data->EndDelivDate); - data["BasisPrice"] = task_data->BasisPrice; - data["IsTrading"] = task_data->IsTrading; - data["UnderlyingInstrID"] = toUtf(task_data->UnderlyingInstrID); - data["UnderlyingMultiple"] = task_data->UnderlyingMultiple; - data["PositionType"] = task_data->PositionType; - data["StrikePrice"] = task_data->StrikePrice; - data["OptionsType"] = task_data->OptionsType; - data["CurrencyID"] = toUtf(task_data->CurrencyID); - data["ArbiType"] = task_data->ArbiType; - data["InstrumentID_1"] = toUtf(task_data->InstrumentID_1); - data["Direction_1"] = task_data->Direction_1; - data["Ratio_1"] = task_data->Ratio_1; - data["InstrumentID_2"] = toUtf(task_data->InstrumentID_2); - data["Direction_2"] = task_data->Direction_2; - data["Ratio_2"] = task_data->Ratio_2; - 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->onRspQryInstrument(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspQryExchange(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcRspExchangeField *task_data = (CUstpFtdcRspExchangeField*)task->task_data; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ExchangeName"] = toUtf(task_data->ExchangeName); - 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->onRspQryExchange(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInvestorPosition(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcRspInvestorPositionField *task_data = (CUstpFtdcRspInvestorPositionField*)task->task_data; - data["InvestorID"] = toUtf(task_data->InvestorID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ClientID"] = toUtf(task_data->ClientID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["Direction"] = task_data->Direction; - data["HedgeFlag"] = task_data->HedgeFlag; - data["UsedMargin"] = task_data->UsedMargin; - data["Position"] = task_data->Position; - data["PositionCost"] = task_data->PositionCost; - data["YdPosition"] = task_data->YdPosition; - data["YdPositionCost"] = task_data->YdPositionCost; - data["FrozenMargin"] = task_data->FrozenMargin; - data["FrozenPosition"] = task_data->FrozenPosition; - data["FrozenClosing"] = task_data->FrozenClosing; - data["YdFrozenClosing"] = task_data->YdFrozenClosing; - data["FrozenPremium"] = task_data->FrozenPremium; - data["LastTradeID"] = toUtf(task_data->LastTradeID); - data["LastOrderLocalID"] = toUtf(task_data->LastOrderLocalID); - data["SpeculationPosition"] = task_data->SpeculationPosition; - data["ArbitragePosition"] = task_data->ArbitragePosition; - data["HedgePosition"] = task_data->HedgePosition; - data["SpecFrozenClosing"] = task_data->SpecFrozenClosing; - data["HedgeFrozenClosing"] = task_data->HedgeFrozenClosing; - data["Currency"] = toUtf(task_data->Currency); - 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->onRspQryInvestorPosition(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspQryComplianceParam(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcRspComplianceParamField *task_data = (CUstpFtdcRspComplianceParamField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["ClientID"] = toUtf(task_data->ClientID); - data["DailyMaxOrder"] = task_data->DailyMaxOrder; - data["DailyMaxOrderAction"] = task_data->DailyMaxOrderAction; - data["DailyMaxErrorOrder"] = task_data->DailyMaxErrorOrder; - data["DailyMaxOrderVolume"] = task_data->DailyMaxOrderVolume; - data["DailyMaxOrderActionVolume"] = task_data->DailyMaxOrderActionVolume; - 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->onRspQryComplianceParam(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInvestorFee(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcInvestorFeeField *task_data = (CUstpFtdcInvestorFeeField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ClientID"] = toUtf(task_data->ClientID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["ProductID"] = toUtf(task_data->ProductID); - data["OpenFeeRate"] = task_data->OpenFeeRate; - data["OpenFeeAmt"] = task_data->OpenFeeAmt; - data["OffsetFeeRate"] = task_data->OffsetFeeRate; - data["OffsetFeeAmt"] = task_data->OffsetFeeAmt; - data["OTFeeRate"] = task_data->OTFeeRate; - data["OTFeeAmt"] = task_data->OTFeeAmt; - data["ExecFeeRate"] = task_data->ExecFeeRate; - data["ExecFeeAmt"] = task_data->ExecFeeAmt; - data["PerOrderAmt"] = task_data->PerOrderAmt; - data["PerCancelAmt"] = task_data->PerCancelAmt; - data["HedgeFlag"] = task_data->HedgeFlag; - 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->onRspQryInvestorFee(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInvestorMargin(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcInvestorMarginField *task_data = (CUstpFtdcInvestorMarginField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ClientID"] = toUtf(task_data->ClientID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["ProductID"] = toUtf(task_data->ProductID); - data["LongMarginRate"] = task_data->LongMarginRate; - data["LongMarginAmt"] = task_data->LongMarginAmt; - data["ShortMarginRate"] = task_data->ShortMarginRate; - data["ShortMarginAmt"] = task_data->ShortMarginAmt; - data["HedgeFlag"] = task_data->HedgeFlag; - 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->onRspQryInvestorMargin(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInvestorCombPosition(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcRspInvestorCombPositionField *task_data = (CUstpFtdcRspInvestorCombPositionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["Direction"] = task_data->Direction; - data["InvestorID"] = toUtf(task_data->InvestorID); - data["HedgeFlag"] = task_data->HedgeFlag; - data["ClientID"] = toUtf(task_data->ClientID); - data["CombInstrumentID"] = toUtf(task_data->CombInstrumentID); - data["Leg1InstrumentID"] = toUtf(task_data->Leg1InstrumentID); - data["Leg2InstrumentID"] = toUtf(task_data->Leg2InstrumentID); - data["CombPosition"] = task_data->CombPosition; - data["CombFrozenPosition"] = task_data->CombFrozenPosition; - data["CombFreeMargin"] = task_data->CombFreeMargin; - 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->onRspQryInvestorCombPosition(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInvestorLegPosition(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcRspInvestorLegPositionField *task_data = (CUstpFtdcRspInvestorLegPositionField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["HedgeFlag"] = task_data->HedgeFlag; - data["ClientID"] = toUtf(task_data->ClientID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["LongPosition"] = task_data->LongPosition; - data["ShortPosition"] = task_data->ShortPosition; - data["LongMargin"] = task_data->LongMargin; - data["ShortMargin"] = task_data->ShortMargin; - data["LongFrozenPosition"] = task_data->LongFrozenPosition; - data["ShortFrozenPosition"] = task_data->ShortFrozenPosition; - data["LongFrozenMargin"] = task_data->LongFrozenMargin; - data["ShortFrozenMargin"] = task_data->ShortFrozenMargin; - 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->onRspQryInvestorLegPosition(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspQryInstrumentGroup(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcRspInstrumentGroupField *task_data = (CUstpFtdcRspInstrumentGroupField*)task->task_data; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["InstrumentGroupID"] = toUtf(task_data->InstrumentGroupID); - 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->onRspQryInstrumentGroup(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspQryClientMarginCombType(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcRspClientMarginCombTypeField *task_data = (CUstpFtdcRspClientMarginCombTypeField*)task->task_data; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["ClientID"] = toUtf(task_data->ClientID); - data["InstrumentGroupID"] = toUtf(task_data->InstrumentGroupID); - data["MarginCombType"] = task_data->MarginCombType; - 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->onRspQryClientMarginCombType(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspExecOrderInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcInputExecOrderField *task_data = (CUstpFtdcInputExecOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["UserOrderLocalID"] = toUtf(task_data->UserOrderLocalID); - data["OrderType"] = task_data->OrderType; - data["DeliveryFlag"] = task_data->DeliveryFlag; - data["HedgeFlag"] = task_data->HedgeFlag; - data["Volume"] = task_data->Volume; - data["UserCustom"] = toUtf(task_data->UserCustom); - data["ActionDay"] = toUtf(task_data->ActionDay); - data["BusinessLocalID"] = task_data->BusinessLocalID; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - 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->onRspExecOrderInsert(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRspExecOrderAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcInputExecOrderActionField *task_data = (CUstpFtdcInputExecOrderActionField*)task->task_data; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["UserOrderActionLocalID"] = toUtf(task_data->UserOrderActionLocalID); - data["UserOrderLocalID"] = toUtf(task_data->UserOrderLocalID); - data["ActionFlag"] = task_data->ActionFlag; - data["VolumeChange"] = task_data->VolumeChange; - data["BusinessLocalID"] = task_data->BusinessLocalID; - data["OrderType"] = task_data->OrderType; - 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->onRspExecOrderAction(data, data, task->task_id, task->task_last); -}; - -void TdApi::processRtnExecOrder(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcExecOrderField *task_data = (CUstpFtdcExecOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["UserOrderLocalID"] = toUtf(task_data->UserOrderLocalID); - data["OrderType"] = task_data->OrderType; - data["DeliveryFlag"] = task_data->DeliveryFlag; - data["HedgeFlag"] = task_data->HedgeFlag; - data["Volume"] = task_data->Volume; - data["UserCustom"] = toUtf(task_data->UserCustom); - data["ActionDay"] = toUtf(task_data->ActionDay); - data["BusinessLocalID"] = task_data->BusinessLocalID; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - data["TradingDay"] = toUtf(task_data->TradingDay); - data["ParticipantID"] = toUtf(task_data->ParticipantID); - data["OrderUserID"] = toUtf(task_data->OrderUserID); - data["ClientID"] = toUtf(task_data->ClientID); - data["SeatID"] = toUtf(task_data->SeatID); - data["InsertTime"] = toUtf(task_data->InsertTime); - data["OrderLocalID"] = toUtf(task_data->OrderLocalID); - data["OrderSource"] = task_data->OrderSource; - data["OrderStatus"] = task_data->OrderStatus; - data["CancelTime"] = toUtf(task_data->CancelTime); - data["CancelUserID"] = toUtf(task_data->CancelUserID); - delete task->task_data; - } - this->onRtnExecOrder(data); -}; - -void TdApi::processErrRtnExecOrderInsert(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcInputExecOrderField *task_data = (CUstpFtdcInputExecOrderField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["InstrumentID"] = toUtf(task_data->InstrumentID); - data["UserOrderLocalID"] = toUtf(task_data->UserOrderLocalID); - data["OrderType"] = task_data->OrderType; - data["DeliveryFlag"] = task_data->DeliveryFlag; - data["HedgeFlag"] = task_data->HedgeFlag; - data["Volume"] = task_data->Volume; - data["UserCustom"] = toUtf(task_data->UserCustom); - data["ActionDay"] = toUtf(task_data->ActionDay); - data["BusinessLocalID"] = task_data->BusinessLocalID; - data["BusinessUnit"] = toUtf(task_data->BusinessUnit); - 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->onErrRtnExecOrderInsert(data, data); -}; - -void TdApi::processErrRtnExecOrderAction(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcInputExecOrderActionField *task_data = (CUstpFtdcInputExecOrderActionField*)task->task_data; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["OrderSysID"] = toUtf(task_data->OrderSysID); - data["BrokerID"] = toUtf(task_data->BrokerID); - data["InvestorID"] = toUtf(task_data->InvestorID); - data["UserID"] = toUtf(task_data->UserID); - data["UserOrderActionLocalID"] = toUtf(task_data->UserOrderActionLocalID); - data["UserOrderLocalID"] = toUtf(task_data->UserOrderLocalID); - data["ActionFlag"] = task_data->ActionFlag; - data["VolumeChange"] = task_data->VolumeChange; - data["BusinessLocalID"] = task_data->BusinessLocalID; - data["OrderType"] = task_data->OrderType; - 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->onErrRtnExecOrderAction(data, data); -}; - -void TdApi::processRtnTransferMoney(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcSyncMoneyTransferField *task_data = (CUstpFtdcSyncMoneyTransferField*)task->task_data; - data["BrokerID"] = toUtf(task_data->BrokerID); - data["AccountID"] = toUtf(task_data->AccountID); - data["BankID"] = toUtf(task_data->BankID); - data["BankAccount"] = toUtf(task_data->BankAccount); - data["Currency"] = toUtf(task_data->Currency); - data["Amount"] = task_data->Amount; - data["SyncTransMoneyEvent"] = task_data->SyncTransMoneyEvent; - data["TradeCode"] = toUtf(task_data->TradeCode); - data["TradeSource"] = task_data->TradeSource; - data["TransSerialNo"] = toUtf(task_data->TransSerialNo); - data["SerialNo"] = toUtf(task_data->SerialNo); - data["UserID"] = toUtf(task_data->UserID); - data["CommandDate"] = toUtf(task_data->CommandDate); - data["CommandTime"] = toUtf(task_data->CommandTime); - delete task->task_data; - } - this->onRtnTransferMoney(data); -}; - -void TdApi::processRspQrySystemTime(Task *task) -{ - gil_scoped_acquire acquire; - dict data; - if (task->task_data) - { - CUstpFtdcRspQrySystemTimeField *task_data = (CUstpFtdcRspQrySystemTimeField*)task->task_data; - data["ExchangeID"] = toUtf(task_data->ExchangeID); - data["SystemTime"] = toUtf(task_data->SystemTime); - 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->onRspQrySystemTime(data, data, task->task_id, task->task_last); -}; - diff --git a/vnpy/api/femas/generatefemas/femas_td_source_switch.cpp b/vnpy/api/femas/generatefemas/femas_td_source_switch.cpp deleted file mode 100644 index 4f71ebbf..00000000 --- a/vnpy/api/femas/generatefemas/femas_td_source_switch.cpp +++ /dev/null @@ -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; -} - diff --git a/vnpy/api/femas/generatefemas/femas_td_source_task.cpp b/vnpy/api/femas/generatefemas/femas_td_source_task.cpp deleted file mode 100644 index b2e9c7d5..00000000 --- a/vnpy/api/femas/generatefemas/femas_td_source_task.cpp +++ /dev/null @@ -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); -}; - diff --git a/vnpy/api/femas/generatefemas/femas_typedef.py b/vnpy/api/femas/generatefemas/femas_typedef.py deleted file mode 100644 index b108415d..00000000 --- a/vnpy/api/femas/generatefemas/femas_typedef.py +++ /dev/null @@ -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" diff --git a/vnpy/api/femas/generatefemas/mdtemp/femas_md_header_define.h b/vnpy/api/femas/generatefemas/mdtemp/femas_md_header_define.h deleted file mode 100644 index 371b4154..00000000 --- a/vnpy/api/femas/generatefemas/mdtemp/femas_md_header_define.h +++ /dev/null @@ -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 diff --git a/vnpy/api/femas/generatefemas/mdtemp/femas_md_header_function.h b/vnpy/api/femas/generatefemas/mdtemp/femas_md_header_function.h deleted file mode 100644 index 482250f8..00000000 --- a/vnpy/api/femas/generatefemas/mdtemp/femas_md_header_function.h +++ /dev/null @@ -1,4 +0,0 @@ -int reqUserLogin(const dict &req, int reqid); - -int reqUserLogout(const dict &req, int reqid); - diff --git a/vnpy/api/femas/generatefemas/mdtemp/femas_md_header_on.h b/vnpy/api/femas/generatefemas/mdtemp/femas_md_header_on.h deleted file mode 100644 index 9e130818..00000000 --- a/vnpy/api/femas/generatefemas/mdtemp/femas_md_header_on.h +++ /dev/null @@ -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) {}; - diff --git a/vnpy/api/femas/generatefemas/mdtemp/femas_md_header_process.h b/vnpy/api/femas/generatefemas/mdtemp/femas_md_header_process.h deleted file mode 100644 index 477f9207..00000000 --- a/vnpy/api/femas/generatefemas/mdtemp/femas_md_header_process.h +++ /dev/null @@ -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); - diff --git a/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_function.cpp b/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_function.cpp deleted file mode 100644 index 09a94fd5..00000000 --- a/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_function.cpp +++ /dev/null @@ -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; -}; - diff --git a/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_module.cpp b/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_module.cpp deleted file mode 100644 index 2204a982..00000000 --- a/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_module.cpp +++ /dev/null @@ -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) -; diff --git a/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_on.cpp b/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_on.cpp deleted file mode 100644 index 972e941a..00000000 --- a/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_on.cpp +++ /dev/null @@ -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; - } -}; - diff --git a/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_process.cpp b/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_process.cpp deleted file mode 100644 index 54b115c0..00000000 --- a/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_process.cpp +++ /dev/null @@ -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); -}; - diff --git a/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_switch.cpp b/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_switch.cpp deleted file mode 100644 index 7fbabe15..00000000 --- a/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_switch.cpp +++ /dev/null @@ -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; -} - diff --git a/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_task.cpp b/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_task.cpp deleted file mode 100644 index d83a3134..00000000 --- a/vnpy/api/femas/generatefemas/mdtemp/femas_md_source_task.cpp +++ /dev/null @@ -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); -}; -