public TWSExecDetailsEventArgs(TWSClient client, int orderId, IBContract contract, IBExecution execution) : base(client) { OrderId = orderId; Contract = contract; Execution = execution; }
private void ProcessExecutionData() { int version = _enc.DecodeInt(); int orderId = _enc.DecodeInt(); IBContract contract = new IBContract(); contract.Symbol = _enc.DecodeString(); contract.SecType = _enc.DecodeSecType(); contract.Expiry = DateTime.ParseExact(_enc.DecodeString(), IB_EXPIRY_DATE_FORMAT, CultureInfo.InvariantCulture); contract.Strike = _enc.DecodeDouble(); contract.Right = _enc.DecodeString(); contract.Exchange = _enc.DecodeString(); contract.Currency = _enc.DecodeString(); contract.LocalSymbol = _enc.DecodeString(); IBExecution execution = new IBExecution(); execution.OrderID = orderId; execution.ExecID = _enc.DecodeString(); execution.Time = _enc.DecodeString(); execution.AcctNumber = _enc.DecodeString(); execution.Exchange = _enc.DecodeString(); execution.Side = _enc.DecodeString(); execution.Shares = _enc.DecodeInt(); execution.Price = _enc.DecodeDouble(); if (version >= 2) execution.PermID = _enc.DecodeInt(); if (version >= 3) execution.ClientID = _enc.DecodeInt(); if (version >= 4) execution.Liquidation = _enc.DecodeInt(); OnExecDetails(orderId, contract, execution); }
protected void OnExecDetails(int orderId, IBContract contract, IBExecution execution) { if (ExecDetails != null) ExecDetails(this, new TWSExecDetailsEventArgs(this, orderId, contract, execution)); }