Skip to content

Commit 30e46a0

Browse files
committed
资金账号信息添加账号信息
1 parent 5013e56 commit 30e46a0

File tree

8 files changed

+24
-0
lines changed

8 files changed

+24
-0
lines changed

QuantBox_CTP_Trade/TraderApi.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,7 @@ void CTraderApi::OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingA
10511051
{
10521052
AccountField* pField = (AccountField*)m_msgQueue->new_block(sizeof(AccountField));
10531053

1054+
strcpy(pField->Account, pTradingAccount->AccountID);
10541055
pField->PreBalance = pTradingAccount->PreBalance;
10551056
pField->CurrMargin = pTradingAccount->CurrMargin;
10561057
pField->Commission = pTradingAccount->Commission;

QuantBox_Femas_Trade/TraderApi.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,7 @@ void CTraderApi::OnRspQryInvestorAccount(CUstpFtdcRspInvestorAccountField *pRspI
10281028
{
10291029
AccountField* pField = (AccountField*)m_msgQueue->new_block(sizeof(AccountField));
10301030

1031+
strcpy(pField->Account, pRspInvestorAccount->AccountID);
10311032
pField->PreBalance = pRspInvestorAccount->PreBalance;
10321033
pField->CurrMargin = pRspInvestorAccount->Margin;
10331034
pField->Commission = pRspInvestorAccount->Fee;

QuantBox_Kingstar_Trade/TraderApi.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1176,6 +1176,7 @@ void CTraderApi::OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CTho
11761176
pField->ExpireDate = GetDate(pInstrument->ExpireDate);
11771177
pField->OptionsType = TThostFtdcOptionsTypeType_2_PutCall(pInstrument->OptionsType);
11781178
pField->StrikePrice = (pInstrument->StrikePrice < DBL_EPSILON || pInstrument->StrikePrice == DBL_MAX) ? 0 : pInstrument->StrikePrice;
1179+
strcpy(pField->UnderlyingInstrID, pInstrument->UnderlyingInstrID);
11791180

11801181
m_msgQueue->Input_NoCopy(ResponeType::OnRspQryInstrument, m_msgQueue, m_pClass, bIsLast, 0, pField, sizeof(InstrumentField), nullptr, 0, nullptr, 0);
11811182
}

QuantBox_LTS_Trade/TraderApi.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,7 @@ void CTraderApi::OnRspQryTradingAccount(CSecurityFtdcTradingAccountField *pTradi
682682
{
683683
AccountField* pField = (AccountField*)m_msgQueue->new_block(sizeof(AccountField));
684684

685+
strcpy(pField->Account, pTradingAccount->AccountID);
685686
pField->PreBalance = pTradingAccount->PreBalance;
686687
pField->CurrMargin = pTradingAccount->CurrMargin;
687688
//pField->CloseProfit = pTradingAccount->CloseProfit;

QuantBox_XSpeed_Trade/TraderApi.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,7 @@ void CTraderApi::OnRspCustomerCapital(struct DFITCCapitalInfoRtnField * pCapital
845845
{
846846
AccountField* pField = (AccountField*)m_msgQueue->new_block(sizeof(AccountField));
847847

848+
strcpy(pField->Account, pCapitalInfoRtn->accountID);
848849
pField->PreBalance = pCapitalInfoRtn->preEquity;
849850
pField->CurrMargin = pCapitalInfoRtn->margin;
850851
pField->Commission = pCapitalInfoRtn->fee;

csharp/QuantBox.XAPI/Struct.cs

+2
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,8 @@ public struct InstrumentField
564564
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
565565
public struct AccountField
566566
{
567+
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
568+
public string Account;
567569
/// <summary>
568570
/// 上次结算准备金
569571
/// </summary>

include/ApiEnum.h

+16
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,21 @@ enum InstrumentType :char
150150
Synthetic,
151151
};
152152

153+
154+
/*
155+
发现融资融券的只有部分功能加入,还有一些功能缺失
156+
这下回到XAPI的定位问题,到底是一个只服务自动套利交易的API,还是全功能的API
157+
*/
158+
enum SecurityType :char
159+
{
160+
CS, // Common Stock
161+
CB, // Convertible Bond,标记后,深圳卖出当前可转债表示转股
162+
ETF, // 标记后,买入表示申购,卖出表示赎回
163+
LOF, // 标记后,买入表示申购,卖出表示赎回
164+
SF, // 标记后,买入表示合并,卖出表示分拆
165+
CashMargin, // 标记后,开仓表示"融",平仓表示"还"
166+
};
167+
153168
enum BarType :char
154169
{
155170
Time,
@@ -209,4 +224,5 @@ enum ExchangeType :char
209224
HKEx,
210225
};
211226

227+
212228
#endif

include/ApiStruct.h

+1
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ struct InstrumentField
411411
///账号
412412
struct AccountField
413413
{
414+
AccountIDType Account;
414415
///上次结算准备金
415416
MoneyType PreBalance;
416417
///当前保证金总额

0 commit comments

Comments
 (0)