Пример #1
0
        public DFITCInsertOrderField InsertOrder(string symbolCode, double price, XSpeedBuySellType direct, int volume, XSpeedOpenCloseType flag, string orderRef = "")
        {
            DFITCInsertOrderField order = new DFITCInsertOrderField();

            order.AccountID = this.AccountID;

            //合约
            order.InstrumentID = symbolCode;

            order.LocalOrderID = this.IncrementOrderRef();

            //方向
            order.BuySellType = direct;
            //开平仓
            order.OpenCloseType = flag;
            //投机/套保
            order.Speculator = 0;

            ///价格
            order.InsertPrice = price;
            ///数量: 1
            order.OrderAmount = volume;
            //限价单
            order.OrderType = XSpeedOrderType.Limitorder;
            //自动单
            order.IsAutoOrder = XSpeedIsAutoOrderType.NonAutoOrder;
            //普通单
            order.OrderProperty = XSpeedOrderPropertyType.NON;

            SendInsertOrder(order);

            return(order);
        }
Пример #2
0
 public int SendInsertOrder(DFITCInsertOrderField order)
 {
     return(InvokeAPI(XSpeedRequestAction.InsertOrderAction, order, 0));
 }