上海期货交易CTP开发——资金转账(银期转账)

CTP资金操作主要有查询银行帐号、查询银行余额、银行转期货、期货转银行等。

 

一、查询银行帐号:

CThostFtdcQryAccountregisterField req = {0};  
req.BankID; //可以查询指定银行账号信息,不填就是查询所有签约银行帐号信息  
req.BankBranchID;  
req.CurrencyID;  
ReqQryAccountregister(&req,reqInfo.nRequestID); 


CThostFtdcQryTransferBankField req = {0};  
ReqQryTransferBank(&req,nRequestID);

 

二、查询银行余额:

CThostFtdcReqQueryAccountField req = {0};  
strcpy(req.TradeCode,"204002"); //期货发起查询银行余额  
req.BankID; //必填  
req.BankBranchID; //必填  
if (req.BrokerBranchID[0]==0)  
{  
strcpy(req.BrokerBranchID,"0000");  
}  
req.BrokerID; //必填  
req.BrokerBranchID; //必填  
if (req.BrokerBranchID[0]==0)  
{  
strcpy(req.BrokerBranchID,"0000");  
}  
//req.TradeDate;  
//req.TradeTime;  
//req.BankSerial;  
//req.TradingDay;  
//req.PlateSerial;  
//req.LastFragment;  
//req.SessionID;  
//req.CustomerName;  
//req.IdCardType;  
//req.IdentifiedCardNo;  
//req.CustType;  
req.BankAccount; //必填  
req.BankPassWord; //必填  
req.AccountID; //必填  
req.Password; //必填  
//req.InstallID;  
//req.FutureSerial;  
strcpy(req.UserID,m_UserID);  
//req.VerifyCertNoFlag;  
req.CurrencyID; //必填  
//req.Digest;  
//req.BankAccType;  
//req.DeviceID;  
//req.BankSecuAccType;  
//req.BrokerIDByBank;  
//req.BankSecuAcc;  
//req.BankPwdFlag;  
req.SecuPwdFlag = THOST_FTDC_BPWDF_BlankCheck; //必填  
//req.OperNo;  
req.RequestID = reqInfo.nRequestID;  
//req.TID;  
ReqQueryBankAccountMoneyByFuture(&req,reqInfo.nRequestID);

 

三、证券与银行互转:

CThostFtdcReqTransferField req = {0};  
//req.TradeCode;  
req.BankID; //必填  
req.BankBranchID; //必填  
if (req.BankBranchID[0]==0)  
{  
strcpy(req.BankBranchID,"0000");  
}  
req.BrokerID; //必填  
req.BrokerBranchID; //必填  
if (req.BrokerBranchID[0]==0)  
{  
strcpy(req.BrokerBranchID,"0000");  
}  
//req.TradeDate;  
//req.TradeTime;  
//req.BankSerial;  
//req.TradingDay;  
//req.PlateSerial;  
//req.LastFragment;  
//req.SessionID;  
//req.CustomerName;  
//req.IdCardType;  
//req.IdentifiedCardNo;  
//req.CustType;  
req.BankAccount; //必填  
req.BankPassWord; //必填  
//req.AccountID;  
req.AccountID; //必填  
req.Password; //必填  
//req.InstallID;  
//req.FutureSerial;  
strcpy(req.UserID,m_UserID);  
//req.VerifyCertNoFlag;  
req.CurrencyID; //必填  
req.TradeAmount; //必填  
//req.FutureFetchAmount;  
//req.FeePayFlag;  
//req.CustFee;  
//req.BrokerFee;  
//req.Message;  
//req.Digest;  
//req.BankAccType;  
//req.DeviceID;  
//req.BankSecuAccType;  
//req.BrokerIDByBank;  
//req.BankSecuAcc;  
//req.BankPwdFlag;  
req.SecuPwdFlag = THOST_FTDC_BPWDF_BlankCheck;  
//req.OperNo;  
req.RequestID = reqInfo.nRequestID;  
//req.TID;  
//req.TransferStatus;  
ReqFromBankToFutureByFuture(&req,reqInfo.nRequestID); //银行转期货  
ReqFromFutureToBankByFuture(&req,reqInfo.nRequestID); //期货转银行

 

四、请求查询转帐流水:

CThostFtdcQryTransferSerialField req = {0};  
strcpy(req.BrokerID,m_BrokerID);  
strcpy(req.AccountID,m_TradingAccounts[reqInfo.lAccIdx].AccountID);  
req.BankID; //指定银行  
req.CurrencyID;  
ReqQryTransferSerial(&req,reqInfo.nRequestID);
分享到:

评论已关闭