Example #1
0
int TdApi::reqOrderInsert(dict req, int nRequestID)
{
	CThostFtdcInputOrderField myreq = CThostFtdcInputOrderField();
	memset(&myreq, 0, sizeof(myreq));
	getChar(req, "ContingentCondition", &myreq.ContingentCondition);
	getStr(req, "CombOffsetFlag", myreq.CombOffsetFlag);
	getStr(req, "UserID", myreq.UserID);
	getDouble(req, "LimitPrice", &myreq.LimitPrice);
	getInt(req, "UserForceClose", &myreq.UserForceClose);
	getChar(req, "Direction", &myreq.Direction);
	getInt(req, "IsSwapOrder", &myreq.IsSwapOrder);
	getInt(req, "VolumeTotalOriginal", &myreq.VolumeTotalOriginal);
	getChar(req, "OrderPriceType", &myreq.OrderPriceType);
	getChar(req, "TimeCondition", &myreq.TimeCondition);
	getStr(req, "OrderSysID", myreq.OrderSysID);
	getInt(req, "IsAutoSuspend", &myreq.IsAutoSuspend);
	getDouble(req, "StopPrice", &myreq.StopPrice);
	getStr(req, "InstrumentID", myreq.InstrumentID);
	getStr(req, "ExchangeID", myreq.ExchangeID);
	getInt(req, "MinVolume", &myreq.MinVolume);
	getChar(req, "ForceCloseReason", &myreq.ForceCloseReason);
	getStr(req, "BrokerID", myreq.BrokerID);
	getStr(req, "CombHedgeFlag", myreq.CombHedgeFlag);
	getStr(req, "GTDDate", myreq.GTDDate);
	getStr(req, "BusinessUnit", myreq.BusinessUnit);
	getStr(req, "OrderRef", myreq.OrderRef);
	getStr(req, "InvestorID", myreq.InvestorID);
	getChar(req, "VolumeCondition", &myreq.VolumeCondition);
	getInt(req, "RequestID", &myreq.RequestID);
	int i = this->api->ReqOrderInsert(&myreq, nRequestID);
	return i;
};
Example #2
0
int TdApi::reqOrderInsert(dict req, int nRequestID)
{
	CThostFtdcInputOrderField myreq = CThostFtdcInputOrderField();
	memset(&myreq, 0, sizeof(myreq));
	getChar(req, "offsetFlag", myreq.offsetFlag);
	getChar(req, "offsetFlag", myreq.offsetFlag);
	getChar(req, "entrustTime", myreq.entrustTime);
	getChar(req, "LocalOrderNo", myreq.LocalOrderNo);
	getChar(req, "marketID", myreq.marketID);
	getChar(req, "orderNo", myreq.orderNo);
	getChar(req, "tradeWay", myreq.tradeWay);
	getChar(req, "buyOrSell", myreq.buyOrSell);
	getChar(req, "instID", myreq.instID);
	getChar(req, "seatID", myreq.seatID);
	getChar(req, "status", myreq.status);
	getChar(req, "cancelTime", myreq.cancelTime);
	getChar(req, "middleFlag", myreq.middleFlag);
	getChar(req, "middleFlag", myreq.middleFlag);
	getChar(req, "validDate", myreq.validDate);
	getInt(req, "matchQty", &myreq.matchQty);
	getChar(req, "clientID", myreq.clientID);
	getChar(req, "clientID", myreq.clientID);
	getChar(req, "forceoffset_flag", myreq.forceoffset_flag);
	getChar(req, "orderFlag", myreq.orderFlag);
	getInt(req, "volumnCheck", &myreq.volumnCheck);
	getInt(req, "cancelQty", &myreq.cancelQty);
	getChar(req, "priceFlag", myreq.priceFlag);
	getChar(req, "exchangeID", myreq.exchangeID);
	getInt(req, "amount", &myreq.amount);
	getInt(req, "amount", &myreq.amount);
	int i = this->api->ReqOrderInsert(&myreq, nRequestID);
	return i;
};