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,"<strong>204002</strong>"); //期货发起查询银行余额
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 = <strong>THOST_FTDC_BPWDF_BlankCheck</strong>; //必填
//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 = <strong>THOST_FTDC_BPWDF_BlankCheck</strong>;
//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);