Exemplo n.º 1
0
        /// <summary>
        /// 克隆USeProduct。
        /// </summary>
        /// <returns></returns>
        public USeInstrument Clone()
        {
            USeInstrument product = new USeInstrument();

            product.InstrumentCode = this.InstrumentCode;
            product.InstrumentName = this.InstrumentName;
            product.Market         = this.Market;
            return(product);
        }
Exemplo n.º 2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (GetType() != obj.GetType())
            {
                return(false);
            }

            USeInstrument product = obj as USeInstrument;

            //return this.InstrumentCode.Equals(product.InstrumentCode, StringComparison.OrdinalIgnoreCase);
            //产品比较只比较产品代码,因Ctp交易环境不同代码所属市场不同
            if (this.InstrumentCode.Equals(product.InstrumentCode, StringComparison.OrdinalIgnoreCase))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// 撤单。
 /// </summary>
 /// <param name="orderNum">委托单号。</param>
 /// <param name="product">委托产品。</param>
 /// <param name="error">[out]撤单失败错误信息。</param>
 /// <returns>撤单是否成功。</returns>
 public abstract bool CancelOrder(USeOrderNum orderNum, USeInstrument product, out string error);
Exemplo n.º 4
0
 /// <summary>
 /// 委托下单。
 /// </summary>
 /// <param name="product">委托产品。</param>
 /// <param name="qty">委托量。</param>
 /// <param name="price">委托价格。</param>
 /// <param name="offsetType">开平仓方向。</param>
 /// <param name="orderSide">买卖方向。</param>
 /// <param name="error">[out]委托失败原因。</param>
 /// <returns>委托单号。</returns>
 /// <remarks>返回为null代表失败,否则为委托单号。</remarks>
 public abstract USeOrderNum PlaceOrder(USeInstrument product, int qty, decimal price, USeOffsetType offsetType, USeOrderSide orderSide, out string error);
Exemplo n.º 5
0
 /// <summary>
 /// 查询某一合约指定方向当前持仓。
 /// </summary>
 /// <param name="instrument">合约。</param>
 /// <param name="direction">持仓方向。</param>
 /// <returns></returns>
 public abstract USePosition QueryPositions(USeInstrument instrument, USeDirection direction);
Exemplo n.º 6
0
 /// <summary>
 /// 查询某一合约当前持仓。
 /// </summary>
 /// <param name="instrument">合约。</param>
 /// <returns></returns>
 public abstract List <USePosition> QueryPositions(USeInstrument instrument);
Exemplo n.º 7
0
 /// <summary>
 /// 查询期权合约交易成本信息。
 /// </summary>
 /// <param name="instrument"></param>
 /// <returns></returns>
 public virtual USeOptionTradeCost QueryOptionTradeCost(USeInstrument instrument)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 8
0
 /// <summary>
 /// 查询合约保证金。
 /// </summary>
 /// <param name="instrument"></param>
 /// <returns></returns>
 public abstract USeMargin QueryInstrumentMargin(USeInstrument instrument);
Exemplo n.º 9
0
 /// <summary>
 /// 查询合约手续费。
 /// </summary>
 /// <param name="instrument">合约。</param>
 /// <returns>合约手续费。</returns>
 public abstract USeFee QueryInstrumentFee(USeInstrument instrument);
Exemplo n.º 10
0
 /// <summary>
 /// 查询合约的合约乘数。
 /// </summary>
 /// <param name="instrument">合约。</param>
 /// <returns>合约乘数。</returns>
 public abstract int QueryInstrumentVolumeMultiple(USeInstrument instrument);
Exemplo n.º 11
0
 /// <summary>
 /// 查询指定合约详细信息。
 /// </summary>
 /// <param name="instrument">合约。</param>
 /// <returns>合约详细信息。</returns>
 public abstract USeInstrumentDetail QueryInstrumentDetail(USeInstrument instrument);
Exemplo n.º 12
0
 /// <summary>
 /// 快速查询行情(无缓存直接返回空行情)。
 /// </summary>
 /// <param name="instrument"></param>
 /// <returns></returns>
 public abstract USeMarketData QuickQuery(USeInstrument instrument);
Exemplo n.º 13
0
 /// <summary>
 /// 退订行情。
 /// </summary>
 /// <param name="instrument">合约。</param>
 public abstract void Unsubscribe(USeInstrument instrument);
Exemplo n.º 14
0
 public USeMarketData2(USeInstrument instrument)
 {
     this.Instrument = instrument;
 }