public override void OptionSingleEntrust(EntrustPara param) { try { if (!islogon()) { return; } #region packer CT2Packer packer = new CT2Packer(2); packer.BeginPack(); packer.AddField("user_token", Convert.ToSByte('S'), 512, 4); packer.AddField("combi_no", Convert.ToSByte('S'), 8, 4); packer.AddField("market_no", Convert.ToSByte('S'), 3, 4); packer.AddField("stock_code", Convert.ToSByte('S'), 16, 4); packer.AddField("entrust_direction", Convert.ToSByte('S'), 3, 4); packer.AddField("futures_direction", Convert.ToSByte('S'), 1, 4); packer.AddField("price_type", Convert.ToSByte('S'), 1, 4); packer.AddField("entrust_price", Convert.ToSByte('F'), 11, 4); packer.AddField("entrust_amount", Convert.ToSByte('F'), 16, 2); packer.AddField("covered_flag", Convert.ToSByte('S'), 1, 2); packer.AddStr(this.token); packer.AddStr(param.portfolio); packer.AddStr(this.getMarketNo(param.exchange)); packer.AddStr(param.securitycode); packer.AddStr(((int)param.entrustdirection).ToString()); packer.AddStr(((int)param.futuredirection).ToString()); packer.AddStr("0"); //0=限价 packer.AddDouble(param.price); packer.AddDouble(param.volume); packer.AddStr("0"); //covered_flag,备兑标志,0=非备兑 packer.EndPack(); #endregion int retcode = this.sendpacker(OptionFunction.SingleEntrust, packer); MessageManager.GetInstance().Add(MessageType.TradeNotice, string.Format("单笔委托:code={0}", param.securitycode)); } catch (Exception ex) { throw ex; } }
public abstract void OptionSingleEntrust(EntrustPara param);