您的位置:首页 > 编程语言 > PHP开发

CTP综合交易平台 下单字段分析

2015-11-16 13:58 666 查看
///输入报单

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

//限价 你的价格

//条件单 你的价格

///数量

TThostFtdcVolumeType  VolumeTotalOriginal;

//你的单量

///有效期类型

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;

///成交量类型

TThostFtdcVolumeConditionType  VolumeCondition;

///任何数量

#define THOST_FTDC_VC_AV '1'  //普遍用这个

///最小数量

#define THOST_FTDC_VC_MV '2'

///全部数量

#define THOST_FTDC_VC_CV '3'

///最小成交量

TThostFtdcVolumeType  MinVolume;

针对FAK指令,上表中THOST_FTDC_VC_AV代表任意数量,而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;

};
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: