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

            entity.ProductCode    = this.ProductCode;
            entity.ShortName      = this.ShortName;
            entity.LongName       = this.LongName;
            entity.Market         = this.Market;
            entity.VolumeMultiple = this.VolumeMultiple;
            entity.PriceTick      = this.PriceTick;

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

            USeProduct product = obj as USeProduct;

            //return this.InstrumentCode.Equals(product.InstrumentCode, StringComparison.OrdinalIgnoreCase);
            //产品比较只比较产品代码,因Ctp交易环境不同代码所属市场不同
            if (this.ProductCode.Equals(product.ProductCode) && this.Market == product.Market)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// 获取USe品种指数编码。
 /// </summary>
 /// <param name="product">品种。</param>
 /// <returns>品种指数编码。</returns>
 public static USeInstrument GetVarietiesIndexCode(USeProduct product)
 {
     return(GetVarietiesIndexCode(product.ProductCode, product.Market));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 获取USe主力合约编码。
 /// </summary>
 /// <param name="product">品种。</param>
 /// <returns>主力合约编码。</returns>
 public static USeInstrument GetMainContractCode(USeProduct product)
 {
     return(GetMainContractCode(product.ProductCode, product.Market));
 }