CTP综合交易平台下单字段分析CTP综合交易平台下单字段分析2015-11-16 13:58 1126人阅读评论(0) 收藏举报版权声明:本文为博主原创文章,未经博主允许不得转载。
///输入报单struct CThostFtdcInputOrderField{///经纪公司代码TThostFtdcBrokerIDType BrokerID;///投资者代码TThostFtdcInvestorIDType InvestorID;///合约代码TThostFtdcInstrumentIDType InstrumentID;///报单引用TThostFtdcOrderRefType OrderRef;///用户代码TThostFtdcUserIDType UserID;///报单价格条件TThostFtdcOrderPriceTypeType OrderPriceType;///市价#define THOST_FTDC_OPT_AnyPrice '1'///限价/条件单#define THOST_FTDC_OPT_LimitPrice '2'///最优价#define THOST_FTDC_OPT_BestPrice '3'///最新价#define THOST_FTDC_OPT_LastPrice '4'///最新价浮动上浮1个ticks#define THOST_FTDC_OPT_LastPricePlusOneTicks '5'///最新价浮动上浮2个ticks#define THOST_FTDC_OPT_LastPricePlusTwoTicks '6' ///最新价浮动上浮3个ticks#define THOST_FTDC_OPT_LastPricePlusThreeTicks '7' ///卖一价#define THOST_FTDC_OPT_AskPrice1 '8'///卖一价浮动上浮1个ticks#define THOST_FTDC_OPT_AskPrice1PlusOneTicks '9' ///卖一价浮动上浮2个ticks#define THOST_FTDC_OPT_AskPrice1PlusTwoTicks 'A' ///卖一价浮动上浮3个ticks#define THOST_FTDC_OPT_AskPrice1PlusThreeTicks 'B' ///买一价#define THOST_FTDC_OPT_BidPrice1 'C'///买一价浮动上浮1个ticks#define THOST_FTDC_OPT_BidPrice1PlusOneTicks 'D'///买一价浮动上浮2个ticks#define THOST_FTDC_OPT_BidPrice1PlusTwoTicks 'E' ///买一价浮动上浮3个ticks#define THOST_FTDC_OPT_BidPrice1PlusThreeTicks 'F' ///买卖方向TThostFtdcDirectionType Direction;///买#define THOST_FTDC_D_Buy '0'///卖#define THOST_FTDC_D_Sell '1'///组合开平标志TThostFtdcCombOffsetFlagType CombOffsetFlag;///开仓#define THOST_FTDC_OF_Open '0'///平仓#define THOST_FTDC_OF_Close '1'///强平#define THOST_FTDC_OF_ForceClose '2'///平今#define THOST_FTDC_OF_CloseToday '3'///平昨#define THOST_FTDC_OF_CloseYesterday '4'///强减#define THOST_FTDC_OF_ForceOff '5'///本地强平#define THOST_FTDC_OF_LocalForceClose '6'///组合投机套保标志TThostFtdcCombHedgeFlagType CombHedgeFlag;///投机#define THOST_FTDC_HF_Speculation '1'///套利#define THOST_FTDC_HF_Arbitrage '2'///套保#define THOST_FTDC_HF_Hedge '3'///价格TThostFtdcPriceType LimitPrice;//市价0//限价你的价格//条件单你的价格///数量TThostFtdcV olumeType V olumeTotalOriginal;//你的单量///有效期类型TThostFtdcTimeConditionType TimeCondition;///立即完成,否则撤销#define THOST_FTDC_TC_IOC '1' //市价///本节有效#define THOST_FTDC_TC_GFS '2'///当日有效#define THOST_FTDC_TC_GFD '3' //限价、条件单///指定日期前有效#define THOST_FTDC_TC_GTD '4'///撤销前有效#define THOST_FTDC_TC_GTC '5'///集合竞价有效#define THOST_FTDC_TC_GFA '6'///GTD日期TThostFtdcDateType GTDDate;///成交量类型TThostFtdcV olumeConditionType V olumeCondition;///任何数量#define THOST_FTDC_VC_A V '1' //普遍用这个///最小数量#define THOST_FTDC_VC_MV '2'///全部数量#define THOST_FTDC_VC_CV '3'///最小成交量TThostFtdcV olumeType MinV olume;针对FAK指令,上表中THOST_FTDC_VC_A V代表任意数量,而THOST_FTDC_VC_MV代表最小数量。
若为后者,投资者需要指定能成交手数的最小值。
该字段表示立即能成交的手数如果小于该数量,则不会参与撮合成交,全部立即撤销。
///触发条件TThostFtdcContingentConditionType ContingentCondition;///立即#define THOST_FTDC_CC_Immediately '1'///止损#define THOST_FTDC_CC_Touch '2'///止赢#define THOST_FTDC_CC_TouchProfit '3'///预埋单#define THOST_FTDC_CC_ParkedOrder '4'///最新价大于条件价#define THOST_FTDC_CC_LastPriceGreaterThanStopPrice '5' ///最新价大于等于条件价#define THOST_FTDC_CC_LastPriceGreaterEqualStopPrice '6' ///最新价小于条件价#define THOST_FTDC_CC_LastPriceLesserThanStopPrice '7' ///最新价小于等于条件价#define THOST_FTDC_CC_LastPriceLesserEqualStopPrice '8' ///卖一价大于条件价#define THOST_FTDC_CC_AskPriceGreaterThanStopPrice '9' ///卖一价大于等于条件价#define THOST_FTDC_CC_AskPriceGreaterEqualStopPrice 'A'///卖一价小于条件价#define THOST_FTDC_CC_AskPriceLesserThanStopPrice 'B' ///卖一价小于等于条件价#define THOST_FTDC_CC_AskPriceLesserEqualStopPrice 'C' ///买一价大于条件价#define THOST_FTDC_CC_BidPriceGreaterThanStopPrice 'D' ///买一价大于等于条件价#define THOST_FTDC_CC_BidPriceGreaterEqualStopPrice 'E' ///买一价小于条件价#define THOST_FTDC_CC_BidPriceLesserThanStopPrice 'F' ///买一价小于等于条件价#define THOST_FTDC_CC_BidPriceLesserEqualStopPrice 'H' ///止损价TThostFtdcPriceType StopPrice;//条件单触发价格///强平原因TThostFtdcForceCloseReasonType ForceCloseReason;///非强平#define THOST_FTDC_FCC_NotForceClose '0' //正常交易选这个///资金不足#define THOST_FTDC_FCC_LackDeposit '1'///客户超仓#define THOST_FTDC_FCC_ClientOverPositionLimit '2'///会员超仓#define THOST_FTDC_FCC_MemberOverPositionLimit '3'///持仓非整数倍#define THOST_FTDC_FCC_NotMultiple '4'///违规#define THOST_FTDC_FCC_Violation '5'///其它#define THOST_FTDC_FCC_Other '6'///自然人临近交割#define THOST_FTDC_FCC_PersonDeliv '7'///自动挂起标志TThostFtdcBoolType IsAutoSuspend;// 0 no 一般选0//1 yes///业务单元TThostFtdcBusinessUnitType BusinessUnit;///请求编号TThostFtdcRequestIDType RequestID;///用户强评标志TThostFtdcBoolType UserForceClose;// 0 no 一般选0//1 yes///互换单标志TThostFtdcBoolType IsSwapOrder; };。